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 500203 - eog crash when .gnome2/eog is not a directory
eog crash when .gnome2/eog is not a directory
Status: RESOLVED FIXED
Product: eog
Classification: Core
Component: image viewer
2.20.x
Other Linux
: Normal critical
: ---
Assigned To: EOG Maintainers
EOG Maintainers
: 497206 505236 506731 520712 556288 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2007-11-28 14:17 UTC by Sebastien Bacher
Modified: 2008-10-23 22:36 UTC
See Also:
GNOME target: ---
GNOME version: 2.19/2.20


Attachments
make room for dotdir (1.23 KB, patch)
2008-02-24 20:50 UTC, Felix Riemann
rejected Details | Review
just print a warning instead (2.20 KB, patch)
2008-02-24 23:43 UTC, Felix Riemann
committed Details | Review

Description Sebastien Bacher 2007-11-28 14:17:49 UTC
The bug has been opened on https://bugs.launchpad.net/ubuntu/+source/eog/+bug/147059

"Binary package hint: eog

when opening EOG from any filemanager nothing happens. in a shell i get this error:
EOG-ERROR **: file eog-util.c: line 300 (eog_util_dot_dir): assertion failed: (exists)
aborting...
Aborted (core dumped)
...
http://launchpadlibrarian.net/9688509/gdb-eog2.txt

EOG-ERROR **: file eog-util.c: line 300 (eog_util_dot_dir): assertion failed: (exists)
aborting...

Program received signal SIGABRT, Aborted.

Thread NaN (LWP 15873)

  • #0 __kernel_vsyscall
  • #1 raise
    from /lib/tls/i686/cmov/libc.so.6
  • #2 abort
    from /lib/tls/i686/cmov/libc.so.6
  • #3 IA__g_logv
  • #4 IA__g_log
  • #5 IA__g_assert_warning
    at /build/buildd/glib2.0-2.14.1/glib/gmessages.c line 552
  • #6 eog_util_dot_dir
    at eog-util.c line 300
  • #7 eog_application_init
    at eog-application.c line 125
  • #8 IA__g_type_create_instance
    at /build/buildd/glib2.0-2.14.1/gobject/gtype.c line 1569

cheers.
...
Comment 1 Claudio Saavedra 2007-11-28 14:40:51 UTC
*** Bug 497206 has been marked as a duplicate of this bug. ***
Comment 2 Felix Riemann 2007-11-28 17:14:18 UTC
Oh yes, I forgot to answer in bug 497206.
The problem is that we currently don't handle the case when ~/.gnome2/eog is a file.

So, the possible solutions would be to simply delete the file or trying to move it away safely (renaming it to eog.bak; possibly deleting it if that fails).
Which one is the preferable? We should avoid asking the user as he most probably won't know what's going on.
Comment 3 Claudio Saavedra 2007-11-28 17:40:37 UTC
Well. I think there is the very corner case (probably from really old eog versions) when eog for some reason, created that file. And then, it would be sane to remove the file.

And there is the other really unlikely corner case, when that file was created for some strange reason by a user (or other application?). Not sure how to handle this in a consistente and safe way.

But changing the assertion to a warning comes to my mind, eitherway.

Comment 4 Felix Riemann 2007-12-20 23:12:59 UTC
Just another possibility I just saw in my .gnome2 folder.
We could call EOG's dot-dir "eog.d" instead of just "eog" (yelp and bug-buddy are examples doing it).
Comment 5 Claudio Saavedra 2007-12-20 23:23:50 UTC
That could do it. But we would need to rename the .eog directory, if exists and is a directory, so that users do not loose their customized toolbars.
Comment 6 Felix Riemann 2007-12-20 23:36:53 UTC
Leaves one question though: What to do if "eog.d" exists and is no directory? 
Comment 7 Felix Riemann 2007-12-23 15:30:26 UTC
*** Bug 505236 has been marked as a duplicate of this bug. ***
Comment 8 Felix Riemann 2008-01-01 20:10:51 UTC
*** Bug 506731 has been marked as a duplicate of this bug. ***
Comment 9 Felix Riemann 2008-02-24 20:50:50 UTC
Created attachment 105869 [details] [review]
make room for dotdir

Maybe we can solve this for 2.22:

This patch tries to move files that come into its way away using g_mkstemp.
Comment 10 Felix Riemann 2008-02-24 23:43:37 UTC
Created attachment 105881 [details] [review]
just print a warning instead

Second approach. 
After finding out that a really "safe" file renaming (without accidentially overwriting another programs data during context switch) is a pretty hard task (and considering that there are comparatively few people suffer from this), we decided to take an easier approach. Now, we display a warning on the console instead of asserting. Changed settings like a custom toolbar layout won't be saved until the user moved that file away (or deleted it).
Comment 11 Claudio Saavedra 2008-02-24 23:54:23 UTC
Considering the security implications and that it is a very corner case (really few reports for a feature that's been out for 6 months now), I think that the warning is enough. If more reports come out, we should consider finding a safe way of moving the file away.

Patch looks ok, Felix.
Comment 12 Felix Riemann 2008-02-25 12:01:51 UTC
Okay, committed it.

2008-02-25  Felix Riemann  <>

	* src/eog-application.c: (eog_application_init),
	(eog_application_save_toolbars_model):
	* src/eog-util.c: (eog_util_dot_dir):
	Don't assert if we cannot create the user preferences directory
	because a file with the same name blocking it. Log a warning instead.
	Attempts to save the toolbar layout will be ignored until the
	user moved the file away. Fixes bug #500203.
----
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.
Comment 13 Lucas Rocha 2008-03-06 11:19:16 UTC
*** Bug 520712 has been marked as a duplicate of this bug. ***
Comment 14 André Klapper 2008-10-23 22:36:36 UTC
*** Bug 556288 has been marked as a duplicate of this bug. ***