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 530196 - _g_local_file_has_trash_dir() doesn't handle st_dev == 0
_g_local_file_has_trash_dir() doesn't handle st_dev == 0
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: gio
2.16.x
Other NetBSD
: Normal major
: ---
Assigned To: Alexander Larsson
gtkdev
Depends on:
Blocks:
 
 
Reported: 2008-04-27 12:55 UTC by Jared D. McNeill
Modified: 2008-05-17 06:02 UTC
See Also:
GNOME target: ---
GNOME version: 2.21/2.22


Attachments
Patch to _g_local_file_has_trash_dir (1.04 KB, patch)
2008-04-29 10:37 UTC, Jared D. McNeill
committed Details | Review

Description Jared D. McNeill 2008-04-27 12:55:56 UTC
Please describe the problem:
Launching Nautilus on NetBSD with a home directory on /dev/wd0a causes the following message to be printed:

	(nautilus:543): GLib-CRITICAL **: g_once_init_leave: assertion `initialization_value != 0' failed

Looking in the source code for glib2-2.16.3, in the file
gio/glocalfile.c and function _g_local_file_has_trash_dir(), we see:


	if (g_once_init_enter (&home_dev))
	  {
	    gsize setup_value = 0;
	    struct stat home_stat;


	    g_stat (g_get_home_dir (), &home_stat);
	    setup_value = home_stat.st_dev;
	    g_once_init_leave (&home_dev, setup_value);
	  }

g_once_init_leave triggers this assertion if the second arg
(`initialization_value') is 0, and a stat of a file off the device /dev/wd0a
on NetBSD will result in st_dev being 0.

As a result Nautilus no longer works on NetBSD with newer glib if the user's home directory is on the first partition of the first IDE drive.

Steps to reproduce:
1. Install NetBSD and the latest GNOME packages on an IDE hard disk where /home is on the root partition.
2. Code inspection.


Actual results:
Nautilus will not allow the user to navigate any directory off of their home directory -- so eg. the desktop is blank with an hour glass. The rest of the filesystem is browsable.

Expected results:


Does this happen every time?
Yes.

Other information:
Original NetBSD problem report here:
  http://www.netbsd.org/cgi-bin/query-pr-single.pl?number=38518

I was asked to report this upstream.
Comment 1 Jared D. McNeill 2008-04-29 10:37:22 UTC
Created attachment 110104 [details] [review]
Patch to _g_local_file_has_trash_dir

Written by Matthias Drochner -- M.Drochner . fz-juelich . de
Comment 2 Matthias Clasen 2008-05-15 07:06:52 UTC
Please commit
Comment 3 Matthias Clasen 2008-05-17 06:02:05 UTC
        Bug 530196 – _g_local_file_has_trash_dir() doesn't handle st_dev == 0

        * glocalfile.c (_g_local_file_has_trash_dir): Handle the case that
        st_dev might be zero.