8252148: vmError::controlled_crash should be #ifdef ASSERT and move tests to gtest#1723
8252148: vmError::controlled_crash should be #ifdef ASSERT and move tests to gtest#1723coleenp wants to merge 8 commits intoopenjdk:masterfrom
Conversation
|
👋 Welcome back coleenp! A progress list of the required criteria for merging this PR into |
Webrevs
|
|
Very nice cleanup. I like moving the majority of that code to a gtest. |
|
@coleenp This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be: You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 23 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. ➡️ To integrate this PR with the above commit message to the |
tstuefe
left a comment
There was a problem hiding this comment.
Hi Coleen,
this is a good cleanup, I like this a lot.
About moving ErrorHandlerTest.java to gtest: this is a slick way of doing these tests. However, some things to consider:
- Strictly speaking we now do not test the real error handler output but the artificial output
ExecutingUnitTestsgives us. The real printing code is now untested. This may have bitten you right here, since I believe inprint_error_for_unit_testyou miss ava_copywhich should have messed up detail_args and garbled the real output later on. - moving these tests out of jtreg means we give up flexibility (excluding them or moving them to another tier). Do they impact the gtest run time noticeably?
There are also remaining problems with gtest death tests, which I hope we can fix at some point. I don't hold my breath though since we decided to not own the gtest code and cannot make modifications:
- Death tests are easily confused by stderr output. See: https://bugs.openjdk.java.net/browse/JDK-8257229. So whenever we have unconditional stderr output in the VM (eg if some large page alloc failed) these death tests fail too.
- Death tests don't tell you the assert message which happened if it did not match their expectations. Thats plain annoying. See https://bugs.openjdk.java.net/browse/JDK-8257227.
|
I posted a comment on https://bugs.openjdk.java.net/browse/JDK-8257227. I don't know how to deal with https://bugs.openjdk.java.net/browse/JDK-8257229. These tests would fail because of that also. The assert message tests are nice and imo better than having crashing jtreg tests, but they have these limitations. |
JDK-8257229 is being fixed in #1748 |
tstuefe
left a comment
There was a problem hiding this comment.
Hi Coleen, sorry for forgetting to mention va_end too. That's still missing, otherwise we leak the copied va_list. Otherwise this looks nice, this is a good cleanup.
Thanks, Thomas
tstuefe
left a comment
There was a problem hiding this comment.
Thanks, looks good now.
..Thomas
|
Hi Coleen, sorry, found another issue. In Cheers, Thomas |
|
Hi Thomas, thank you for finding the "last" bug in this. I made the buffer stack allocated and 256. That should be enough and it passes all the gtests. Thanks again. |
Thanks Coleen! Looks good now. |
|
Thanks Thomas, Ioi and Gerard. I remerged with JDK-8257229: gtest death tests fail with unrecognized stderr output to make sure they still worked together. |
|
So it turns out that I only tested with linux-x64-debug and not windows and macosx which have slightly different rules for pattern matching. Some of the patterns in the assert(some expression) failed: message didn't match, so I just added .* to the expected message and that worked better. Now I've tested them everywhere. |
|
Thanks for re-reviewing Ioi and Thomas. |
|
@coleenp Since your change was applied there have been 24 commits pushed to the
Your commit was automatically rebased without conflicts. Pushed as commit c37eabe. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
Moved some unit tests from vmError into a gtest and moved controlled_crash code under #ifdef ASSERT rather than #ifndef PRODUCT since the tests that use this are @requires = vm.debug. This change keeps the ErrorHandlerTest=n option and other handler test options, because there are some tests that use this more but moves them to develop options (they were notproduct). There are some ErrorHandlerTest=n tests that do more thorough hs_err_pid.log file verification that remain.
Tested with tier1-3 with product and fastdebug builds. Built with optimized.
This is for JDK 17.
Progress
Issue
Reviewers
Download
$ git fetch https://git.openjdk.java.net/jdk pull/1723/head:pull/1723$ git checkout pull/1723