GNOME Bugzilla – Bug 167557
gnome-terminal crashes by gconf schema injection
Last modified: 2007-11-27 02:39:04 UTC
Please describe the problem: I'm trying to load schemas into gnome terminal with the gconf command, however it crashes randomly saying: ** (gnome-terminal:21777): CRITICAL **: file terminal-profile.c: line 374 (terminal_profile_new): assertion `terminal_profile_lookup (name) == NULL' failed Steps to reproduce: 1. load a schema with gconftool-2 --load schemafile 2. change the list of current schemas via gconftool-2 (to make gnome-terminal aware of the change) 3. if needed, repeat a few times with different schemas (or use the script below) Actual results: gnome-terminal crashes. Expected results: not to crash. Does this happen every time? no, random. but often. Other information: I have created a script with proof of concept code at: http://bashish.sourceforge.net/gnome-crash/gnome-crash.tar.bz2 and the full backtrace: http://bashish.sourceforge.net/gnome-crash/gnome-terminal.trace.bz2
I included the message of gnome-terminal 2.8.2 in the bugreport, following is the message for gnome-terminal 2.9.2: ** (gnome-terminal:32445): CRITICAL **: terminal_profile_new: assertion `terminal_profile_lookup (name) == NULL' failed
I can confirm this problem. Here's a full stacktrace: Backtrace was generated from '/home/devel/gnome/INSTALL/bin/gnome-terminal' Using host libthread_db library "/lib/libthread_db.so.1". [Thread debugging using libthread_db enabled] [New Thread -1208973632 (LWP 26137)] [New Thread -1216607312 (LWP 26140)] 0x00d71402 in ?? ()
+ Trace 61919
Thread 1 (Thread -1208973632 (LWP 26137))
I'll attach a first tentative fix which makes the crasher go away here. NOT to be applied yet, since I'm just patching the symptom
Created attachment 49533 [details] [review] Fixes the crasher
Michele, did you look into this further?
Hiding the symptom of a deeper problem is not acceptable, marking the patch as rejected.
I think I found the 'deeper problem'. The kamikaze script has an error that causes the profile '1' to be added to the gconf key "... global/profile_list" twice. terminal_profile_new() correctly bails out if it sees a name that is already in its hash table, but the following call to terminal_profile_update() at terminal.c:2077 doesn't check for that condition (ie, that profile == NULL). You can reproduce the problem directly if you just add a second 'Default' entry to key "... global/profile_list". On principle I think this should be a wontfix, since the user is externally filling the gconf keys with crap data, and that's not our problem. But... Michele's 1-line patch fixes the problem completely (it is exactly what I came up with independantly without seeing the patch beforehand). In other words, the 'deeper problem' was merely that the gconf keys were being screwed up by somebody else, so gnome-terminal shouldn't worry about it. Yet, since the fix is so simple, and (god knows why) somebody's tripped on this problem before, I vote for the patch being applied.
Thanks for taking the time to report this bug. This particular bug has already been reported into our bug tracking system, but we are happy to tell you that the problem has already been fixed. It should be solved in the next software version. You may want to check for a software upgrade. *** This bug has been marked as a duplicate of 499797 ***