On Wed, 21 Oct 2026 06:29:29 GMT, Yasumasa Suenaga <[email protected]> wrote:

>> Alpine Linux would not provide `.eh_frame` enough to unwind in both regular 
>> binary and debuginfo. We need to refer `.debug_frame` in debuginfo for 
>> unwinding.
>> 
>> This ticket also re-enable mixed jstack jtreg tests on Alpine if musl-c 
>> debuginfo is available because `.debug_frame` would be provided by musl-dbg 
>> package.
>> This change passed all of serviceability/sa jtreg tests on following 
>> environment:
>> 
>> - Fedora 44 x86_64
>> - Alpine Linux 3.23 (with musl-dbg) x86_64
>> - Rocky Linux 9.5 aarch64
>> 
>> ---------
>> - [x] I confirm that I make this contribution in accordance with the 
>> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai).
>
> Yasumasa Suenaga has updated the pull request incrementally with one 
> additional commit since the last revision:
> 
>   update condition

src/jdk.hotspot.agent/linux/native/libsaproc/libproc_impl.c line 142:

> 140:        if (ph->core == NULL) {
> 141:          close(lib->fd);
> 142:        }

Combine with next line.

src/jdk.hotspot.agent/linux/native/libsaproc/libproc_impl.c line 143:

> 141:          close(lib->fd);
> 142:        }
> 143:        else if (lib->fd != ph->core->exec_fd) {

During a core detach you might use ph->core after freeing it.  core_release() 
frees ph->core before calling destroy_lib_info(), yet here you are 
de-referencing through ph->core.

src/jdk.hotspot.agent/share/native/libsaproc/ps_core_common.c line 89:

> 87:     }
> 88:     lib = lib->next;
> 89:   }

This code is shared with macosx, but no changes have been made to the macosx 
port to make sure the fds are still being closed.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/33375#discussion_r4341464955
PR Review Comment: https://git.openjdk.org/jdk/pull/33375#discussion_r4341503487
PR Review Comment: https://git.openjdk.org/jdk/pull/33375#discussion_r4341461852

Reply via email to