RFR: 8376284: New test serviceability/sa/TestJhsdbJstackMixedCore.java from JDK-8374482 fails on Linux Alpine
Chris Plummer
cjplummer at openjdk.org
Fri Jan 30 22:11:04 UTC 2026
On Thu, 29 Jan 2026 06:20:57 GMT, Yasumasa Suenaga <ysuenaga at openjdk.org> wrote:
> TestJhsdbJstackMixedCore.java introduced in [JDK-8374482](https://bugs.openjdk.org/browse/JDK-8374482) failed on Alpine because musl-c does not provide the symbol of signal trampoline (`__restore_rt` on Linux Kernel for AMD64) as following:
>
>
> java.lang.RuntimeException: '<signal handler called>' missing from stdout/stderr
> at jdk.test.lib.process.OutputAnalyzer.shouldContain(OutputAnalyzer.java:253)
> at TestJhsdbJstackMixedCore.runJstackMixed(TestJhsdbJstackMixedCore.java:62)
> at TestJhsdbJstackMixedCore.main(TestJhsdbJstackMixedCore.java:74)
> at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
> at java.base/java.lang.reflect.Method.invoke(Method.java:565)
> at com.sun.javatest.regtest.agent.MainActionHelper$AgentVMRunnable.run(MainActionHelper.java:335)
> at java.base/java.lang.Thread.run(Thread.java:1516)
>
>
> It would success if debuginfo is installed, but it should be skipped if the symbol is not available.
> See JBS for details.
test/hotspot/jtreg/serviceability/sa/TestJhsdbJstackMixedCore.java line 71:
> 69: // Check whether the symbol of signal trampoline is available.
> 70: var libc = SATestUtils.getLibCPath();
> 71: if (!SATestUtils.isSymbolAvailable(libc, "__restore_rt")) {
Do we have any reason to support the lookup of symbols not in libc? I'm just wondering if `SATestUtils.isSymbolAvailable()` should just take the symbol argument not the libc argument.
test/lib/jdk/test/lib/SA/SATestUtils.java line 272:
> 270: /**
> 271: * Find library file what provides address of strlen(3), then returns it as libc.
> 272: * This method would work on Linux only.
Suggestion:
* Find library file that provides strlen(3), then returns it as libc.
* This method works on Linux only.
test/lib/jdk/test/lib/SA/SATestUtils.java line 300:
> 298: var info = arena.allocate(structDLInfo);
> 299: int result = (int)dladdr.invoke(ptrStrlen, info);
> 300: if(result == 0){
Suggestion:
if (result == 0) {
test/lib/jdk/test/lib/SA/SATestUtils.java line 315:
> 313: /**
> 314: * Find debuginfo file from the library.
> 315: * This method would work on Linux only.
Suggestion:
* Find debuginfo file for the library.
* This method will work on Linux only.
test/lib/jdk/test/lib/SA/SATestUtils.java line 345:
> 343: }
> 344:
> 345: private static boolean isSymbolAvailableInternal(String lib, String symbol) throws IOException {
Should `lib` be named something more like `debugInfoPath`?
test/lib/jdk/test/lib/SA/SATestUtils.java line 354:
> 352:
> 353: /**
> 354: * This method would work on Linux only.
Suggestion:
* This method will work on Linux only.
test/lib/jdk/test/lib/SA/SATestUtils.java line 356:
> 354: * This method would work on Linux only.
> 355: * Both "readelf" and "nm" have to be available.
> 356: * @return true if given symbol is available on given lib.
Suggestion:
* @return true if given symbol is available in given lib.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/29480#discussion_r2748141842
PR Review Comment: https://git.openjdk.org/jdk/pull/29480#discussion_r2748107517
PR Review Comment: https://git.openjdk.org/jdk/pull/29480#discussion_r2748164779
PR Review Comment: https://git.openjdk.org/jdk/pull/29480#discussion_r2748145164
PR Review Comment: https://git.openjdk.org/jdk/pull/29480#discussion_r2748160452
PR Review Comment: https://git.openjdk.org/jdk/pull/29480#discussion_r2748135231
PR Review Comment: https://git.openjdk.org/jdk/pull/29480#discussion_r2748143118
More information about the serviceability-dev
mailing list