RFR: 8252148: vmError::controlled_crash should be #ifdef ASSERT [v3]

Ioi Lam iklam at openjdk.java.net
Fri Dec 11 20:11:57 UTC 2020


On Fri, 11 Dec 2020 18:14:38 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:

>> test/hotspot/gtest/unittest.hpp line 138:
>> 
>>> 136:     ASSERT_EXIT(child_ ## category ## _ ## name ## _(),             \
>>> 137:                 ::testing::ExitedWithCode(1),                       \
>>> 138:                 "^assert failed: .*" msg);                          \
>> 
>> Good!
>
> So if I take out '^' here, I've also fixed https://bugs.openjdk.java.net/browse/JDK-8257229 ?  I had a version without ^.

I think it's better to fix JDK-8257229 separately, so it's easier to track the issues.

Adding `.*` here affects all tests, and it might make the match more liberal than necessary. E.g., if we have `msg = "end of the world"`, the regexp would inadvertently match

assert failed: some unrelated assert
Whew, we avoided the end of the world

It would be better to add the .* in a specific test like 

TEST_VM_ASSERT_MSG(vmErrorTest, assert1, ".*assert.str == NULL. failed: expected null") {

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

PR: https://git.openjdk.java.net/jdk/pull/1723


More information about the hotspot-dev mailing list