RFR: 8272586: emit abstract machine code in hs-err logs [v3]

Doug Simon dnsimon at openjdk.java.net
Thu Oct 7 13:49:12 UTC 2021


On Thu, 7 Oct 2021 13:33:41 GMT, Doug Simon <dnsimon at openjdk.org> wrote:

>> This enhances hs-err logs to:
>> * Show the [abstract machine code](https://bugs.openjdk.java.net/browse/JDK-8213084) of the crashing frame if a disassembler is not installed.
>> * Show machine code for the top frames on the native stack.
>> 
>> An interpreter or stub frame is only shown if it is the crashing frame.
>> 
>> A sample of the enhanced hs-err log can be seen [here](https://bugs.openjdk.java.net/secure/attachment/96664/hs_err_pid7179.log).
>
> Doug Simon has updated the pull request incrementally with five additional commits since the last revision:
> 
>  - improved test for platforms such as Windows where only a single frame can have its code printed
>  - more nullptr usage
>    changed should_print_code to add_if_absent
>    made printed_capacity a const value
>    handle platforms where native stack cannot be walked directly by VMError
>    improved Crasher such that the crash happens in a JIT compiled frame
>  - refined MachCodeFramesInErrorFile test
>  - omit timestamp from nmethod decoding and printing
>  - removed leftover debug printing

src/hotspot/share/compiler/compileTask.cpp line 244:

> 242:     if (timestamp) {
> 243:       // Print current time
> 244:       st->print("%7d ", (int)tty->time_stamp().milliseconds());

I'm not sure why a timestamp should be included when printing the contents of an nmethod outside the context of a CompileTask. The timestamp was causing the `DisassembleCodeBlobTest` to fail as it expects disassembling a given nmethod twice to produce the same result.

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

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


More information about the hotspot-dev mailing list