Blizzard / Blizzard/node-rdkafka

Thread 15 "rdk:broker-1" received signal SIGSEGV, Segmentation fault.

Open
#1,054 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
JavaScript
Stars
2.2k
Forks
403
PR merge metrics
No merged PRs in 30d

Description

**Environment Information**
- OS Ubuntu container
- Node Version v18.15.0
- NPM Version 9.5.0
- C++ Toolchain gpp
- node-rdkafka version 2.18.0 latest

**Steps to Reproduce**

const consumer = new node_rdkafka_1.KafkaConsumer({
...options,
rebalance_cb: function (err, assignment) {
return (0, utils_1.onRebalance)(err, assignment, this, _this);
},
}, {
'auto.offset.reset': 'earliest',
});

dockerfile
***
RUN apt-get update && apt-get install -qq --no-install-recommends -y \
ca-certificates \
curl \
jq \
nano \
node-gyp \
build-essential \
python3 \
librdkafka-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
***

**node-rdkafka Configuration Settings**

option=> {
"group.id": "fi***",
"bootstrap.servers": "b***",
"security.protocol": "ssl",
"sasl.mechanisms": "SCRAM-SHA-512",
"sasl.username": "c***",
"sasl.password": "c***",
"client.id": "find",
"group.instance.id": "find",
"enable.auto.commit": true,
"max.in.flight": 5,
"allow.auto.create.topics": false,
"session.timeout.ms": 120000,
"heartbeat.interval.ms": 30000,
}

**Additional context**
i get this error

[c] PID:1 - 11/09/2023, 8:39:02 PM LOG [Fi] Start application listening on group:find url: ["b**"]
[New Thread 0x7fffde1fc700 (LWP 50168)]
[New Thread 0x7fffdd7fb700 (LWP 50169)]
[New Thread 0x7fffdcdfa700 (LWP 50170)]
[New Thread 0x7ffd43fff700 (LWP 50171)]
[New Thread 0x7ffd435fe700 (LWP 50172)]
--Type for more, q to quit, c to continue without paging--bt

Thread 16 "rdk:broker-1" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7ffd435fe700 (LWP 50172)]
0x00007fffecff32a3 in SSL_get_peer_certificate () from /usr/lib/x86_64-linux-gnu/libssl.so.1.1

(gdb) bt
#0 0x00007fffecff32a3 in SSL_get_peer_certificate () from /usr/lib/x86_64-linux-gnu/libssl.so.1.1
#1 0x00007fffed1fb409 in rd_kafka_transport_ssl_verify (rktrans=0x7ffd34005100) at rdkafka_ssl.c:582
#2 rd_kafka_transport_ssl_handshake (rktrans=rktrans@entry=0x7ffd34005100) at rdkafka_ssl.c:620
#3 0x00007fffed0c1190 in rd_kafka_transport_io_event (rktrans=rktrans@entry=0x7ffd34005100, events=events@entry=1,
socket_errstr=0x0) at rdkafka_transport.c:744
#4 0x00007fffed0c1e6c in rd_kafka_transport_io_serve (rktrans=0x7ffd34005100, rkq=, timeout_ms=)
at rdkafka_transport.c:1047
#5 0x00007fffed0a9fcc in rd_kafka_broker_ops_io_serve (rkb=rkb@entry=0x7ffd4c05bb50, abs_timeout=9630356814)
at rdkafka_broker.c:3568
#6 0x00007fffed0aa4f3 in rd_kafka_broker_consumer_serve (rkb=rkb@entry=0x7ffd4c05bb50, abs_timeout=abs_timeout@entry=9630356814)
at rdkafka_broker.c:4271
#7 0x00007fffed0aac89 in rd_kafka_broker_serve (rkb=rkb@entry=0x7ffd4c05bb50, timeout_ms=, timeout_ms@entry=1000)
at rdkafka_broker.c:4413
#8 0x00007fffed0ab155 in rd_kafka_broker_thread_main (arg=0x7ffd4c05bb50) at rdkafka_broker.c:4561
#9 0x00007ffff7c7af5a in start_thread (arg=) at pthread_create.c:474
#10 0x00007ffff7b9aa2f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

the segmentation fault is occurring within the SSL_get_peer_certificate function from the libssl library.

need your help thank in advance

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the crash in the supplied Ubuntu container with the shown node-rdkafka configuration and capture the GDB backtrace. Then inspect rdkafka_ssl.c around rd_kafka_transport_ssl_verify at line 582 and the SSL_get_peer_certificate call, along with the surrounding handshake path. Done means the same TLS consumer configuration no longer produces a segmentation fault.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
distributed-systems, networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.