admin管理员组

文章数量:1389812

I'm running a multi-threaded Java Swing app on a Macbook Pro Sequoia 15.3.1 which I regularly put to sleep and wake. I've noticed upon waking the application will occasionally crash, but unfortunately there is no stack trace in the logs. Only this:

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00000001940fc07c, pid=92739, tid=125871
#
# JRE version: OpenJDK Runtime Environment Homebrew (23.0.1) (build 23.0.1)
# Java VM: OpenJDK 64-Bit Server VM Homebrew (23.0.1, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, bsd-aarch64)
# Problematic frame:
# C  [CoreVideo+0x307c]  CVXTime::translateTime(CVTimeStamp const*, CVTimeStamp*) const+0x2c
#
# No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /var/folders/r_/gktdwd0x4q9fhzp8stylc1pc0000gp/T//hs_err_pid92739.log
#
# If you would like to submit a bug report, please visit:
#   
#

I go to the report file and here is the first few sections:

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00000001940fc07c, pid=92739, tid=125871
#
# JRE version: OpenJDK Runtime Environment Homebrew (23.0.1) (build 23.0.1)
# Java VM: OpenJDK 64-Bit Server VM Homebrew (23.0.1, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, bsd-aarch64)
# Problematic frame:
# C  [CoreVideo+0x307c]  CVXTime::translateTime(CVTimeStamp const*, CVTimeStamp*) const+0x2c
#
# No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# If you would like to submit a bug report, please visit:
#   
#

---------------  S U M M A R Y ------------

Command Line: /Users/me/app/target/app.jar

Host: "Mac14,10" arm64, 12 cores, 16G, Darwin 24.3.0, macOS 15.3.1 (24D70)
Time: Thu Mar 13 09:12:27 2025 CDT elapsed time: 14073.500905 seconds (0d 3h 54m 33s)

---------------  T H R E A D  ---------------

Current thread is native thread

Stack: [0x000000016e510000,0x000000016e593000],  sp=0x000000016e592c00,  free space=523k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C  [CoreVideo+0x307c]  CVXTime::translateTime(CVTimeStamp const*, CVTimeStamp*) const+0x2c
C  [CoreVideo+0x2dec]  CVDisplayLink::calculateNextWakeUpTime(CVTimeStamp*, CVTimeStamp*, bool)+0xe0
C  [CoreVideo+0x241c]  CVDisplayLink::runIOThread()+0x198
C  [libsystem_pthread.dylib+0x72e4]  _pthread_start+0x88

siginfo: si_signo: 11 (SIGSEGV), si_code: 2 (SEGV_ACCERR), si_addr: 0x0000c0dcee097a28

Registers:
 x0=0x0000600001b07870  x1=0x000000016e592d00  x2=0x000000016e592e20  x3=0x0000000000000000
 x4=0x0151300001513100  x5=0x00000000000100a8  x6=0x0000000000000000  x7=0x00000000007c074d
 x8=0x0000c0dcee097870  x9=0x0000000000030d40 x10=0x00000f2f8a0d3180 x11=0x0000000000030d40
x12=0x0000000000000100 x13=0x0000000001513100 x14=0x0000000001513000 x15=0x0151300001513100
x16=0x00000001f6117790 x17=0x67900001f6117790 x18=0x0000000000000000 x19=0x0000600001b07870
x20=0x000000016e592e20 x21=0x000000016e592d00 x22=0x0000000000000000 x23=0x0000000000000000
x24=0x00000f2f8a21f315 x25=0x000000011602ac18 x26=0x00000001f23c3d18 x27=0x00000f2f8a2266e2
x28=0x0000000000000000  fp=0x000000016e592c70  lr=0x00000001940fbdec  sp=0x000000016e592c00
pc=0x00000001940fc07c cpsr=0x0000000080001000

Top of Stack: (sp=0x000000016e592c00)
0x000000016e592c00:   00000001f23c35d8 0000000194114194
0x000000016e592c10:   0000000000000000 0000000000000004
0x000000016e592c20:   00000001940fbe1c 00000001941452d1
0x000000016e592c30:   000000016e592c70 00000001941140d8
0x000000016e592c40:   00000f2f8a21f315 0000000000000000
0x000000016e592c50:   0000000000000000 000000011602ac00
0x000000016e592c60:   000000011602aa20 000000016e592e20
0x000000016e592c70:   000000016e592e10 00000001940fbdec
0x000000016e592c80:   000000011602aa20 0000000000000000
0x000000016e592c90:   00000f2f8a206c75 00000f2f8a1ef902
0x000000016e592ca0:   0000000000017373 0000000000030d40
0x000000016e592cb0:   000000011602ab18 0000000113ca4220
0x000000016e592cc0:   0000000000000001 00006000032488d0
0x000000016e592cd0:   000000000000003c 0000000000000001
0x000000016e592ce0:   000000011602aa38 0000000000000000
0x000000016e592cf0:   000000016e592d10 000000018ac92a18
0x000000016e592d00:   016e360000000000 00000f2f8a1f8100
0x000000016e592d10:   00000f2f8a10668d 3ff0000000000000
0x000000016e592d20:   0000000000030d40 0000000000000000
0x000000016e592d30:   0000000000000000 0000000000000000
0x000000016e592d40:   0000000000000001 0000000000000000
0x000000016e592d50:   0000000000000000 0000000000000000
0x000000016e592d60:   0000000000000000 0000000000000000
0x000000016e592d70:   0000000000000000 0000000000000002
0x000000016e592d80:   0000000000000000 0000000000000000
0x000000016e592d90:   0000000000000000 0000000000000000
0x000000016e592da0:   000000011602ab18 000000011602aa20
0x000000016e592db0:   0000000000000000 0000000000000000
0x000000016e592dc0:   00000001f23c3d18 00000001f23c3cf8
0x000000016e592dd0:   0000000000000003 00000001f23c3cf4
0x000000016e592de0:   00000f2f8a21f315 0000000000000000
0x000000016e592df0:   000000011602ab18 000000011602aad8 

