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

Issue with running nanomq 0.20.5 on 32bit armv7a architecture #1506

Closed
destroyer5656 opened this issue Oct 26, 2023 · 14 comments
Closed

Issue with running nanomq 0.20.5 on 32bit armv7a architecture #1506

destroyer5656 opened this issue Oct 26, 2023 · 14 comments
Assignees
Labels

Comments

@destroyer5656
Copy link

destroyer5656 commented Oct 26, 2023

Describe the bug
Seeing issues with nanomq starting as a zombie process when built for this architecture, seems to work on 64bit arm environments but not for 32bit arm environment.

Expected behavior

nanomq should start up not as a zombie process, and should be killable.

Actual Behavior

nanomq never starts up successfully

To Reproduce

If possible include actual reproduction test code here.
Minimal C test cases are perferred.

Environment Details

  • NanoMQ version
  • 0.20.5
  • Operating system and version
  • Linux imx6ull 5.4.70-2.3.0 1 PREEMPT Fri Aug 11 07:46:10 UTC 2023 armv7l armv7l armv7l GNU/Linux
  • Compiler and language used

nanomq old_config file has:
websocket.enable = false
enable_ipc_internal = false

compiler:
armv7a_gcc_6_5_0

binary:
/usr/bin/nanomq: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 2.6.32, BuildID[sha1]=8563969b188aac30e2eed2df45bbf3bb2cfdbbfc, stripped

testing scenario
Using on a armv7a embedded device, we also have a aarch64 device that compiles successfully and runs properly on the new release.

Client SDK
We are using AWS IOT core on the other side.

If possible include the mqtt sdk you used to connect to nanomq
Minimal C test cases are perferred.

Additional context
Add any other context about the problem here.

Valgrind output when running:

root@imx6ull~# valgrind --leak-check=full nanomq start --url nmq-tcp://127.0.0.1:1234 --old_conf .nanomq_config.conf
==16633== Memcheck, a memory error detector
==16633== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==16633== Using Valgrind-3.15.0 and LibVEX; rerun with -h for copyright info
==16633== Command: nanomq start --url nmq-tcp://127.0.0.1:1234 --old_conf ./nanomq_config.conf
==16633==
==16633== Conditional jump or move depends on uninitialised value(s)
==16633== at 0x31D0A: ??? (in /usr/bin/nanomq)
==16633==
==16633== Conditional jump or move depends on uninitialised value(s)
==16633== at 0x481A570: calloc (vg_replace_malloc.c:762)
==16633== by 0x31D31: ??? (in /usr/bin/nanomq)
==16633==
==16633== Conditional jump or move depends on uninitialised value(s)
==16633== at 0x481BE94: strncpy (vg_replace_strmem.c:552)
==16633== by 0x31D3B: ??? (in /usr/bin/nanomq)
==16633==
==16633== Conditional jump or move depends on uninitialised value(s)
==16633== at 0x481BEC0: strncpy (vg_replace_strmem.c:552)
==16633== by 0x31D3B: ??? (in /usr/bin/nanomq)
==16633==
==16633== Conditional jump or move depends on uninitialised value(s)
==16633== at 0x481BF10: strncpy (vg_replace_strmem.c:552)
==16633== by 0x31D3B: ??? (in /usr/bin/nanomq)
==16633==
==16633== Conditional jump or move depends on uninitialised value(s)
==16633== at 0x481BF34: strncpy (vg_replace_strmem.c:552)
==16633== by 0x31D3B: ??? (in /usr/bin/nanomq)
==16633==
==16633== Conditional jump or move depends on uninitialised value(s)
==16633== at 0x328CC: ??? (in /usr/bin/nanomq)
==16633==
==16633== Conditional jump or move depends on uninitialised value(s)
==16633== at 0x481A570: calloc (vg_replace_malloc.c:762)
==16633== by 0x328F3: ??? (in /usr/bin/nanomq)
==16633==
==16633== Conditional jump or move depends on uninitialised value(s)
==16633== at 0x481BE94: strncpy (vg_replace_strmem.c:552)
==16633== by 0x328FD: ??? (in /usr/bin/nanomq)
==16633==
==16633== Conditional jump or move depends on uninitialised value(s)
==16633== at 0x481BEC0: strncpy (vg_replace_strmem.c:552)
==16633== by 0x328FD: ??? (in /usr/bin/nanomq)
==16633==
==16633== Conditional jump or move depends on uninitialised value(s)
==16633== at 0x481BF10: strncpy (vg_replace_strmem.c:552)
==16633== by 0x328FD: ??? (in /usr/bin/nanomq)
==16633==
==16633== Conditional jump or move depends on uninitialised value(s)
==16633== at 0x481BF34: strncpy (vg_replace_strmem.c:552)
==16633== by 0x328FD: ??? (in /usr/bin/nanomq)
==16633==
==16633== Conditional jump or move depends on uninitialised value(s)
==16633== at 0x31A4C: ??? (in /usr/bin/nanomq)
==16633==
==16633== Conditional jump or move depends on uninitialised value(s)
==16633== at 0x34F60: ??? (in /usr/bin/nanomq)
==16633==
==16633== Conditional jump or move depends on uninitialised value(s)
==16633== at 0x481A570: calloc (vg_replace_malloc.c:762)
==16633== by 0x34F8F: ??? (in /usr/bin/nanomq)
==16633==
==16633== Conditional jump or move depends on uninitialised value(s)
==16633== at 0x481BE94: strncpy (vg_replace_strmem.c:552)
==16633== by 0x34F99: ??? (in /usr/bin/nanomq)
==16633==
==16633== Conditional jump or move depends on uninitialised value(s)
==16633== at 0x481BEC0: strncpy (vg_replace_strmem.c:552)
==16633== by 0x34F99: ??? (in /usr/bin/nanomq)
==16633==
==16633== Conditional jump or move depends on uninitialised value(s)
==16633== at 0x481BF10: strncpy (vg_replace_strmem.c:552)
==16633== by 0x34F99: ??? (in /usr/bin/nanomq)
==16633==
==16633== Conditional jump or move depends on uninitialised value(s)
==16633== at 0x481BF34: strncpy (vg_replace_strmem.c:552)
==16633== by 0x34F99: ??? (in /usr/bin/nanomq)
==16633==
NanoMQ Broker is started successfully!
==16633== Thread 8 nng:task:
==16633== Invalid read of size 1
==16633== at 0x481BAD8: strlen (vg_replace_strmem.c:461)
==16633== by 0x460D599F: __vfprintf_internal (vfprintf-internal.c:1688)
==16633== by 0x460E0FAD: __vsnprintf_internal (vsnprintf.c:114)
==16633== by 0x460C9D4D: snprintf (snprintf.c:31)
==16633== by 0x21097: ??? (in /usr/bin/nanomq)
==16633== Address 0x18b is not stack'd, malloc'd or (recently) free'd
==16633==
==16633==
==16633== Process terminating with default action of signal 11 (SIGSEGV)
==16633== Access not within mapped region at address 0x18B
==16633== at 0x481BAD8: strlen (vg_replace_strmem.c:461)
==16633== by 0x460D599F: __vfprintf_internal (vfprintf-internal.c:1688)
==16633== by 0x460E0FAD: __vsnprintf_internal (vsnprintf.c:114)
==16633== by 0x460C9D4D: snprintf (snprintf.c:31)
==16633== by 0x21097: ??? (in /usr/bin/nanomq)
==16633== If you believe this happened as a result of a stack
==16633== overflow in your program's main thread (unlikely but
==16633== possible), you can try to increase the size of the
==16633== main thread stack using the --main-stacksize= flag.
==16633== The main thread stack size used in this run was 8388608.
==16633==
==16633== HEAP SUMMARY:
==16633== in use at exit: 21,868 bytes in 99 blocks
==16633== total heap usage: 314 allocs, 215 frees, 146,042 bytes allocated
==16633==
==16633== Thread 1:
==16633== 1,440 bytes in 10 blocks are possibly lost in loss record 44 of 46
==16633== at 0x481A5C0: calloc (vg_replace_malloc.c:762)
==16633== by 0x4606CE11: allocate_dtv (dl-tls.c:286)
==16633== by 0x4606D423: _dl_allocate_tls (dl-tls.c:532)
==16633== by 0x461976BB: allocate_stack (allocatestack.c:622)
==16633== by 0x461976BB: pthread_create@@GLIBC_2.4 (pthread_create.c:662)
==16633== by 0x1E23F: ??? (in /usr/bin/nanomq)
==16633==
==16633== LEAK SUMMARY:
==16633== definitely lost: 0 bytes in 0 blocks
==16633== indirectly lost: 0 bytes in 0 blocks
==16633== possibly lost: 1,440 bytes in 10 blocks
==16633== still reachable: 20,428 bytes in 89 blocks
==16633== suppressed: 0 bytes in 0 blocks
==16633== Reachable blocks (those to which a pointer was found) are not shown.
==16633== To see them, rerun with: --leak-check=full --show-leak-kinds=all
==16633==
==16633== Use --track-origins=yes to see where uninitialised values come from
==16633== For lists of detected and suppressed errors, rerun with: -s
==16633== ERROR SUMMARY: 1002 errors from 21 contexts (suppressed: 0 from 0)
Segmentation fault``

