RFR: 8302189: Mark assertion failures noreturn

Kim Barrett kbarrett at openjdk.org
Sat Mar 4 11:19:12 UTC 2023


On Fri, 3 Mar 2023 04:35:35 GMT, David Holmes <dholmes at openjdk.org> wrote:

> I don't use these particular debugging mechanism, neither Debugger nor BREAKPOINT, but it seems potentially problematic to me that the removed BREAKPOINTs happened after the error was reported, and IIUC the new mechanism will activate before the error is reported.

The removed BREAKPOINTs were not happening after the error was reported.
Normally the report functions would report and die, without reaching the
BREAKPOINT at all.  They were only reachable when "Debugging" was enabled by
being in one of the manually invoked "commands", which disabled the report
function and made it return immediately to the BREAKPOINT, which isn't really
very interesting because in one of these commands we want to just "ignore"
errors entirely.

> make/hotspot/lib/CompileJvm.gmk line 103:
> 
>> 101: DISABLED_WARNINGS_xlc := tautological-compare shift-negative-value
>> 102: 
>> 103: DISABLED_WARNINGS_microsoft := 4624 4244 4291 4146 4127 4722
> 
> It is annoying that we don't document what these warnings are. :(

I've made the same comment in the past.  This time I decided to do something about it:
https://bugs.openjdk.org/browse/JDK-8303618
Document disabled C/C++ warnings on Windows

> src/hotspot/share/utilities/debug.cpp line 85:
> 
>> 83:   if (is_enabled()) {
>> 84:     fatal("Multiple Debugging contexts");
>> 85:   }
> 
> This seems too restrictive as you could hit different DebuggingContexts in different threads. ??

This facility is only intended for use by manually invoked commands while the program is stopped in a debugger. Multi-threaded use is not an issue (and was not supported previously either). I don't think there are any nested uses either, but I've now run across a couple of places where nesting could be useful. So I'm changing the state from a simple bool to a nesting counter.

> src/hotspot/share/utilities/debug.cpp line 290:
> 
>> 288:  private:
>> 289:   ResourceMark _rm;
>> 290:   DebuggingContext _debugging;
> 
> Why a different initialization syntax here?

I don't understand the question?  These are member variable declarations.

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

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



More information about the build-dev mailing list