Re: [PATCH] robustness for GdkEvent.xs



On Sun, 2005-11-06 at 22:14 -0500, muppet wrote:

1. emit event-after
2. handler invoked
3. GClosure.xs tries to marshal the parameters
4. GdkEvent.xs tries to figure out into which package to bless the event
5. gdk_event_get_package() doesn't know about GDK_GRAB_BROKEN, and  
croaks with "Illegal type %d in event->type".
6. we later crash in gsignal.c because it's really not good to  
longjmp out of signals.

Now, #6 isn't really what i'm worried about --- we know that  
exceptions in signals are bad, that's why we eval handlers.  #5 is  
the problem.  We need to be robust against this sort of thing,  
because it's always possible for new versions of gtk+ to add event  
types, and we shouldn't crash because of it -- we should at least  
limp along.

Ouch, I should have been more careful when I added support for
grab-broken.  Sorry about that.  I did test compilations/runs on all
stable gtk+'s, but our test suite just doesn't cover this kind of thing.

The attached patch turns this croak() into a warn, and falls back on  
blessing the event into the generic Gtk2::Gdk::Event package.  It  
also plugs a memory leak by ensuring that we have  
Gtk2::Gdk::Event::GrabBroken::DESTROY.

The patch looks good to me.

I think this needs to go into HEAD and 1.10x.  Should we release a  
new 1.08x with this for distros that still have 1.08x as the current  
stable?

If there's a reasonable possibility that distros which ship 1.08x
actually incorporate a bug fix release, then yes, I think this is worth
a 1.084.

-- 
Bye,
-Torsten




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]