You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have made an executable that creates one rd_kafka_t as producer and one as consumer in separate threads. When using only one at a time, they work correctly. When I create both at the same time, the executable crashes on the second call to rd_kafka_brokers_add(). I'm only adding a single broker but I do it once for each rd_kafka_t.
I've tried setting the broker via "bootstrap.servers" and that has the same effect.
The crash occurs under rd_kafka_broker_thread_main() and getaddrinfo() in internal_getent() (see entire callstack below.)
I'm unsure what else to try. Any help or tips appreciated.
Checklist
librdkafka version (release number or git tag): 0.11.5
0x00007ffff0131448 in internal_getent (stream=stream@entry=0x7ffff002e670, result=result@entry=0x7fffd1ff8900, buffer=buffer@entry=0x7fffd1ff8d10 "",
buflen=buflen@entry=1024, errnop=errnop@entry=0x7fffd1ffb6b0, herrnop=herrnop@entry=0x7fffd1ffb6e8, af=0, flags=0) at nss_files/files-XXX.c:216
216 nss_files/files-XXX.c: No such file or directory.
(gdb) i stack
#0 0x00007ffff0131448 in internal_getent (stream=stream@entry=0x7ffff002e670, result=result@entry=0x7fffd1ff8900, buffer=buffer@entry=0x7fffd1ff8d10 "",
buflen=buflen@entry=1024, errnop=errnop@entry=0x7fffd1ffb6b0, herrnop=herrnop@entry=0x7fffd1ffb6e8, af=0, flags=0) at nss_files/files-XXX.c:216 #1 0x00007ffff01328bd in _nss_files_gethostbyname4_r (name=0x7fffd1ffa6a0 "xnode.second-bridge.net", pat=0x7fffd1ff8a88, buffer=0x7fffd1ff8d10 "", buflen=1024,
errnop=0x7fffd1ffb6b0, herrnop=0x7fffd1ffb6e8, ttlp=0x0) at nss_files/files-hosts.c:416 #2 0x0000000000791be5 in gaih_inet.constprop () #3 0x0000000000793b74 in getaddrinfo () #4 0x00000000004492ae in rd_getaddrinfo (nodesvc=, defsvc=0x7fffd1ffa7a0 "9092", flags=32, family=, socktype=,
protocol=, errstr=0x7fffd1ff9288) at ../../../Shared/librdkafka/src/rdaddr.c:168 #5 0x000000000046014a in rd_kafka_broker_resolve (rkb=) at ../../../Shared/librdkafka/src/rdkafka_broker.c:667 #6 rd_kafka_broker_connect (rkb=) at ../../../Shared/librdkafka/src/rdkafka_broker.c:1466 #7 rd_kafka_broker_thread_main (arg=0x7fffd8002dd0) at ../../../Shared/librdkafka/src/rdkafka_broker.c:3512 #8 0x00000000004be976 in _thrd_wrapper_function (aArg=) at ../../../Shared/librdkafka/src/tinycthread.c:624 #9 0x00000000004e0ebb in start_thread (arg=0x7fffd1ffb700) at pthread_create.c:463 #10 0x0000000000798f5f in clone ()
The text was updated successfully, but these errors were encountered:
Our application uses both consumer and producer instances simultaneously, but we create them one at a time from the same thread - the librdkafka code uses its own threads for all the hard work. Maybe serialising the startup would work around any thread safety issue in getaddrinfo.
Description
I have made an executable that creates one rd_kafka_t as producer and one as consumer in separate threads. When using only one at a time, they work correctly. When I create both at the same time, the executable crashes on the second call to rd_kafka_brokers_add(). I'm only adding a single broker but I do it once for each rd_kafka_t.
I've tried setting the broker via "bootstrap.servers" and that has the same effect.
The crash occurs under rd_kafka_broker_thread_main() and getaddrinfo() in internal_getent() (see entire callstack below.)
I'm unsure what else to try. Any help or tips appreciated.
Checklist
0x00007ffff0131448 in internal_getent (stream=stream@entry=0x7ffff002e670, result=result@entry=0x7fffd1ff8900, buffer=buffer@entry=0x7fffd1ff8d10 "",
buflen=buflen@entry=1024, errnop=errnop@entry=0x7fffd1ffb6b0, herrnop=herrnop@entry=0x7fffd1ffb6e8, af=0, flags=0) at nss_files/files-XXX.c:216
216 nss_files/files-XXX.c: No such file or directory.
(gdb) i stack
#0 0x00007ffff0131448 in internal_getent (stream=stream@entry=0x7ffff002e670, result=result@entry=0x7fffd1ff8900, buffer=buffer@entry=0x7fffd1ff8d10 "",
buflen=buflen@entry=1024, errnop=errnop@entry=0x7fffd1ffb6b0, herrnop=herrnop@entry=0x7fffd1ffb6e8, af=0, flags=0) at nss_files/files-XXX.c:216
#1 0x00007ffff01328bd in _nss_files_gethostbyname4_r (name=0x7fffd1ffa6a0 "xnode.second-bridge.net", pat=0x7fffd1ff8a88, buffer=0x7fffd1ff8d10 "", buflen=1024,
errnop=0x7fffd1ffb6b0, herrnop=0x7fffd1ffb6e8, ttlp=0x0) at nss_files/files-hosts.c:416
#2 0x0000000000791be5 in gaih_inet.constprop ()
#3 0x0000000000793b74 in getaddrinfo ()
#4 0x00000000004492ae in rd_getaddrinfo (nodesvc=, defsvc=0x7fffd1ffa7a0 "9092", flags=32, family=, socktype=,
protocol=, errstr=0x7fffd1ff9288) at ../../../Shared/librdkafka/src/rdaddr.c:168
#5 0x000000000046014a in rd_kafka_broker_resolve (rkb=) at ../../../Shared/librdkafka/src/rdkafka_broker.c:667
#6 rd_kafka_broker_connect (rkb=) at ../../../Shared/librdkafka/src/rdkafka_broker.c:1466
#7 rd_kafka_broker_thread_main (arg=0x7fffd8002dd0) at ../../../Shared/librdkafka/src/rdkafka_broker.c:3512
#8 0x00000000004be976 in _thrd_wrapper_function (aArg=) at ../../../Shared/librdkafka/src/tinycthread.c:624
#9 0x00000000004e0ebb in start_thread (arg=0x7fffd1ffb700) at pthread_create.c:463
#10 0x0000000000798f5f in clone ()
The text was updated successfully, but these errors were encountered: