Re: [Nautilus-list] Segfault when dragging icons

On Wed, 18 Jul 2001, Alex Larsson wrote:

> I'm currently tracking down a DnD segfault, and I need some help.
> The segfault can be triggered by massive dragging of directories to the
> location bar. One way I've been able to trigger it is to go to
> /usr/share/doc and drag some directory, drop it on the location bar, then
> go "up" and repeat. After a while it crashes. (I'm using fam, dunno if
> that matters.)

Ok. Here is a patch that i believe fixes this problem. It is sorta hard to
verify since the actuall bug is hard to trigger though:

Index: libnautilus-private/nautilus-icon-container.c
RCS file: /cvs/gnome/nautilus/libnautilus-private/nautilus-icon-container.c,v
retrieving revision 1.214
diff -u -p -r1.214 nautilus-icon-container.c
--- libnautilus-private/nautilus-icon-container.c	2001/06/01 15:19:58	1.214
+++ libnautilus-private/nautilus-icon-container.c	2001/07/19 18:44:01
@@ -3594,7 +3594,8 @@ nautilus_icon_container_clear (NautilusI
 	details->icons = NULL;
 	g_list_free (details->new_icons);
 	details->new_icons = NULL;
+	details->drop_target = NULL;
 	nautilus_icon_container_update_scroll_region (container);

What is happening is that nautilus_icon_container_clear () gets run for
some reason, and frees all the icons. After that we get a drag_motion
event, and the handler for that touches details->drop_target which has
already been freed and dies.

I have not figured out exactly why this happens, but I added some code
that checked if nautilus_icon_container_clear () frees the
detail_drop->target icon, the it prints a warning and sets
detail_drop->target to 0xf00ba9ed. And when i finaly managed to reproduce
the crash i got the warning and the crash looked exactly like the previous
except icon was 0xf00ba9ed.

I am very unknowledagle about this code, but possibly
details->keyboard_focus and details->keyboard_icon_to_reveal should be set
to NULL too, since icon_destroy () does that too.

Anyway, can i commit this patch?

/ Alex

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