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

David Holmes dholmes at openjdk.org
Thu Jun 8 02:27:48 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()) {

IIUC the basic fix here is track the last pc that was found before things "got stuck" so we print it. Though I'm unclear on the details - didn't we already print this pc in the stack trace as it was the last good pc? If so what does the new `print_code` show in addition?

An example of the before/after output in the hs_err file would be helpful.

Thanks.

src/hotspot/share/utilities/vmError.cpp line 680:

> 678:   // keep track of which code has already been printed
> 679:   const int printed_capacity = max_error_log_print_code;
> 680:   address printed[printed_capacity];

Does this buffer get reused/overwritten by the "printing code blobs" logic?

src/hotspot/share/utilities/vmError.cpp line 976:

> 974:       // We have printed the native stack in platform-specific code
> 975:       // Windows/x64 needs special handling.
> 976:       // Stack walking may got stuck. Try to print the calling code.

Nit: s/got/get/

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

PR Review: https://git.openjdk.org/jdk/pull/14358#pullrequestreview-1468870840
PR Review Comment: https://git.openjdk.org/jdk/pull/14358#discussion_r1222365748
PR Review Comment: https://git.openjdk.org/jdk/pull/14358#discussion_r1222366172


More information about the hotspot-dev mailing list