On Wed, 9 Sep 2026 06:58:16 GMT, Yasumasa Suenaga <[email protected]> wrote:
> [JDK-8388696](https://bugs.openjdk.org/browse/JDK-8388696) (PR #31999) has > changed SA code to show error message if DWARF parser encounts unsupported > DWARF instructions. This caused a new error in > TestJhsdbJstackMixedWithXComp.java#xcomp. See JBS for details. > > This PR updates to return the result from > `DwarfParser::parse_dwarf_instructions` - `false` if DWARF parser failed such > as unknown instruction. `DW_CFA_def_cfa_expression` is one of cases of > failure because SA does not support it. > However `DW_CFA_def_cfa_expression` might be set for signal trampoline such > as `__restore_rt` on AMD64. Thus this PR ignores the failure in > `DwarfParser::parse_dwarf_instructions` if PC points signal trampoline. > > This PR passed serviceability/sa tests on both AMD64 and AArch64 Linux. > > --------- > - [x] I confirm that I make this contribution in accordance with the [OpenJDK > Interim AI Policy](https://openjdk.org/legal/ai). I think this change is fine as a simple fix for now. However, we might want to improve this in the future. "errors" like this are a bit different. It is an error, but we don't want it to result in a test failure by always printing it s stderr. The problem with print_debug() is that it is off by default and is really meant to dump diagnostic output to aid in debugging SA, not to report problems to the user. This seems like the type of message we would want the user to always see, which is why print_error() was used. Maybe we need print_warning() that is always enabled and goes to stdout. That way we'll see this in the log files without having to set LIBSAPROC_DEBUG=1 and get all the other debug output noise that comes along with it. The message would't cause a test failure because it would be on stdout, not stderr. It seems there are a lot of other print_debug messages that could also switch to print_warning(). ------------- Marked as reviewed by cjplummer (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/32777#pullrequestreview-5156411867
