On Fri, 28 Aug 2026 08:48:03 GMT, GuoziElain <[email protected]> wrote:

>> `ExecutionEnvironment` verifies that the JDK launcher preserves 
>> `LD_LIBRARY_PATH` when starting a child VM. A RISC-V QEMU launcher wrapper 
>> needs to set this variable to locate the target libraries, so the wrapper 
>> overwrites the sentinel value before the child VM starts. The test therefore 
>> cannot verify its intended launcher property in this environment.
>> 
>> This change excludes only RISC-V running under QEMU, using the same 
>> `vm.cpu.features` condition already used by other tests. Native RISC-V and 
>> all other supported Unix platforms continue to run the test.
>> 
>> Testing:
>> 
>> - Reproduced the original failure under `qemu-riscv64-static`: `FAIL: did 
>> not get <LD_LIBRARY_PATH=/Bridge/On/The/River/Kwai>`.
>> - Verified that the test is not selected when `os.arch=riscv64` and 
>> `vm.cpu.features=qemu`.
>> - Verified `test/jdk/tools/launcher/ExecutionEnvironment.java` passes on 
>> Linux x86_64 (`passed: 1`).
>> 
>> ---------
>> - [x] I confirm that I make this contribution in accordance with the 
>> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai).
>
> GuoziElain has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   8353495: Update copyright year

Yes, I found one additional similar case: `tools/launcher/Test7029048.java`. It 
also sets and validates `LD_LIBRARY_PATH`.

I reproduced it with QEMU 10.0.0, where the JVM CPU feature string correctly 
contains `qemu`. Before the update, `ExecutionEnvironment.java` was excluded as 
intended, while both `LIBJVM` cases in `Test7029048.java` failed with `expected 
3 but got 1` because the QEMU wrapper replaced `LD_LIBRARY_PATH`.

I added the same RISC-V qemu-user `@requires` condition to `Test7029048.java` 
in commit 58ea09a2506. With that change, both tests are excluded under RISC-V 
qemu-user, and `Test7029048.java` still passes on native Linux x86_64 (`passed: 
1`). I also audited the other `LD_LIBRARY_PATH` references and did not find 
another launcher test that directly checks this preservation behavior.

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

PR Comment: https://git.openjdk.org/jdk/pull/32553#issuecomment-5478473049

Reply via email to