Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#40 GtkTreeIter's aren't persistent; causes crash on img getting

open
nobody
None
5
2009-02-21
2009-02-21
Tom Parker
No

When attempting to grab images off the network, in the time interval between the initial request for the image and the request being fulfilled the iter ceases to be valid. Therefore, we need to store paths (which are persistent) and convert back to iters when needed.

Without the attached patch, twitux repeatedly crashes when it has no cached avatars (removing contents of ~/.gnome2/twitux/avatars/ does this). With the patch, it is fine

Starting program: /home/palfrey/src/twitux/src/twitux
[Thread debugging using libthread_db enabled]
[New Thread 0xb6f91700 (LWP 21183)]

** (twitux:21183): WARNING **: Default timeline in not set
[New Thread 0xb6bdbb90 (LWP 21196)]
[Thread 0xb6bdbb90 (LWP 21196) exited]
[New Thread 0xb6bdbb90 (LWP 21197)]
[Thread 0xb6bdbb90 (LWP 21197) exited]

Gtk-CRITICAL **: gtk_list_store_set_valist: assertion `VALID_ITER (iter, list_store)' failed
aborting...

Program received signal SIGABRT, Aborted.
[Switching to Thread 0xb6f91700 (LWP 21183)]
0xb7f43424 in __kernel_vsyscall ()
(gdb) bt full
#0 0xb7f43424 in __kernel_vsyscall ()
No symbol table info available.
#1 0xb72fb640 in raise () from /lib/i686/cmov/libc.so.6
No symbol table info available.
#2 0xb72fd018 in abort () from /lib/i686/cmov/libc.so.6
No symbol table info available.
#3 0xb746e4a4 in IA__g_logv (log_domain=0xb7b28837 "Gtk", log_level=G_LOG_LEVEL_CRITICAL,
format=0xb74a5bfb "%s: assertion `%s' failed",
args1=0xbf95dddc "�K��\025H���r���\030�\b��F��쿷0=�\b(�\225�\234\236\230�7\210���K��\025H��")
at /build/buildd/glib2.0-2.18.4/glib/gmessages.c:497
depth = 1
domain = <value optimized out>
data = (gpointer) 0x0
log_func = (GLogFunc) 0xb746db00 <IA__g_log_default_handler>
domain_fatal_mask = 5
test_level = <value optimized out>
was_recursion = 0
i = <value optimized out>
#4 0xb746e4d6 in IA__g_log (log_domain=0xb7b28837 "Gtk", log_level=G_LOG_LEVEL_CRITICAL,
format=0xb74a5bfb "%s: assertion `%s' failed") at /build/buildd/glib2.0-2.18.4/glib/gmessages.c:517
No locals.
#5 0xb746e70b in IA__g_return_if_fail_warning (log_domain=0xb7b28837 "Gtk",
pretty_function=0xb7bb4bf9 "gtk_list_store_set_valist", expression=0xb7bb4815 "VALID_ITER (iter, list_store)")
at /build/buildd/glib2.0-2.18.4/glib/gmessages.c:532
No locals.
#6 0xb7989e9c in IA__gtk_list_store_set_valist (list_store=0x8dfc860, iter=0xbf95deb4, var_args=0xbf95de58 "")
at /build/buildd/gtk+2.0-2.14.7/gtk/gtkliststore.c:893
emit_signal = 0
maybe_need_sort = 0
__PRETTY_FUNCTION__ = "IA__gtk_list_store_set_valist"
#7 0xb7989f8f in IA__gtk_list_store_set (list_store=0x8dfc860, iter=0xbf95deb4)
at /build/buildd/gtk+2.0-2.14.7/gtk/gtkliststore.c:935
---Type <return> to continue, or q <return> to quit---
No locals.
#8 0x08051925 in twitux_app_set_image (file=0x8ef45f0 "/home/palfrey/.gnome2/twitux/avatars/Turquoise_Mouth_normal.jpg",
iter={stamp = -567252007, user_data = 0x8c318b0, user_data2 = 0xbf95dea8, user_data3 = 0x8053b58}) at twitux-app.c:1505
store = (GtkListStore *) 0x8dfc860
pixbuf = (GdkPixbuf *) 0x8ed6958
resized = (GdkPixbuf *) 0x8ed68e8
error = (GError *) 0x0
height = 48
width = 48
#9 0x08053850 in network_cb_on_image (session=0x8c53d30, msg=0x8e9c070, user_data=0x8ed6fa0) at twitux-network.c:747
image = (TwituxImage *) 0x8ed6fa0

Discussion