RFR: 8303948: HsErrFileUtils.checkHsErrFileContent() fails to check the last pattern. [v2]

David Holmes dholmes at openjdk.org
Mon Mar 20 02:19:22 UTC 2023


On Fri, 17 Mar 2023 14:37:26 GMT, Varada M <duke at openjdk.org> wrote:

>> When last pattern in deque [positivePatternStack] is not matching in HsErrFile, it comes out of the loop and check whether the positivePatternStack is empty or not, which turns to be empty because the pollFirst() removes the pattern. 
>> 
>> This has been noticed in the TestSigInfoInHsErrFile.java where the segfault address for AIX is set as "0x0*1400" instead of "0xffffffffffffffff", which should throw the expected error but the error is neglected due to empty deque and the test is passed. 
>> 
>> JBS issue : [8303948](https://bugs.openjdk.org/browse/JDK-8303948)
>
> Varada M has updated the pull request incrementally with one additional commit since the last revision:
> 
>   8303948: HsErrFileUtils.checkHsErrFileContent() fails to check the last pattern.

So checking for null-ness covers the case of the last pattern not matching, regardless of whether there are any other patterns still to be checked. Yep that logic seems fine.

A nit with the explanatory comment though.

test/hotspot/jtreg/runtime/ErrorHandling/HsErrFileUtils.java line 133:

> 131:                 lineNo++;
> 132:             }
> 133:             // check if current pattern is NULL then pattern matches else throw RuntimeException

Sorry this doesn't read very clearly to me. Suggestion:

// If the current pattern is not null then it didn't match

Thanks

-------------

Marked as reviewed by dholmes (Reviewer).

PR: https://git.openjdk.org/jdk/pull/12970


More information about the hotspot-runtime-dev mailing list