RFR: 8309613: [Windows] hs_err files sometimes miss information about the code containing the error [v3]
Martin Doerr
mdoerr at openjdk.org
Mon Jun 12 14:55:51 UTC 2023
On Mon, 12 Jun 2023 14:24:27 GMT, Martin Doerr <mdoerr at openjdk.org> wrote:
>> We have seen hs_err files for errors triggered by C2 compiled methods which miss the most relevant information: the C2 method (see JBS issue for more details). I have found a possibility to add it. Please take a look and provide feedback.
>>
>> Testing:
>>
>> diff --git a/src/hotspot/share/opto/parse1.cpp b/src/hotspot/share/opto/parse1.cpp
>> index f179d3ba88d..c35a1ac595e 100644
>> --- a/src/hotspot/share/opto/parse1.cpp
>> +++ b/src/hotspot/share/opto/parse1.cpp
>> @@ -1210,6 +1210,12 @@ void Parse::do_method_entry() {
>> make_dtrace_method_entry(method());
>> }
>>
>> + if (UseNewCode) {
>> + Node* halt = _gvn.transform(new HaltNode(control(), frameptr(), "Requested Halt!"));
>> + C->root()->add_req(halt);
>> + set_control(halt);
>> + }
>> +
>> #ifdef ASSERT
>> // Narrow receiver type when it is too broad for the method being parsed.
>> if (!method()->is_static()) {
>>
>>
>> "java -XX:+UseNewCode -version" shows the following output (when no hsdis lib is provided):
>>
>> --------------- T H R E A D ---------------
>>
>> Current thread (0x0000024daebb2b30): JavaThread "main" [_thread_in_Java, id=30876, stack(0x000000cdacc00000,0x000000cdacd00000) (1024K)]
>>
>> Stack: [0x000000cdacc00000,0x000000cdacd00000]
>> Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
>> V [jvm.dll+0x6ca5b9] os::win32::platform_print_native_stack+0xd9 (os_windows_x86.cpp:236)
>> V [jvm.dll+0x8a3af1] VMError::report+0xd61 (vmError.cpp:991)
>> V [jvm.dll+0x8a5d6e] VMError::report_and_die+0x5fe (vmError.cpp:1797)
>> V [jvm.dll+0x283061] report_fatal+0x71 (debug.cpp:212)
>> V [jvm.dll+0x621c3e] MacroAssembler::debug64+0x8e (macroAssembler_x86.cpp:829)
>> C 0x0000024dc1553cf4
>>
>> the last pc belongs to nmethod (will be printed below)
>>
>> Compiled method (c2) 92 16 4 java.lang.Object::<init> (1 bytes)
>> total in heap [0x0000024dc1553b10,0x0000024dc1553d50] = 576
>> relocation [0x0000024dc1553c70,0x0000024dc1553c88] = 24
>> main code [0x0000024dc1553ca0,0x0000024dc1553d00] = 96
>> stub code [0x0000024dc1553d00,0x0000024dc1553d18] = 24
>> metadata [0x0000024dc1553d18,0x0000024dc1553d20] = 8
>> scopes data [0x0000024dc1553d20,0x0000024dc1553d28] = 8
>> scopes pcs [0x0000024dc1553d28,0x0000024dc1553d48] = 32
>> dependencies [0x0000024dc1553d48,0x0000024dc1553d50] = 8
>>
>> [Constant Pool (empty)]
>>
>> [MachCode]
>> [Entry Point]
>> # {method} {0x0000000800478d78} '<init>' '()V' ...
>
> Martin Doerr has updated the pull request incrementally with one additional commit since the last revision:
>
> Move parts to step which prints code blobs
Hi David, I've moved the verbose parts to the step "printing code blobs if possible" and updated the example output. In this particular case, the steps between the native stack and my new code don't print anything, so, the output looks very similar.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/14358#issuecomment-1587507260
More information about the hotspot-compiler-dev
mailing list