Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

consumer segfaulting when connecting to test.gcn.nasa.gov #17

Closed
blaufuss opened this issue Apr 17, 2023 · 4 comments · Fixed by #18
Closed

consumer segfaulting when connecting to test.gcn.nasa.gov #17

blaufuss opened this issue Apr 17, 2023 · 4 comments · Fixed by #18

Comments

@blaufuss
Copy link

Hi

Was trying to listen in on some testing messages I'm trying to generate and send from icecube.* but am having trouble with simply listening to the test instance.

This code
consumer = Consumer(client_id='XXX',
client_secret='XXX',
domain='test.gcn.nasa.gov')

Subscribe to topics and receive alerts

consumer.subscribe(['gcn.classic.text.ICECUBE_ASTROTRACK_BRONZE',
'gcn.classic.text.ICECUBE_ASTROTRACK_GOLD',
'gcn.classic.text.ICECUBE_CASCADE'])
while True:
for message in consumer.consume(timeout=1):
value = message.value()
print(value)

(when using credentials from test.gcn.nasa.gov)
segfaults (backtrace attached)

Similar code, without the "domain" setting and client_* from gcn.nasa.gov has worked fine

This is gcn-kafka 0.3.0, using Homebrew python (Mac OS 13.3.1,Python 3.11.3)

Anything I'm doing wrong?

gcn_kafka_crash.txt

@blaufuss
Copy link
Author

tried on a linux box as well, same result, with gdb output;
Starting program: /home/blaufuss/env3/bin/python test.py
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[Detaching after fork from child process 185623]
[New Thread 0x7ffff529b700 (LWP 185624)]
[New Thread 0x7fffeffff700 (LWP 185625)]
[New Thread 0x7ffff4a9a700 (LWP 185626)]
[New Thread 0x7fffef7fe700 (LWP 185627)]
[New Thread 0x7fffeeffd700 (LWP 185628)]
[New Thread 0x7fffee7fc700 (LWP 185629)]
[New Thread 0x7fffedffb700 (LWP 185630)]

Thread 1 "python" received signal SIGSEGV, Segmentation fault.
0x00007ffff6a72034 in rd_kafka_q_serve_rkmessages ()
from /home/blaufuss/env3/lib/python3.8/site-packages/confluent_kafka/../confluent_kafka.libs/librdkafka-e24e6ccd.so.1

HTH

@lpsinger
Copy link
Member

This is due to a known issue in the latest version of librdkafka/confluent-kafka-python: confluentinc/librdkafka#4245

As a workaround, install the previous version of confluent-kafka:

pip install 'confluent-kafka==2.0.2'

lpsinger added a commit to lpsinger/gcn-kafka-python that referenced this issue Apr 18, 2023
Work around a segfault that was introduced in
librdkafka/confluent-kafka-python 2.1.0 by disallowing that version
as a dependency.

See confluentinc/librdkafka#4245.

Fixes nasa-gcn#17.
lpsinger added a commit that referenced this issue Apr 18, 2023
Work around a segfault that was introduced in
librdkafka/confluent-kafka-python 2.1.0 by disallowing that version
as a dependency.

See confluentinc/librdkafka#4245.

Fixes #17.
@lpsinger
Copy link
Member

@blaufuss, as an alternative workaround, you can just update to the latest version of gcn-kafka-python:

pip install --upgrade gcn-kafka

@blaufuss
Copy link
Author

Thanks fixed the seg faults.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants