JDK-8248532 : Every time I change keyboard language at my MacBook, Java crashes
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 14.0.1
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • OS: os_x
  • CPU: x86
  • Submitted: 2020-06-25
  • Updated: 2021-11-15
  • Resolved: 2020-09-09
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 11 JDK 13 JDK 15 JDK 16
11.0.10-oracleFixed 13.0.6Fixed 15.0.4Fixed 16 b15Fixed
Related Reports
Relates :  
Relates :  
Description
ADDITIONAL SYSTEM INFORMATION :
Process:               java [17525]
Path:                  /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java
Identifier:            net.java.openjdk.cmd
Version:               1.0 (1.0)
Code Type:             X86-64 (Native)
Parent Process:        ??? [1]
Responsible:           java [17525]
User ID:               501

Date/Time:             2020-06-25 07:20:40.327 +0100
OS Version:            Mac OS X 10.14.6 (18G5033)
Report Version:        12
Bridge OS Version:     4.5 (17P5290)
Anonymous UUID:        5EB39D01-1345-957B-83EC-7230D42C72F4

Sleep/Wake UUID:       4A7C74F2-DD79-445D-A5F2-A46FD8DBF974

Time Awake Since Boot: 340000 seconds
Time Since Wake:       330 seconds

System Integrity Protection: enabled

Crashed Thread:        0  AppKit Thread  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_BAD_ACCESS (SIGABRT)
Exception Codes:       EXC_I386_GPFLT
Exception Note:        EXC_CORPSE_NOTIFY

Application Specific Information:
abort() called

Thread 0 Crashed:: AppKit Thread  Dispatch queue: com.apple.main-thread
0   libsystem_kernel.dylib        	0x00007fff629d32c2 __pthread_kill + 10
1   libsystem_pthread.dylib       	0x00007fff62a8ebf1 pthread_kill + 284
2   libsystem_c.dylib             	0x00007fff6293d6a6 abort + 127
3   libjvm.dylib                  	0x000000010b88f5c1 os::abort(bool) + 25
4   libjvm.dylib                  	0x000000010b9bbff6 VMError::report_and_die() + 2306
5   libjvm.dylib                  	0x000000010b891206 JVM_handle_bsd_signal + 1131
6   libjvm.dylib                  	0x000000010b88d44b signalHandler(int, __siginfo*, void*) + 47
7   libsystem_platform.dylib      	0x00007fff62a83b5d _sigtramp + 29
8   ???                           	0x0000000000000004 0 + 4
9   com.apple.CoreFoundation      	0x00007fff3696e1a0 ___CFXRegistrationPost_block_invoke + 63
10  com.apple.CoreFoundation      	0x00007fff3696e10a _CFXRegistrationPost + 404
11  com.apple.CoreFoundation      	0x00007fff369765b8 ___CFXNotificationPost_block_invoke + 87
12  com.apple.CoreFoundation      	0x00007fff368def44 -[_CFXNotificationRegistrar find:object:observer:enumerator:] + 1642
13  com.apple.CoreFoundation      	0x00007fff368de2f7 _CFXNotificationPost + 732
14  com.apple.Foundation          	0x00007fff38b66a2b -[NSNotificationCenter postNotificationName:object:userInfo:] + 66
15  com.apple.CoreFoundation      	0x00007fff3696e226 __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 12
16  com.apple.CoreFoundation      	0x00007fff3696e1a0 ___CFXRegistrationPost_block_invoke + 63
17  com.apple.CoreFoundation      	0x00007fff36947df8 __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 12
18  com.apple.CoreFoundation      	0x00007fff3690b517 __CFRunLoopDoBlocks + 394
19  com.apple.CoreFoundation      	0x00007fff3690ac36 __CFRunLoopRun + 1174
20  com.apple.CoreFoundation      	0x00007fff3690a54e CFRunLoopRunSpecific + 455
21  com.apple.HIToolbox           	0x00007fff35b691ab RunCurrentEventLoopInMode + 292
22  com.apple.HIToolbox           	0x00007fff35b68ded ReceiveNextEventCommon + 355
23  com.apple.HIToolbox           	0x00007fff35b68c76 _BlockUntilNextEventMatchingListInModeWithFilter + 64
24  com.apple.AppKit              	0x00007fff33f0077d _DPSNextEvent + 1135
25  com.apple.AppKit              	0x00007fff33eff46b -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1361
26  libosxapp.dylib               	0x0000000110135328 -[NSApplicationAWT nextEventMatchingMask:untilDate:inMode:dequeue:] + 124
27  com.apple.AppKit              	0x00007fff33ef9588 -[NSApplication run] + 699
28  libosxapp.dylib               	0x0000000110134f72 +[NSApplicationAWT runAWTLoopWithApp:] + 156
29  libsplashscreen.dylib         	0x00000001101114e8 __SplashInitPlatform_block_invoke_1 + 360
30  JavaNativeFoundation          	0x00007fff3aa31fce +[JNFRunLoop _performCopiedBlock:] + 17
31  com.apple.Foundation          	0x00007fff38c052b2 __NSThreadPerformPerform + 328
32  com.apple.CoreFoundation      	0x00007fff36927d17 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
33  com.apple.CoreFoundation      	0x00007fff36927cbd __CFRunLoopDoSource0 + 108
34  com.apple.CoreFoundation      	0x00007fff3690b67b __CFRunLoopDoSources0 + 195
35  com.apple.CoreFoundation      	0x00007fff3690ac45 __CFRunLoopRun + 1189
36  com.apple.CoreFoundation      	0x00007fff3690a54e CFRunLoopRunSpecific + 455
37  java                          	0x000000010a23946e CreateExecutionEnvironment + 871
38  java                          	0x000000010a23503c JLI_Launch + 1952
39  java                          	0x000000010a23b4cb main + 101
40  java                          	0x000000010a234894 start + 52

