Integrated: 8309613: [Windows] hs_err files sometimes miss information about the code containing the error

Martin Doerr mdoerr at openjdk.org
Wed Jun 14 08:32:11 UTC 2023


On Wed, 7 Jun 2023 14:32:13 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 (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' in 'java/lang/Object'
>   #           [sp+0x20]  (sp of caller)
>   0x0000024dc1553ca0: 448b 5208 | 49bb 0000 | 0000 0800...

This pull request has now been integrated.

Changeset: bd79db39
Author:    Martin Doerr <mdoerr at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/bd79db3930f192f6742e29a63a6d1c3bc3dd3385
Stats:     56 lines in 10 files changed: 41 ins; 0 del; 15 mod

8309613: [Windows] hs_err files sometimes miss information about the code containing the error

Reviewed-by: dholmes, stuefe

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

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


More information about the hotspot-dev mailing list