GNOME Bugzilla – Bug 530196
_g_local_file_has_trash_dir() doesn't handle st_dev == 0
Last modified: 2008-05-17 06:02:05 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.
Created attachment 110104 [details] [review] Patch to _g_local_file_has_trash_dir Written by Matthias Drochner -- M.Drochner . fz-juelich . de
Please commit
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.