Thread 1:
0   libsystem_kernel.dylib        	0x00007fff629cf9da __ulock_wait + 10
1   libsystem_pthread.dylib       	0x00007fff62a906de _pthread_join + 358
2   java                          	0x000000010a238a2b ContinueInNewThread0 + 102
3   java                          	0x000000010a235ee8 ContinueInNewThread + 201
4   java                          	0x000000010a23878b JVMInit + 363
5   java                          	0x000000010a235c66 JLI_Launch + 5066
6   java                          	0x000000010a23b4cb main + 101
7   java                          	0x000000010a239100 apple_main + 92
8   libsystem_pthread.dylib       	0x00007fff62a8c2eb _pthread_body + 126
9   libsystem_pthread.dylib       	0x00007fff62a8f249 _pthread_start + 66
10  libsystem_pthread.dylib       	0x00007fff62a8b40d thread_start + 13

Thread 2:
0   libsystem_kernel.dylib        	0x00007fff629d0866 __psynch_cvwait + 10
1   libsystem_pthread.dylib       	0x00007fff62a8f56e _pthread_cond_wait + 722
2   libjvm.dylib                  	0x000000010b88bb4a os::PlatformEvent::park() + 192
3   libjvm.dylib                  	0x000000010b86880e ParkCommon(ParkEvent*, long) + 42
4   libjvm.dylib                  	0x000000010b8690f2 Monitor::IWait(Thread*, long) + 168
5   libjvm.dylib                  	0x000000010b8692e9 Monitor::wait(bool, long, bool) + 261
6   libjvm.dylib                  	0x000000010b975bf8 Threads::destroy_vm() + 80
7   libjvm.dylib                  	0x000000010b726dd2 jni_DestroyJavaVM + 254
8   java                          	0x000000010a236227 JavaMain + 805
9   libsystem_pthread.dylib       	0x00007fff62a8c2eb _pthread_body + 126
10  libsystem_pthread.dylib       	0x00007fff62a8f249 _pthread_start + 66
11  libsystem_pthread.dylib       	0x00007fff62a8b40d thread_start + 13

