Backporting stack guard fixes from JDK-9 (8169373+8159335+8139864)

Jan Kratochvil (Azul) jkratochvil at azul.com
Mon Dec 18 08:53:42 UTC 2023


On Fri, 15 Dec 2023 15:45:41 +0800, Thomas Stüfe wrote:
> This coding only gets executed for the primordial thread, and the only way
> that could happen is if the hotspot had been embedded into a custom
> launcher. Is this the case here?

No, the crashed executable is .../bin/java.


> The normal java launcher invokes the JVM on a newly spawned pthread, so
> is_primordial_thread will always be false.

jdk/src/solaris/bin/java_md_solinux.c
    if (pthread_create(&tid, &attr, (void *(*)(void*))continuation, (void*)args) == 0) {
      void * tmp;
      // set name of the main java thread
      pthread_setname_np(pthread_self(), "JAVA");
----> pthread_join(tid, &tmp);
^^^^ = here is the core file in TID == PID
      rslt = (int)tmp;
    } else {
     /*
      * Continue execution in current thread if for some reason (e.g. out of
      * memory/LWP)  a new thread can't be created. This will likely fail
      * later in continuation as JNI_CreateJavaVM needs to create quite a
      * few new threads, anyway, just give it a try..
      */

OK, thanks for the advice. So the backport makes no sense.


Jan


More information about the jdk8u-dev mailing list