Hi All,
While doing GRPC communication in C using (
https://github.com/Juniper/grpc-c) library i am getting a segmentation fault, i am using a 8 core processor, so
gctp_max_threads = 8 and
gctp_nthreads = 9 is seen in the stack trace. Is this causing the problem or is there something else someone can point out from the stack trace below?
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffd7fff700 (LWP 3273)]
0x00007ffff6d5240a in pthread_join () from /lib/x86_64-linux-gnu/libpthread.so.0
STACK TRACE ::
(gdb) bt
#0 0x00007ffff6d5240a in pthread_join () from /lib/x86_64-linux-gnu/libpthread.so.0
#1 0x00007ffff77e54e4 in gc_delete_threads (pool=0x711d60, pool=0x711d60) at ../../lib/thread_pool.c:111
#2 0x00007ffff77e564e in grpc_c_thread_pool_add (pool=0x711d60, func=0x7ffff77e4c00 <gc_run_rpc>, arg=0x7fffd0004220) at ../../lib/thread_pool.c:176
#3 0x00007ffff77e496c in gc_handle_server_event_internal (cq=0x7fffd000e020, cq@entry=0x712430, server=server@entry=0x712330, ts=...) at ../../lib/service.c:929
#4 0x00007ffff77e4c2d in gc_run_rpc (arg=<optimized out>) at ../../lib/service.c:1031
#5 0x00007ffff77e5421 in gc_thread_func (arg=0x7fffe0026600) at ../../lib/thread_pool.c:52
#6 0x00000000004651c7 in ?? ()
#7 0x00007ffff6d51064 in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
#8 0x00007ffff657d62d in clone () from /lib/x86_64-linux-gnu/libc.so.6
(gdb) p *pool
{gctp_max_threads = 8, gctp_wait_threads = 7, gctp_nthreads = 9, gctp_shutdown = 0, gctp_lock = {__data = {__lock = 0, __count = 0, __owner = 0, __nusers = 7, __kind = 0, __spins = 0, __elision = 0, __list = {__prev = 0x0, __next = 0x0}}, __size = '\000' <repeats 12 times>, "\a", '\000' <repeats 26 times>, __align = 0}, gctp_cv = {__data = {__lock = 0, __futex = 5861, __total_seq = 2934, __wakeup_seq = 2927, __woken_seq = 2927, __mutex = 0x711d70, __nwaiters = 14, __broadcast_seq = 0}, __size = "\000\000\000\000\345\026\000\000v\v\000\000\000\000\000\000o\v\000\000\000\000\000\000o\v\000\000\000\000\000\000p\035q\000\000\000\000\000\016\000\000\000\000\000\000", __align = 25172803321856}, gctp_shutdown_cv = {__data = {__lock = 0, __futex = 0, __total_seq = 0, __wakeup_seq = 0, __woken_seq = 0, __mutex = 0x0, __nwaiters = 0, __broadcast_seq = 0}, __size = '\000' <repeats 47 times>, __align = 0}, gctp_callbacks_head = {tqh_first = 0x0, tqh_last = 0x711df8}, gctp_dead_threads = {tqh_first = 0x7fffd000c1c0, tqh_last = 0x7fffe8023c18}}