Thread 3:
0   libsystem_kernel.dylib        	0x00007fff629d0866 __psynch_cvwait + 10
1   libsystem_pthread.dylib       	0x00007fff62a8f56e _pthread_cond_wait + 722
2   libjvm.dylib                  	0x000000010b88bb4a os::PlatformEvent::park() + 192
3   libjvm.dylib                  	0x000000010b86880e ParkCommon(ParkEvent*, long) + 42
4   libjvm.dylib                  	0x000000010b8690f2 Monitor::IWait(Thread*, long) + 168
5   libjvm.dylib                  	0x000000010b86936a Monitor::wait(bool, long, bool) + 390
6   libjvm.dylib                  	0x000000010b6780aa GCTaskManager::get_task(unsigned int) + 56
7   libjvm.dylib                  	0x000000010b679177 GCTaskThread::run() + 349
8   libjvm.dylib                  	0x000000010b88fe2a java_start(Thread*) + 246
9   libsystem_pthread.dylib       	0x00007fff62a8c2eb _pthread_body + 126
10  libsystem_pthread.dylib       	0x00007fff62a8f249 _pthread_start + 66
11  libsystem_pthread.dylib       	0x00007fff62a8b40d thread_start + 13

Thread 4:
0   libsystem_kernel.dylib        	0x00007fff629d0866 __psynch_cvwait + 10
1   libsystem_pthread.dylib       	0x00007fff62a8f56e _pthread_cond_wait + 722
2   libjvm.dylib                  	0x000000010b88bb4a os::PlatformEvent::park() + 192
3   libjvm.dylib                  	0x000000010b86880e ParkCommon(ParkEvent*, long) + 42
4   libjvm.dylib                  	0x000000010b8690f2 Monitor::IWait(Thread*, long) + 168
5   libjvm.dylib                  	0x000000010b86936a Monitor::wait(bool, long, bool) + 390
6   libjvm.dylib                  	0x000000010b6780aa GCTaskManager::get_task(unsigned int) + 56
7   libjvm.dylib                  	0x000000010b679177 GCTaskThread::run() + 349
8   libjvm.dylib                  	0x000000010b88fe2a java_start(Thread*) + 246
9   libsystem_pthread.dylib       	0x00007fff62a8c2eb _pthread_body + 126
10  libsystem_pthread.dylib       	0x00007fff62a8f249 _pthread_start + 66
11  libsystem_pthread.dylib       	0x00007fff62a8b40d thread_start + 13

Thread 5:
0   libsystem_kernel.dylib        	0x00007fff629d0866 __psynch_cvwait + 10
1   libsystem_pthread.dylib       	0x00007fff62a8f56e _pthread_cond_wait + 722
2   libjvm.dylib                  	0x000000010b88bb4a os::PlatformEvent::park() + 192
3   libjvm.dylib                  	0x000000010b86880e ParkCommon(ParkEvent*, long) + 42
4   libjvm.dylib                  	0x000000010b8690f2 Monitor::IWait(Thread*, long) + 168
5   libjvm.dylib                  	0x000000010b86936a Monitor::wait(bool, long, bool) + 390
6   libjvm.dylib                  	0x000000010b6780aa GCTaskManager::get_task(unsigned int) + 56
7   libjvm.dylib                  	0x000000010b679177 GCTaskThread::run() + 349
8   libjvm.dylib                  	0x000000010b88fe2a java_start(Thread*) + 246
9   libsystem_pthread.dylib       	0x00007fff62a8c2eb _pthread_body + 126
10  libsystem_pthread.dylib       	0x00007fff62a8f249 _pthread_start + 66
11  libsystem_pthread.dylib       	0x00007fff62a8b40d thread_start + 13

