! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
[PATCH] Seg fault on exit since 01/12/2011 (commit-id: 6339e18fad389b14566965...
Status:
RESOLVED: FIXED
Severity:
trivial
Product:
Ristretto
Component:
Application

Comments

Description Eric Koegel editbugs 2011-12-02 11:47:15 CET
Created attachment 3995 
This patch adds a simple check to ensure the thumbnailer isn't NULL before using it

Here's the backtrace:
Program received signal SIGSEGV, Segmentation fault.
0x00000000004274b2 in rstto_thumbnailer_dequeue_thumbnail (thumbnailer=0x0, thumb=0xaeb060) at thumbnailer.c:332
332	    if (thumbnailer->priv->request_timer_id)
(gdb) bt
#0  0x00000000004274b2 in rstto_thumbnailer_dequeue_thumbnail (thumbnailer=0x0, thumb=0xaeb060) at thumbnailer.c:332
#1  0x0000000000425370 in rstto_thumbnail_bar_remove (container=0x9ce260, child=0xaeb060) at thumbnail_bar.c:670
#2  0x00007ffff66360a4 in g_closure_invoke (closure=0x695d20, return_value=0x0, n_param_values=2, param_values=0x78c870, invocation_hint=<optimized out>) at /build/buildd/glib2.0-2.30.0/./gobject/gclosure.c:774
#3  0x00007ffff664781a in signal_emit_unlocked_R (node=<optimized out>, detail=0, instance=0x9ce260, emission_return=0x0, instance_and_params=0x78c870) at /build/buildd/glib2.0-2.30.0/./gobject/gsignal.c:3202
#4  0x00007ffff66516b1 in g_signal_emit_valist (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>, var_args=<optimized out>) at /build/buildd/glib2.0-2.30.0/./gobject/gsignal.c:3003
#5  0x00007ffff6651852 in g_signal_emit (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>) at /build/buildd/glib2.0-2.30.0/./gobject/gsignal.c:3060
#6  0x00007ffff79f99b5 in gtk_widget_dispose (object=0xaeb060) at /build/buildd/gtk+2.0-2.24.6/gtk/gtkwidget.c:8767
#7  0x00007ffff663a8d0 in g_object_run_dispose (object=0xaeb060) at /build/buildd/glib2.0-2.30.0/./gobject/gobject.c:945
#8  0x00007ffff616bb97 in g_list_foreach (list=<optimized out>, func=0x7ffff79f0690 <IA__gtk_widget_destroy>, user_data=0x0) at /build/buildd/glib2.0-2.30.0/./glib/glist.c:938
#9  0x000000000042543d in rstto_thumbnail_bar_forall (container=0x9ce260, include_internals=0, callback=0x7ffff79f0690 <IA__gtk_widget_destroy>, callback_data=0x0) at thumbnail_bar.c:692
#10 0x00007ffff785a2ef in gtk_container_destroy (object=0x9ce260) at /build/buildd/gtk+2.0-2.24.6/gtk/gtkcontainer.c:1093
#11 0x00007ffff6635ffa in g_closure_invoke (closure=0x681cd0, return_value=0x0, n_param_values=1, param_values=0x824260, invocation_hint=<optimized out>) at /build/buildd/glib2.0-2.30.0/./gobject/gclosure.c:774
#12 0x00007ffff6647a78 in signal_emit_unlocked_R (node=<optimized out>, detail=0, instance=0x9ce260, emission_return=0x0, instance_and_params=0x824260) at /build/buildd/glib2.0-2.30.0/./gobject/gsignal.c:3388
#13 0x00007ffff66516b1 in g_signal_emit_valist (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>, var_args=<optimized out>) at /build/buildd/glib2.0-2.30.0/./gobject/gsignal.c:3003
#14 0x00007ffff6651852 in g_signal_emit (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>) at /build/buildd/glib2.0-2.30.0/./gobject/gsignal.c:3060
#15 0x00007ffff78ffc60 in gtk_object_dispose (gobject=<optimized out>) at /build/buildd/gtk+2.0-2.24.6/gtk/gtkobject.c:421
#16 0x0000000000423dd2 in rstto_thumbnail_bar_dispose (object=0x9ce260) at thumbnail_bar.c:244
#17 0x00007ffff663a8d0 in g_object_run_dispose (object=0x9ce260) at /build/buildd/glib2.0-2.30.0/./gobject/gobject.c:945
#18 0x00007ffff785a2ef in gtk_container_destroy (object=0x9c6ac0) at /build/buildd/gtk+2.0-2.24.6/gtk/gtkcontainer.c:1093
#19 0x00007ffff6635ffa in g_closure_invoke (closure=0x681cd0, return_value=0x0, n_param_values=1, param_values=0x8c8700, invocation_hint=<optimized out>) at /build/buildd/glib2.0-2.30.0/./gobject/gclosure.c:774

Basically rstto_thumbnail_bar_dispose gets called on #16 and un-references the thumbnailer which rstto_thumbnailer_dequeue_thumbnail tries to use. I added a simple check for NULL which fixes the Seg fault. 
This only happens during the program shutdown after some images have been loaded.
Comment 1 Stephan Arts editbugs 2011-12-02 15:14:05 CET
The correct check for NULL would be present in the function rstto_thumbnail_bar_remove, and a g_return_if_fail (RSTTO_IS_THUMBNAILER (thumbnailer)) call inside rstto_thumbnailer_dequeue_thumbnail.
Comment 2 Eric Koegel editbugs 2011-12-02 19:00:25 CET
Created attachment 3998 
Patch adds checks to ensure the thumbnailer isn't NULL when calling rstto_thumbnailer_dequeue_thumbnail or rstto_thumbnail_bar_remove

Fixed. I hadn't thought to add the commit-id. Learn something new every time, thanks!
Comment 3 Stephan Arts editbugs 2011-12-02 20:00:53 CET
Patch applied on master (commit-id: e0401b759d80569596241ec9e27f33387849ca42)

Bug #8211

Reported by:
Eric Koegel
Reported on: 2011-12-02
Last modified on: 2011-12-02

People

Assignee:
Stephan Arts
CC List:
0 users

Version

Version:
unspecified

Attachments

Additional information