root@imx6ull:~# valgrind --leak-check=full --track-origins=yes nanomq start --url nmq-tcp://127.0.0.1:1234 --old_conf ./nanomq_config.conf
==1318== Memcheck, a memory error detector
==1318== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==1318== Using Valgrind-3.15.0 and LibVEX; rerun with -h for copyright info
==1318== Command: nanomq start --url nmq-tcp://127.0.0.1:1234 --old_conf /nanomq_config.conf
==1318==
==1318== Conditional jump or move depends on uninitialised value(s)
==1318== at 0x31D0A: ??? (in /usr/bin/nanomq)
==1318== Uninitialised value was created by a heap allocation
==1318== at 0x48179A0: malloc (vg_replace_malloc.c:309)
==1318== by 0x49E5BD1: getdelim (iogetdelim.c:62)
==1318== by 0x3AE19: ??? (in /usr/bin/nanomq)
==1318==
==1318== Conditional jump or move depends on uninitialised value(s)
==1318== at 0x481A570: calloc (vg_replace_malloc.c:762)
==1318== by 0x31D31: ??? (in /usr/bin/nanomq)
==1318== Uninitialised value was created by a heap allocation
==1318== at 0x48179A0: malloc (vg_replace_malloc.c:309)
==1318== by 0x49E5BD1: getdelim (iogetdelim.c:62)
==1318== by 0x3AE19: ??? (in /usr/bin/nanomq)
==1318==
==1318== Conditional jump or move depends on uninitialised value(s)
==1318== at 0x481BE94: strncpy (vg_replace_strmem.c:552)
==1318== by 0x31D3B: ??? (in /usr/bin/nanomq)
==1318== Uninitialised value was created by a heap allocation
==1318== at 0x48179A0: malloc (vg_replace_malloc.c:309)
==1318== by 0x49E5BD1: getdelim (iogetdelim.c:62)
==1318== by 0x3AE19: ??? (in /usr/bin/nanomq)
==1318==
==1318== Conditional jump or move depends on uninitialised value(s)
==1318== at 0x481BEC0: strncpy (vg_replace_strmem.c:552)
==1318== by 0x31D3B: ??? (in /usr/bin/nanomq)
==1318== Uninitialised value was created by a heap allocation
==1318== at 0x48179A0: malloc (vg_replace_malloc.c:309)
==1318== by 0x49E5BD1: getdelim (iogetdelim.c:62)
==1318== by 0x3AE19: ??? (in /usr/bin/nanomq)
==1318==
==1318== Conditional jump or move depends on uninitialised value(s)
==1318== at 0x481BF10: strncpy (vg_replace_strmem.c:552)
==1318== by 0x31D3B: ??? (in /usr/bin/nanomq)
==1318== Uninitialised value was created by a heap allocation
==1318== at 0x48179A0: malloc (vg_replace_malloc.c:309)
==1318== by 0x49E5BD1: getdelim (iogetdelim.c:62)
==1318== by 0x3AE19: ??? (in /usr/bin/nanomq)
==1318==
==1318== Conditional jump or move depends on uninitialised value(s)
==1318== at 0x481BF34: strncpy (vg_replace_strmem.c:552)
==1318== by 0x31D3B: ??? (in /usr/bin/nanomq)
==1318== Uninitialised value was created by a heap allocation
==1318== at 0x48179A0: malloc (vg_replace_malloc.c:309)
==1318== by 0x49E5BD1: getdelim (iogetdelim.c:62)
==1318== by 0x3AE19: ??? (in /usr/bin/nanomq)
==1318==
==1318== Conditional jump or move depends on uninitialised value(s)
==1318== at 0x328CC: ??? (in /usr/bin/nanomq)
==1318== Uninitialised value was created by a heap allocation
==1318== at 0x48179A0: malloc (vg_replace_malloc.c:309)
==1318== by 0x49E5BD1: getdelim (iogetdelim.c:62)
==1318== by 0x3AE19: ??? (in /usr/bin/nanomq)
==1318==
==1318== Conditional jump or move depends on uninitialised value(s)
==1318== at 0x481A570: calloc (vg_replace_malloc.c:762)
==1318== by 0x328F3: ??? (in /usr/bin/nanomq)
==1318== Uninitialised value was created by a heap allocation
==1318== at 0x48179A0: malloc (vg_replace_malloc.c:309)
==1318== by 0x49E5BD1: getdelim (iogetdelim.c:62)
==1318== by 0x3AE19: ??? (in /usr/bin/nanomq)
==1318==
==1318== Conditional jump or move depends on uninitialised value(s)
==1318== at 0x481BE94: strncpy (vg_replace_strmem.c:552)
==1318== by 0x328FD: ??? (in /usr/bin/nanomq)
==1318== Uninitialised value was created by a heap allocation
==1318== at 0x48179A0: malloc (vg_replace_malloc.c:309)
==1318== by 0x49E5BD1: getdelim (iogetdelim.c:62)
==1318== by 0x3AE19: ??? (in /usr/bin/nanomq)
==1318==
==1318== Conditional jump or move depends on uninitialised value(s)
==1318== at 0x481BEC0: strncpy (vg_replace_strmem.c:552)
==1318== by 0x328FD: ??? (in /usr/bin/nanomq)
==1318== Uninitialised value was created by a heap allocation
==1318== at 0x48179A0: malloc (vg_replace_malloc.c:309)
==1318== by 0x49E5BD1: getdelim (iogetdelim.c:62)
==1318== by 0x3AE19: ??? (in /usr/bin/nanomq)
==1318==
==1318== Conditional jump or move depends on uninitialised value(s)
==1318== at 0x481BF10: strncpy (vg_replace_strmem.c:552)
==1318== by 0x328FD: ??? (in /usr/bin/nanomq)
==1318== Uninitialised value was created by a heap allocation
==1318== at 0x48179A0: malloc (vg_replace_malloc.c:309)
==1318== by 0x49E5BD1: getdelim (iogetdelim.c:62)
==1318== by 0x3AE19: ??? (in /usr/bin/nanomq)
==1318==
==1318== Conditional jump or move depends on uninitialised value(s)
==1318== at 0x481BF34: strncpy (vg_replace_strmem.c:552)
==1318== by 0x328FD: ??? (in /usr/bin/nanomq)
==1318== Uninitialised value was created by a heap allocation
==1318== at 0x48179A0: malloc (vg_replace_malloc.c:309)
==1318== by 0x49E5BD1: getdelim (iogetdelim.c:62)
==1318== by 0x3AE19: ??? (in /usr/bin/nanomq)
==1318==
==1318== Conditional jump or move depends on uninitialised value(s)
==1318== at 0x31A4C: ??? (in /usr/bin/nanomq)
==1318== Uninitialised value was created by a heap allocation
==1318== at 0x48179A0: malloc (vg_replace_malloc.c:309)
==1318== by 0x49E5BD1: getdelim (iogetdelim.c:62)
==1318== by 0x3AE19: ??? (in /usr/bin/nanomq)
==1318==
==1318== Conditional jump or move depends on uninitialised value(s)
==1318== at 0x34F60: ??? (in /usr/bin/nanomq)
==1318== Uninitialised value was created by a heap allocation
==1318== at 0x48179A0: malloc (vg_replace_malloc.c:309)
==1318== by 0x49E5BD1: getdelim (iogetdelim.c:62)
==1318== by 0x3AE19: ??? (in /usr/bin/nanomq)
==1318==
==1318== Conditional jump or move depends on uninitialised value(s)
==1318== at 0x481A570: calloc (vg_replace_malloc.c:762)
==1318== by 0x34F8F: ??? (in /usr/bin/nanomq)
==1318== Uninitialised value was created by a heap allocation
==1318== at 0x48179A0: malloc (vg_replace_malloc.c:309)
==1318== by 0x49E5BD1: getdelim (iogetdelim.c:62)
==1318== by 0x3AE19: ??? (in /usr/bin/nanomq)
==1318==
==1318== Conditional jump or move depends on uninitialised value(s)
==1318== at 0x481BE94: strncpy (vg_replace_strmem.c:552)
==1318== by 0x34F99: ??? (in /usr/bin/nanomq)
==1318== Uninitialised value was created by a heap allocation
==1318== at 0x48179A0: malloc (vg_replace_malloc.c:309)
==1318== by 0x49E5BD1: getdelim (iogetdelim.c:62)
==1318== by 0x3AE19: ??? (in /usr/bin/nanomq)
==1318==
==1318== Conditional jump or move depends on uninitialised value(s)
==1318== at 0x481BEC0: strncpy (vg_replace_strmem.c:552)
==1318== by 0x34F99: ??? (in /usr/bin/nanomq)
==1318== Uninitialised value was created by a heap allocation
==1318== at 0x48179A0: malloc (vg_replace_malloc.c:309)
==1318== by 0x49E5BD1: getdelim (iogetdelim.c:62)
==1318== by 0x3AE19: ??? (in /usr/bin/nanomq)
==1318==
==1318== Conditional jump or move depends on uninitialised value(s)
==1318== at 0x481BF10: strncpy (vg_replace_strmem.c:552)
==1318== by 0x34F99: ??? (in /usr/bin/nanomq)
==1318== Uninitialised value was created by a heap allocation
==1318== at 0x48179A0: malloc (vg_replace_malloc.c:309)
==1318== by 0x49E5BD1: getdelim (iogetdelim.c:62)
==1318== by 0x3AE19: ??? (in /usr/bin/nanomq)
==1318==
==1318== Conditional jump or move depends on uninitialised value(s)
==1318== at 0x481BF34: strncpy (vg_replace_strmem.c:552)
==1318== by 0x34F99: ??? (in /usr/bin/nanomq)
==1318== Uninitialised value was created by a heap allocation
==1318== at 0x48179A0: malloc (vg_replace_malloc.c:309)
==1318== by 0x49E5BD1: getdelim (iogetdelim.c:62)
==1318== by 0x3AE19: ??? (in /usr/bin/nanomq)
==1318==
NanoMQ Broker is started successfully!
==1318== Thread 8 nng:task:
==1318== Invalid read of size 1
==1318== at 0x481BAD8: strlen (vg_replace_strmem.c:461)
==1318== by 0x49DF99F: __vfprintf_internal (vfprintf-internal.c:1688)
==1318== by 0x49EAFAD: __vsnprintf_internal (vsnprintf.c:114)
==1318== by 0x49D3D4D: snprintf (snprintf.c:31)
==1318== by 0x21097: ??? (in /usr/bin/nanomq)
==1318== Address 0x18b is not stack'd, malloc'd or (recently) free'd
==1318==
==1318==
==1318== Process terminating with default action of signal 11 (SIGSEGV)
==1318== Access not within mapped region at address 0x18B
==1318== at 0x481BAD8: strlen (vg_replace_strmem.c:461)
==1318== by 0x49DF99F: __vfprintf_internal (vfprintf-internal.c:1688)
==1318== by 0x49EAFAD: __vsnprintf_internal (vsnprintf.c:114)
==1318== by 0x49D3D4D: snprintf (snprintf.c:31)
==1318== by 0x21097: ??? (in /usr/bin/nanomq)
==1318== If you believe this happened as a result of a stack
==1318== overflow in your program's main thread (unlikely but
==1318== possible), you can try to increase the size of the
==1318== main thread stack using the --main-stacksize= flag.
==1318== The main thread stack size used in this run was 8388608.
==1318==
==1318== HEAP SUMMARY:
==1318== in use at exit: 21,868 bytes in 99 blocks
==1318== total heap usage: 314 allocs, 215 frees, 146,042 bytes allocated
==1318==
==1318== Thread 1:
==1318== 1,440 bytes in 10 blocks are possibly lost in loss record 44 of 46
==1318== at 0x481A5C0: calloc (vg_replace_malloc.c:762)
==1318== by 0x4606CE11: allocate_dtv (dl-tls.c:286)
==1318== by 0x4606D423: _dl_allocate_tls (dl-tls.c:532)
==1318== by 0x497C6BB: allocate_stack (allocatestack.c:622)
==1318== by 0x497C6BB: pthread_create@@GLIBC_2.4 (pthread_create.c:662)
==1318== by 0x1E23F: ??? (in /usr/bin/nanomq)
==1318==
==1318== LEAK SUMMARY:
==1318== definitely lost: 0 bytes in 0 blocks
==1318== indirectly lost: 0 bytes in 0 blocks
==1318== possibly lost: 1,440 bytes in 10 blocks
==1318== still reachable: 20,428 bytes in 89 blocks
==1318== suppressed: 0 bytes in 0 blocks
==1318== Reachable blocks (those to which a pointer was found) are not shown.
==1318== To see them, rerun with: --leak-check=full --show-leak-kinds=all
==1318==
==1318== For lists of detected and suppressed errors, rerun with: -s
==1318== ERROR SUMMARY: 1002 errors from 21 contexts (suppressed: 0 from 0)
Segmentation fault

