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

Doug Simon dnsimon at openjdk.java.net
Thu Oct 7 13:46:08 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

I have pushed further changes to this PR to address test failures:
* omit timestamp from nmethod decoding and printing (0621eb90dd9644b73ed3e595fbd8dee6fd12a25e)
* support printing the crashing frame on platforms such as Windows where stack walking cannot be done without platform support
* changed MachCodeFramesInErrorFile to pass if Crasher fails to crash in the expected frame (driving C2 with VM options is not 100% guaranteed to give the expected outcome)

I would appreciate a review of these changes.

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

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


More information about the hotspot-dev mailing list