Instructions: (pc=0x00000001940fc07c)
0x00000001940fbf7c:   95 fd ff 97 80 1e 41 f9 a7 fd ff 97 90 02 40 f9
0x00000001940fbf8c:   f1 03 14 aa d1 59 e8 f2 30 1a c1 da 08 8e 48 f8
0x00000001940fbf9c:   e9 03 10 aa e0 03 14 aa e1 03 15 aa f1 03 09 aa
0x00000001940fbfac:   d1 df f5 f2 11 09 3f d7 9f 1a 01 f9 90 02 40 f9
0x00000001940fbfbc:   f1 03 14 aa d1 59 e8 f2 30 1a c1 da 08 8e 48 f8
0x00000001940fbfcc:   e9 03 10 aa e0 03 14 aa e1 03 13 aa f1 03 09 aa
0x00000001940fbfdc:   d1 df f5 f2 11 09 3f d7 fd 7b 59 a9 f4 4f 58 a9
0x00000001940fbfec:   f6 57 57 a9 f8 5f 56 a9 fa 67 55 a9 fc 6f 54 a9
0x00000001940fbffc:   e9 23 53 6d ff 83 06 91 ff 0f 5f d6 7f 23 03 d5
0x00000001940fc00c:   f6 57 bd a9 f4 4f 01 a9 fd 7b 02 a9 fd 83 00 91
0x00000001940fc01c:   f3 03 00 aa 14 60 00 91 e0 03 14 aa 1c 1f 01 94
0x00000001940fc02c:   75 ce 5b a9 e0 03 14 aa 1d 1f 01 94 e0 03 15 aa
0x00000001940fc03c:   e1 03 13 aa fd 7b 42 a9 f4 4f 41 a9 f6 57 c3 a8
0x00000001940fc04c:   ff 0f 5f d6 7f 23 03 d5 ff 03 02 d1 f8 5f 04 a9
0x00000001940fc05c:   f6 57 05 a9 f4 4f 06 a9 fd 7b 07 a9 fd c3 01 91
0x00000001940fc06c:   f4 03 02 aa f5 03 01 aa f3 03 00 aa 08 00 40 f9
0x00000001940fc07c:   17 d9 5b a9 20 80 c0 3c 28 20 40 f9 e8 0f 00 f9
0x00000001940fc08c:   e0 83 80 3c e0 03 00 f9 c1 02 00 d0 21 bc 09 91
0x00000001940fc09c:   a0 00 80 52 fe 5f 00 94 80 82 c0 3c 88 22 40 f9
0x00000001940fc0ac:   81 0e 40 fd 89 12 40 f9 8a 06 40 b9 e9 1b 00 f9
0x00000001940fc0bc:   e1 17 00 fd e8 ab 01 a9 e0 83 80 3c f3 03 00 f9
0x00000001940fc0cc:   c1 02 00 d0 21 e8 0a 91 a0 00 80 52 f0 5f 00 94
0x00000001940fc0dc:   f7 db 00 a9 f3 03 00 f9 c1 02 00 d0 21 10 0d 91
0x00000001940fc0ec:   a0 00 80 52 ea 5f 00 94 68 2e 40 f9 69 52 40 b9
0x00000001940fc0fc:   e8 a7 00 a9 f3 03 00 f9 c1 02 00 d0 21 4c 0e 91
0x00000001940fc10c:   a0 00 80 52 e2 5f 00 94 60 26 40 fd 61 0a 40 fd
0x00000001940fc11c:   21 d8 61 7e e0 87 00 6d f3 03 00 f9 c1 02 00 d0
0x00000001940fc12c:   21 58 0f 91 a0 00 80 52 d9 5f 00 94 88 22 40 f9
0x00000001940fc13c:   48 03 00 36 a9 22 40 f9 89 00 00 37 a9 00 08 37
0x00000001940fc14c:   09 00 80 d2 14 00 00 14 a9 06 40 f9 12 00 00 14
0x00000001940fc15c:   a9 0a 40 f9 6a 2e 40 f9 4b 01 09 cb 60 01 63 9e
0x00000001940fc16c:   00 40 61 1e 29 01 0a eb 21 01 63 9e 00 9c 61 1e 

It seems these lines show that CoreVideo CVXTime::translateTime(CVTimeStamp const*, CVTimeStamp*) is causing a segfault. I'm guessing it's some JDK library I'm calling possibily to do with Swing, but that's where my understanding and research reaches its limit.

My question is how can I prevent the crash from happening?

本文标签: macosJVM Crashes with Java Swing App when coming out of sleepStack Overflow