@destroyer5656
Copy link
Author

destroyer5656 commented Oct 26, 2023

More valgrind output with more flags:
root@imx6ull:~# valgrind -s --leak-check=full --leak-resolution=high --show-leak-kinds=all --track-origins=yes nanomq start --url nmq-tcp://127.0.0.1:1234 --old_conf /nanomq_config.conf
==1381== Memcheck, a memory error detector
==1381== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==1381== Using Valgrind-3.15.0 and LibVEX; rerun with -h for copyright info
==1381== Command: nanomq start --url nmq-tcp://127.0.0.1:1234 --old_conf /nanomq_config.conf
==1381==
==1381== Conditional jump or move depends on uninitialised value(s)
==1381== at 0x31D0A: ??? (in /usr/bin/nanomq)
==1381== Uninitialised value was created by a heap allocation
==1381== at 0x48179A0: malloc (vg_replace_malloc.c:309)
==1381== by 0x49E5BD1: getdelim (iogetdelim.c:62)
==1381== by 0x3AE19: ??? (in /usr/bin/nanomq)
==1381==
==1381== Conditional jump or move depends on uninitialised value(s)
==1381== at 0x481A570: calloc (vg_replace_malloc.c:762)
==1381== by 0x31D31: ??? (in /usr/bin/nanomq)
==1381== Uninitialised value was created by a heap allocation
==1381== at 0x48179A0: malloc (vg_replace_malloc.c:309)
==1381== by 0x49E5BD1: getdelim (iogetdelim.c:62)
==1381== by 0x3AE19: ??? (in /usr/bin/nanomq)
==1381==
==1381== Conditional jump or move depends on uninitialised value(s)
==1381== at 0x481BE94: strncpy (vg_replace_strmem.c:552)
==1381== by 0x31D3B: ??? (in /usr/bin/nanomq)
==1381== Uninitialised value was created by a heap allocation
==1381== at 0x48179A0: malloc (vg_replace_malloc.c:309)
==1381== by 0x49E5BD1: getdelim (iogetdelim.c:62)
==1381== by 0x3AE19: ??? (in /usr/bin/nanomq)
==1381==
==1381== Conditional jump or move depends on uninitialised value(s)
==1381== at 0x481BEC0: strncpy (vg_replace_strmem.c:552)
==1381== by 0x31D3B: ??? (in /usr/bin/nanomq)
==1381== Uninitialised value was created by a heap allocation
==1381== at 0x48179A0: malloc (vg_replace_malloc.c:309)
==1381== by 0x49E5BD1: getdelim (iogetdelim.c:62)
==1381== by 0x3AE19: ??? (in /usr/bin/nanomq)
==1381==
==1381== Conditional jump or move depends on uninitialised value(s)
==1381== at 0x481BF10: strncpy (vg_replace_strmem.c:552)
==1381== by 0x31D3B: ??? (in /usr/bin/nanomq)
==1381== Uninitialised value was created by a heap allocation
==1381== at 0x48179A0: malloc (vg_replace_malloc.c:309)
==1381== by 0x49E5BD1: getdelim (iogetdelim.c:62)
==1381== by 0x3AE19: ??? (in /usr/bin/nanomq)
==1381==
==1381== Conditional jump or move depends on uninitialised value(s)
==1381== at 0x481BF34: strncpy (vg_replace_strmem.c:552)
==1381== by 0x31D3B: ??? (in /usr/bin/nanomq)
==1381== Uninitialised value was created by a heap allocation
==1381== at 0x48179A0: malloc (vg_replace_malloc.c:309)
==1381== by 0x49E5BD1: getdelim (iogetdelim.c:62)
==1381== by 0x3AE19: ??? (in /usr/bin/nanomq)
==1381==
==1381== Conditional jump or move depends on uninitialised value(s)
==1381== at 0x328CC: ??? (in /usr/bin/nanomq)
==1381== Uninitialised value was created by a heap allocation
==1381== at 0x48179A0: malloc (vg_replace_malloc.c:309)
==1381== by 0x49E5BD1: getdelim (iogetdelim.c:62)
==1381== by 0x3AE19: ??? (in /usr/bin/nanomq)
==1381==
==1381== Conditional jump or move depends on uninitialised value(s)
==1381== at 0x481A570: calloc (vg_replace_malloc.c:762)
==1381== by 0x328F3: ??? (in /usr/bin/nanomq)
==1381== Uninitialised value was created by a heap allocation
==1381== at 0x48179A0: malloc (vg_replace_malloc.c:309)
==1381== by 0x49E5BD1: getdelim (iogetdelim.c:62)
==1381== by 0x3AE19: ??? (in /usr/bin/nanomq)
==1381==
==1381== Conditional jump or move depends on uninitialised value(s)
==1381== at 0x481BE94: strncpy (vg_replace_strmem.c:552)
==1381== by 0x328FD: ??? (in /usr/bin/nanomq)
==1381== Uninitialised value was created by a heap allocation
==1381== at 0x48179A0: malloc (vg_replace_malloc.c:309)
==1381== by 0x49E5BD1: getdelim (iogetdelim.c:62)
==1381== by 0x3AE19: ??? (in /usr/bin/nanomq)
==1381==
==1381== Conditional jump or move depends on uninitialised value(s)
==1381== at 0x481BEC0: strncpy (vg_replace_strmem.c:552)
==1381== by 0x328FD: ??? (in /usr/bin/nanomq)
==1381== Uninitialised value was created by a heap allocation
==1381== at 0x48179A0: malloc (vg_replace_malloc.c:309)
==1381== by 0x49E5BD1: getdelim (iogetdelim.c:62)
==1381== by 0x3AE19: ??? (in /usr/bin/nanomq)
==1381==
==1381== Conditional jump or move depends on uninitialised value(s)
==1381== at 0x481BF10: strncpy (vg_replace_strmem.c:552)
==1381== by 0x328FD: ??? (in /usr/bin/nanomq)
==1381== Uninitialised value was created by a heap allocation
==1381== at 0x48179A0: malloc (vg_replace_malloc.c:309)
==1381== by 0x49E5BD1: getdelim (iogetdelim.c:62)
==1381== by 0x3AE19: ??? (in /usr/bin/nanomq)
==1381==
==1381== Conditional jump or move depends on uninitialised value(s)
==1381== at 0x481BF34: strncpy (vg_replace_strmem.c:552)
==1381== by 0x328FD: ??? (in /usr/bin/nanomq)
==1381== Uninitialised value was created by a heap allocation
==1381== at 0x48179A0: malloc (vg_replace_malloc.c:309)
==1381== by 0x49E5BD1: getdelim (iogetdelim.c:62)
==1381== by 0x3AE19: ??? (in /usr/bin/nanomq)
==1381==
==1381== Conditional jump or move depends on uninitialised value(s)
==1381== at 0x31A4C: ??? (in /usr/bin/nanomq)
==1381== Uninitialised value was created by a heap allocation
==1381== at 0x48179A0: malloc (vg_replace_malloc.c:309)
==1381== by 0x49E5BD1: getdelim (iogetdelim.c:62)
==1381== by 0x3AE19: ??? (in /usr/bin/nanomq)
==1381==
==1381== Conditional jump or move depends on uninitialised value(s)
==1381== at 0x34F60: ??? (in /usr/bin/nanomq)
==1381== Uninitialised value was created by a heap allocation
==1381== at 0x48179A0: malloc (vg_replace_malloc.c:309)
==1381== by 0x49E5BD1: getdelim (iogetdelim.c:62)
==1381== by 0x3AE19: ??? (in /usr/bin/nanomq)
==1381==
==1381== Conditional jump or move depends on uninitialised value(s)
==1381== at 0x481A570: calloc (vg_replace_malloc.c:762)
==1381== by 0x34F8F: ??? (in /usr/bin/nanomq)
==1381== Uninitialised value was created by a heap allocation
==1381== at 0x48179A0: malloc (vg_replace_malloc.c:309)
==1381== by 0x49E5BD1: getdelim (iogetdelim.c:62)
==1381== by 0x3AE19: ??? (in /usr/bin/nanomq)
==1381==
==1381== Conditional jump or move depends on uninitialised value(s)
==1381== at 0x481BE94: strncpy (vg_replace_strmem.c:552)
==1381== by 0x34F99: ??? (in /usr/bin/nanomq)
==1381== Uninitialised value was created by a heap allocation
==1381== at 0x48179A0: malloc (vg_replace_malloc.c:309)
==1381== by 0x49E5BD1: getdelim (iogetdelim.c:62)
==1381== by 0x3AE19: ??? (in /usr/bin/nanomq)
==1381==
==1381== Conditional jump or move depends on uninitialised value(s)
==1381== at 0x481BEC0: strncpy (vg_replace_strmem.c:552)
==1381== by 0x34F99: ??? (in /usr/bin/nanomq)
==1381== Uninitialised value was created by a heap allocation
==1381== at 0x48179A0: malloc (vg_replace_malloc.c:309)
==1381== by 0x49E5BD1: getdelim (iogetdelim.c:62)
==1381== by 0x3AE19: ??? (in /usr/bin/nanomq)
==1381==
==1381== Conditional jump or move depends on uninitialised value(s)
==1381== at 0x481BF10: strncpy (vg_replace_strmem.c:552)
==1381== by 0x34F99: ??? (in /usr/bin/nanomq)
==1381== Uninitialised value was created by a heap allocation
==1381== at 0x48179A0: malloc (vg_replace_malloc.c:309)
==1381== by 0x49E5BD1: getdelim (iogetdelim.c:62)
==1381== by 0x3AE19: ??? (in /usr/bin/nanomq)
==1381==
==1381== Conditional jump or move depends on uninitialised value(s)
==1381== at 0x481BF34: strncpy (vg_replace_strmem.c:552)
==1381== by 0x34F99: ??? (in /usr/bin/nanomq)
==1381== Uninitialised value was created by a heap allocation
==1381== at 0x48179A0: malloc (vg_replace_malloc.c:309)
==1381== by 0x49E5BD1: getdelim (iogetdelim.c:62)
==1381== by 0x3AE19: ??? (in /usr/bin/nanomq)
==1381==
NanoMQ Broker is started successfully!
==1381== Thread 8 nng:task:
==1381== Invalid read of size 1
==1381== at 0x481BAD8: strlen (vg_replace_strmem.c:461)
==1381== by 0x49DF99F: __vfprintf_internal (vfprintf-internal.c:1688)
==1381== by 0x49EAFAD: __vsnprintf_internal (vsnprintf.c:114)
==1381== by 0x49D3D4D: snprintf (snprintf.c:31)
==1381== by 0x21097: ??? (in /usr/bin/nanomq)
==1381== Address 0x18b is not stack'd, malloc'd or (recently) free'd
==1381==
==1381==
==1381== Process terminating with default action of signal 11 (SIGSEGV)
==1381== Access not within mapped region at address 0x18B
==1381== at 0x481BAD8: strlen (vg_replace_strmem.c:461)
==1381== by 0x49DF99F: __vfprintf_internal (vfprintf-internal.c:1688)
==1381== by 0x49EAFAD: __vsnprintf_internal (vsnprintf.c:114)
==1381== by 0x49D3D4D: snprintf (snprintf.c:31)
==1381== by 0x21097: ??? (in /usr/bin/nanomq)
==1381== If you believe this happened as a result of a stack
==1381== overflow in your program's main thread (unlikely but
==1381== possible), you can try to increase the size of the
==1381== main thread stack using the --main-stacksize= flag.
==1381== The main thread stack size used in this run was 8388608.
==1381==
==1381== HEAP SUMMARY:
==1381== in use at exit: 21,868 bytes in 99 blocks
==1381== total heap usage: 314 allocs, 215 frees, 146,042 bytes allocated
==1381==
==1381== Thread 1:
==1381== 1 bytes in 1 blocks are still reachable in loss record 1 of 46
==1381== at 0x48179A0: malloc (vg_replace_malloc.c:309)
==1381== by 0x1D3DF: ??? (in /usr/bin/nanomq)
==1381==
==1381== 4 bytes in 1 blocks are still reachable in loss record 2 of 46
==1381== at 0x481A5C0: calloc (vg_replace_malloc.c:762)
==1381== by 0x16E2D: ??? (in /usr/bin/nanomq)
==1381==
==1381== 8 bytes in 1 blocks are still reachable in loss record 3 of 46
==1381== at 0x481A5C0: calloc (vg_replace_malloc.c:762)
==1381== by 0x13F6B: ??? (in /usr/bin/nanomq)
==1381==
==1381== 8 bytes in 1 blocks are still reachable in loss record 4 of 46
==1381== at 0x48179A0: malloc (vg_replace_malloc.c:309)
==1381== by 0x1CE6D: ??? (in /usr/bin/nanomq)
==1381==
==1381== 8 bytes in 2 blocks are still reachable in loss record 5 of 46
==1381== at 0x48179A0: malloc (vg_replace_malloc.c:309)
==1381== by 0x13FFF: ??? (in /usr/bin/nanomq)
==1381==
==1381== 10 bytes in 1 blocks are still reachable in loss record 6 of 46
==1381== at 0x48179A0: malloc (vg_replace_malloc.c:309)
==1381== by 0x1D435: ??? (in /usr/bin/nanomq)
==1381==
==1381== 12 bytes in 1 blocks are still reachable in loss record 7 of 46
==1381== at 0x481A5C0: calloc (vg_replace_malloc.c:762)
==1381== by 0x19AFD: ??? (in /usr/bin/nanomq)
==1381==
==1381== 14 bytes in 5 blocks are still reachable in loss record 8 of 46
==1381== at 0x48179A0: malloc (vg_replace_malloc.c:309)
==1381== by 0x1AD4D: ??? (in /usr/bin/nanomq)
==1381==
==1381== 15 bytes in 1 blocks are still reachable in loss record 9 of 46
==1381== at 0x48179A0: malloc (vg_replace_malloc.c:309)
==1381== by 0x1CFA7: ??? (in /usr/bin/nanomq)
==1381==
==1381== 20 bytes in 2 blocks are still reachable in loss record 10 of 46
==1381== at 0x481A5C0: calloc (vg_replace_malloc.c:762)
==1381== by 0x44927: ??? (in /usr/bin/nanomq)
==1381==
==1381== 22 bytes in 2 blocks are still reachable in loss record 11 of 46
==1381== at 0x48179A0: malloc (vg_replace_malloc.c:309)
==1381== by 0x1FECB: ??? (in /usr/bin/nanomq)
==1381==
==1381== 28 bytes in 1 blocks are still reachable in loss record 12 of 46
==1381== at 0x481A5C0: calloc (vg_replace_malloc.c:762)
==1381== by 0x3C49F: ??? (in /usr/bin/nanomq)
==1381==
==1381== 28 bytes in 1 blocks are still reachable in loss record 13 of 46
==1381== at 0x481A5C0: calloc (vg_replace_malloc.c:762)
==1381== by 0x3B827: ??? (in /usr/bin/nanomq)
==1381==
==1381== 28 bytes in 1 blocks are still reachable in loss record 14 of 46
==1381== at 0x481A5C0: calloc (vg_replace_malloc.c:762)
==1381== by 0x3AF0B: ??? (in /usr/bin/nanomq)
==1381==
==1381== 32 bytes in 1 blocks are still reachable in loss record 15 of 46
==1381== at 0x481A5C0: calloc (vg_replace_malloc.c:762)
==1381== by 0x5706D: ??? (in /usr/bin/nanomq)
==1381==
==1381== 40 bytes in 1 blocks are still reachable in loss record 16 of 46
==1381== at 0x481A5C0: calloc (vg_replace_malloc.c:762)
==1381== by 0x17A57: ??? (in /usr/bin/nanomq)
==1381==
==1381== 40 bytes in 1 blocks are still reachable in loss record 17 of 46
==1381== at 0x481A5C0: calloc (vg_replace_malloc.c:762)
==1381== by 0x1CDB1: ??? (in /usr/bin/nanomq)
==1381==
==1381== 40 bytes in 1 blocks are still reachable in loss record 18 of 46
==1381== at 0x481A5C0: calloc (vg_replace_malloc.c:762)
==1381== by 0x57043: ??? (in /usr/bin/nanomq)
==1381==
==1381== 44 bytes in 1 blocks are still reachable in loss record 19 of 46
==1381== at 0x481A5C0: calloc (vg_replace_malloc.c:762)
==1381== by 0x47569: ??? (in /usr/bin/nanomq)
==1381==
==1381== 64 bytes in 1 blocks are still reachable in loss record 20 of 46
==1381== at 0x481A5C0: calloc (vg_replace_malloc.c:762)
==1381== by 0x18F4F: ??? (in /usr/bin/nanomq)
==1381==
==1381== 72 bytes in 2 blocks are still reachable in loss record 21 of 46
==1381== at 0x481A5C0: calloc (vg_replace_malloc.c:762)
==1381== by 0x3D5EB: ??? (in /usr/bin/nanomq)
==1381==
==1381== 92 bytes in 1 blocks are still reachable in loss record 22 of 46
==1381== at 0x481A5C0: calloc (vg_replace_malloc.c:762)
==1381== by 0x6904F: ??? (in /usr/bin/nanomq)
==1381==
==1381== 112 bytes in 2 blocks are still reachable in loss record 23 of 46
==1381== at 0x481A5C0: calloc (vg_replace_malloc.c:762)
==1381== by 0x3D5FB: ??? (in /usr/bin/nanomq)
==1381==
==1381== 120 bytes in 5 blocks are still reachable in loss record 24 of 46
==1381== at 0x481A5C0: calloc (vg_replace_malloc.c:762)
==1381== by 0x1AD3F: ??? (in /usr/bin/nanomq)
==1381==
==1381== 128 bytes in 1 blocks are still reachable in loss record 25 of 46
==1381== at 0x481A5C0: calloc (vg_replace_malloc.c:762)
==1381== by 0x18E63: ??? (in /usr/bin/nanomq)
==1381==
==1381== 160 bytes in 1 blocks are still reachable in loss record 26 of 46
==1381== at 0x48179A0: malloc (vg_replace_malloc.c:309)
==1381== by 0x2095B: ??? (in /usr/bin/nanomq)
==1381==
==1381== 160 bytes in 2 blocks are still reachable in loss record 27 of 46
==1381== at 0x48179A0: malloc (vg_replace_malloc.c:309)
==1381== by 0x13FC3: ??? (in /usr/bin/nanomq)
==1381==
==1381== 168 bytes in 1 blocks are still reachable in loss record 28 of 46
==1381== at 0x481A5C0: calloc (vg_replace_malloc.c:762)
==1381== by 0x1C30F: ??? (in /usr/bin/nanomq)
==1381==
==1381== 168 bytes in 1 blocks are still reachable in loss record 29 of 46
==1381== at 0x481A5C0: calloc (vg_replace_malloc.c:762)
==1381== by 0x45545: ??? (in /usr/bin/nanomq)
==1381==
==1381== 192 bytes in 1 blocks are still reachable in loss record 30 of 46
==1381== at 0x481A5C0: calloc (vg_replace_malloc.c:762)
==1381== by 0x58429: ??? (in /usr/bin/nanomq)
==1381==
==1381== 206 bytes in 14 blocks are still reachable in loss record 31 of 46
==1381== at 0x48179A0: malloc (vg_replace_malloc.c:309)
==1381== by 0x1C123: ??? (in /usr/bin/nanomq)
==1381==
==1381== 208 bytes in 2 blocks are still reachable in loss record 32 of 46
==1381== at 0x481A5C0: calloc (vg_replace_malloc.c:762)
==1381== by 0x1B60D: ??? (in /usr/bin/nanomq)
==1381==
==1381== 224 bytes in 2 blocks are still reachable in loss record 33 of 46
==1381== at 0x481A5C0: calloc (vg_replace_malloc.c:762)
==1381== by 0x4491B: ??? (in /usr/bin/nanomq)
==1381==
==1381== 224 bytes in 2 blocks are still reachable in loss record 34 of 46
==1381== at 0x481A5C0: calloc (vg_replace_malloc.c:762)
==1381== by 0x1E58B: ??? (in /usr/bin/nanomq)
==1381==
==1381== 232 bytes in 1 blocks are still reachable in loss record 35 of 46
==1381== at 0x481A5C0: calloc (vg_replace_malloc.c:762)
==1381== by 0x16E65: ??? (in /usr/bin/nanomq)
==1381==
==1381== 256 bytes in 1 blocks are still reachable in loss record 36 of 46
==1381== at 0x481A5C0: calloc (vg_replace_malloc.c:762)
==1381== by 0x1C31B: ??? (in /usr/bin/nanomq)
==1381==
==1381== 272 bytes in 1 blocks are still reachable in loss record 37 of 46
==1381== at 0x481A5C0: calloc (vg_replace_malloc.c:762)
==1381== by 0x57F59: ??? (in /usr/bin/nanomq)
==1381==
==1381== 320 bytes in 1 blocks are still reachable in loss record 38 of 46
==1381== at 0x48179A0: malloc (vg_replace_malloc.c:309)
==1381== by 0x49E52B3: __fopen_internal (iofopen.c:65)
==1381== by 0x34E87: ??? (in /usr/bin/nanomq)
==1381==
==1381== 480 bytes in 5 blocks are still reachable in loss record 39 of 46
==1381== at 0x481A5C0: calloc (vg_replace_malloc.c:762)
==1381== by 0x17965: ??? (in /usr/bin/nanomq)
==1381==
==1381== 664 bytes in 1 blocks are still reachable in loss record 40 of 46
==1381== at 0x481A5C0: calloc (vg_replace_malloc.c:762)
==1381== by 0x14E2F: ??? (in /usr/bin/nanomq)
==1381==
==1381== 1,096 bytes in 1 blocks are still reachable in loss record 41 of 46
==1381== at 0x481A5C0: calloc (vg_replace_malloc.c:762)
==1381== by 0x1AFEB: ??? (in /usr/bin/nanomq)
==1381==
==1381== 1,112 bytes in 1 blocks are still reachable in loss record 42 of 46
==1381== at 0x481A5C0: calloc (vg_replace_malloc.c:762)
==1381== by 0x1843D: ??? (in /usr/bin/nanomq)
==1381==
==1381== 1,424 bytes in 1 blocks are still reachable in loss record 43 of 46
==1381== at 0x481A5C0: calloc (vg_replace_malloc.c:762)
==1381== by 0x19A81: ??? (in /usr/bin/nanomq)
==1381==
==1381== 1,440 bytes in 10 blocks are possibly lost in loss record 44 of 46
==1381== at 0x481A5C0: calloc (vg_replace_malloc.c:762)
==1381== by 0x4606CE11: allocate_dtv (dl-tls.c:286)
==1381== by 0x4606D423: _dl_allocate_tls (dl-tls.c:532)
==1381== by 0x497C6BB: allocate_stack (allocatestack.c:622)
==1381== by 0x497C6BB: pthread_create@@GLIBC_2.4 (pthread_create.c:662)
==1381== by 0x1E23F: ??? (in /usr/bin/nanomq)
==1381==
==1381== 2,592 bytes in 9 blocks are still reachable in loss record 45 of 46
==1381== at 0x481A5C0: calloc (vg_replace_malloc.c:762)
==1381== by 0x165D7: ??? (in /usr/bin/nanomq)
==1381==
==1381== 9,280 bytes in 3 blocks are still reachable in loss record 46 of 46
==1381== at 0x48179A0: malloc (vg_replace_malloc.c:309)
==1381== by 0x18B6D: ??? (in /usr/bin/nanomq)
==1381==
==1381== LEAK SUMMARY:
==1381== definitely lost: 0 bytes in 0 blocks
==1381== indirectly lost: 0 bytes in 0 blocks
==1381== possibly lost: 1,440 bytes in 10 blocks
==1381== still reachable: 20,428 bytes in 89 blocks
==1381== suppressed: 0 bytes in 0 blocks
==1381==
==1381== ERROR SUMMARY: 1002 errors from 21 contexts (suppressed: 0 from 0)
==1381==
==1381== 1 errors in context 1 of 21:
==1381== Thread 8 nng:task:
==1381== Invalid read of size 1
==1381== at 0x481BAD8: strlen (vg_replace_strmem.c:461)
==1381== by 0x49DF99F: __vfprintf_internal (vfprintf-internal.c:1688)
==1381== by 0x49EAFAD: __vsnprintf_internal (vsnprintf.c:114)
==1381== by 0x49D3D4D: snprintf (snprintf.c:31)
==1381== by 0x21097: ??? (in /usr/bin/nanomq)
==1381== Address 0x18b is not stack'd, malloc'd or (recently) free'd
==1381==
==1381==
==1381== 2 errors in context 2 of 21:
==1381== Thread 1:
==1381== Conditional jump or move depends on uninitialised value(s)
==1381== at 0x481BF10: strncpy (vg_replace_strmem.c:552)
==1381== by 0x34F99: ??? (in /usr/bin/nanomq)
==1381== Uninitialised value was created by a heap allocation
==1381== at 0x48179A0: malloc (vg_replace_malloc.c:309)
==1381== by 0x49E5BD1: getdelim (iogetdelim.c:62)
==1381== by 0x3AE19: ??? (in /usr/bin/nanomq)
==1381==
==1381==
==1381== 2 errors in context 3 of 21:
==1381== Conditional jump or move depends on uninitialised value(s)
==1381== at 0x481BE94: strncpy (vg_replace_strmem.c:552)
==1381== by 0x34F99: ??? (in /usr/bin/nanomq)
==1381== Uninitialised value was created by a heap allocation
==1381== at 0x48179A0: malloc (vg_replace_malloc.c:309)
==1381== by 0x49E5BD1: getdelim (iogetdelim.c:62)
==1381== by 0x3AE19: ??? (in /usr/bin/nanomq)
==1381==
==1381==
==1381== 2 errors in context 4 of 21:
==1381== Conditional jump or move depends on uninitialised value(s)
==1381== at 0x481A570: calloc (vg_replace_malloc.c:762)
==1381== by 0x34F8F: ??? (in /usr/bin/nanomq)
==1381== Uninitialised value was created by a heap allocation
==1381== at 0x48179A0: malloc (vg_replace_malloc.c:309)
==1381== by 0x49E5BD1: getdelim (iogetdelim.c:62)
==1381== by 0x3AE19: ??? (in /usr/bin/nanomq)
==1381==
==1381==
==1381== 2 errors in context 5 of 21:
==1381== Conditional jump or move depends on uninitialised value(s)
==1381== at 0x34F60: ??? (in /usr/bin/nanomq)
==1381== Uninitialised value was created by a heap allocation
==1381== at 0x48179A0: malloc (vg_replace_malloc.c:309)
==1381== by 0x49E5BD1: getdelim (iogetdelim.c:62)
==1381== by 0x3AE19: ??? (in /usr/bin/nanomq)
==1381==
==1381==
==1381== 2 errors in context 6 of 21:
==1381== Conditional jump or move depends on uninitialised value(s)
==1381== at 0x481BF10: strncpy (vg_replace_strmem.c:552)
==1381== by 0x31D3B: ??? (in /usr/bin/nanomq)
==1381== Uninitialised value was created by a heap allocation
==1381== at 0x48179A0: malloc (vg_replace_malloc.c:309)
==1381== by 0x49E5BD1: getdelim (iogetdelim.c:62)
==1381== by 0x3AE19: ??? (in /usr/bin/nanomq)
==1381==
==1381==
==1381== 2 errors in context 7 of 21:
==1381== Conditional jump or move depends on uninitialised value(s)
==1381== at 0x481BE94: strncpy (vg_replace_strmem.c:552)
==1381== by 0x31D3B: ??? (in /usr/bin/nanomq)
==1381== Uninitialised value was created by a heap allocation
==1381== at 0x48179A0: malloc (vg_replace_malloc.c:309)
==1381== by 0x49E5BD1: getdelim (iogetdelim.c:62)
==1381== by 0x3AE19: ??? (in /usr/bin/nanomq)
==1381==
==1381==
==1381== 2 errors in context 8 of 21:
==1381== Conditional jump or move depends on uninitialised value(s)
==1381== at 0x481A570: calloc (vg_replace_malloc.c:762)
==1381== by 0x31D31: ??? (in /usr/bin/nanomq)
==1381== Uninitialised value was created by a heap allocation
==1381== at 0x48179A0: malloc (vg_replace_malloc.c:309)
==1381== by 0x49E5BD1: getdelim (iogetdelim.c:62)
==1381== by 0x3AE19: ??? (in /usr/bin/nanomq)
==1381==
==1381==
==1381== 2 errors in context 9 of 21:
==1381== Conditional jump or move depends on uninitialised value(s)
==1381== at 0x31D0A: ??? (in /usr/bin/nanomq)
==1381== Uninitialised value was created by a heap allocation
==1381== at 0x48179A0: malloc (vg_replace_malloc.c:309)
==1381== by 0x49E5BD1: getdelim (iogetdelim.c:62)
==1381== by 0x3AE19: ??? (in /usr/bin/nanomq)
==1381==
==1381==
==1381== 4 errors in context 10 of 21:
==1381== Conditional jump or move depends on uninitialised value(s)
==1381== at 0x481BF10: strncpy (vg_replace_strmem.c:552)
==1381== by 0x328FD: ??? (in /usr/bin/nanomq)
==1381== Uninitialised value was created by a heap allocation
==1381== at 0x48179A0: malloc (vg_replace_malloc.c:309)
==1381== by 0x49E5BD1: getdelim (iogetdelim.c:62)
==1381== by 0x3AE19: ??? (in /usr/bin/nanomq)
==1381==
==1381==
==1381== 4 errors in context 11 of 21:
==1381== Conditional jump or move depends on uninitialised value(s)
==1381== at 0x481BE94: strncpy (vg_replace_strmem.c:552)
==1381== by 0x328FD: ??? (in /usr/bin/nanomq)
==1381== Uninitialised value was created by a heap allocation
==1381== at 0x48179A0: malloc (vg_replace_malloc.c:309)
==1381== by 0x49E5BD1: getdelim (iogetdelim.c:62)
==1381== by 0x3AE19: ??? (in /usr/bin/nanomq)
==1381==
==1381==
==1381== 4 errors in context 12 of 21:
==1381== Conditional jump or move depends on uninitialised value(s)
==1381== at 0x481A570: calloc (vg_replace_malloc.c:762)
==1381== by 0x328F3: ??? (in /usr/bin/nanomq)
==1381== Uninitialised value was created by a heap allocation
==1381== at 0x48179A0: malloc (vg_replace_malloc.c:309)
==1381== by 0x49E5BD1: getdelim (iogetdelim.c:62)
==1381== by 0x3AE19: ??? (in /usr/bin/nanomq)
==1381==
==1381==
==1381== 4 errors in context 13 of 21:
==1381== Conditional jump or move depends on uninitialised value(s)
==1381== at 0x328CC: ??? (in /usr/bin/nanomq)
==1381== Uninitialised value was created by a heap allocation
==1381== at 0x48179A0: malloc (vg_replace_malloc.c:309)
==1381== by 0x49E5BD1: getdelim (iogetdelim.c:62)
==1381== by 0x3AE19: ??? (in /usr/bin/nanomq)
==1381==
==1381==
==1381== 8 errors in context 14 of 21:
==1381== Conditional jump or move depends on uninitialised value(s)
==1381== at 0x31A4C: ??? (in /usr/bin/nanomq)
==1381== Uninitialised value was created by a heap allocation
==1381== at 0x48179A0: malloc (vg_replace_malloc.c:309)
==1381== by 0x49E5BD1: getdelim (iogetdelim.c:62)
==1381== by 0x3AE19: ??? (in /usr/bin/nanomq)
==1381==
==1381==
==1381== 53 errors in context 15 of 21:
==1381== Conditional jump or move depends on uninitialised value(s)
==1381== at 0x481BEC0: strncpy (vg_replace_strmem.c:552)
==1381== by 0x34F99: ??? (in /usr/bin/nanomq)
==1381== Uninitialised value was created by a heap allocation
==1381== at 0x48179A0: malloc (vg_replace_malloc.c:309)
==1381== by 0x49E5BD1: getdelim (iogetdelim.c:62)
==1381== by 0x3AE19: ??? (in /usr/bin/nanomq)
==1381==
==1381==
==1381== 53 errors in context 16 of 21:
==1381== Conditional jump or move depends on uninitialised value(s)
==1381== at 0x481BEC0: strncpy (vg_replace_strmem.c:552)
==1381== by 0x31D3B: ??? (in /usr/bin/nanomq)
==1381== Uninitialised value was created by a heap allocation
==1381== at 0x48179A0: malloc (vg_replace_malloc.c:309)
==1381== by 0x49E5BD1: getdelim (iogetdelim.c:62)
==1381== by 0x3AE19: ??? (in /usr/bin/nanomq)
==1381==
==1381==
==1381== 106 errors in context 17 of 21:
==1381== Conditional jump or move depends on uninitialised value(s)
==1381== at 0x481BEC0: strncpy (vg_replace_strmem.c:552)
==1381== by 0x328FD: ??? (in /usr/bin/nanomq)
==1381== Uninitialised value was created by a heap allocation
==1381== at 0x48179A0: malloc (vg_replace_malloc.c:309)
==1381== by 0x49E5BD1: getdelim (iogetdelim.c:62)
==1381== by 0x3AE19: ??? (in /usr/bin/nanomq)
==1381==
==1381==
==1381== 187 errors in context 18 of 21:
==1381== Conditional jump or move depends on uninitialised value(s)
==1381== at 0x481BF34: strncpy (vg_replace_strmem.c:552)
==1381== by 0x34F99: ??? (in /usr/bin/nanomq)
==1381== Uninitialised value was created by a heap allocation
==1381== at 0x48179A0: malloc (vg_replace_malloc.c:309)
==1381== by 0x49E5BD1: getdelim (iogetdelim.c:62)
==1381== by 0x3AE19: ??? (in /usr/bin/nanomq)
==1381==
==1381==
==1381== 187 errors in context 19 of 21:
==1381== Conditional jump or move depends on uninitialised value(s)
==1381== at 0x481BF34: strncpy (vg_replace_strmem.c:552)
==1381== by 0x31D3B: ??? (in /usr/bin/nanomq)
==1381== Uninitialised value was created by a heap allocation
==1381== at 0x48179A0: malloc (vg_replace_malloc.c:309)
==1381== by 0x49E5BD1: getdelim (iogetdelim.c:62)
==1381== by 0x3AE19: ??? (in /usr/bin/nanomq)
==1381==
==1381==
==1381== 374 errors in context 20 of 21:
==1381== Conditional jump or move depends on uninitialised value(s)
==1381== at 0x481BF34: strncpy (vg_replace_strmem.c:552)
==1381== by 0x328FD: ??? (in /usr/bin/nanomq)
==1381== Uninitialised value was created by a heap allocation
==1381== at 0x48179A0: malloc (vg_replace_malloc.c:309)
==1381== by 0x49E5BD1: getdelim (iogetdelim.c:62)
==1381== by 0x3AE19: ??? (in /usr/bin/nanomq)
==1381==
==1381== ERROR SUMMARY: 1002 errors from 21 contexts (suppressed: 0 from 0)
Segmentation fault

