! 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 !
tumblerd crash quite often on Meego tablet
Status:
RESOLVED: FIXED
Product:
Tumbler
Component:
General

Comments

Description Wind Yuan 2011-04-28 04:02:05 CEST
Tumblerd always report Segmentation fault when tumblerd send method call 'Queue' to gst-video-thumbnail, in following function call:
      "dbus_g_proxy_call_with_timeout (s->proxy, "Queue",…);"
     <<tumbler-specialized-thumbnailer.c:tumbler_specialized_thumbnailer_create>>
This function call is in a new thread<Thread 2>, and main loop running in main thread<Thread 1>. I’m not sure there’s any thread safe problem. 

So I did the following steps.
STEP1: comment out this dbus_g_proxy_call… function. Result: never crash(certainly thumbnail would not be generated), seems this func should not be called in sub-thread.
STEP2: <Thread 2> post the function msg to dbus_g_proxy_call to main thread(main loop), cond_wait for the dbus_g_proxy_call return from main thread, then continue other processing. Result: tumblerd working well without crash.

Looks like STEP2 can fix the bug, but I do not know why. does dbus have the thread-safe problem?
Comment 1 Jannis Pohlmann editbugs 2011-12-27 14:38:23 CET
From what I remember, D-Bus is not thread-safe, so calling D-Bus methods from a thread different from the one that runs the main loop can result in undesired behavior. 

There are a couple of patches from Nokia pending related to this issue. I'll have to look them up and attach them to this bug.
Comment 2 Wind Yuan 2011-12-27 15:21:11 CET
(In reply to comment #1)
> From what I remember, D-Bus is not thread-safe, so calling D-Bus methods from a
> thread different from the one that runs the main loop can result in undesired
> behavior. 
> 
> There are a couple of patches from Nokia pending related to this issue. I'll
> have to look them up and attach them to this bug.

Sorry I was busy with other things so didn't update the status here. D-Bus can be used in multi-threads, but need call 'dbus_g_thread_init()' first. I think someone already fix it up. Maybe on the way in some patches. If not, you can submit a patch just add <dbus_g_thread_init> in thumberd/main.c:main. This can work for me.
Comment 3 Jannis Pohlmann editbugs 2012-02-24 17:57:07 CET
I've added a call to dbus_g_thread_init() and I'm closing this bug as fixed. If it is not yet fixed, please re-open.

commit c48cb86cf91f46c3d90358c118de8003752ec5b0
Author: Jannis Pohlmann <jannis.pohlmann@codethink.co.uk>
Date:   Fri Feb 24 16:55:46 2012 +0000

    Call dbus_g_thread_init() to hopefully fix threading issues (bug #7544).

Bug #7544

Reported by:
Wind Yuan
Reported on: 2011-04-28
Last modified on: 2012-02-24

People

Assignee:
Jannis Pohlmann
CC List:
1 user

Version

Version:
0.1.21

Attachments

Additional information