Thread 6:
0   libsystem_kernel.dylib        	0x00007fff629d0866 __psynch_cvwait + 10
1   libsystem_pthread.dylib       	0x00007fff62a8f56e _pthread_cond_wait + 722
2   libjvm.dylib                  	0x000000010b88bb4a os::PlatformEvent::park() + 192
3   libjvm.dylib                  	0x000000010b86880e ParkCommon(ParkEvent*, long) + 42
4   libjvm.dylib                  	0x000000010b8690f2 Monitor::IWait(Thread*, long) + 168
5   libjvm.dylib                  	0x000000010b86936a Monitor::wait(bool, long, bool) + 390
6   libjvm.dylib                  	0x000000010b6780aa GCTaskManager::get_task(unsigned int) + 56
7   libjvm.dylib                  	0x000000010b679177 GCTaskThread::run() + 349
8   libjvm.dylib                  	0x000000010b88fe2a java_start(Thread*) + 246
9   libsystem_pthread.dylib       	0x00007fff62a8c2eb _pthread_body + 126
10  libsystem_pthread.dylib       	0x00007fff62a8f249 _pthread_start + 66
11  libsystem_pthread.dylib       	0x00007fff62a8b40d thread_start + 13

Thread 7:
0   libsystem_kernel.dylib        	0x00007fff629d0866 __psynch_cvwait + 10
1   libsystem_pthread.dylib       	0x00007fff62a8f56e _pthread_cond_wait + 722
2   libjvm.dylib                  	0x000000010b88bb4a os::PlatformEvent::park() + 192
3   libjvm.dylib                  	0x000000010b86880e ParkCommon(ParkEvent*, long) + 42
4   libjvm.dylib                  	0x000000010b8690f2 Monitor::IWait(Thread*, long) + 168
5   libjvm.dylib                  	0x000000010b86936a Monitor::wait(bool, long, bool) + 390
6   libjvm.dylib                  	0x000000010b6780aa GCTaskManager::get_task(unsigned int) + 56
7   libjvm.dylib                  	0x000000010b679177 GCTaskThread::run() + 349
8   libjvm.dylib                  	0x000000010b88fe2a java_start(Thread*) + 246
9   libsystem_pthread.dylib       	0x00007fff62a8c2eb _pthread_body + 126
10  libsystem_pthread.dylib       	0x00007fff62a8f249 _pthread_start + 66
11  libsystem_pthread.dylib       	0x00007fff62a8b40d thread_start + 13

Thread 8:
0   libsystem_kernel.dylib        	0x00007fff629d0866 __psynch_cvwait + 10
1   libsystem_pthread.dylib       	0x00007fff62a8f56e _pthread_cond_wait + 722
2   libjvm.dylib                  	0x000000010b88bb4a os::PlatformEvent::park() + 192
3   libjvm.dylib                  	0x000000010b86880e ParkCommon(ParkEvent*, long) + 42
4   libjvm.dylib                  	0x000000010b8690f2 Monitor::IWait(Thread*, long) + 168
5   libjvm.dylib                  	0x000000010b86936a Monitor::wait(bool, long, bool) + 390
6   libjvm.dylib                  	0x000000010b6780aa GCTaskManager::get_task(unsigned int) + 56
7   libjvm.dylib                  	0x000000010b679177 GCTaskThread::run() + 349
8   libjvm.dylib                  	0x000000010b88fe2a java_start(Thread*) + 246
9   libsystem_pthread.dylib       	0x00007fff62a8c2eb _pthread_body + 126
10  libsystem_pthread.dylib       	0x00007fff62a8f249 _pthread_start + 66
11  libsystem_pthread.dylib       	0x00007fff62a8b40d thread_start + 13

Thread 9:
0   libsystem_kernel.dylib        	0x00007fff629d0866 __psynch_cvwait + 10
1   libsystem_pthread.dylib       	0x00007fff62a8f56e _pthread_cond_wait + 722
2   libjvm.dylib                  	0x000000010b88bb4a os::PlatformEvent::park() + 192
3   libjvm.dylib                  	0x000000010b86880e ParkCommon(ParkEvent*, long) + 42
4   libjvm.dylib                  	0x000000010b8690f2 Monitor::IWait(Thread*, long) + 168
5   libjvm.dylib                  	0x000000010b86936a Monitor::wait(bool, long, bool) + 390
6   libjvm.dylib                  	0x000000010b6780aa GCTaskManager::get_task(unsigned int) + 56
7   libjvm.dylib                  	0x000000010b679177 GCTaskThread::run() + 349
8   libjvm.dylib                  	0x000000010b88fe2a java_start(Thread*) + 246
9   libsystem_pthread.dylib       	0x00007fff62a8c2eb _pthread_body + 126
10  libsystem_pthread.dylib       	0x00007fff62a8f249 _pthread_start + 66
11  libsystem_pthread.dylib       	0x00007fff62a8b40d thread_start + 13

