Skip to content

Leaks handling member_id #5234

@HofiOne

Description

@HofiOne

On macOS ARM version

 brew info librdkafka
==> librdkafka: stable 2.12.1 (bottled), HEAD
Apache Kafka C/C++ library
https://github.com/confluentinc/librdkafka
Installed
/opt/homebrew/Cellar/librdkafka/2.12.1 (41 files, 10.3MB) *
  Poured from bottle using the formulae.brew.sh API on 2025-11-08 at 08:58:06
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/lib/librdkafka.rb
License: BSD-2-Clause
==> Dependencies
Build: pkgconf ✔
Required: lz4 ✔, lzlib ✔, openssl@3 ✔, zstd ✔
==> Options
--HEAD
	Install HEAD version
==> Analytics
install: 4,008 (30 days), 9,552 (90 days), 39,727 (365 days)
install-on-request: 2,525 (30 days), 6,024 (90 days), 27,764 (365 days)
build-error: 3 (30 days)

I can see leaking strings at exit (by a good chance related to the member_id) like:

Code Type:       ARM64
Platform:        macOS
Parent Process:  debugserver [46404]
Target Type:     live task

Date/Time:       2025-11-09 10:45:17.764 +0100
Launch Time:     2025-11-09 10:43:52.719 +0100
OS Version:      macOS 26.1 (25B78)
Report Version:  7
Analysis Tool:   /usr/bin/leaks

Physical footprint:         919.3M
Physical footprint (peak):  950.8M
Idle exit:                  untracked
----

leaks Report Version: 4.0, multi-line stacks
Process 46403: 9676 nodes malloced for 3721 KB
Process 46403: 6 leaks for 480 total leaked bytes.

STACK OF 4 INSTANCES OF 'ROOT LEAK: <malloc in rd_kafka_cgrp_op_serve>':
8   libsystem_pthread.dylib               0x1903f8ba8 thread_start + 8
7   libsystem_pthread.dylib               0x1903fdc08 _pthread_start + 136
6   librdkafka.1.dylib                    0x1072d4d4c _thrd_wrapper_function + 28
5   librdkafka.1.dylib                    0x10735aa50 rd_kafka_thread_main + 416
4   librdkafka.1.dylib                    0x107287c28 rd_kafka_q_serve0 + 808
3   librdkafka.1.dylib                    0x1072a2368 rd_kafka_cgrp_op_serve + 200
2   libsystem_c.dylib                     0x190296728 strndup + 72
1   libsystem_malloc.dylib                0x1902117d8 _malloc + 88
0   libsystem_malloc.dylib                0x190229f40 _malloc_zone_malloc_instrumented_or_legacy + 152
====
    4 (320 bytes) << TOTAL >>
      1 (80 bytes) ROOT LEAK: <malloc in rd_kafka_cgrp_op_serve 0x7870192c0> [80]  length: 57  "group-test-topic-189-00b9ffdc-843e-4510-84e8-29b4c9b74968"
      1 (80 bytes) ROOT LEAK: <malloc in rd_kafka_cgrp_op_serve 0x787019310> [80]  length: 57  "group-test-topic-189-3b48876e-666d-421f-acc5-4c71c98f40bf"
      1 (80 bytes) ROOT LEAK: <malloc in rd_kafka_cgrp_op_serve 0x787019360> [80]  length: 57  "group-test-topic-189-00b9ffdc-843e-4510-84e8-29b4c9b74968"
      1 (80 bytes) ROOT LEAK: <malloc in rd_kafka_cgrp_op_serve 0x787019400> [80]  length: 57  "group-test-topic-189-3b48876e-666d-421f-acc5-4c71c98f40bf"

STACK OF 2 INSTANCES OF 'ROOT LEAK: <malloc in rd_kafka_cgrp_op_serve>':
8   libsystem_pthread.dylib               0x1903f8ba8 thread_start + 8
7   libsystem_pthread.dylib               0x1903fdc08 _pthread_start + 136
6   librdkafka.1.dylib                    0x1072d4d4c _thrd_wrapper_function + 28
5   librdkafka.1.dylib                    0x10735aa50 rd_kafka_thread_main + 416
4   librdkafka.1.dylib                    0x107287c28 rd_kafka_q_serve0 + 808
3   librdkafka.1.dylib                    0x1072a2368 rd_kafka_cgrp_op_serve + 200
2   libsystem_c.dylib                     0x190296728 strndup + 72
1   libsystem_malloc.dylib                0x1902117d8 _malloc + 88
0   libsystem_malloc.dylib                0x190229f40 _malloc_zone_malloc_instrumented_or_legacy + 152
====
    2 (160 bytes) << TOTAL >>
      1 (80 bytes) ROOT LEAK: <malloc in rd_kafka_cgrp_op_serve 0x7870194a0> [80]  length: 57  "group-test-topic-189-a6cd5521-7745-4613-9ea3-3b147846b354"
      1 (80 bytes) ROOT LEAK: <malloc in rd_kafka_cgrp_op_serve 0x787019540> [80]  length: 57  "group-test-topic-189-a6cd5521-7745-4613-9ea3-3b147846b354"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions