RFR: 8293851: hs_err should print more stack in hex dump [v2]

Stefan Karlsson stefank at openjdk.org
Fri Sep 16 09:22:42 UTC 2022


On Thu, 15 Sep 2022 15:00:49 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:

>> Similar to [JDK-8217879](https://bugs.openjdk.org/browse/JDK-8217879), the debugging would be easier if we dump more stack in the hex dump. This is especially convenient when debugging Loom and seeing more of the raw stack in the crash log. Reading farther from current SP is generally safe, since stack banging mechanism provides us with accessible stack at all times for normal SPs. In fact, many platforms already read significantly more stack than x86. 
>> 
>> We can homogenize the stack printing across all architectures. I believe the stack grows the same way on all supported arches (downwards), so we can read in one direction. Tell me if you still want to make that one selectable.
>> 
>> As the safeguard, [JDK-8217994](https://bugs.openjdk.org/browse/JDK-8217994) gives us the facility to read the memory much more safely, so we can dump more stack without elevated risk of secondary crash, in case the stack is not readable.
>> 
>> x86_64 hs_err before:
>> 
>> Top of Stack: (sp=0x00007fdab92650b0)
>> 0x00007fdab92650b0:   00000000ffffffff 00007fdb0c2d5c50
>> 0x00007fdab92650c0:   00007fdab9265460 00007fdb12e4a106
>> 0x00007fdab92650d0:   0000000000000001 00007fdb0c20e980
>> 0x00007fdab92650e0:   0000000000000000 00007fdb0c2ff4c0 
>> 
>> 
>> x86_64 hs_err after:
>> 
>> Top of Stack: (sp=0x00007f10ccb1d0b0)
>> 0x00007f10ccb1d0b0:   00000000ffffffff 00007f11202d5c50
>> 0x00007f10ccb1d0c0:   00007f10ccb1d460 00007f11266e4106
>> 0x00007f10ccb1d0d0:   0000000000000001 00007f112020e980
>> 0x00007f10ccb1d0e0:   0000000000000000 00007f11202ff4c0
>> 0x00007f10ccb1d0f0:   00007f112020e980 00007f10ccb1d140
>> 0x00007f10ccb1d100:   00007f11202fd4f0 00007f11202ffb80
>> 0x00007f10ccb1d110:   00007f11202ffbc0 00007f11202fff68
>> 0x00007f10ccb1d120:   00000000000003d8 00007f1000000002
>> 0x00007f10ccb1d130:   00007f11202ff4c0 00007f10ccb1d550
>> 0x00007f10ccb1d140:   00007f11202fd4f0 0000000300000007
>> 0x00007f10ccb1d150:   00007f11202d5c50 00007f112020e980
>> 0x00007f10ccb1d160:   00007f10ccb1d740 0000000000000000
>> 0x00007f10ccb1d170:   00007f10a80668c0 00007f11ffffffff
>> 0x00007f10ccb1d180:   00007f109c00d250 00007f1000000000
>> 0x00007f10ccb1d190:   00007f109c00ecd8 00007f10a80404a0
>> 0x00007f10ccb1d1a0:   0000000000000000 000000011d001001
>> 0x00007f10ccb1d1b0:   0000000000000000 00007f11202ffc20
>> 0x00007f10ccb1d1c0:   00007f11202ffbc0 0000000800000000
>> 0x00007f10ccb1d1d0:   0000000100000003 0000000000000000
>> 0x00007f10ccb1d1e0:   00007f11202ffc68 00007f1000000003
>> 0x00007f10ccb1d1f0:   00007f10a803b1d0 0000002000000000
>> 0x00007f10ccb1d200:   000000000000003b 0000004100000000
>> 0x00007f10ccb1d210:   000000aaffffffff 00007f10ccb1d218
>> 0x00007f10ccb1d220:   00000000000001e8 00007f1127d233e6
>> 0x00007f10ccb1d230:   00007f110fee5f80 0000000000000000
>> 0x00007f10ccb1d240:   00007f110fee5f80 00007f110fef2c50
>> 0x00007f10ccb1d250:   00007f10a8040490 00007f10a8040490
>> 0x00007f10ccb1d260:   00007f10a8040498 00007f110fee5f80
>> 0x00007f10ccb1d270:   00007f1120000001 00007f10ccb1d218
>> 0x00007f10ccb1d280:   00007f110fe65f80 0000000000000000
>> 0x00007f10ccb1d290:   00007f110fe66051 00007f110fee5b18
>> 0x00007f10ccb1d2a0:   00007f10a8040338 00007f10a804034c 
>> 
>> 
>> Testing:
>>   - [x] Eyeballing ad-hoc crash logs
>>   - [x] Build: linux-x86_64-server-fastdebug
>>   - [x] Build: linux-x86_64-zero-fastdebug
>>   - [x] Build: linux-x86-server-fastdebug
>>   - [x] Cross-build: linux-aarch64-server-fastdebug
>>   - [x] Cross-build: linux-arm-server-fastdebug
>>   - [x] Cross-build: linux-riscv64-server-fastdebug
>>   - [x] Cross-build: linux-s390x-server-fastdebug
>>   - [x] Cross-build: linux-ppc64le-server-fastdebug
>>   - [x] Cross-build: linux-ppc64-server-fastdebug
>
> Aleksey Shipilev has updated the pull request incrementally with two additional commits since the last revision:
> 
>  - Rename to print_tos
>  - Drop stack unitsize

Marked as reviewed by stefank (Reviewer).

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

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


More information about the hotspot-runtime-dev mailing list