RFR: 8376269: Mixed jstack cannot find function in vDSO

Chris Plummer cjplummer at openjdk.org
Wed Jan 28 20:26:51 UTC 2026


On Sun, 25 Jan 2026 03:55:13 GMT, Yasumasa Suenaga <ysuenaga at openjdk.org> wrote:

> Some functions / signal trampoline would be provided by vDSO in Linux. However SA cannot find symbols in it because it is not a regular ELF, it is on the memory only.
> For example, mixed jstack could not decode the symbol in the coredump crashed in gettimeofday(2) as following:
> 
> 
> 0x00007faae3dd0818      VMError::report_and_die(Thread*, unsigned int, unsigned char*, void const*, void const*) + 0x58
> 0x00007faae3aff1ba      JVM_handle_linux_signal + 0x42a
> 0x00007faae4ad9290      <signal handler called>
> 0x00007faae4cd8e69              ????????
> 0x00007faaca78ffa1      <nep_invoker_blob>
> 0x00007faaca73fd48      * java.lang.invoke.LambdaForm$MH+0x0000000028156c00.invoke(java.lang.Object, long, long, long) bci:12 (Interpreted frame)
> 
> 
> It should be:
> 
> 
> 0x00007fb5841d0818      VMError::report_and_die(Thread*, unsigned int, unsigned char*, void const*, void const*) + 0x58
> 0x00007fb583eff1ba      JVM_handle_linux_signal + 0x42a
> 0x00007fb584fd9290      <signal handler called>
> 0x00007fb5851d8e69      __cvdso_gettimeofday_data.constprop.0 + 0x99
> 0x00007fb56a78f321      <nep_invoker_blob>
> 0x00007fb56a73fd48      * java.lang.invoke.LambdaForm$MH+0x000000000e156c00.invoke(java.lang.Object, long, long, long) bci:12 (Interpreted frame)
> 
> 
> Some platforms (Ubuntu 24.04 and Fedora 43 at least) provide vDSO binary in `/lib/modules/<kernel version>/vdso`. This patch attempts to load it if we can refer it because we want to use debuginfo of vDSO if possible. Otherwise load vDSO memory.

src/jdk.hotspot.agent/linux/native/libsaproc/ps_core.c line 702:

> 700:          if (strcmp("linux-vdso.so.1", lib_name) == 0 ||
> 701:              strcmp("linux-vdso64.so.1", lib_name) == 0) {
> 702:             struct utsname uts;

It might be more readable if all the new code below this point was in a new function, but I'll leave it up to you to decide if it is worth doing.

src/jdk.hotspot.agent/linux/native/libsaproc/ps_core.c line 709:

> 707:               = "vdso64.so";
> 708: #else
> 709:               = "vdso32.so";

Do we need 32 bit support? I though it was already dropped.

src/jdk.hotspot.agent/linux/native/libsaproc/ps_core.c line 712:

> 710: #endif
> 711: 
> 712:             // Check vDSO binary at first (for referring debuginfo if possible).

Suggestion:

            // Check vDSO binary first (for referring debuginfo if possible).

src/jdk.hotspot.agent/linux/native/libsaproc/ps_core.c line 720:

> 718:                lib_fd = pathmap_open(lib_name);
> 719:             } else {
> 720:                // Copy vDSO memory segment to temporal memory from core

Suggestion:

               // Copy vDSO memory segment from core to temporal memory

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

PR Review Comment: https://git.openjdk.org/jdk/pull/29400#discussion_r2738464103
PR Review Comment: https://git.openjdk.org/jdk/pull/29400#discussion_r2738450779
PR Review Comment: https://git.openjdk.org/jdk/pull/29400#discussion_r2738471726
PR Review Comment: https://git.openjdk.org/jdk/pull/29400#discussion_r2738469538


More information about the serviceability-dev mailing list