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

Doug Simon dnsimon at openjdk.java.net
Thu Oct 7 17:26:10 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

The MachCodeFramesInErrorFile test is crashing on macosx-aarch64. I've isolated the problem in lldb:

Process 43544 stopped
* thread #3, stop reason = signal SIGBUS
  * frame #0: 0x00000001064cc8b4 libjvm.dylib`PcDescCache::add_pc_desc(this=0x00000001186083b0, pc_desc=0x0000000118608770) at nmethod.cpp:395:18
    frame #1: 0x00000001064d4588 libjvm.dylib`PcDescContainer::find_pc_desc_internal(this=0x00000001186083b0, pc=" \U00000003\xd5\xe9s@\xd1?\U00000001", approximate=true, search=0x000000017008d0f0) at nmethod.cpp:2220:20
    frame #2: 0x0000000105bd23a8 libjvm.dylib`PcDescContainer::find_pc_desc(this=0x00000001186083b0, pc=" \U00000003\xd5\xe9s@\xd1?\U00000001", approximate=true, search=0x000000017008d0f0) at compiledMethod.hpp:136:12
    frame #3: 0x0000000105bd230c libjvm.dylib`CompiledMethod::find_pc_desc(this=0x0000000118608310, pc=" \U00000003\xd5\xe9s@\xd1?\U00000001", approximate=true) at compiledMethod.hpp:404:31
    frame #4: 0x0000000105d326fc libjvm.dylib`CompiledMethod::pc_desc_near(this=0x0000000118608310, pc=" \U00000003\xd5\xe9s@\xd1?\U00000001") at compiledMethod.hpp:232:45
    frame #5: 0x00000001064d7c8c libjvm.dylib`nmethod::scope_desc_in(this=0x0000000118608310, begin="\U0000001f \U00000003\xd5\xe9s@\xd1?\U00000001", end="\xe9s@\xd1?\U00000001") at nmethod.cpp:3129:15
    frame #6: 0x00000001064d6c6c libjvm.dylib`nmethod::has_code_comment(this=0x0000000118608310, begin="\U0000001f \U00000003\xd5\xe9s@\xd1?\U00000001", end="\xe9s@\xd1?\U00000001") at nmethod.cpp:3255:20
    frame #7: 0x00000001064cf9fc libjvm.dylib`nmethod::decode2(this=0x0000000118608310, ost=0x000000017008df38) const at nmethod.cpp:2983:79
    frame #8: 0x0000000105e3f244 libjvm.dylib`Disassembler::decode(cb=0x0000000118608310, st=0x000000017008df38) at disassembler.cpp:875:21
    frame #9: 0x00000001067dd568 libjvm.dylib`print_code(st=0x000000017008df38, thread=0x000000010080bc20, pc="J\U00000001@\xf9\x8b\xcfA\xf9\U0000007f\U00000001@\xb9\x88\xc3N9\xc8", is_crash_pc=true, printed=0x000000017008dc50, printed_capacity=5) at vmError.cpp:307:9
    frame #10: 0x00000001067dbe18 libjvm.dylib`VMError::report(st=0x000000017008df38, _verbose=true) at vmError.cpp:928:16


This looks like a pre-existing bug.
@vnkozlov would be able to help me with this?

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

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


More information about the hotspot-dev mailing list