@JaylinYu
Copy link
Member

Could you verify if this issue only happens on 0.20.5? does 0.19.5 works fine?

@destroyer5656
Copy link
Author

Yeah correct 0.19.5 and 0.20.0 works fine, atleast for a while until the memory leak crashes the program.

@JaylinYu
Copy link
Member

JaylinYu commented Oct 27, 2023

Thats strange. No memleak detected with ASAN on my dev env. Noted that session keeping and msg caching might result in the wrong report of memleak. Could you submit your memleak info?

And this issue is a mistake of mine, due to this pr nanomq/NanoNNG@ded86c0

Will re-release 0.20.5 today!

@JaylinYu JaylinYu self-assigned this Oct 27, 2023
@JaylinYu JaylinYu added the bug label Oct 27, 2023
JaylinYu added a commit to nanomq/NanoNNG that referenced this issue Oct 27, 2023
JaylinYu added a commit to nanomq/NanoNNG that referenced this issue Oct 27, 2023
@JaylinYu
Copy link
Member

I have pushed a fix. Could you have a try on the master branch?

@destroyer5656
Copy link
Author

Awesome thanks!

@JaylinYu
Copy link
Member

JaylinYu commented Oct 27, 2023

Awesome thanks!

I suppose the fix works? Will proceed to modify the release.

