After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 150467 - gnome-settings-daemon always crashing
gnome-settings-daemon always crashing
Status: RESOLVED FIXED
Product: gnome-vfs
Classification: Deprecated
Component: MIME data
2.7.x
Other Linux
: Urgent critical
: ---
Assigned To: gnome-vfs maintainers
Control-Center Maintainers
Depends on:
Blocks:
 
 
Reported: 2004-08-18 16:59 UTC by Oliver Lemke
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: 2.8.0
GNOME version: 2.7/2.8


Attachments
mimeinfo.cache making g-s-d crash (5.11 KB, text/plain)
2004-09-01 23:51 UTC, Oliver Lemke
  Details
test program (1.62 KB, text/plain)
2004-09-02 21:36 UTC, Christophe Fergeau
  Details
double free fix (2.72 KB, patch)
2004-09-03 08:32 UTC, Christophe Fergeau
none Details | Review

Description Oliver Lemke 2004-08-18 16:59:38 UTC
The g-s-d keeps crashing while trying to access the file
/usr/share/applications/defaults.list which does not
exist on my system.

After creating an empty defaults.list it works.

The bug occurs on mandrake cooker with the gnome2.7
rpms from Goetz Waschk as well as on my gentoo box
with a current cvs build.

Backtrace of g-s-d:

  • #0 free
    from /lib/libc.so.6
  • #1 g_free
    at gmem.c line 186
  • #2 g_list_foreach
    at glist.c line 669
  • #3 free_mime_info_cache_map_list
    at gnome-vfs-mime-info-cache.c line 82
  • #4 g_hash_table_destroy
    at ghash.c line 744
  • #5 gnome_vfs_mime_info_cache_dir_init
    at gnome-vfs-mime-info-cache.c line 128
  • #6 gnome_vfs_mime_info_cache_dir_changed
    at gnome-vfs-mime-info-cache.c line 326
  • #7 actually_dispatch_callback
    at gnome-vfs-monitor.c line 271
  • #8 g_idle_dispatch
    at gmain.c line 3802
  • #9 g_main_context_dispatch
    at gmain.c line 1942
  • #10 g_main_context_iterate
    at gmain.c line 2573
  • #11 g_main_loop_run
    at gmain.c line 2777
  • #12 gtk_main__internal_alias
    at gtkmain.c line 1180
  • #13 main
    at factory.c line 56

Comment 1 Rui Miguel Seabra 2004-08-26 23:30:29 UTC
Also on FC3 development packages.
Comment 2 Rui Miguel Seabra 2004-08-26 23:41:51 UTC
I think it's really related to bug http://bugzilla.gnome.org/show_bug.cgi?id=117483

cd
mkdir bakcup
mv .gnome .gnome_private backup/

Get out of gnome COMPLETELY. If you don't know how reboot, for instance. You
should be absolutely certain no process is going to be running in the background.

At least that has worked for me.
Comment 3 Oliver Lemke 2004-08-27 08:04:24 UTC
I don't think it is related to #117483 because in my case it is not related to
old files in .gnome or .gnome_private, it is not even related to any out-dated
files in the user's home directory.

