GNOME Bugzilla – Bug 136236
iagno and gataxx segfault immediately when selecting settings->preferences
Last modified: 2004-12-22 21:47:04 UTC
Distribution: Fedora Core release 1 (Yarrow) Package: gnome-games Severity: normal Version: GNOME2.5.90 2.5.7 Gnome-Distributor: GNOME.Org Synopsis: iagno and gataxx segfault immediately when selecting settings->preferences Bugzilla-Product: gnome-games Bugzilla-Component: iagno Bugzilla-Version: 2.5.7 BugBuddy-GnomeVersion: 2.0 (2.5.90.1) Description: Description of the crash: select settings->preferences, app go boom. This is with both iagno and gattaxx HEAD, and gtk HEAD as of this morning. Debugging Information: Backtrace was generated from '/home/louie/jhbuilt/bin/iagno' Using host libthread_db library "/lib/tls/libthread_db.so.1". [Thread debugging using libthread_db enabled] [New Thread -1084986784 (LWP 27830)] 0x002b6c32 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2
+ Trace 44831
Thread 1 (Thread -1084986784 (LWP 27830))
------- Bug moved to this database by unknown@bugzilla.gnome.org 2004-03-04 20:06 ------- Unknown version 2.5.7 in product gnome-games. Setting version to the default, "unspecified". Reassigning to the default owner of the component, gnome-games-maint@bugzilla.gnome.org.
Program received signal SIGSEGV, Segmentation fault.
+ Trace 44832
Thread 1086826976 (LWP 5015)
GtkComboBox changed its semantics a little bit recently. I whipped up a patch really quickly to fix this.
Created attachment 25186 [details] [review] Quick fix
OK, so it looks like Jonathon's patch should work, but why is gtk *ever* calling a callback with a NULL widget !? Would a cleaner fix be to fill the menu before attaching the signal ? I'll fix this tonight when I get home.
The combo now selects the first item when you go from an empty combo to a combo with an entry. As you hadn't prepended the theme to the theme list yet, that part of set_selection changed. You can attach the signal later, but make sure you make the call to set_selection explicitly. I just changed fill_menu to make it more robust so that it could be called again (eg. if the themes changed on disk).
jrb, is this the kind of thing someone should do a quick audit or federico-style public service announcement so we make sure there aren't more of these scattered around the code base?
Not sure. The Combo doesn't have a whole lot of use right now, and I'd imagine people would run into this kind of problem already. It can't hurt too much, though.
I've applied the patch to both iagno and gataxx. I've also hooked in the signal after fill_menu to avoid doing the ugly block/unblock thing. Marking as fixed.