<AWT Dev> <AWT dev> Review request for JDK-8165555: [macosx] VM crashes on second attempt to execute JCK interactive tests that use Robot (single JVM, agent)
manajit.halder at oracle.com
Wed Sep 21 13:01:52 UTC 2016
Thanks for the comment.
Access to "instance" is not broken. The problem is with the dictionary variable "javaToMacKeyMap" within the "instance" reference.
The dictionary is not getting initialised for the second time when singleton method is called for the second time. The dictionary is
getting initialised during the first time singleton method is called and hence crash was observed. Tried adding self.javaToMacKeyMap
but doesn’t solve the problem.
I propose two solutions to this problem:
Reinitialise the dictionary every-time the singleton method is called.
dictionary is initialised multiple times (every time singleton method is called).
Make the dictionary static.
Still dictionary need to be initialised multiple times.
No singleton method, just two static methods, one method to initialise the dictionary and other to get the key form the dictionary.
Not prepared. Will be prepared if second solution accepted.
There are no test cases. Problem can be reproduced by executing following JCK test:
java -jar JCK-runtime-9/lib/jtjck.jar -mode:single -k:interactive "api/java_awt/interactive/event/EventTests.html#EventTest0019 api/java_awt/interactive/event/EventTests.html#EventTest0013”
> On 20-Sep-2016, at 4:42 am, Sergey Bylokhov <Sergey.Bylokhov at oracle.com> wrote:
> Hi, Manajit.
> It seems that after the fix "(CRobotKeyCodeMapping *) sharedInstance" returns the new object per invocation, so it is not really sharedInstance. I am not sure I understand what is wrong in the current code, from the my point of view this is a correct singleton. It it true that the problem is in access to broken "instance" and not to "javaToMacKeyMap" inside the "instance"? If not then "javaToMacKeyMap" should be changed to "self.javaToMacKeyMap".
> Do you have a test case to reproduce the bug?
> On 19.09.16 15:26, Manajit Halder wrote:
>> Hi All,
>> Kindly review the fix for JDK9.
>> [macosx] VM crashes on second attempt to execute JCK interactive tests
>> that use Robot (single JVM, agent)
>> While executing the JCK test for the second time the robot was getting
>> initialised once again and old instance of CRobotKeyCodeMapping was not
>> Crash was observed while trying to access invalid instance of
>> A new instance of CRobotKeyCodeMapping is created when robot is initialised.
> Best regards, Sergey.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the awt-dev