RFR: 8261916: gtest/GTestWrapper.java vmErrorTest.unimplemented1_vm_assert failed

David Holmes dholmes at openjdk.java.net
Mon Mar 15 23:14:08 UTC 2021


On Mon, 15 Mar 2021 22:45:29 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:

>> Please see bug report for gory details.
>> 
>> For the specific issue here of the vm_assert gtests I propose to make two changes to the VM:
>> 
>> 1. When core dumps are disabled, os::abort should call ::_exit not ::exit, as the former more closely models the abrupt termination of ::abort() but without the core dump.
>> 
>> 2. The race condition when SupressFatalErrorMessages is true is fixed by placing the check after the atomic set/check of the thread-id. That way only a single thread can trigger the fatal error processing. 
>> 
>> I was debating whether to make a slight change so that even when SuppressFatalErrorMessage is true, secondary failures will report that such an error occurred but not with any details. But I've left the existing silence for now. It is possible someone uses the flag to hide a message I would like to expose. I suppose adding additional output in debug builds only may be an option - options welcomed.
>> 
>> Testing:
>>  - fully manual
>> 
>> I manually set up the conditions where a background thread could crash due to the atexit actions executing. I added special debug code to show what was happening in such cases, and that secondary errors were occurring. I then applied the fix for #2 and saw the second thread getting caught; then I applied fix #1 and the secondary crashes were gone.
>> 
>> Also did tier 1-3 testing and local gtest testing just to sanity check things.
>> 
>> Thanks,
>> David
>
> src/hotspot/share/utilities/vmError.cpp line 1455:
> 
>> 1453:         // If we already hit a secondary error during abort, then calling
>> 1454:         // it again is likely to hit another one. But eventually, if we
>> 1455:         // don't deadlock somewhere, we will call os::die() above.
> 
> Should os::die call _exit or will ::abort kill the process?  ie. are the comments in os::die corect?

The comments in os::die() are correct. The abort() will kill the process (and generate a core dump).

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

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


More information about the hotspot-runtime-dev mailing list