Re: Closure bug? (was Re: Drag and Drop is broken)



Havoc Pennington <hp redhat com> writes:

> Robert Brady <robert suse co uk> writes:
> > In HEAD as of now, testtext segfaulting on the nth drag from it,
> > (where n is 2 or 3) - it's pretty easy to reproduce...
> > 
> 
> I'm guessing this segfault is some interaction between the DND code
> and the new GClosure stuff, with memory management not working the
> same way it used to, so something gets freed or overwritten that
> shouldn't. The segfault is a bit different each time and obviously
> involves corrupt memory. Anyhow, between the DND code and the closure
> code I'm not touching it. ;-)
> 
> Owen, Tim, to reproduce this, in the text widget select text and drag
> it somewhere else in the widget to drop a few times. I also reproduced
> it once in testdnd, by dragging quickly from "Drag Here" to the
> trashcan, but it took a couple dozen tries to make testdnd
> crash. Probably some sort of race condition.
> 
> Purify would probably nail this bug in 5 minutes if someone has that.

It's not a memory corruption bug at all.

The problem is that 

 gtk_signal_disconnect_by_data (object, data)

Is supposed to disconnect _ALL_ handlers on the object with the given
data, but it currently only disconnects the first one, so you are left
with a stale connection hanging around.

We probably need g_signal_handler_find_all (), or maybe
gtk_signal_compat_matched () could be implemented as

 while (g_signal_handler_fine ()) 

Though that might be a little inefficient.

Anyways, I'll turn this one over to Tim now and let him figure
out how to fix it.

Regards,
                                        Owen




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