Thread 10:
0   libsystem_kernel.dylib        	0x00007fff629d0866 __psynch_cvwait + 10
1   libsystem_pthread.dylib       	0x00007fff62a8f56e _pthread_cond_wait + 722
2   libjvm.dylib                  	0x000000010b88bb4a os::PlatformEvent::park() + 192
3   libjvm.dylib                  	0x000000010b86880e ParkCommon(ParkEvent*, long) + 42
4   libjvm.dylib                  	0x000000010b8690f2 Monitor::IWait(Thread*, long) + 168
5   libjvm.dylib                  	0x000000010b86936a Monitor::wait(bool, long, bool) + 390
6   libjvm.dylib                  	0x000000010b6780aa GCTaskManager::get_task(unsigned int) + 56
7   libjvm.dylib                  	0x000000010b679177 GCTaskThread::run() + 349
8   libjvm.dylib                  	0x000000010b88fe2a java_start(Thread*) + 246
9   libsystem_pthread.dylib       	0x00007fff62a8c2eb _pthread_body + 126
10  libsystem_pthread.dylib       	0x00007fff62a8f249 _pthread_start + 66
11  libsystem_pthread.dylib       	0x00007fff62a8b40d thread_start + 13

Thread 11:
0   libsystem_kernel.dylib        	0x00007fff629d0866 __psynch_cvwait + 10
1   libsystem_pthread.dylib       	0x00007fff62a8f56e _pthread_cond_wait + 722
2   libjvm.dylib                  	0x000000010b88ca42 os::PlatformEvent::park(long) + 404
3   libjvm.dylib                  	0x000000010b8690f2 Monitor::IWait(Thread*, long) + 168
4   libjvm.dylib                  	0x000000010b86936a Monitor::wait(bool, long, bool) + 390
5   libjvm.dylib                  	0x000000010b9c2054 VMThread::loop() + 444
6   libjvm.dylib                  	0x000000010b9c1adf VMThread::run() + 121
7   libjvm.dylib                  	0x000000010b88fe2a java_start(Thread*) + 246
8   libsystem_pthread.dylib       	0x00007fff62a8c2eb _pthread_body + 126
9   libsystem_pthread.dylib       	0x00007fff62a8f249 _pthread_start + 66
10  libsystem_pthread.dylib       	0x00007fff62a8b40d thread_start + 13

Thread 12:: Java: Reference Handler
0   libsystem_kernel.dylib        	0x00007fff629d0866 __psynch_cvwait + 10
1   libsystem_pthread.dylib       	0x00007fff62a8f56e _pthread_cond_wait + 722
2   libjvm.dylib                  	0x000000010b88bb4a os::PlatformEvent::park() + 192
3   libjvm.dylib                  	0x000000010b8835c3 ObjectMonitor::wait(long, bool, Thread*) + 763
4   libjvm.dylib                  	0x000000010b9422ac ObjectSynchronizer::wait(Handle, long, Thread*) + 202
5   libjvm.dylib                  	0x000000010b7526ed JVM_MonitorWait + 156
6   ???                           	0x00000001194fa228 0 + 4719616552
7   ???                           	0x00000001191a675c 0 + 47161280

A DESCRIPTION OF THE PROBLEM :
I am using Java to work from home. My company requires Java to remotely work and access my desktop at the office. I am working from a MacBook (latest version Pro). Every time I change the language at my MacBook, Java crashes 


FREQUENCY : always



Comments
I am dropping jdk8u-fix-* labels from this issue and from JDK-8234786, at this point it is clear that approval for them was requested prematurely, sorry for the confusion.
15-11-2021

