open-hpi / openhpi

Other
6 stars 10 forks source link

The ov_rest plugin could go to deadlock #1998

Closed mohandev2 closed 6 years ago

mohandev2 commented 6 years ago

In a rare situation (when the synergy ring is installed with new bits, many manual changes are done etc) ov_rest plugin could get into a deadlock situation. Was unable to reproduce.

(gdb) info threads Id Target Id Frame 6 Thread 0x7f5be64b5700 (LWP 26955) "DiscoveryThread" 0x00007f5beb373949 in syscall () from /lib64/libc.so.6 5 Thread 0x7f5be5cb4700 (LWP 26956) "EventGet" 0x00007f5bec7cff4d in __lll_lock_wait () from /lib64/libpthread.so.0 4 Thread 0x7f5be4cb2700 (LWP 26958) "ov_rest_event_t" 0x00007f5beb373949 in syscall () from /lib64/libc.so.6 3 Thread 0x7f5bd7fff700 (LWP 3895) "pool" 0x00007f5beb373949 in syscall () from /lib64/libc.so.6 2 Thread 0x7f5bd75dc700 (LWP 3898) "pool" 0x00007f5beb373949 in syscall () from /lib64/libc.so.6

Thread 6 (Thread 0x7f5be64b5700 (LWP 26955)):

0 0x00007f5beb373949 in syscall () from /lib64/libc.so.6

1 0x00007f5bebb77306 in g_mutex_lock_slowpath () from /lib64/libglib-2.0.so.0

2 0x00007f5be93fa40f in ov_rest_discover_resources (oh_handler=0x16e43b0) at ov_rest_discover.c:1634

3 0x00000000004150d0 in oh_discovery () at plugin.c:740

4 0x00000000004247de in discovery_func (data=) at threaded.c:50

5 0x00007f5bebbcb4e5 in g_thread_proxy () from /lib64/libglib-2.0.so.0

6 0x00007f5bec7c9dc5 in start_thread () from /lib64/libpthread.so.0

7 0x00007f5beb3791cd in clone () from /lib64/libc.so.6

Thread 5 (Thread 0x7f5be5cb4700 (LWP 26956)):

0 0x00007f5bec7cff4d in __lll_lock_wait () from /lib64/libpthread.so.0

1 0x00007f5bec7cbd1d in _L_lock_840 () from /lib64/libpthread.so.0

2 0x00007f5bec7cbc3a in pthread_mutex_lock () from /lib64/libpthread.so.0

3 0x0000000000414c31 in oh_get_handler (hid=hid@entry=1) at plugin.c:415

4 0x0000000000412def in oh_harvest_events () at event.c:204

5 0x0000000000424683 in evtget_func (data=) at threaded.c:93

6 0x00007f5bebbcb4e5 in g_thread_proxy () from /lib64/libglib-2.0.so.0

7 0x00007f5bec7c9dc5 in start_thread () from /lib64/libpthread.so.0

8 0x00007f5beb3791cd in clone () from /lib64/libc.so.6

Thread 4 (Thread 0x7f5be4cb2700 (LWP 26958)):

0 0x00007f5beb373949 in syscall () from /lib64/libc.so.6

1 0x00007f5bebb77306 in g_mutex_lock_slowpath () from /lib64/libglib-2.0.so.0

2 0x00007f5be93e1c5c in ov_rest_re_discover (handler=handler@entry=0x16e43b0) at ov_rest_event.c:1759

3 0x00007f5be93e33f0 in ov_rest_event_thread (ov_pointer=0x16e43b0) at ov_rest_event.c:1934

4 0x00007f5bebbcb4e5 in g_thread_proxy () from /lib64/libglib-2.0.so.0

5 0x00007f5bec7c9dc5 in start_thread () from /lib64/libpthread.so.0

6 0x00007f5beb3791cd in clone () from /lib64/libc.so.6

Thread 3 (Thread 0x7f5bd7fff700 (LWP 3895)):

0 0x00007f5beb373949 in syscall () from /lib64/libc.so.6

1 0x00007f5bebb77306 in g_mutex_lock_slowpath () from /lib64/libglib-2.0.so.0

2 0x0000000000424af5 in oh_wake_discovery_thread () at threaded.c:233

3 0x00000000004162a7 in saHpiDiscover (SessionId=) at safhpi.c:108

4 0x000000000040cba8 in process_msg (changed_sid=, data_len=@0x7f5bd7fecedc: 4, data=0x7f5bd7feed90 "\b", rq_byte_order=1234, hm=0x7f5bec7b70c0 <hpi_marshal+64>) at server.cpp:398

5 service_thread (sock_ptr=) at server.cpp:261

6 0x00007f5bebbcbe6c in g_thread_pool_thread_proxy () from /lib64/libglib-2.0.so.0

7 0x00007f5bebbcb4e5 in g_thread_proxy () from /lib64/libglib-2.0.so.0

8 0x00007f5bec7c9dc5 in start_thread () from /lib64/libpthread.so.0

9 0x00007f5beb3791cd in clone () from /lib64/libc.so.6

Thread 2 (Thread 0x7f5bd75dc700 (LWP 3898)):

0 0x00007f5beb373949 in syscall () from /lib64/libc.so.6

1 0x00007f5bebb77306 in g_mutex_lock_slowpath () from /lib64/libglib-2.0.so.0

2 0x0000000000424af5 in oh_wake_discovery_thread () at threaded.c:233

3 0x00000000004162a7 in saHpiDiscover (SessionId=) at safhpi.c:108

4 0x000000000040cba8 in process_msg (changed_sid=, data_len=@0x7f5bd75c9edc: 4, data=0x7f5bd75cbd90 "\t", rq_byte_order=1234, hm=0x7f5bec7b70c0 <hpi_marshal+64>) at server.cpp:398

5 service_thread (sock_ptr=) at server.cpp:261

6 0x00007f5bebbcbe6c in g_thread_pool_thread_proxy () from /lib64/libglib-2.0.so.0

7 0x00007f5bebbcb4e5 in g_thread_proxy () from /lib64/libglib-2.0.so.0

8 0x00007f5bec7c9dc5 in start_thread () from /lib64/libpthread.so.0

9 0x00007f5beb3791cd in clone () from /lib64/libc.so.6

Thread 1 (Thread 0x7f5bedaf7840 (LWP 26954)):

0 0x00007f5beb373949 in syscall () from /lib64/libc.so.6

1 0x00007f5bebbe8c7c in g_cond_wait () from /lib64/libglib-2.0.so.0

2 0x00007f5bebbcc550 in g_thread_pool_free () from /lib64/libglib-2.0.so.0

3 0x0000000000411f58 in oh_server_run (ipvflags=ipvflags@entry=1, bindaddr=, port=, sock_timeout=, max_threads=-1) at server.cpp:202

Reported by: mohandev2

Original Ticket: openhpi/bugs/1998

mohandev2 commented 6 years ago

Original comment by: HemanthBeecherla

mohandev2 commented 6 years ago

This bug was closed when fix for #1999 was checked in. Even though 1999 was not an exact duplicate of this bug, going to mark this bug as duplicate of 1999. Also 1999 was shipped in 3.8.0 release. This bug need not be reported in the changelog

mohandev2 commented 6 years ago

Duplicate of #1999