Bug 90135

Summary: Thread blocking issue
Product: dbus Reporter: Ralf Habacker <ralf.habacker>
Component: coreAssignee: D-Bus Maintainers <dbus>
Status: RESOLVED MOVED QA Contact: D-Bus Maintainers <dbus>
Severity: normal    
Priority: medium    
Version: git master   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: test.c
CmakeLists.txt (Linux only cmake build file)
test.c (with message unref)

Description Ralf Habacker 2015-04-22 07:20:48 UTC
While reviewing the test case for https://bugs.freedesktop.org/show_bug.cgi?id=89297 a thread blocking issue has been detected with a slighty modified test case, which is appended to this bug.

The test case sends messages to the session bus over a dbus connection from two threads, which works fine in mostly cases (visible by the test case output).

From time to time the output stops for about 40-60 seconds and then continues. On that case the threads shows the following back trace. 

Program received signal SIGINT, Interrupt.
0x00007ffff761f20d in nanosleep () from /lib64/libc.so.6
(gdb) info thread
  Id   Target Id         Frame 
  3    Thread 0x7ffff6b5d700 (LWP 1779) "dbus-test" 0x00007ffff79210af in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
  2    Thread 0x7ffff735e700 (LWP 1778) "dbus-test" 0x00007ffff76457bd in poll () from /lib64/libc.so.6
* 1    Thread 0x7ffff7fbe700 (LWP 1774) "dbus-test" 0x00007ffff761f20d in nanosleep () from /lib64/libc.so.6
(gdb) thread 3
[Switching to thread 3 (Thread 0x7ffff6b5d700 (LWP 1779))]
#0  0x00007ffff79210af in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
(gdb) bt
#0  0x00007ffff79210af in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1  0x00007ffff7bb1bea in _dbus_platform_condvar_wait () from /home/xxx/dbus/usr/local/lib/libdbus-1.so.3
#2  0x00007ffff7b8be59 in _dbus_condvar_wait () from /home/xxx/dbus/usr/local/lib/libdbus-1.so.3
#3  0x00007ffff7b55987 in _dbus_connection_acquire_io_path () from /home/xxx/dbus/usr/local/lib/libdbus-1.so.3
#4  0x00007ffff7b55cbb in _dbus_connection_do_iteration_unlocked () from /home/xxx/dbus/usr/local/lib/libdbus-1.so.3
#5  0x00007ffff7b5ab46 in _dbus_connection_flush_unlocked () from /home/xxx/dbus/usr/local/lib/libdbus-1.so.3
#6  0x00007ffff7b58165 in _dbus_connection_block_pending_call () from /home/xxx/dbus/usr/local/lib/libdbus-1.so.3
#7  0x00007ffff7b821d4 in dbus_pending_call_block () from /home/xxx/dbus/usr/local/lib/libdbus-1.so.3
#8  0x00007ffff7b5aa13 in dbus_connection_send_with_reply_and_block () from /home/xxx/dbus/usr/local/lib/libdbus-1.so.3
#9  0x0000000000400ea4 in fun ()
#10 0x00007ffff791d0db in start_thread () from /lib64/libpthread.so.0
#11 0x00007ffff764e58d in clone () from /lib64/libc.so.6
(gdb) thread 2
[Switching to thread 2 (Thread 0x7ffff735e700 (LWP 1778))]
#0  0x00007ffff76457bd in poll () from /lib64/libc.so.6
(gdb) bt
#0  0x00007ffff76457bd in poll () from /lib64/libc.so.6
#1  0x00007ffff7baf660 in _dbus_poll () from /home/xxx/dbus/usr/local/lib/libdbus-1.so.3
#2  0x00007ffff7b907a0 in socket_do_iteration () from /home/xxx/dbus/usr/local/lib/libdbus-1.so.3
#3  0x00007ffff7b8da64 in _dbus_transport_do_iteration () from /home/xxx/dbus/usr/local/lib/libdbus-1.so.3
#4  0x00007ffff7b55d9c in _dbus_connection_do_iteration_unlocked () from /home/xxx/dbus/usr/local/lib/libdbus-1.so.3
#5  0x00007ffff7b5855f in _dbus_connection_block_pending_call () from /home/xxx/dbus/usr/local/lib/libdbus-1.so.3
#6  0x00007ffff7b821d4 in dbus_pending_call_block () from /home/xxx/dbus/usr/local/lib/libdbus-1.so.3
#7  0x00007ffff7b5aa13 in dbus_connection_send_with_reply_and_block () from /home/xxx/dbus/usr/local/lib/libdbus-1.so.3
#8  0x0000000000400ea4 in fun ()
#9  0x00007ffff791d0db in start_thread () from /lib64/libpthread.so.0
#10 0x00007ffff764e58d in clone () from /lib64/libc.so.6
(gdb) c
Continuing.
Comment 1 Ralf Habacker 2015-04-22 07:21:22 UTC
Created attachment 115259 [details]
test.c
Comment 2 Ralf Habacker 2015-04-22 07:22:03 UTC
Created attachment 115260 [details]
CmakeLists.txt (Linux only cmake build file)
Comment 3 Ralf Habacker 2015-04-22 07:24:28 UTC
Created attachment 115261 [details]
test.c (with message unref)
Comment 4 GitLab Migration User 2018-10-12 21:23:00 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/dbus/dbus/issues/127.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.