eclipse-cyclonedds / cyclonedds

Eclipse Cyclone DDS project
https://projects.eclipse.org/projects/iot.cyclonedds
Other
799 stars 349 forks source link

dds_domain_set_deafmute block the thread "tev" #1960

Open tangc1986 opened 3 months ago

tangc1986 commented 3 months ago

At that time, I was using the master branch and when using a function like dds_domain_set_deafmute(writer, true, true, DDS_SECS (1)); in the code, the tev thread would be blocked, resulting in the failure to send protocol messages.

The function stack of the tev thread when the problem occurred is as follows:

(gdb) bt
#0  futex_wait_cancelable (private=<optimized out>, expected=0, futex_word=0x55661f7ee4a4) at ../sysdeps/nptl/futex-internal.h:183
#1  __pthread_cond_wait_common (abstime=0x0, clockid=0, mutex=0x55661f7ee450, cond=0x55661f7ee478) at pthread_cond_wait.c:508
#2  __pthread_cond_wait (cond=0x55661f7ee478, mutex=0x55661f7ee450) at pthread_cond_wait.c:647
#3  0x00007f1ad871fc13 in ddsrt_cond_wait (cond=0x55661f7ee478, mutex=0x55661f7ee450) at /home/tc/git/cyclonedds/src/ddsrt/src/sync/posix/sync.c:88
#4  0x00007f1ad86ab264 in ddsi_delete_xevent_sync (evq=0x55661f7ee3f0, ev=0x55661f8051e0) at /home/tc/git/cyclonedds/src/core/ddsi/src/ddsi_xevent.c:290
#5  0x00007f1ad86ab2fd in ddsi_delete_xevent (ev=0x55661f8051e0) at /home/tc/git/cyclonedds/src/core/ddsi/src/ddsi_xevent.c:308
#6  0x00007f1ad8688bf8 in reset_deaf_mute (gv=0x55661f7eb7f8, xev=0x55661f8051e0, xp=0x7f1ad0000b60, varg=0x55661f805228, tnow=...) at /home/tc/git/cyclonedds/src/core/ddsi/src/ddsi_init.c:1073
#7  0x00007f1ad86abb5b in handle_timed_xevent (evq=0x55661f7ee3f0, xev=0x55661f8051e0, xp=0x7f1ad0000b60, tnow=...) at /home/tc/git/cyclonedds/src/core/ddsi/src/ddsi_xevent.c:512
#8  0x00007f1ad86abdbc in handle_xevents (thrst=0x55661f7ea5c0, xevq=0x55661f7ee3f0, xp=0x7f1ad0000b60, tnow=...) at /home/tc/git/cyclonedds/src/core/ddsi/src/ddsi_xevent.c:577
#9  0x00007f1ad86abfcb in xevent_thread (xevq=0x55661f7ee3f0) at /home/tc/git/cyclonedds/src/core/ddsi/src/ddsi_xevent.c:609
#10 0x00007f1ad86a69aa in create_thread_wrapper (ptr=0x55661f7ea5c0) at /home/tc/git/cyclonedds/src/core/ddsi/src/ddsi_thread.c:260
#11 0x00007f1ad87203a2 in os_startRoutineWrapper (threadContext=0x55661f7f6750) at /home/tc/git/cyclonedds/src/ddsrt/src/threads/posix/threads.c:190
#12 0x00007f1ad8052609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#13 0x00007f1ad84f6353 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
eboasson commented 3 months ago

Interesting ... Is it reproducible? Because if it is, it would be really interesting to see what the other threads are doing (thread apply all bt instead of bt). Thanks!