[jdk11u-dev] RFR: 8214097: Rework thread initialization and teardown logic

Severin Gehwolf sgehwolf at openjdk.org
Tue Dec 19 10:58:45 UTC 2023


On Tue, 19 Dec 2023 09:49:22 GMT, SUN Guoyun <duke at openjdk.org> wrote:

> runtime/InternalApi/ThreadCpuTimesDeadlock.java can trigger exception occasionally on jdk11u fastdebug, the reason is that when `fast_cpu_time(Thread *thread)` is called, a non-java-thread state is ALLOCATED, so set_osthread (osthread) or osthread ->set_pthread_id (tid) is not yet completed.
> 
> <pre>
> 14:13:40 #
> 14:13:40 # A fatal error has been detected by the Java Runtime Environment:
> 14:13:40 #
> 14:13:40 #  SIGSEGV (0xb) at pc=0x000000fff454e840, pid=954448, tid=954670
> 14:13:40 #
> 14:13:40 # JRE version: OpenJDK Runtime Environment ls-internal (11.0.22+6) (fastdebug build 11.0.22+6-1)
> 14:13:40 # Java VM: OpenJDK 64-Bit Server VM ls-internal (fastdebug 11.0.22+6-1, mixed mode, tiered, compressed oops, g1 gc, linux-loongarch64)
> 14:13:40 # Problematic frame:
> 14:13:40 # C  [libpthread.so.0+0x12840]  pthread_getcpuclockid+0x0
> 14:13:40 #
> </pre>
> so need backport this patch.
> GHA and tier2-3 locally has finish, the failed items are not related to this patch.
> <pre>
> ==============================
> Test summary
> ==============================
>    TEST                                              TOTAL  PASS  FAIL ERROR   
>    jtreg:test/hotspot/jtreg:tier2                      323   323     0     0   
>>> jtreg:test/jdk:tier2                               3480  3478     2     0 <<
>    jtreg:test/langtools:tier2                           11    11     0     0   
>    jtreg:test/nashorn:tier2                             36    36     0     0   
>>> jtreg:test/jaxp:tier2                               443    24   419     0 <<
> ==============================
> ==============================                                                  
> Test summary                                                                    
> ==============================                                                  
>    TEST                                              TOTAL  PASS  FAIL ERROR    
>    jtreg:test/hotspot/jtreg:tier3                       48    48     0     0    
>>> jtreg:test/jdk:tier3                               2114  2113     1     0 << 
>    jtreg:test/langtools:tier3                            0     0     0     0    
>    jtreg:test/nashorn:tier3                              0     0     0     0    
>    jtreg:test/jaxp:tier3                                 0     0     0     0    
> ============================== 
> </pre>

@sunny868 Why are you backporting this patch to OpenJDK 11u? It's an intrusive patch that changes thread initialization which isn't suitable for backport at this stage in the lifecycle of JDK 11. There must be a **very** good reason to even consider it.

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

PR Comment: https://git.openjdk.org/jdk11u-dev/pull/2411#issuecomment-1862543399


More information about the jdk-updates-dev mailing list