<AWT Dev> [14] Review Request: 8225101 Crash at sun.awt.X11.XlibWrapper.XkbGetUpdatedMap when change keybord map
Pankaj Bansal
pankaj.b.bansal at oracle.com
Tue Sep 10 06:07:13 UTC 2019
Looks good to me
-Pankaj
-----Original Message-----
From: Phil Race
Sent: Tuesday, September 10, 2019 1:37 AM
To: Sergey Bylokhov; awt-dev at openjdk.java.net
Subject: Re: <AWT Dev> [14] Review Request: 8225101 Crash at sun.awt.X11.XlibWrapper.XkbGetUpdatedMap when change keybord map
Approved
-phil.
On 9/6/19 8:05 PM, Sergey Bylokhov wrote:
> Hello.
> Please review the fix for JDK 14.
>
> Bug: https://bugs.openjdk.java.net/browse/JDK-8225101
> Fix: http://cr.openjdk.java.net/~serb/8225101/webrev.00
>
> This is the fix of the bug caused by dereferencing 0 in XkbMapNotify
> notification.
>
> The sun.awt.X11.XToolkit class contains a native pointer
> "awt_XKBDescPtr" which is initialized at the start of the application
> or by the "XkbNewKeyboardNotify"
> notification. And deallocated by the same "XkbNewKeyboardNotify" or
> via "ShutdownHook"
>
> The "awt_XKBDescPtr" in the changed code in the webrev might be NULL
> in two situations:
> - Sometime before the "XlibWrapper.XkbGetMap" returned NULL for some
> reason.
> - The shutdown hook start to execute in parallel and dispose of the
> current keyboard info and
> sets "awt_XKBDescPtr" to 0
>
> I was able to reproduce the bug by some script which floods the
> XServer with millions of keyboard requests, which makes the system
> unresponsive but allow to get the timings to reproduce the bug.
>
> As a fix, I suggest using "awt_XKBDescPtr" in "XkbMapNotify" only if
> it is not 0, as we already do in all other places.
>
>
More information about the awt-dev
mailing list