[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-openjfx-dev
Subject:    Re: RFR: 8301219: JavaFX crash when closing with the escape key [v3]
From:       Thiago Milczarek Sayao <tsayao () openjdk ! org>
Date:       2023-12-24 14:24:50
Message-ID: MeO4-QZFD7sOpW2gGfLgRvqlPjZF8JBDvV7yqa23tXM=.1882691b-b2e2-4ed0-82d9-2867c75e0ad7 () github ! com
[Download RAW message or body]

On Mon, 18 Dec 2023 19:15:03 GMT, Martin Fox <mfox@openjdk.org> wrote:

> > While processing a key down event the Glass GTK code sends out PRESSED and TYPED \
> > KeyEvents back to back. If the stage is closed during the PRESSED event the code \
> > will end up referencing freed memory while sending out the TYPED event. This can \
> > lead to intermittent crashes. 
> > In GlassApplication.cpp the EventCounterHelper object ensures the WindowContext \
> > isn't deleted while processing an event. Currently the helper object is being \
> > created *after* IME handling instead of before. If the IME is enabled it's \
> > possible for the WindowContext to be deleted in the middle of executing a number \
> > of keyboard-related events. 
> > The fix is simple; instantiate the EventCounterHelper object earlier. There isn't \
> > always a WindowContext so I tweaked the EventCounterHelper to do nothing if the \
> > context is null. 
> > To make the crash more reproducible I altered the WindowContext such that when \
> > it's deleted the freed memory is filled with 0xCC. This made the crash more \
> > reproducible and allowed me to test the fix. I did the same with GlassView since \
> > that's the only other Glass GTK class that's instantiated with `new` and \
> > discarded with `delete`.
> 
> Martin Fox has updated the pull request incrementally with one additional commit \
> since the last revision: 
> Consistent use of FILL in mem debug code.

Looks good.

-------------

Marked as reviewed by tsayao (Committer).

PR Review: https://git.openjdk.org/jfx/pull/1307#pullrequestreview-1795582351


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic