RFR: 8378702: jdk.test.lib.Platform.isMusl() may return false negative on Alpine Linux

Frederic Thevenet fthevenet at openjdk.org
Fri Feb 27 11:37:25 UTC 2026


On Thu, 26 Feb 2026 22:18:57 GMT, Roger Riggs <rriggs at openjdk.org> wrote:

>> jdk.test.lib.Platform.isMusl() may return false on Alpine linux, where it should return true.
>> This means that the jtreg tests is is used to guard will incorrectly fail.
>> This happens when tests deliberately clobber the  PATH and `ldd` can no longer be found. This PR uses a full path for `ldd` instead to work around the issue.
>
> test/lib/jdk/test/lib/Platform.java line 200:
> 
>> 198:                 String l = b.readLine();
>> 199:                 return (l != null && l.contains("musl"));
>> 200:             } catch (Exception e) {}
> 
> Wouldn't it be better to at least print the exception to make it easier to diagnose.

I'm glad you raise that point, because I actually feel the same, especially since printing the exception is the first thing I did when I started investigating the problem.
But, given that this is how the original test was written, I suspected this might have been done on purpose to avoid polluting the output, that some tests might be parsing as part of their operation.

Not sure this is justified; I just opted to minimize the risk of an unfortunate side-effect. But again, I agree better logging would probably have helped catching this way earlier.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/29923#discussion_r2863895254


More information about the core-libs-dev mailing list