librdkafka icon indicating copy to clipboard operation
librdkafka copied to clipboard

Chasing a segfault during termination in rdkafka-ruby

Open thijsc opened this issue 3 years ago • 0 comments

Description

We've been chasing a segfault that sometimes occurs in the rdkafka Ruby gem when exiting:

/home/semaphore/rdkafka-ruby/lib/rdkafka/native_kafka.rb:44: [BUG] Segmentation fault at 0x00007f4f0dffb9d0
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux]

-- Control frame information -----------------------------------------------
c:0062 p:---- s:0333 e:000332 CFUNC  :rd_kafka_destroy
c:0061 p:0044 s:0328 e:000327 METHOD /home/semaphore/rdkafka-ruby/lib/rdkafka/native_kafka.rb:44
c:0060 p:0003 s:0323 e:000322 BLOCK  /home/semaphore/rdkafka-ruby/lib/rdkafka/native_kafka.rb:29 [FINISH]
c:0059 p:---- s:0319 e:000318 CFUNC  :fork
c:0058 p:0022 s:0315 e:000314 BLOCK  /home/semaphore/rdkafka-ruby/spec/rdkafka/producer_spec.rb:461 [FINISH]
c:0057 p:---- s:0307 e:000306 CFUNC  :instance_exec

I believe I've followed the termination instructions. Can you give any hints on where we could look next to make this robust?

How to reproduce

The CI build for rdkafka-ruby fails about 25% of the time with a segfault. Full log of a run here.

Checklist

Please provide the following information:

  • [x] librdkafka version 1.9.2
  • [x] Apache Kafka version: Confluent 5.2.5
  • [x] librdkafka client configuration: Multiple configuration used
  • [x] Operating system: Ubuntu 18.04
  • [x] Provide logs - not relevant probably
  • [x] Provide broker log excerpts - not relevant probably
  • [ ] Critical issue

thijsc avatar Sep 16 '22 15:09 thijsc