! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Segfault at startup (hardcodes non-existent thumbnailers path ?)
Status:
RESOLVED: FIXED
Product:
Tumbler
Component:
General

Comments

Description Landry Breuil editbugs 2010-01-09 16:12:42 CET
Created attachment 2771 
gdb backtrace

launching tumblerd segfaults at startup. Traceback attached, though it's not very informative...

To me, tumblerd hardcodes /usr/share/thumbnailers (somewhere, didn't find where) in its list of directories containing thumbnailers, but this directory doesn't exist on OpenBSD. /usr/local/share/thumbnailers/ exists though, thunar & thunar-thumbnailers installs their desktop files there.

Output is :
(gdb) r
Starting program: /usr/local/libexec/tumblerd 
tumbler-xdg-cache-Message: Initializing the Tumbler XDG cache plugin
tumbler-font-thumbnailer-Message: Initializing the Tumbler Font Thumbnailer plugin
tumbler-jpeg-thumbnailer-Message: Initializing the Tumbler Pixbuf Thumbnailer plugin
tumbler-pixbuf-thumbnailer-Message: Initializing the Tumbler Pixbuf Thumbnailer plugin
Registry:
  Preferred Thumbnailers:
  Registry Thumbnailers:

Registry:
  Preferred Thumbnailers:
  Registry Thumbnailers:

Registry:
  Preferred Thumbnailers:
  Registry Thumbnailers:

Thumbnailers:

Overrides:

(tumblerd:22735): tumblerd-DEBUG:   /usr/share/thumbnailers deleted

Program received signal SIGSEGV, Segmentation fault.
[Switching to process 22735, thread 0x7dedf800]
0x0aaf230b in g_str_hash () from /usr/local/lib/libglib-2.0.so.1802.0


As a sidenote, compiling with --enable-debug=full fails at:
tumbler-provider-factory.c: In function `tumbler_provider_factory_add_types':
tumbler-provider-factory.c:127: warning: declaration of `index' shadows a global declaration
<built-in>:0: warning: shadowed declaration is here

replacing 'index' occurences by 'idx' makes it build ..
Comment 1 Landry Breuil editbugs 2010-01-09 16:17:47 CET
Duh. As soon as i hit enter, i figured out the cause.
XDG_DATA_DIRS=/usr/local/share:/usr/share:/usr/local/share

But.. if i run XDG_DATA_DIRS=/usr/local/share /usr/local/libexec/tumblerd, tumblerd still segfaults, this time trying to monitor  ~/.local/share/thumbnailers, which doesn't exist either. If i mkdir it, and run XDG_DATA_DIRS=/usr/local/share /usr/local/libexec/tumblerd, it doesn't segfault.
Comment 2 Jannis Pohlmann editbugs 2010-01-09 20:46:21 CET
Can you try to provide me with more detailed backtraces from both crashes? Unfortunately, I'm unable to reproduce them on my machine.
Comment 3 Landry Breuil editbugs 2010-01-11 20:50:50 CET
Well.. i don't know what i can provide you more as backtrace. The crash is the same for /usr/share/thumbnailers or ~/.local/share/thumbnailers.

After the debug message
(tumblerd:11149): tumblerd-DEBUG:   /usr/share/thumbnailers deleted
dir_index = tumbler_manager_get_dir_index (manager, file); => dir_index is 2.

tumbler_manager_directory_deleted() gets called..

while (g_hash_table_iter_next (&iter, (gpointer) &hash_key, (gpointer) &list)) exits immediately (maybe because /usr/share/thumbnailers is the first in the list, wild guess ?), leading to a non-initialized delete_keys.

hence the crash in:
for (lp = delete_keys; lp != NULL; lp = lp->next)
  g_hash_table_remove (manager->thumbnailers, (const gchar *)lp->data);

Initializing delete_keys to NULL at line 1411 like done in tumbler_manager_unload_overrides_file() fixes the issue.

Well, it still lists no thumbnailers, even with thunar-thumbnailers package installed, but i suppose that's another story..

tumbler-xdg-cache-Message: Initializing the Tumbler XDG cache plugin
tumbler-font-thumbnailer-Message: Initializing the Tumbler Font Thumbnailer plugin
tumbler-jpeg-thumbnailer-Message: Initializing the Tumbler Pixbuf Thumbnailer plugin
tumbler-pixbuf-thumbnailer-Message: Initializing the Tumbler Pixbuf Thumbnailer plugin
Registry:
  Preferred Thumbnailers:
  Registry Thumbnailers:

Registry:
  Preferred Thumbnailers:
  Registry Thumbnailers:

Registry:
  Preferred Thumbnailers:
  Registry Thumbnailers:

Thumbnailers:

Overrides:
Comment 4 Jannis Pohlmann editbugs 2010-11-13 14:36:53 CET
This should be fixed in master. Please re-open if it isn't. Here's the commit log:

commit 6224fb7559ee76e2ffea90fbaf8835125c842de3
Author: Jannis Pohlmann <jannis@xfce.org>
Date:   Sat Nov 13 14:35:07 2010 +0100

    Fix a segfault when one of the thumbnailer dirs is deleted (bug #6134).
    
    These crashes were due to an uninitialized variable (delete_keys),
    causing an iteration over a broken GList of strings.

Bug #6134

Reported by:
Landry Breuil
Reported on: 2010-01-09
Last modified on: 2010-11-13

People

Assignee:
Jannis Pohlmann
CC List:
0 users

Version

Attachments

gdb backtrace (3.02 KB, application/octet-stream)
2010-01-09 16:12 CET , Landry Breuil
no flags

Additional information