@destroyer5656
Copy link
Author

destroyer5656 commented Oct 27, 2023

Testing the fix right now.

For the memleak info, its hard to reproduce as it only occurs after 2+ days of load testing the broker with a high message amount. In 0.19.5 it was crashing more often but in 0.20.0 it was only occurring after 2 days of runtime at a really high message rate. When running normally with a standard message amount we don't notice the issue, and its hard to get debug logs as the rest of the system starts crashing.

@JaylinYu
Copy link
Member

JaylinYu commented Oct 27, 2023

Testing the fix right now.

For the memleak info, its hard to reproduce as it only occurs after 2+ days of load testing the broker with a high message amount. In 0.19.5 it was crashing more often but in 0.20.0 it was only occurring after 2 days of runtime at a really high message rate. When running normally with a standard message amount we don't notice the issue.

Ok, perhaps AWS IoT bridging is the one to be blame. Heavy test conducted on nanomq, but AWS Bridge is not include, due to lack of resources. Happy to fix it if you got more log. (set nanomq log to "info" is enough)

And... what do you mean by "rest of the system starts crashing" ? Seems like an OS issue

@destroyer5656
Copy link
Author

The rest of the system runs out of ram and oom reaper starts killing all the running processes.

@JaylinYu
Copy link
Member

The rest of the system runs out of ram and oom reaper starts killing all the running processes.

