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 381119 - gnome-vfs-daemon crashes without /etc/fstab
gnome-vfs-daemon crashes without /etc/fstab
Status: RESOLVED FIXED
Product: gnome-vfs
Classification: Deprecated
Component: Other
cvs (head)
Other All
: Immediate critical
: ---
Assigned To: Christian Neumair
gnome-vfs maintainers
Depends on:
Blocks:
 
 
Reported: 2006-12-01 01:42 UTC by paul
Modified: 2006-12-01 22:32 UTC
See Also:
GNOME target: ---
GNOME version: 2.17/2.18


Attachments
Proposed patch (611 bytes, patch)
2006-12-01 17:17 UTC, Christian Neumair
committed Details | Review

Description paul 2006-12-01 01:42:42 UTC
essentially trivial, as i don't use gnome-vfs-daemon much
but, dbus spawns it when gnome-panel is launched

from apple's crashreporter:
**********

Date/Time:  2006-11-30 17:38:53 -0800
OS Version: 10.2.8 (Build 6R73)
Host:       shadesofgray

Command:    gnome-vfs-daemon
PID:        6323

Exception:  EXC_BAD_ACCESS (0x0001)
Codes:      KERN_INVALID_ADDRESS (0x0001) at 0xb4000005

Thread 0 Crashed:
 #0   0x00d2b448 in g_list_sort_real (glist.c:614)
 #1   0x00d2b554 in g_list_sort (glist.c:639)
 #2   0x0000d674 in update_fstab_drives (gnome-vfs-volume-monitor-daemon.c:733)
 #3   0x0000bdb8 in gnome_vfs_volume_monitor_daemon_init (gnome-vfs-volume-monitor-daemon.c:191)
 #4   0x00710504 in g_type_create_instance (gtype.c:1569)
 #5   0x006ef47c in g_object_constructor (gobject.c:1041)
 #6   0x006eec34 in g_object_newv (gobject.c:937)
 #7   0x006eef7c in g_object_new_valist (gobject.c:981)
 #8   0x006ee678 in g_object_new (gobject.c:795)
 #9   0x0000a1ac in _gnome_vfs_get_volume_monitor_internal (gnome-vfs-volume-monitor.c:315)
 #10  0x0000a2b0 in gnome_vfs_get_volume_monitor (gnome-vfs-volume-monitor.c:342)
 #11  0x00004cec in main (vfs-daemon.c:945)
 #12  0x00002924 in _start (crt.c:267)
 #13  0x000027a4 in start

PPC Thread State:
  srr0: 0x00d2b448 srr1: 0x0000f030                vrsave: 0x00000000
   xer: 0x00000000   lr: 0x00d2b554  ctr: 0x00d2b528   mq: 0x00000000
    r0: 0xb4000001   r1: 0xbffff4a0   r2: 0xb4000001   r3: 0xb4000001
    r4: 0x0000fdc4   r5: 0x00000000   r6: 0x80808080   r7: 0x00000002
    r8: 0x0030a010   r9: 0xa0000dfc  r10: 0x0030a290  r11: 0x00e1ce0c
   r12: 0x00d2b528  r13: 0x00000000  r14: 0x00000000  r15: 0x00000000
   r16: 0x00000000  r17: 0x00000000  r18: 0x00000000  r19: 0x00000000
   r20: 0x00000000  r21: 0x00000000  r22: 0x00000000  r23: 0x00000000
   r24: 0x00000000  r25: 0x00000000  r26: 0xbffffa98  r27: 0x00000008
   r28: 0x00000001  r29: 0x0007b018  r30: 0xbffff4a0  r31: 0x0000d630

and from good ol' gdb
(gdb) r
Starting program: /opt/local/libexec/gnome-vfs-daemon 
Reading symbols for shared libraries +++++++++++++.. done
Reading symbols for shared libraries . done

(process:6160): libgnomevfs-WARNING **: Unable to stat /etc/fstab: No such file or directory