[~sgehwolf] Thanks for the approval! Just as you correctly stated this issue is blocked by JDK-8214578 , that introduced possible crashes. I assume, if JDK-8214578 is going to be reviewed and approved, the following 4 patches needs to be pushed at the same time: - JDK-8214578 (original change) - JDK-8248532 (this issue) - JDK-8234786 (another fix, that also applies cleanly on top of JDK-8214578) - JDK-8257242 (another fix, that, in addition to JDK-8214578, also requires JDK-8234786, so it was not marked for approval unlike previous 2)
05-11-2021

[~akasko] Are you going to push this to jdk8u? It's been approved. Update: This is pending conclusion on JDK-8214578 and if successful, pushed together.
05-11-2021

Fix request (8u) Requesting backport to 8u because it fixes the problem introduced with JDK-8214578 that is on review for 8u. Patch applies cleanly (with updated path) on top of JDK-8214578 and is intended to be pushed along with it. 8u exported changeset with updated path: https://cr.openjdk.java.net/~akasko/jdk8u/8248532/8248532_8u.patch
06-10-2021

Fix request (15u). I would like to backport the fix to jdk15u for parity with jdk11u. The original patch applied cleanly.
25-04-2021

Fix request (13u). I would like to backport the fix to jdk13u for parity with jdk11u. The original patch applied cleanly.
21-12-2020

Fix request (11u) -- will label after testing completed. I would like to downport this for parity with 11.0.10-oracle. Applies clean.
05-10-2020

Changeset: 6329de45 Author: Prasanta Sadhukhan <psadhukhan@openjdk.org> Date: 2020-09-09 13:43:06 +0000 URL: https://git.openjdk.java.net/jdk/commit/6329de45
09-09-2020

macos code historically uses NSNotificationCenter without any crash, so there's no need to use NSDistributedNotificationCenter. On further investigation , if is found we used wrong observer setup. So, proper fix is to use the implementation class as observer as is used in existing NSNotficationCenter setup in LWCToolkit.m
09-09-2020

Proposed fix is to use NSDistributedNotificationCenter for the notification handler. From https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/Notifications/Articles/NotificationCenters.html it is seen that "NSNotificationCenter" This notification center handles notifications within a single process whereas "NSDistributedNotificationCenter" This distributed notification center handles notifications that can be sent between processes on a single machine. Since, the app is bundled with Java, notifications needed to handled between different processes in such case.
31-08-2020

I could reproduce this crash with this app by switching between Romaji and English 1-2 times. However, I also tried with the JDK-8214578 testcase and tried switching between Romaji and English/US keyboard layout several times but could not see any crash. Is it possible to get a Java testcase?
27-08-2020

Steps to reproduce: - Install the mucommander 0.9.5, this version starts to use the jdk 11.0.7: https://github.com/mucommander/mucommander/releases - Run the mucomander: open /Applications/muCommander.app/ - Switch the input keyboard layout(I use RU<-->EN) a few times, probably select some other app and then move back, in a loop. - At some point, the crash occurs. To check that it was caused by the JDK-8214578: - Rollback the fix for JDK-8214578, and rebuild jdk11u - Delete the jdk11.0.7 used by the mucommander, it is located in /Applications/muCommander.app/Contents/PlugIns/macOS/Contents/Home/jre/ - Put your own build of JDK to the path above. - Run the mucomander: open /Applications/muCommander.app/ It will work fine.
31-07-2020

I can reproduce the crash, seems like a regression between 11.0.4 and 11.0.7. The crash occurs when the java and the app are bundled together, which could be a bundler issue.
31-07-2020

Issue does not reproduce locally and we didn't get relevant details from the submitter as requested, therefore closing this as "Cannot Reproduce". If we receive any update in future with required details, we may consider reopening this issue.
07-07-2020

Reported with JDK 14.0.1 and Mac OS X 10.14.6, crash occurs in AppKit when user change keyboard language at his MacBook. Checked this with reported configuration but couldn't reproduce the issue. Written back to the submitter requesting additional information/steps.
30-06-2020