Understood. Limit the queue length (max_mqueue_len) and the num of ctx (parallel) could help on reducing the memory ceiling of nanomq:

mqtt = {
  max_packet_size = 1KB       # Maximum packet size NanoMQ can accept and send, 1B~260MB.
  max_mqueue_len = 2048       # Maximum length of the in-flight window queue
  retry_interval = 10s        # Retry interval for QoS 1/2 message delivering
  keepalive_multiplier = 1.25 # Multiplier for MQTT keepalive timeout. 
  property_size = 32          # Maximum size for a MQTT user property.
}

@destroyer5656
Copy link
Author

destroyer5656 commented Oct 27, 2023

Will try that thanks! Will open a new issue once I get some debug logs from the aws iot bridge! Also confirming it no longer segfaults when running on latest master on our 32bit armv7 platform. Thanks for the quick help.

@destroyer5656
Copy link
Author

destroyer5656 commented Nov 15, 2023

I tried tuning the memory but nomatter what I do I can't get it to reduce below 150 megabytes after a certain amount of runtime it just starts increasing albeit very slowly.
here is my current config:

cat /nanomq_config.conf
websocket.enable = false
enable_ipc_internal = false
max_packet_size = 10240
msq_len = 1024
keepalive_backoff = 1250
property_size = 32
parallel = 2

@JaylinYu
Copy link
Member

JaylinYu commented Nov 16, 2023

Hi, I was saying queue length (max_mqueue_len) and the num of ctx (parallel) help limit the memory usage. However, I cannot calculate a precise number of memory consumption. It is also affected by the size of msg and number of connected clients.
While the number of clients and pressure remain unchanged. By reducing the msq_len and parallel, you should be able to get a lower footprint comparatively.

As for your parameters, you could try to reduce the number of msq_len to 256. but it only works if you see logs like "Warning: msg lost due to reach the limit of lmq". (cache msg occupies memory)

Otherwise, perhaps the memory is used by sockets and aios, pipes for sustaining MQTT connections.

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

No branches or pull requests

2 participants