<AWT Dev> Crash in "getNumButtons" (libawt_xawt.so) after applying Linux OS patch " libXi6-1.7.4-12.2.x86_64
Jitendra Singh
jitendra.enania at in.ibm.com
Fri Nov 10 13:26:31 UTC 2017
Hi,
DETAILS ABOUT THE PROBLEM
Crash in "getNumButtons" (libawt_xawt.so) after applying Linux OS patch "
libXi6-1.7.4-12.2.x86_64.
AWT-EventQueue-0 (java.awt.EventDispatchThread at 0xFFEEA8D8)
sun/awt/X11/XToolkit.getNumberOfButtonsImpl ()I
sun/awt/X11/XToolkit.getNumberOfButtons ()I(1483)
sun/awt/X11/XToolkit.initializeDesktopProperties ()V(1466)
java/awt/Toolkit.getDesktopProperty
(Ljava/lang/String;)Ljava/lang/Object;(1801)
sun/swing/SwingUtilities2$AATextInfo.getAATextInfo
(Z)Lsun/swing/SwingUtilities2$AATextInfo;(163)
javax/swing/plaf/metal/MetalLookAndFeel.initComponentDefaults
(Ljavax/swing/UIDefaults;)V
javax/swing/plaf/basic/BasicLookAndFeel.getDefaults
()Ljavax/swing/UIDefaults;(159)
javax/swing/plaf/metal/MetalLookAndFeel.getDefaults
()Ljavax/swing/UIDefaults;(1588)
javax/swing/UIManager.setLookAndFeel (Ljavax/swing/LookAndFeel;)V(550)
javax/swing/UIManager.setLookAndFeel (Ljava/lang/String;)V(590)
javax/swing/UIManager.initializeDefaultLAF (Ljava/util/Properties;)V(1360)
javax/swing/UIManager.initialize ()V(1470)
javax/swing/UIManager.maybeInitialize ()V(1437)
javax/swing/UIManager.getUI
(Ljavax/swing/JComponent;)Ljavax/swing/plaf/ComponentUI;(1017)
javax/swing/JPanel.updateUI ()V(137)
javax/swing/JPanel.<init> (Ljava/awt/LayoutManager;Z)V(97)
javax/swing/JPanel.<init> (Ljava/awt/LayoutManager;)V(106)
com/ibm/acsp/monitor/MonitorPanel.<init> ()V
com/ibm/acsp/monitor/Monitor.<init> ()V
com/ibm/acsp/monitor/Monitor$4.run ()V
java/awt/event/InvocationEvent.dispatch ()V(322)
java/awt/EventQueue.dispatchEventImpl
(Ljava/awt/AWTEvent;Ljava/lang/Object;)V(767)
java/awt/EventQueue.access$500
(Ljava/awt/EventQueue;Ljava/awt/AWTEvent;Ljava/lang/Object;)V(108)
java/awt/EventQueue$3.run ()Ljava/lang/Void;(720)
java/awt/EventQueue$3.run ()Ljava/lang/Object;(714)
java/security/AccessController.doPrivileged
(Ljava/security/PrivilegedAction;Ljava/security/AccessControlContext;)Ljava/lang/Object;(529)
java/security/ProtectionDomain$1.doIntersectionPrivilege
(Ljava/security/PrivilegedAction;Ljava/security/AccessControlContext;Ljava/security/AccessControlContext;)Ljava/lang/Object;(86)
java/awt/EventQueue.dispatchEvent (Ljava/awt/AWTEvent;)V(737)
java/awt/EventDispatchThread.pumpOneEventForFilters (I)V(212)
java/awt/EventDispatchThread.pumpEventsForFilter
(ILjava/awt/Conditional;Ljava/awt/EventFilter;)V(127)
java/awt/EventDispatchThread.pumpEventsForHierarchy
(ILjava/awt/Conditional;Ljava/awt/Component;)V(116)
java/awt/EventDispatchThread.pumpEvents (ILjava/awt/Conditional;)V(112)
java/awt/EventDispatchThread.pumpEvents (Ljava/awt/Conditional;)V(104)
java/awt/EventDispatchThread.run ()V(93)
Native Call Stack:-
./opt/ibm/acsp-server/jvm64/jre/lib/amd64/compressedrefs/libj9prt28.so
<signal handler called>
getNumButtons ()
from ./opt/ibm/acsp-server/jvm64/jre/lib/amd64/libawt_xawt.so
Java_sun_awt_X11_XToolkit_getNumberOfButtonsImpl ()
from ./opt/ibm/acsp-server/jvm64/jre/lib/amd64/libawt_xawt.so
JVMprJavaSendNative ()
from ./opt/ibm/acsp-server/jvm64/jre/lib/amd64/compressedrefs/libj9vm28.so
?? ()
resolveSpecialMethodRefInto ()
from ./opt/ibm/acsp-server/jvm64/jre/lib/amd64/compressedrefs/libj9vm28.so
VM_BytecodeInterpreter::run(J9VMThread*) ()
from ./opt/ibm/acsp-server/jvm64/jre/lib/amd64/compressedrefs/libj9vm28.so
bytecodeLoop ()
from ./opt/ibm/acsp-server/jvm64/jre/lib/amd64/compressedrefs/libj9vm28.so
./opt/ibm/acsp-server/jvm64/jre/lib/amd64/compressedrefs/libj9prt28.so
<signal handler called>
getNumButtons ()
from ./opt/ibm/acsp-server/jvm64/jre/lib/amd64/libawt_xawt.so
Java_sun_awt_X11_XToolkit_getNumberOfButtonsImpl ()
from ./opt/ibm/acsp-server/jvm64/jre/lib/amd64/libawt_xawt.so
JVMprJavaSendNative ()
from ./opt/ibm/acsp-server/jvm64/jre/lib/amd64/compressedrefs/libj9vm28.so
?? ()
resolveSpecialMethodRefInto ()
from ./opt/ibm/acsp-server/jvm64/jre/lib/amd64/compressedrefs/libj9vm28.so
VM_BytecodeInterpreter::run(J9VMThread*) ()
from ./opt/ibm/acsp-server/jvm64/jre/lib/amd64/compressedrefs/libj9vm28.so
bytecodeLoop ()
from ./opt/ibm/acsp-server/jvm64/jre/lib/amd64/compressedrefs/libj9vm28.so
RECREATION STEPS
Run the attached MouseInfo.java testcase on a linux box having Linux OS
patch " libXi6-1.7.4-12.2.x86_64 or higher.
PROBLEM ANALYSIS
The reported issue started happening after applying the Linux OS patch "
libXi6-1.7.4-12.2.x86_64.
With our investigation this seems to be bug at the OS layer in which OS API
ListInputDevices returns "null" even though the number of input devices are
not zero.
Although the crash is observed due to the failure of OS API, ideally JDK
should not have been crashed. We need to take care of this "NULL" scenario
at the JDK level.
Suggested Fix:-
Introduced a Null check in "getNumButtons" function (XToolkit.c).
(See attached file: webrev.zip)
Able to build the above fix against JDK 10 and triggered jtreg tests. I
will share the test results soon.
Testcase:-
(See attached file: MouseInfoTest.java)
With Thanks and Regards,
Jitendra Singh.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/awt-dev/attachments/20171110/e7dfc5b1/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: graycol.gif
Type: image/gif
Size: 105 bytes
Desc: not available
URL: <http://mail.openjdk.java.net/pipermail/awt-dev/attachments/20171110/e7dfc5b1/graycol-0001.gif>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: webrev.zip
Type: application/zip
Size: 86983 bytes
Desc: not available
URL: <http://mail.openjdk.java.net/pipermail/awt-dev/attachments/20171110/e7dfc5b1/webrev-0001.zip>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: MouseInfoTest.java
Type: application/octet-stream
Size: 1017 bytes
Desc: not available
URL: <http://mail.openjdk.java.net/pipermail/awt-dev/attachments/20171110/e7dfc5b1/MouseInfoTest-0001.java>
More information about the awt-dev
mailing list