I've created a new user account. Only file in his home directory is an .xinitrc
to start gnome. :-) And g-s-d is still choking on it. :-(

Also, I must admit that creating the /usr/share/applications/defaults.list does
not cure all problems. I cannot change the default applications for a file in
the nautilus file properties dialog. It crashes when clicking on an item in the
application list. So, something else must be wrong.

What really drives me mad is that for most of the users of the gnome2.7 rpms for
Mandrake it seems to work without any problems. But there are a few others
experiencing exactly the same problem as I do.
Comment 4 Rui Miguel Seabra 2004-08-28 16:13:02 UTC
Well, I do think it is related, and I've got more data concerning it.
It seems some process keeps creating ~/.gnome and more.

I now have:

[rms@roque ~]$ find .gnome
.gnome
.gnome/mime-info
.gnome/gnome-vfs
.gnome/gnome-vfs/.trash_entry_cache

[rms@roque ~]$ rpm -qa gnome-vfs*
gnome-vfs2-devel-2.7.91-1
gnome-vfs2-smb-2.7.91-1
gnome-vfs2-2.7.91-1

So who's writing it? Nautilus? Maybe, judging by the trash reference.
Comment 5 Andrew Sobala 2004-08-28 22:40:05 UTC
Marking with 2.8.0 milestone; sounds like something fishy is going on and it's
stopping gnome booting at all.
Comment 6 Andrew Sobala 2004-08-29 12:46:39 UTC
Now "tentatively" 2.8.0 - comments on mailing lists suggest it may only be
mandrake packages.
Comment 7 Rui Miguel Seabra 2004-08-31 09:03:47 UTC
Fedora Core 3 (development) on my case, so it's not just Mandrake packages!
Comment 8 Rui Miguel Seabra 2004-08-31 09:15:55 UTC
The original suggestion (which I somehow missed):

# touch /usr/share/applications/defaults.list

Does seem to solve it.
Comment 9 Jody Goldberg 2004-08-31 16:21:24 UTC
This seems like a gnome-vfs level fix.
Comment 10 Kjartan Maraas 2004-09-01 13:23:08 UTC
Reassigning to the correct owner too. Please remember to do this every time a
report is moved between products.
Comment 11 Kjartan Maraas 2004-09-01 21:43:15 UTC
I don't have defaults.list and it's not crashing here at all. Also FC3. Did
anyone try the latest gnome-vfs and control-center release?
Comment 12 Oliver Lemke 2004-09-01 23:50:47 UTC
Found the problem. It is the mimeinfo.cache file in /usr/share/applications
created by running 'update-desktop-database'. After removing it,
gnome-settings-daemon runs without crashing. Running u-d-d and restarting g-s-d,
the crash is back. Tested with latest gnome-vfs and control-center.
A stripped-down version only containing image/jpeg and image/png works fine. So,
it must be one of the other entries which makes it crash.
I'll try to figure out the bad entry.
Comment 13 Oliver Lemke 2004-09-01 23:51:41 UTC
Created attachment 31195 [details]
mimeinfo.cache making g-s-d crash
Comment 14 Oliver Lemke 2004-09-02 00:12:14 UTC
The abiword.desktop file was causing the crash. It contains spaces in the
MimeType list after the semicolons. 

MimeType=application/x-abiword; text/x-abiword; text/x-xml-abiword; text/plain;
application/msword;

Removing the spaces and running u-d-d makes g-s-d happy. :-)
Comment 15 Christophe Fergeau 2004-09-02 21:35:36 UTC
I didn't manage to reproduce it even with artificially corrupted files. Could
you try the attached test and tell me if it's reproduceable with it?
Comment 16 Christophe Fergeau 2004-09-02 21:36:31 UTC
Created attachment 31219 [details]
test program
Comment 17 Oliver Lemke 2004-09-03 00:17:02 UTC
After running your test program on mandrake, gentoo and fedora core rawhide,
things are getting clearer now. To make a long story short: The problem are
duplicate entries in mimeinfo.cache.

The problem is triggered by a combination of two bugs:

1. If one desktop file defines 'MimeType=text/plain;' and a second one defines
'MimeType=application/x-abiword; text/plain;', the update-desktop-database tool
creates two entries in mimeinfo.cache. One for 'text/plain' and another one for
' text/plain'. Actually, I'm not sure whether this is a bug or intended behaviour.

2. I guess gnome-vfs will ignore the space at the beginning of the line. So, we
have two entries for text/plain! Which makes gnome-vfs go mad. Depending on the
location and associated desktop file(s) of the duplicate entries, it either
returns a wrong desktop file, complete rubbish or segfaults.

Tests with the abiword.desktop file:

Mandrake/Gentoo:
olemke@defiant:mtest ./test-mime text/plain
Desktop files associated with text/plain:
gnumeric.desktop

After shuffling the lines in mimeinfo.cache it returns ggv.desktop or others.

FedoraCore Rawhide:
[olemke@stargazer mtest]$ ./test-mime text/plain
Desktop files associated with text/plain:
ar_LB
ar_KW.utf8
ar_KW.UTF-8

(no, this is NOT a copy'n'paste error :-) )

Afterwards I played a bit around with duplicating different entries and
associating different desktop entries with them. In some cases it produced a
segfault:

