GNOME Bugzilla – Bug 349471
Crash on manually changing the icon theme name
Last modified: 2008-03-07 23:04:08 UTC
What were you doing when the application crashed? Changed icon theme name in index.theme file. Distribution: Ubuntu 6.10 (edgy) Gnome Release: 2.15.90 2006-07-24 (Ubuntu) BugBuddy Version: 2.15.90 Memory status: size: 31739904 vsize: 0 resident: 31739904 share: 0 rss: 13533184 rss_rlim: 0 CPU usage: start_time: 1154373351 rtime: 0 utime: 3480 stime: 0 cutime:2118 cstime: 0 timeout: 1362 it_real_value: 0 frequency: 0 Backtrace was generated from '/usr/bin/gnome-theme-manager' (no debugging symbols found) Using host libthread_db library "/lib/tls/i686/cmov/libthread_db.so.1". (no debugging symbols found) [Thread debugging using libthread_db enabled] [New Thread -1210173776 (LWP 18219)] (no debugging symbols found) 0xffffe410 in __kernel_vsyscall ()
+ Trace 69842
Thread 1 (Thread -1210173776 (LWP 18219))
*** Bug 349507 has been marked as a duplicate of this bug. ***
I can't reproduce this bug with version 2.14.1. Did you edit the file while the theme was selected, and was it a system or a user installed theme?
Steps to reproduce: 1. Set icon theme to user theme. 2. Open theme details in theme preference manager and go to icon tab. 3. Open up the index.theme file in the icon folder. 4. Change the name of the theme under [Icon Theme] and save. 5. Try to switch icon theme. 6. Crashes.
Ah, ok, you were changing the name icon theme in the index.theme belonging to the icon theme, not the index.theme belonging to the metatheme. Confirmed.
Clarifying the title, and marking down in severity, as I don't think this is something people would be doing on a regular basis.
*** Bug 357333 has been marked as a duplicate of this bug. ***
*** Bug 360434 has been marked as a duplicate of this bug. ***
*** Bug 362520 has been marked as a duplicate of this bug. ***
Looks like this may be a wider issue judging by the duplicates. I just tried to duplicate the problem again and got a slightly different backtrace:
+ Trace 76605
*** Bug 363624 has been marked as a duplicate of this bug. ***
*** Bug 366474 has been marked as a duplicate of this bug. ***
Crasher -- Priority High, Severity critical.
*** Bug 366946 has been marked as a duplicate of this bug. ***
*** Bug 369725 has been marked as a duplicate of this bug. ***
*** Bug 372716 has been marked as a duplicate of this bug. ***
*** Bug 371629 has been marked as a duplicate of this bug. ***
I really need a good stack trace from someone who can reproduce this bug. Without a stack trace from the crash it's very hard to determine what caused it. Please see http://live.gnome.org/GettingTraces for more information on how to do so.
This bug was easy to reproduce. Here is the stack trace from the crash: http://hosted.blaksaga.com/themecrashtrace.txt The steps I used to reproduce this bug were: 1. Open gnome theme preferences. 2. Copy a theme folder in the ~/.icons directory to ~/.icons/newname. 3. Edit the ~/.icons/newname/index.theme file and replace name=oldname with name=newname. 4. Save the file. Gnome theme manager immediately crashed. If you need more info, let me know.
Created attachment 76337 [details] Stack trace of the crash. On second thought, I will attach the stack trace. It seems better in practice. You never know when the link I posted will work or not.
*** Bug 374742 has been marked as a duplicate of this bug. ***
*** Bug 375794 has been marked as a duplicate of this bug. ***
*** Bug 383517 has been marked as a duplicate of this bug. ***
*** Bug 383959 has been marked as a duplicate of this bug. ***
*** Bug 386137 has been marked as a duplicate of this bug. ***
*** Bug 389086 has been marked as a duplicate of this bug. ***
*** Bug 389912 has been marked as a duplicate of this bug. ***
*** Bug 390524 has been marked as a duplicate of this bug. ***
Here is a slightly better stack trace, since it uses a build without optimisations and no-inline: Backtrace was generated from '/opt/gnome2/bin/gnome-theme-manager' Using host libthread_db library "/lib/tls/libthread_db.so.1". [Thread debugging using libthread_db enabled] [New Thread -1224141120 (LWP 18799)] 0xb72cf20e in __waitpid_nocancel () from /lib/tls/libpthread.so.0
+ Trace 99292
Created attachment 79381 [details] [review] gnome-theme-manager-theme-rename-crashfix.patch This seems to fix the crash but implementation is awful ;)
Created attachment 79382 [details] [review] gnome-theme-manager-crasher.patch Get rid of double assignment, added comments, constification? Ok to commit?
My previous patches were wrong, they only disabled icon themes (unfortunately I was too late to spot this). Sorry for the spam :( But Thomas, could I apply at least the repeated assigment part? ;)
If there is some problem with "old" entries in the hash table, can't they be removed somehow?
It seems that the problem is caused by the text editor's temporary files. If we monitor only the index.theme file for changes, everything is going fine (almost) With the diff below, the segfault is gone, the remaining issue is that when you modify the icon theme name, an incorrect entry is added on the head of the list. I'll try to take a look when I'll have more time. Diff : --- control-center-2.16.1/capplets/common/gnome-theme-info.c 2005-11-14 16:18:03.000000000 +0100 +++ control-center-2.16.1.debug/capplets/common/gnome-theme-info.c 2007-01-04 15:31:52.000000000 +0100 @@ -1146,15 +1146,15 @@ /* Add the handle for this directory */ index_uri = gnome_vfs_uri_append_file_name (theme_dir_uri, "index.theme"); update_icon_theme_index (index_uri, monitor_data->priority); - gnome_vfs_uri_unref (index_uri); - uri_string = gnome_vfs_uri_to_string (theme_dir_uri, GNOME_VFS_URI_HIDE_NONE); + uri_string = gnome_vfs_uri_to_string (index_uri, GNOME_VFS_URI_HIDE_NONE); result = gnome_vfs_monitor_add (& (monitor_data->common_icon_theme_dir_handle), uri_string, - GNOME_VFS_MONITOR_DIRECTORY, + GNOME_VFS_MONITOR_FILE, common_icon_theme_dir_changed, monitor_data); g_free (uri_string); + gnome_vfs_uri_unref (index_uri); if (result == GNOME_VFS_ERROR_NOT_SUPPORTED) real_monitor_not_added = TRUE;
Created attachment 79391 [details] [review] gnome-themes-hashtable-syncer.patch I took Jean's monitor patch (this fixes at least the segfault) and now non-existing themes are removed from hash table so names table is kept in sync with uri hash table. Hopefully this helps.
Created attachment 79398 [details] [review] gnome-theme-manager-hashtable-corrupter.patch Ok, found the real cause. Apparently the update_common_theme_dir_index() passes wrong theme name to the hash_table item destroyer and the item doesn't get freed. Also update_common_theme_dir_index() needs a rewrite. Badly ;)
That looks like about the same place I had got to too. I'll try out the patch and commit it if it doesn't seem to affect anything else. One thing to note is that you're patch is using a different indent style from the original source, and you're using c99 style comments. It's probably good practice to try and avoid these things.
Patch worked perfectly and now committed. Thanks for your help!
*** Bug 396969 has been marked as a duplicate of this bug. ***
*** Bug 397090 has been marked as a duplicate of this bug. ***
*** Bug 398755 has been marked as a duplicate of this bug. ***
*** Bug 401077 has been marked as a duplicate of this bug. ***
*** Bug 401526 has been marked as a duplicate of this bug. ***
That's still happening with 2.17.90, https://launchpad.net/ubuntu/+source/control-center/+bug/81923 is an Ubuntu bug with a similar backtrace:
+ Trace 105933
Reopening
*** Bug 404001 has been marked as a duplicate of this bug. ***
*** Bug 404641 has been marked as a duplicate of this bug. ***
*** Bug 404643 has been marked as a duplicate of this bug. ***
*** Bug 405086 has been marked as a duplicate of this bug. ***
*** Bug 405925 has been marked as a duplicate of this bug. ***
*** Bug 406915 has been marked as a duplicate of this bug. ***
*** Bug 407362 has been marked as a duplicate of this bug. ***
*** Bug 407970 has been marked as a duplicate of this bug. ***
*** Bug 408580 has been marked as a duplicate of this bug. ***
*** Bug 410654 has been marked as a duplicate of this bug. ***
Here's another backtrace, debug symbols, no optimisations, 2.17.91 (gdb) run Starting program: /usr/bin/gnome-theme-manager [Thread debugging using libthread_db enabled] [New Thread -1226090816 (LWP 27187)] (gnome-theme-manager:27187): Gtk-WARNING **: Error loading theme icon for stock: Failed to open file '/home/pandis/.icons/Lila/scalable/stock/gtk-dialog-info.svg': No such file or directory Program received signal SIGSEGV, Segmentation fault.
+ Trace 112972
Thread NaN (LWP 27187)
*** Bug 411134 has been marked as a duplicate of this bug. ***
*** Bug 412189 has been marked as a duplicate of this bug. ***
*** Bug 413861 has been marked as a duplicate of this bug. ***
*** Bug 416350 has been marked as a duplicate of this bug. ***
*** Bug 416942 has been marked as a duplicate of this bug. ***
*** Bug 420600 has been marked as a duplicate of this bug. ***
*** Bug 424689 has been marked as a duplicate of this bug. ***
*** Bug 426689 has been marked as a duplicate of this bug. ***
*** Bug 427055 has been marked as a duplicate of this bug. ***
*** Bug 427120 has been marked as a duplicate of this bug. ***
*** Bug 430421 has been marked as a duplicate of this bug. ***
*** Bug 431631 has been marked as a duplicate of this bug. ***
Has anybody encountered this with >= 2.20?
Guess not.