JDK-8249874 : Invoking java.awt.Robot#keyPress crashes the JVM | OpenJDK14.0.1+14
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 14.0.1
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: os_x
  • CPU: x86_64
  • Submitted: 2020-07-16
  • Updated: 2020-08-05
  • Resolved: 2020-07-23
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 16
16Resolved
Related Reports
Duplicate :  
Description
ADDITIONAL SYSTEM INFORMATION :
---------------  S Y S T E M  ---------------

OS:uname:Darwin 19.5.0 Darwin Kernel Version 19.5.0: Tue May 26 20:41:44 PDT 2020; root:xnu-6153.121.2~2/RELEASE_X86_64 x86_64
OS uptime: 1 days 23:04 hours
rlimit: STACK 8192k, CORE 0k, NPROC 11136, NOFILE 10240, AS infinity, DATA infinity, FSIZE infinity
load average:3.80 2.42 2.07

CPU:total 8 (initial active 8) (4 cores per cpu, 2 threads per core) family 6 model 158 stepping 9, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3, sse4.1, sse4.2, popcnt, avx, avx2, aes, clmul, erms, rtm, 3dnowpref, lzcnt, ht, tsc, tscinvbit, bmi1, bmi2, adx, fma

Memory: 4k page, physical 67108864k(2050216k free), swap 0k(0k free)

vm_info: OpenJDK 64-Bit Server VM (14.0.1+14) for bsd-amd64 JRE (14.0.1+14), built on Jun 30 2020 17:14:54 by "brew" with clang 4.2.1 Compatible Apple LLVM 11.0.3 (clang-1103.0.32.62)

END.


A DESCRIPTION OF THE PROBLEM :
When invoking java.awt.Robot#keyPress on Mac OS Catalina the JVM crashes.

ERROR MESSAGES/STACK TRACES THAT OCCUR :
Host: iMac18,3 x86_64 4200 MHz, 8 cores, 64G, Darwin 19.5.0
Time: Wed Jul 15 21:12:03 2020 PDT elapsed time: 7 seconds (0d 0h 0m 7s)

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

Current thread (0x00007fd51b828000):  JavaThread "Test worker" [_thread_in_native, id=25347, stack(0x000070000ce97000,0x000070000cf97000)]

Stack: [0x000070000ce97000,0x000070000cf97000],  sp=0x000070000cf92400,  free space=1005k
Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code)
C  [libdispatch.dylib+0x38f1]  _dispatch_assert_queue_fail+0x63
C  [libdispatch.dylib+0x3886]  dispatch_assert_queue+0x7a
C  [HIToolbox+0x31dd2]  islGetInputSourceListWithAdditions+0x77
C  [HIToolbox+0x345c8]  isValidateInputSourceRef+0x5a
C  [HIToolbox+0x34490]  TSMGetInputSourceProperty+0x1e
C  [SkyLight+0x238c28]  invocation function for block in key_translate_initialize()+0xb2
C  [libdispatch.dylib+0x2658]  _dispatch_client_callout+0x8
C  [libdispatch.dylib+0x37de]  _dispatch_once_callout+0x14
C  [SkyLight+0x238b74]  CGSKeyEventTranslate+0x40
C  [SkyLight+0xd52f0]  SLEventCreateKeyboardEvent+0x110
C  [libawt_lwawt.dylib+0x2ad80]  Java_sun_lwawt_macosx_CRobot_keyEvent+0x48
j  sun.lwawt.macosx.CRobot.keyEvent(IZ)V+0 java.desktop@14.0.1
j  sun.lwawt.macosx.CRobot.keyPress(I)V+3 java.desktop@14.0.1
j  java.awt.Robot.keyPress(I)V+10 java.desktop@14.0.1

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
In jshell:
import java.awt.Robot;
var awtRobot = new Robot();
awtRobot.keyPress(java.awt.event.KeyEvent.VK_1);

ACTUAL -
Crashes the jvm

CUSTOMER SUBMITTED WORKAROUND :
The adoptOpenJDK build works as expected. The oracle openjdk build crashes

FREQUENCY : always



Comments
From the stack trace, it looks like the crash is related to the Text Input Sources, similar warning/error was fixed in the JDK-8226806
23-07-2020

Tested exact version of java, and cannot reproduce the problem.
23-07-2020

Additional Information from submitter: =========================== I installed the JDK from Homebrew formula: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/openjdk.rb Build was downloaded from: homepage "https://openjdk.java.net/" url "https://hg.openjdk.java.net/jdk-updates/jdk14u/archive/jdk-14.0.1-ga.tar.bz2" sha256 "f9c4a55ac858f858222bc5fe6e4b890f9b4a3f942fd0211575b0418aec5c14d6"
23-07-2020