[olemke@stargazer mtest]$ gdb ./test-mime
(gdb) run application/x-tar
Starting program: /home/olemke/mtest/test-mime application/x-tar
[Thread debugging using libthread_db enabled]
[New Thread -151074560 (LWP 6974)]
Desktop files associated with application/x-tar:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -151074560 (LWP 6974)]
0x002952fa in strcmp () from /lib/tls/libc.so.6

(gdb) thread apply all bt

Thread 1 (Thread -151074560 (LWP 6974))

  • #0 strcmp
    from /lib/tls/libc.so.6
  • #1 g_list_find_custom
    from /usr/lib/libglib-2.0.so.0
  • #2 gnome_vfs_mime_get_all_desktop_entries
    from /usr/lib/libgnomevfs-2.so.0
  • #3 main
    at ./test-new-mime.c line 43

This was on Fedora Core as I don't have debug-enabled compiles on gentoo and
mandrake at the moment. If you can't reproduce it and/or need more info let me
know. In that case I can recompile gnome-vfs and glib with debug info on my
gentoo box and hopefully provide a more detailed backtrace.
Comment 18 Eric Butler 2004-09-03 05:27:28 UTC
Both gnome-settings-daemon and nautilus both crash-looping..

Here are the backtraces I got in case they are of use to anyone:

- http://extremeboredom.net/Stuff/nautilus-crash1.txt
- http://extremeboredom.net/Stuff/gsd-crash1.txt

I tried running test-mime on a few things and it didn't crash, but text/plain
was assoceated with eye of gnome for some reason, and x-directory/normal was
assoceated with nothing, not sure if that's important or not.

This is using the latest gnome ebuilds from breakmygentoo.net.
Comment 19 Christophe Fergeau 2004-09-03 08:31:24 UTC
Ok, thanks for all the investigation Oliver. I finally managed to reproduce the
crash in gnome-settings-daemon, here comes a patch which fixes it for me.
Comment 20 Christophe Fergeau 2004-09-03 08:32:20 UTC
Created attachment 31231 [details] [review]
double free fix
Comment 21 Oliver Lemke 2004-09-03 14:15:07 UTC
Yes, the patch fixed it.

One issue remaining: gnome-vfs only uses the last entry of the duplicate mime
type entries. If you have the following in mimeinfo.cache:

text/plain=emacs.desktop
text/plain=vim.desktop

test-mime will only return vim.desktop instead of both. But I guess it's not up
to gnome-vfs to deal with this. update-desktop-database has to be fixed upstream
to not create those duplicate entries.
Comment 22 bugzilla.gnome.org 2004-09-03 21:59:45 UTC
ok, gnome-vfs-2.7.92 did fix the GSD and Nautilus crashes for me (Gentoo, BMG)

now there is one app still crashing: file-roller. Not sure whether this is
related. though (backtrace does not mention gnome-vfs). 

I run a gentoo box and stuff is compiled without much debug info. running
file-roler with gdb I get

Starting program: /usr/bin/file-roller /opt/netapplet-ebuild.tar.bz2
warning: Unable to find dynamic linker breakpoint function.
GDB will be unable to debug shared library initializers
and track explicitly loaded dynamic code.
Detaching after fork from child process 13016.

Gtk-ERROR **: file gtksequence.c: line 1015 (_gtk_sequence_node_insert_sorted):
assertion failed: (node_compare (new, closest, &info) <= 0)
aborting...

Program received signal SIGTRAP, Trace/breakpoint trap.
0x40c2244e in g_logv () from /usr/lib/libglib-2.0.so.0
Comment 23 Christophe Fergeau 2004-09-03 22:11:41 UTC
jens: your stack trace is useless, and I don't really see why you thought
reporting a file-roller crash here would be useful to us...
Comment 24 Elijah Newren 2004-09-11 18:47:55 UTC
Can this bug be closed?  I see this in the ChangeLog:

2004-09-04  Christophe Fergeau  <teuf@gnome.org>

        * libgnomevfs/gnome-vfs-mime-info-cache.c: make sure we don't free
          memory we'll reuse later when managing the mime_info_cache_map
          hash table memory (fixes #150467)
Comment 25 Christian Kellner 2004-09-11 19:07:01 UTC
Fixed in cvs. Closing.