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?
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.
(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.
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).