Program received signal EXC_BAD_ACCESS, Could not access memory.
0x00d2b448 in g_list_sort_real (list=0x11000001, compare_func=0xfdc4 <_gnome_vfs_unix_mount_point_compare>, user_data=0x0) at /Source/glib/glib/glib/glist.c:614
614       if (!list->next) 
(gdb) bt
  • #0 g_list_sort_real
    at /Source/glib/glib/glib/glist.c line 614
  • #1 g_list_sort
    at /Source/glib/glib/glib/glist.c line 639
  • #2 update_fstab_drives
    at /Source/gnome-vfs/gnome-vfs/libgnomevfs/gnome-vfs-volume-monitor-daemon.c line 733
  • #3 gnome_vfs_volume_monitor_daemon_init
    at /Source/gnome-vfs/gnome-vfs/libgnomevfs/gnome-vfs-volume-monitor-daemon.c line 190
  • #4 g_type_create_instance
    at /Source/glib/glib/gobject/gtype.c line 1567
  • #5 g_object_constructor
    at /Source/glib/glib/gobject/gobject.c line 1041
  • #6 g_object_newv
    at /Source/glib/glib/gobject/gobject.c line 937
  • #7 g_object_new_valist
    at /Source/glib/glib/gobject/gobject.c line 981
  • #8 g_object_new
    at /Source/glib/glib/gobject/gobject.c line 795
  • #9 _gnome_vfs_get_volume_monitor_internal
    at /Source/gnome-vfs/gnome-vfs/libgnomevfs/gnome-vfs-volume-monitor.c line 315
  • #10 gnome_vfs_get_volume_monitor
    at /Source/gnome-vfs/gnome-vfs/libgnomevfs/gnome-vfs-volume-monitor.c line 342
  • #11 main
    at /Source/gnome-vfs/gnome-vfs/daemon/vfs-daemon.c line 945

both gnome-vfs and glib are from cvs head
Comment 1 paul 2006-12-01 16:24:12 UTC
wow, ok
so
i looked at this today, and looking at the line numbers, realizing something was different
gnome-vfs-volume-monitor-daemon.c line 190 is
        update_fstab_drives (volume_monitor_daemon);
and with the warning that gnome-vfs gave me
(process:6160): libgnomevfs-WARNING **: Unable to stat /etc/fstab: No such file or directory
i decided to google update_fstab_drives
which led me to bug 120222
which was from 3 years ago in nautilus, but, one of the problems was about bad entries in /etc/fstab
on darwin, there is no fstab
i decided to see what would happen if i gave gnome-vfs a blank fstab file
touch /etc/fstab
now, no crashing :)
so i guess there should be some conditional about darwin cause afaik none of them has an /etc/fstab file
Comment 2 Christian Neumair 2006-12-01 17:16:16 UTC
Thanks for your help!

Raising priority/severity, changing OS to all.

The problem seems to be that one variant of gnome-vfs-unix-mounts.c:_gnome_vfs_get_unix_mount_table (l. 864 as of writing) doesn't initialize the return value to NULL when the stat failed and the function returnes TRUE. Other than that I don't see how this can crash.
Comment 3 Christian Neumair 2006-12-01 17:17:46 UTC
Created attachment 77496 [details] [review]
Proposed patch

Maybe you could try out whether this one helps?
Please remember to delete /etc/fstab again before testing it.
Comment 4 paul 2006-12-01 18:32:31 UTC
(In reply to comment #3)
works for me
thanks
Comment 5 Christian Neumair 2006-12-01 19:15:12 UTC
OK, thanks for your help!

I informed the gnome-vfs-list about the issue, and we should get the patch committed within the next few days.
Comment 6 Christian Kellner 2006-12-01 19:22:09 UTC
Go ahead and commit that maybe also on the stable branch!
Comment 7 Christian Kellner 2006-12-01 19:30:57 UTC
Ohh and thanks to both of you ;-D
Comment 8 Christian Neumair 2006-12-01 22:32:16 UTC
Committed, closing.