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

HTTP API get_clients cause memleak of conn_param #471

Open
JaylinYu opened this issue Mar 23, 2023 · 1 comment
Open

HTTP API get_clients cause memleak of conn_param #471

JaylinYu opened this issue Mar 23, 2023 · 1 comment

Comments

@JaylinYu
Copy link
Member

==867197==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 512 byte(s) in 2 object(s) allocated from:
#0 0x7f8792eb4867 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:145
#1 0x557d46b43323 in nni_alloc /home/jaylin/Projects/EdgeComputing/nanomq/nng/src/platform/posix/posix_alloc.c:20
#2 0x557d46b11cf9 in nng_alloc /home/jaylin/Projects/EdgeComputing/nanomq/nng/src/nng.c:60
#3 0x557d46b66d80 in conn_param_alloc /home/jaylin/Projects/EdgeComputing/nanomq/nng/src/sp/protocol/mqtt/mqtt_parser.c:853
#4 0x557d46ea1bad in tcptran_pipe_nego_cb /home/jaylin/Projects/EdgeComputing/nanomq/nng/src/sp/transport/mqtt/broker_tcp.c:360
#5 0x557d46b3d74e in nni_taskq_thread /home/jaylin/Projects/EdgeComputing/nanomq/nng/src/core/taskq.c:50
#6 0x557d46b3eb06 in nni_thr_wrap /home/jaylin/Projects/EdgeComputing/nanomq/nng/src/core/thread.c:94
#7 0x557d46b47cbb in nni_plat_thr_main /home/jaylin/Projects/EdgeComputing/nanomq/nng/src/platform/posix/posix_thread.c:266
#8 0x7f8792694b42 in start_thread nptl/pthread_create.c:442

Indirect leak of 10 byte(s) in 2 object(s) allocated from:
#0 0x7f8792eb4867 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:145
#1 0x557d46b43323 in nni_alloc /home/jaylin/Projects/EdgeComputing/nanomq/nng/src/platform/posix/posix_alloc.c:20
#2 0x557d46b11cf9 in nng_alloc /home/jaylin/Projects/EdgeComputing/nanomq/nng/src/nng.c:60
#3 0x557d46b62383 in copyn_utf8_str /home/jaylin/Projects/EdgeComputing/nanomq/nng/src/sp/protocol/mqtt/mqtt_parser.c:238
#4 0x557d46b642a3 in conn_handler /home/jaylin/Projects/EdgeComputing/nanomq/nng/src/sp/protocol/mqtt/mqtt_parser.c:597
#5 0x557d46ea1c5f in tcptran_pipe_nego_cb /home/jaylin/Projects/EdgeComputing/nanomq/nng/src/sp/transport/mqtt/broker_tcp.c:363
#6 0x557d46b3d74e in nni_taskq_thread /home/jaylin/Projects/EdgeComputing/nanomq/nng/src/core/taskq.c:50
#7 0x557d46b3eb06 in nni_thr_wrap /home/jaylin/Projects/EdgeComputing/nanomq/nng/src/core/thread.c:94
#8 0x557d46b47cbb in nni_plat_thr_main /home/jaylin/Projects/EdgeComputing/nanomq/nng/src/platform/posix/posix_thread.c:266
#9 0x7f8792694b42 in start_thread nptl/pthread_create.c:442

Indirect leak of 10 byte(s) in 2 object(s) allocated from:
#0 0x7f8792eb4867 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:145
#1 0x557d46b43323 in nni_alloc /home/jaylin/Projects/EdgeComputing/nanomq/nng/src/platform/posix/posix_alloc.c:20
#2 0x557d46b11cf9 in nng_alloc /home/jaylin/Projects/EdgeComputing/nanomq/nng/src/nng.c:60
#3 0x557d46b62383 in copyn_utf8_str /home/jaylin/Projects/EdgeComputing/nanomq/nng/src/sp/protocol/mqtt/mqtt_parser.c:238
#4 0x557d46b64cb6 in conn_handler /home/jaylin/Projects/EdgeComputing/nanomq/nng/src/sp/protocol/mqtt/mqtt_parser.c:640
#5 0x557d46ea1c5f in tcptran_pipe_nego_cb /home/jaylin/Projects/EdgeComputing/nanomq/nng/src/sp/transport/mqtt/broker_tcp.c:363
#6 0x557d46b3d74e in nni_taskq_thread /home/jaylin/Projects/EdgeComputing/nanomq/nng/src/core/taskq.c:50
#7 0x557d46b3eb06 in nni_thr_wrap /home/jaylin/Projects/EdgeComputing/nanomq/nng/src/core/thread.c:94
#8 0x557d46b47cbb in nni_plat_thr_main /home/jaylin/Projects/EdgeComputing/nanomq/nng/src/platform/posix/posix_thread.c:266
#9 0x7f8792694b42 in start_thread nptl/pthread_create.c:442

Indirect leak of 8 byte(s) in 2 object(s) allocated from:
#0 0x7f8792eb4867 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:145
#1 0x557d46b43323 in nni_alloc /home/jaylin/Projects/EdgeComputing/nanomq/nng/src/platform/posix/posix_alloc.c:20
#2 0x557d46b11cf9 in nng_alloc /home/jaylin/Projects/EdgeComputing/nanomq/nng/src/nng.c:60
#3 0x557d46b62383 in copyn_utf8_str /home/jaylin/Projects/EdgeComputing/nanomq/nng/src/sp/protocol/mqtt/mqtt_parser.c:238
#4 0x557d46b65b14 in conn_handler /home/jaylin/Projects/EdgeComputing/nanomq/nng/src/sp/protocol/mqtt/mqtt_parser.c:712
#5 0x557d46ea1c5f in tcptran_pipe_nego_cb /home/jaylin/Projects/EdgeComputing/nanomq/nng/src/sp/transport/mqtt/broker_tcp.c:363
#6 0x557d46b3d74e in nni_taskq_thread /home/jaylin/Projects/EdgeComputing/nanomq/nng/src/core/taskq.c:50
#7 0x557d46b3eb06 in nni_thr_wrap /home/jaylin/Projects/EdgeComputing/nanomq/nng/src/core/thread.c:94
#8 0x557d46b47cbb in nni_plat_thr_main /home/jaylin/Projects/EdgeComputing/nanomq/nng/src/platform/posix/posix_thread.c:266
#9 0x7f8792694b42 in start_thread nptl/pthread_create.c:442

SUMMARY: AddressSanitizer: 540 byte(s) leaked in 8 allocation(s).

@ashamedbit
Copy link
Contributor

Is there a testcase or a command to reproduce this? I can try to fix it.

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

No branches or pull requests

3 participants