issue_owner_repo
listlengths
2
2
issue_body
stringlengths
0
261k
issue_title
stringlengths
1
925
issue_comments_url
stringlengths
56
81
issue_comments_count
int64
0
2.5k
issue_created_at
stringlengths
20
20
issue_updated_at
stringlengths
20
20
issue_html_url
stringlengths
37
62
issue_github_id
int64
387k
2.46B
issue_number
int64
1
127k
[ "emqx", "nanomq" ]
==1419764==ERROR: AddressSanitizer: heap-use-after-free on address 0x60f00005123c at pc 0x55b38e8bcba5 bp 0x7f42035f2b30 sp 0x7f42035f2b20 WRITE of size 4 at 0x60f00005123c thread T13 (nng:task) #0 0x55b38e8bcba4 in nni_atomic_inc ../nng/src/platform/posix/posix_atomic.c:108 #1 0x55b38e8a6426 in nni_msg_clone ../nng/src/core/message.c:316 #2 0x55b38e89991f in nng_msg_clone ../nng/src/nng.c:2088 #3 0x55b38e87c154 in server_cb ../nanomq/apps/broker.c:352 #4 0x55b38e8b64fb in nni_taskq_thread ../nng/src/core/taskq.c:50 #5 0x55b38e8b776a in nni_thr_wrap ../nng/src/core/thread.c:94 #6 0x55b38e8bff64 in nni_plat_thr_main ../nng/src/platform/posix/posix_thread.c:266 #7 0x7f420cdee608 in start_thread /build/glibc-sMfBJT/glibc-2.31/nptl/pthread_create.c:477 #8 0x7f420ccda162 in __clone (/lib/x86_64-linux-gnu/libc.so.6+0x11f162) 0x60f00005123c is located 124 bytes inside of 168-byte region [0x60f0000511c0,0x60f000051268) freed by thread T14 (nng:task) here: #0 0x7f420cf1640f in __interceptor_free ../../../../src/libsanitizer/asan/asan_malloc_linux.cc:122 #1 0x55b38e8bbbdc in nni_free ../nng/src/platform/posix/posix_alloc.c:33 #2 0x55b38e8a6dee in nni_msg_free ../nng/src/core/message.c:465 #3 0x55b38eb78a0f in nmq_tcptran_pipe_send_cb ../nng/src/sp/transport/mqtt/broker_tcp.c:501 #4 0x55b38e8b64fb in nni_taskq_thread ../nng/src/core/taskq.c:50 #5 0x55b38e8b776a in nni_thr_wrap ../nng/src/core/thread.c:94 #6 0x55b38e8bff64 in nni_plat_thr_main ../nng/src/platform/posix/posix_thread.c:266 #7 0x7f420cdee608 in start_thread /build/glibc-sMfBJT/glibc-2.31/nptl/pthread_create.c:477 previously allocated by thread T8 (nng:task) here: #0 0x7f420cf16a06 in __interceptor_calloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cc:153 #1 0x55b38e8bbbb3 in nni_zalloc ../nng/src/platform/posix/posix_alloc.c:26 #2 0x55b38e8a68bc in nni_msg_alloc ../nng/src/core/message.c:388 #3 0x55b38eb792db in tcptran_pipe_recv_cb ../nng/src/sp/transport/mqtt/broker_tcp.c:602 #4 0x55b38e8b64fb in nni_taskq_thread ../nng/src/core/taskq.c:50 #5 0x55b38e8b776a in nni_thr_wrap ../nng/src/core/thread.c:94 #6 0x55b38e8bff64 in nni_plat_thr_main ../nng/src/platform/posix/posix_thread.c:266 #7 0x7f420cdee608 in start_thread /build/glibc-sMfBJT/glibc-2.31/nptl/pthread_create.c:477
Heap use after free when using retain
https://api.github.com/repos/nanomq/nanomq/issues/485/comments
1
2022-04-13T05:35:59Z
2022-04-13T05:50:51Z
https://github.com/nanomq/nanomq/issues/485
1,202,783,056
485
[ "emqx", "nanomq" ]
Run set -e -u -x + echo + docker login -u --password-stdin Error: Cannot perform an interactive login from a non TTY device Error: Process completed with exit code 1.
docker build failed
https://api.github.com/repos/nanomq/nanomq/issues/478/comments
1
2022-04-12T04:28:46Z
2022-04-12T06:48:09Z
https://github.com/nanomq/nanomq/issues/478
1,201,016,699
478
[ "emqx", "nanomq" ]
Folks, please help support Cmake build configurations for mobile platforms, Android, iOS, the use-case is for embeded MQTT broker in mobile apps Cheers
Support native build for mobile platforms
https://api.github.com/repos/nanomq/nanomq/issues/473/comments
2
2022-04-09T19:21:03Z
2024-04-18T06:01:55Z
https://github.com/nanomq/nanomq/issues/473
1,198,748,357
473
[ "emqx", "nanomq" ]
我看到文档中只描述了username/password认证,不知能否进行topic的访问控制?
请问nanomq支持访问控制(ACL)吗?
https://api.github.com/repos/nanomq/nanomq/issues/471/comments
4
2022-04-08T07:45:54Z
2022-12-01T03:48:23Z
https://github.com/nanomq/nanomq/issues/471
1,196,962,782
471
[ "emqx", "nanomq" ]
When compile nanomq on mac with flag below: ``` $ cmake -G Ninja -DCFG_METHOD=CMAKE_CONFIG -DMQ=OFF -DNOLOG=ON -DDEBUG=ON -DASAN=ON -DNNG_ENABLE_TLS=ON .. $ ninja ``` get error: ``` FAILED: nng/CMakeFiles/nng.dir/src/core/pipe.c.o /Library/Developer/CommandLineTools/usr/bin/cc -DASAN -DDEBUG -DNANO_HIDDEN_VISIBILITY -DNANO_PLATFORM_DARWIN -DNANO_PLATFORM_POSIX -DNNG_ENABLE_STATS -DNNG_HAVE_ARC4RANDOM=1 -DNNG_HAVE_BACKTRACE=1 -DNNG_HAVE_BUS0 -DNNG_HAVE_FLOCK=1 -DNNG_HAVE_GETPEEREID=1 -DNNG_HAVE_KQUEUE=1 -DNNG_HAVE_LOCALPEERCRED=1 -DNNG_HAVE_LOCALPEERPID=1 -DNNG_HAVE_LOCKF=1 -DNNG_HAVE_MQTT_BROKER -DNNG_HAVE_MQTT_CLIENT -DNNG_HAVE_MSG_CONTROL=1 -DNNG_HAVE_PAIR0 -DNNG_HAVE_PAIR1 -DNNG_HAVE_PTHREAD_ATFORK_PTHREAD=1 -DNNG_HAVE_PTHREAD_SETNAME_NP=1 -DNNG_HAVE_PUB0 -DNNG_HAVE_PULL0 -DNNG_HAVE_PUSH0 -DNNG_HAVE_REP0 -DNNG_HAVE_REQ0 -DNNG_HAVE_RESPONDENT0 -DNNG_HAVE_SEMAPHORE_PTHREAD=1 -DNNG_HAVE_STDATOMIC=1 -DNNG_HAVE_STRCASECMP=1 -DNNG_HAVE_STRLCPY=1 -DNNG_HAVE_STRNCASECMP=1 -DNNG_HAVE_STRNLEN=1 -DNNG_HAVE_SUB0 -DNNG_HAVE_SURVEYOR0 -DNNG_HAVE_UNIX_SOCKETS=1 -DNNG_HIDDEN_VISIBILITY -DNNG_MAX_TASKQ_THREADS=16 -DNNG_PLATFORM_DARWIN -DNNG_PLATFORM_POSIX -DNNG_PRIVATE -DNNG_STATIC_LIB -DNNG_SUPP_HTTP -DNNG_SUPP_TLS -DNNG_TLS_ENGINE_FINI=nng_tls_engine_fini_mbed -DNNG_TLS_ENGINE_INIT=nng_tls_engine_init_mbed -DNNG_TRANSPORT_INPROC -DNNG_TRANSPORT_IPC -DNNG_TRANSPORT_MQTT_BROKER_TCP -DNNG_TRANSPORT_MQTT_BROKER_TLS -DNNG_TRANSPORT_MQTT_BROKER_WS -DNNG_TRANSPORT_MQTT_BROKER_WSS -DNNG_TRANSPORT_MQTT_TCP -DNNG_TRANSPORT_MQTT_TLS -DNNG_TRANSPORT_TCP -DNNG_TRANSPORT_TLS -DNNG_TRANSPORT_WS -DNNG_TRANSPORT_WSS -DNOLOG -DSUPP_CLIENT -D_GNU_SOURCE -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT -D_THREAD_SAFE -I../nng/src -I/usr/local/include -I../nng/include -I../nanolib/include -I../nanomq/include -std=c99 -g -fsanitize=address -Wall -Wextra -fno-omit-frame-pointer -fsanitize=address -g -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -std=gnu99 -MD -MT nng/CMakeFiles/nng.dir/src/core/pipe.c.o -MF nng/CMakeFiles/nng.dir/src/core/pipe.c.o.d -o nng/CMakeFiles/nng.dir/src/core/pipe.c.o -c ../nng/src/core/pipe.c In file included from ../nng/src/core/pipe.c:12: In file included from ../nng/src/core/nng_impl.h:37: In file included from ../nng/src/core/message.h:14: ../nng/include/nng/mqtt/packet.h:82:2: error: unknown type name 'mqtt_kv' mqtt_kv strpair; ^ In file included from ../nng/src/core/pipe.c:12: In file included from ../nng/src/core/nng_impl.h:37: ../nng/src/core/message.h:84:8: error: must use 'struct' tag to refer to type 'conn_param' extern conn_param *nni_msg_get_conn_param(nni_msg *m); ^ struct ../nng/src/core/message.h:133:2: error: unknown type name 'mqtt_kv' mqtt_kv * user_property; ^ ../nng/src/core/message.h:141:2: error: unknown type name 'mqtt_kv' mqtt_kv * payload_user_property; ^ 4 errors generated. ```
Compile error on `MacOS` with flag `NNG_ENABLE_TLS`
https://api.github.com/repos/nanomq/nanomq/issues/470/comments
2
2022-04-08T06:46:07Z
2022-04-16T02:06:04Z
https://github.com/nanomq/nanomq/issues/470
1,196,899,235
470
[ "emqx", "nanomq" ]
the changes and optimization we made in 0.6.6 breaks websocket feature.
fix mqtt over websocket
https://api.github.com/repos/nanomq/nanomq/issues/459/comments
0
2022-03-31T04:59:53Z
2022-04-02T01:34:03Z
https://github.com/nanomq/nanomq/issues/459
1,187,510,530
459
[ "emqx", "nanomq" ]
porting changes in broker_tcp to nmq_websocket.
Support MQTT V5 in Websocket
https://api.github.com/repos/nanomq/nanomq/issues/458/comments
0
2022-03-31T04:41:34Z
2022-04-25T07:26:28Z
https://github.com/nanomq/nanomq/issues/458
1,187,489,239
458
[ "emqx", "nanomq" ]
Are there plans to add Webhook features?
webhook
https://api.github.com/repos/nanomq/nanomq/issues/453/comments
1
2022-03-29T10:49:27Z
2022-03-29T15:16:23Z
https://github.com/nanomq/nanomq/issues/453
1,184,673,995
453
[ "emqx", "nanomq" ]
================================================================= ==338316==ERROR: LeakSanitizer: detected memory leaks Direct leak of 3520 byte(s) in 110 object(s) allocated from: #0 0x7fe1074c6867 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:145 #1 0x5622635e4a99 in zmalloc ../nanolib/zmalloc.c:50 #2 0x5622635f0a1a in topic_parse ../nanomq/bridge.c:168 #3 0x5622635f0d8f in check_wildcard ../nanomq/bridge.c:211 #4 0x5622635f103d in topic_filter ../nanomq/bridge.c:257 #5 0x562263615847 in server_cb ../nanomq/apps/broker.c:197 #6 0x56226365a1b9 in nni_task_exec ../nng/src/core/taskq.c:144 #7 0x56226363ec17 in nni_aio_finish_impl ../nng/src/core/aio.c:450 #8 0x56226363ec99 in nni_aio_finish_sync ../nng/src/core/aio.c:467 #9 0x5622636794a4 in nano_pipe_recv_cb ../nng/src/sp/protocol/mqtt/nmq_mqtt.c:1023 #10 0x56226365a1b9 in nni_task_exec ../nng/src/core/taskq.c:144 #11 0x56226363ec17 in nni_aio_finish_impl ../nng/src/core/aio.c:450 #12 0x56226363ec99 in nni_aio_finish_sync ../nng/src/core/aio.c:467 #13 0x5622636dc7f6 in tcptran_pipe_recv_cb ../nng/src/sp/transport/mqtt/broker_tcp.c:738 #14 0x5622636599c4 in nni_taskq_thread ../nng/src/core/taskq.c:50 #15 0x56226365ac2e in nni_thr_wrap ../nng/src/core/thread.c:94 #16 0x562263663414 in nni_plat_thr_main ../nng/src/platform/posix/posix_thread.c:266 #17 0x7fe10725a946 in start_thread nptl/pthread_create.c:435 Direct leak of 2640 byte(s) in 110 object(s) allocated from: #0 0x7fe1074c6867 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:145 #1 0x5622635e4a99 in zmalloc ../nanolib/zmalloc.c:50 #2 0x5622635f0a1a in topic_parse ../nanomq/bridge.c:168 #3 0x5622635f0d9f in check_wildcard ../nanomq/bridge.c:212 #4 0x5622635f103d in topic_filter ../nanomq/bridge.c:257 #5 0x562263615847 in server_cb ../nanomq/apps/broker.c:197 #6 0x56226365a1b9 in nni_task_exec ../nng/src/core/taskq.c:144 #7 0x56226363ec17 in nni_aio_finish_impl ../nng/src/core/aio.c:450 #8 0x56226363ec99 in nni_aio_finish_sync ../nng/src/core/aio.c:467 #9 0x5622636794a4 in nano_pipe_recv_cb ../nng/src/sp/protocol/mqtt/nmq_mqtt.c:1023 #10 0x56226365a1b9 in nni_task_exec ../nng/src/core/taskq.c:144 #11 0x56226363ec17 in nni_aio_finish_impl ../nng/src/core/aio.c:450 #12 0x56226363ec99 in nni_aio_finish_sync ../nng/src/core/aio.c:467 #13 0x5622636dc7f6 in tcptran_pipe_recv_cb ../nng/src/sp/transport/mqtt/broker_tcp.c:738 #14 0x5622636599c4 in nni_taskq_thread ../nng/src/core/taskq.c:50 #15 0x56226365ac2e in nni_thr_wrap ../nng/src/core/thread.c:94 #16 0x562263663414 in nni_plat_thr_main ../nng/src/platform/posix/posix_thread.c:266 #17 0x7fe10725a946 in start_thread nptl/pthread_create.c:435 SUMMARY: AddressSanitizer: 6160 byte(s) leaked in 220 allocation(s).
memleak in bridge topic_filter
https://api.github.com/repos/nanomq/nanomq/issues/449/comments
0
2022-03-23T06:41:52Z
2022-03-24T02:01:36Z
https://github.com/nanomq/nanomq/issues/449
1,177,667,968
449
[ "emqx", "nanomq" ]
Compile nanomq. ``` cmake -G Ninja -DCFG_METHOD=CMAKE_CONFIG -DMQ=0 -DNOLOG=ON -DDEBUG=ON -DASAN=ON -DBUILD_BENCH=ON .. ``` Run bench. ``` lee@emqx-sz:~/workspace/nanomq/build$ ./nanomq/nanomq bench start pub -p 1885 -c 1 -t TEST -q 0 -I 1 connected: 1. AddressSanitizer:DEADLYSIGNAL ================================================================= ==612401==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000070 (pc 0x557ec38f7abc bp 0x7f6d559ea8d0 sp 0x7f6d559ea8c0 T21) ==612401==The signal is caused by a READ memory access. ==612401==Hint: address points to the zero page. AddressSanitizer:DEADLYSIGNAL #0 0x557ec38f7abc in nni_msg_get_proto_data ../nng/src/core/message.c:744 #1 0x557ec3949b24 in nni_mqtt_msg_get_packet_type ../nng/src/supplemental/mqtt/mqtt_msg.c:60 #2 0x557ec391296b in mqtt_send_msg ../nng/src/mqtt/protocol/mqtt/mqtt_client.c:253 #3 0x557ec3914581 in mqtt_ctx_send ../nng/src/mqtt/protocol/mqtt/mqtt_client.c:734 #4 0x557ec39018ae in nni_ctx_send ../nng/src/core/socket.c:1344 AddressSanitizer:DEADLYSIGNAL #5 0x557ec38deac5 in nng_ctx_send ../nng/src/nng.c:369 #6 0x557ec38bf374 in pub_cb ../nanomq/apps/bench.c:257 #7 0x557ec3905fc6 in nni_taskq_thread ../nng/src/core/taskq.c:50 #8 0x557ec3907233 in nni_thr_wrap ../nng/src/core/thread.c:94 #9 0x557ec390fa19 in nni_plat_thr_main ../nng/src/platform/posix/posix_thread.c:266 #10 0x7f6d6339858f in start_thread nptl/pthread_create.c:463 #11 0x7f6d6328e222 in __clone (/lib/x86_64-linux-gnu/libc.so.6+0x119222) AddressSanitizer can not provide additional info. SUMMARY: AddressSanitizer: SEGV ../nng/src/core/message.c:744 in nni_msg_get_proto_data Thread T21 (nng:task) created by T0 here: AddressSanitizer:DEADLYSIGNAL AddressSanitizer:DEADLYSIGNAL AddressSanitizer:DEADLYSIGNAL #0 0x7f6d63408a65 in __interceptor_pthread_create ../../../../src/libsanitizer/asan/asan_interceptors.cpp:216 #1 0x557ec390fb49 in nni_plat_thr_init ../nng/src/platform/posix/posix_thread.c:279 #2 0x557ec39074dc in nni_thr_init ../nng/src/core/thread.c:121 #3 0x557ec39062e5 in nni_taskq_init ../nng/src/core/taskq.c:95 #4 0x557ec3906f03 in nni_taskq_sys_init ../nng/src/core/taskq.c:284 #5 0x557ec38f263a in nni_init_helper ../nng/src/core/init.c:35 #6 0x557ec390fe9d in nni_plat_init ../nng/src/platform/posix/posix_thread.c:422 #7 0x557ec38f26b8 in nni_init ../nng/src/core/init.c:58 #8 0x557ec38feaa5 in nni_sock_open ../nng/src/core/socket.c:630 #9 0x557ec39262ef in nni_proto_open ../nng/src/sp/protocol.c:22 #10 0x557ec39149a0 in nng_mqtt_client_open ../nng/src/mqtt/protocol/mqtt/mqtt_client.c:839 #11 0x557ec38c0eb2 in nnb_publish ../nanomq/apps/bench.c:452 #12 0x557ec38c183f in bench_start ../nanomq/apps/bench.c:523 #13 0x557ec389c4a1 in main ../nanomq/nanomq.c:187 #14 0x7f6d6319dcb1 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x28cb1) ==612401==ABORTING ```
bench tool crashed when run with flag -I -q.
https://api.github.com/repos/nanomq/nanomq/issues/448/comments
0
2022-03-22T04:39:28Z
2022-03-23T08:09:41Z
https://github.com/nanomq/nanomq/issues/448
1,176,257,430
448
[ "emqx", "nanomq" ]
Sun Mar 20 13:43:07 2022 tcptran_pipe_recv_cb: remain_len 0 cparam 0x61200001ffc0 clientid mqttx_33927a6f username 1234 proto 4 Sun Mar 20 13:43:07 2022 tcptran_pipe_recv_cb: The type of msg is e0 Sun Mar 20 13:43:07 2022 nni_aio_finish_sync: Hunky dory(0) Sun Mar 20 13:43:07 2022 nano_pipe_recv_cb: ######### nano_pipe_recv_cb ############ Sun Mar 20 13:43:07 2022 nano_pipe_close: ############## nano_pipe_close ############## Sun Mar 20 13:43:07 2022 nni_aio_finish_error: Object closed(7) Sun Mar 20 13:43:07 2022 nni_aio_finish_sync: Hunky dory(0) Sun Mar 20 13:43:07 2022 server_cb: RECV ^^^^ ctx9 ^^^^ Sun Mar 20 13:43:07 2022 decode_pub_message: cmd: 3, retain: 0, qos: 0, dup: 0, remaining length: 108 Sun Mar 20 13:43:07 2022 decode_pub_message: topic: [$SYS/brokers/disconnected], qos: 0 Sun Mar 20 13:43:07 2022 decode_pub_message: used pos: [27] Sun Mar 20 13:43:07 2022 decode_pub_message: payload: [{"username":"1234","ts":275660846,"reason_code":"0","client_id":"mqttx_33927a6f"}], len = 81 Sun Mar 20 13:43:07 2022 handle_pub: pipe_info size: [0] [INFO] Sun Mar 20 13:43:07 2022 (140144533292608:search_and_delete:1339) topic is: testtopic, node->topic is: she [INFO] Sun Mar 20 13:43:07 2022 (140144533292608:search_and_delete:1339) topic is: #, node->topic is: # [INFO] Sun Mar 20 13:43:07 2022 (140144533292608:search_and_delete:1374) Search and delete client [INFO] Sun Mar 20 13:43:07 2022 (140144533292608:search_and_delete:1375) node->topic: testtopic ____________PRINT_DB_CLIENT___________ 1145608179 ____________PRINT_DB_CLIENT___________ ____________PRINT_DB_CLIENT___________ ____________PRINT_DB_CLIENT___________ [INFO] Sun Mar 20 13:43:07 2022 (140144533292608:dbtree_client_free:298) Delete client pipe_id: [1145608179] [INFO] Sun Mar 20 13:43:07 2022 (140144533292608:delete_dbtree_node:1178) Delete node: [#] [INFO] Sun Mar 20 13:43:07 2022 (140144533292608:delete_dbtree_node:1178) Delete node: [testtopic] Sun Mar 20 13:43:07 2022 del_sub_ctx: FREE in topic_node [testtopic/#] in tree Sun Mar 20 13:43:07 2022 del_sub_ctx: info: sub pkt node handling [0x60200001d1d0] [INFO] Sun Mar 20 13:43:07 2022 (140144533292608:search_and_delete:1339) topic is: she, node->topic is: she [INFO] Sun Mar 20 13:43:07 2022 (140144533292608:search_and_delete:1339) topic is: +, node->topic is: + [INFO] Sun Mar 20 13:43:07 2022 (140144533292608:search_and_delete:1339) topic is: relay, node->topic is: relay [INFO] Sun Mar 20 13:43:07 2022 (140144533292608:search_and_delete:1339) topic is: 0, node->topic is: 0 [INFO] Sun Mar 20 13:43:07 2022 (140144533292608:search_and_delete:1339) topic is: energy, node->topic is: 0 [INFO] Sun Mar 20 13:43:07 2022 (140144533292608:search_and_delete:1361) searching unequal AddressSanitizer:DEADLYSIGNAL ================================================================= ==208364==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x55d27407f7cd bp 0x7f75f11fb5f0 sp 0x7f75f11fb2e0 T4) ==208364==The signal is caused by a READ memory access. ==208364==Hint: address points to the zero page. #0 0x55d27407f7cd in server_cb ../nanomq/apps/broker.c:278 #1 0x55d2740c6a9d in nni_task_exec ../nng/src/core/taskq.c:144 #2 0x55d2740aac82 in nni_aio_finish_impl ../nng/src/core/aio.c:450 #3 0x55d2740aaf6e in nni_aio_finish_sync ../nng/src/core/aio.c:467 #4 0x55d2740ea238 in nano_pipe_close ../nng/src/sp/protocol/mqtt/nmq_mqtt.c:776 #5 0x55d2740bab2c in nni_pipe_close ../nng/src/core/pipe.c:137 #6 0x55d2740ebce9 in nano_pipe_recv_cb ../nng/src/sp/protocol/mqtt/nmq_mqtt.c:957 #7 0x55d2740c6a9d in nni_task_exec ../nng/src/core/taskq.c:144 #8 0x55d2740aac82 in nni_aio_finish_impl ../nng/src/core/aio.c:450 #9 0x55d2740aaf6e in nni_aio_finish_sync ../nng/src/core/aio.c:467 #10 0x55d27414ef39 in tcptran_pipe_recv_cb ../nng/src/sp/transport/mqtt/broker_tcp.c:720 #11 0x55d2740c62a8 in nni_taskq_thread ../nng/src/core/taskq.c:50 #12 0x55d2740c787b in nni_thr_wrap ../nng/src/core/thread.c:94 #13 0x55d2740d0061 in nni_plat_thr_main ../nng/src/platform/posix/posix_thread.c:266 #14 0x7f75f6171946 in start_thread nptl/pthread_create.c:435 #15 0x7f75f6201a43 in __clone (/lib/x86_64-linux-gnu/libc.so.6+0x124a43) AddressSanitizer can not provide additional info. SUMMARY: AddressSanitizer: SEGV ../nanomq/apps/broker.c:278 in server_cb Thread T4 created by T0 here: #0 0x7f75f6381685 in __interceptor_pthread_create ../../../../src/libsanitizer/asan/asan_interceptors.cpp:216 #1 0x55d2740d0191 in nni_plat_thr_init ../nng/src/platform/posix/posix_thread.c:279 #2 0x55d2740c7b24 in nni_thr_init ../nng/src/core/thread.c:121 #3 0x55d2740c65c7 in nni_taskq_init ../nng/src/core/taskq.c:95 #4 0x55d2740c754b in nni_taskq_sys_init ../nng/src/core/taskq.c:284 #5 0x55d2740b2734 in nni_init_helper ../nng/src/core/init.c:35 #6 0x55d2740d04e5 in nni_plat_init ../nng/src/platform/posix/posix_thread.c:422 #7 0x55d2740b27b2 in nni_init ../nng/src/core/init.c:58 #8 0x55d2741038b4 in nng_thread_create ../nng/src/supplemental/util/platform.c:42 #9 0x55d27406c6a0 in start_rest_server ../nanomq/web_server.c:437 #10 0x55d2740880a4 in broker_start ../nanomq/apps/broker.c:1147 #11 0x55d27404e84d in main ../nanomq/nanomq.c:187 #12 0x7f75f6106fcf in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58 ==208364==ABORTING
detree_ctx is NULL when client disconnected
https://api.github.com/repos/nanomq/nanomq/issues/445/comments
1
2022-03-20T05:47:38Z
2022-03-21T04:44:56Z
https://github.com/nanomq/nanomq/issues/445
1,174,447,330
445
[ "emqx", "nanomq" ]
![image](https://user-images.githubusercontent.com/25736811/158743205-3b61196c-7457-4619-bdf0-bdfa2927ebd2.png) FAILED: nng/CMakeFiles/nng.dir/src/sp/protocol/mqtt/nmq_mqtt.c.o /usr/bin/cc -DMQ -DNNG_ENABLE_STATS -DNNG_HAVE_ABSTRACT_SOCKETS -DNNG_HAVE_BACKTRACE=1 -DNNG_HAVE_BUS0 -DNNG_HAVE_CLOCK_GETTIME=1 -DNNG_HAVE_EPOLL=1 -DNNG_HAVE_EPOLL_CREATE1=1 -DNNG_HAVE_EVENTFD=1 -DNNG_HAVE_FLOCK=1 -DNNG_HAVE_LIBNSL=1 -DNNG_HAVE_LOCKF=1 -DNNG_HAVE_MQTT_BROKER -DNNG_HAVE_MQTT_CLIENT -DNNG_HAVE_MSG_CONTROL=1 -DNNG_HAVE_PAIR0 -DNNG_HAVE_PAIR1 -DNNG_HAVE_PTHREAD_ATFORK_PTHREAD=1 -DNNG_HAVE_PTHREAD_SETNAME_NP=1 -DNNG_HAVE_PUB0 -DNNG_HAVE_PULL0 -DNNG_HAVE_PUSH0 -DNNG_HAVE_REP0 -DNNG_HAVE_REQ0 -DNNG_HAVE_RESPONDENT0 -DNNG_HAVE_SEMAPHORE_PTHREAD=1 -DNNG_HAVE_SOPEERCRED=1 -DNNG_HAVE_SUB0 -DNNG_HAVE_SURVEYOR0 -DNNG_HAVE_UNIX_SOCKETS=1 -DNNG_HIDDEN_VISIBILITY -DNNG_MAX_TASKQ_THREADS=16 -DNNG_PLATFORM_LINUX -DNNG_PLATFORM_POSIX -DNNG_PRIVATE -DNNG_STATIC_LIB -DNNG_SUPP_HTTP -DNNG_TRANSPORT_INPROC -DNNG_TRANSPORT_IPC -DNNG_TRANSPORT_MQTT_BROKER_TCP -DNNG_TRANSPORT_MQTT_BROKER_WS -DNNG_TRANSPORT_MQTT_TCP -DNNG_TRANSPORT_MQTT_TLS -DNNG_TRANSPORT_TCP -DNNG_TRANSPORT_TLS -DNNG_TRANSPORT_WS -DNNG_USE_EVENTFD -DNOLOG -DSUPP_CLIENT -D_GNU_SOURCE -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT -D_THREAD_SAFE -I/usr/local/package/nanomq/nng/src -I/usr/local/package/nanomq/nng/include -I/usr/local/package/nanomq/nanolib/include -I/usr/local/package/nanomq/nanomq/include -std=c99 -Wall -Wextra -fno-omit-frame-pointer -std=gnu99 -MD -MT nng/CMakeFiles/nng.dir/src/sp/protocol/mqtt/nmq_mqtt.c.o -MF nng/CMakeFiles/nng.dir/src/sp/protocol/mqtt/nmq_mqtt.c.o.d -o nng/CMakeFiles/nng.dir/src/sp/protocol/mqtt/nmq_mqtt.c.o -c /usr/local/package/nanomq/nng/src/sp/protocol/mqtt/nmq_mqtt.c In file included from /usr/local/package/nanomq/nanomq/include/sub_handler.h:7:0, from /usr/local/package/nanomq/nng/src/sp/protocol/mqtt/nmq_mqtt.c:23: /usr/local/package/nanomq/nanomq/include/broker.h:11:23: 致命错误:stdatomic.h:没有那个文件或目录 #include <stdatomic.h> ^ 编译中断。
编译时候缺少文件
https://api.github.com/repos/nanomq/nanomq/issues/440/comments
2
2022-03-17T05:28:26Z
2022-03-17T07:33:04Z
https://github.com/nanomq/nanomq/issues/440
1,171,949,674
440
[ "emqx", "nanomq" ]
官方会出这种编译版本吗?
怎么把nanomq移植到i.mx6嵌入式设备上?
https://api.github.com/repos/nanomq/nanomq/issues/438/comments
1
2022-03-17T02:08:43Z
2022-03-18T03:36:39Z
https://github.com/nanomq/nanomq/issues/438
1,171,843,650
438
[ "emqx", "nanomq" ]
Compile nanomq with asan on mac, run cmd `./nanomq/nanomq broker start --bridge ../etc/nanomq_bridge.conf` got error below. ``` ➜ build git:(master) ✗ ./nanomq/nanomq broker start --bridge ../etc/nanomq_bridge.conf ================================================================= ==37477==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x603000007586 at pc 0x00010443d634 bp 0x7ffeebab6e70 sp 0x7ffeebab6630 READ of size 23 at 0x603000007586 thread T0 #0 0x10443d633 in wrap_strlen+0x183 (libclang_rt.asan_osx_dynamic.dylib:x86_64h+0x1a633) #1 0x7fff6b552158 in vsscanf_l+0x7f (libsystem_c.dylib:x86_64+0x4f158) #2 0x104446fe9 in wrap_sscanf+0xd9 (libclang_rt.asan_osx_dynamic.dylib:x86_64h+0x23fe9) #3 0x104194536 in get_conf_value conf.c:151 #4 0x104196dff in conf_bridge_parse conf.c:570 #5 0x1041dcac2 in broker_start broker.c:1123 #6 0x10419f811 in main nanomq.c:187 #7 0x7fff6b4b3cc8 in start+0x0 (libdyld.dylib:x86_64+0x1acc8) 0x603000007586 is located 0 bytes to the right of 22-byte region [0x603000007570,0x603000007586) allocated by thread T0 here: #0 0x10446c552 in wrap_calloc+0xa2 (libclang_rt.asan_osx_dynamic.dylib:x86_64h+0x49552) #1 0x104198f09 in strtrim conf.c:20 #2 0x104194506 in get_conf_value conf.c:149 #3 0x104196dff in conf_bridge_parse conf.c:570 #4 0x1041dcac2 in broker_start broker.c:1123 #5 0x10419f811 in main nanomq.c:187 #6 0x7fff6b4b3cc8 in start+0x0 (libdyld.dylib:x86_64+0x1acc8) SUMMARY: AddressSanitizer: heap-buffer-overflow (libclang_rt.asan_osx_dynamic.dylib:x86_64h+0x1a633) in wrap_strlen+0x183 Shadow bytes around the buggy address: 0x1c0600000e60: fd fd fd fa fa fa fd fd fd fd fa fa fd fd fd fa 0x1c0600000e70: fa fa fd fd fd fd fa fa fd fd fd fa fa fa fd fd 0x1c0600000e80: fd fd fa fa fd fd fd fa fa fa fd fd fd fd fa fa 0x1c0600000e90: fd fd fd fa fa fa fd fd fd fd fa fa fd fd fd fa 0x1c0600000ea0: fa fa fd fd fd fd fa fa 00 00 00 00 fa fa 00 00 =>0x1c0600000eb0:[06]fa fa fa 00 00 00 00 fa fa fa fa fa fa fa fa 0x1c0600000ec0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x1c0600000ed0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x1c0600000ee0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x1c0600000ef0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x1c0600000f00: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa Shadow byte legend (one shadow byte represents 8 application bytes): Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 Heap left redzone: fa Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack after return: f5 Stack use after scope: f8 Global redzone: f9 Global init order: f6 Poisoned by user: f7 Container overflow: fc Array cookie: ac Intra object redzone: bb ASan internal: fe Left alloca redzone: ca Right alloca redzone: cb Shadow gap: cc ==37477==ABORTING [1] 37477 abort ./nanomq/nanomq broker start --bridge ../etc/nanomq_bridge.conf ```
Bridge caused heap-buffer-overflow.
https://api.github.com/repos/nanomq/nanomq/issues/436/comments
1
2022-03-16T07:16:57Z
2022-03-17T02:01:39Z
https://github.com/nanomq/nanomq/issues/436
1,170,632,763
436
[ "emqx", "nanomq" ]
``` $ mosquitto_sub -t 'topic1/+' $ mosquitto_pub -t topic1/ -m "forward_msg" ``` sub client can not receive msg
Wildcard '+' subscription is not correct.
https://api.github.com/repos/nanomq/nanomq/issues/435/comments
0
2022-03-16T02:39:20Z
2022-03-16T07:48:41Z
https://github.com/nanomq/nanomq/issues/435
1,170,469,515
435
[ "emqx", "nanomq" ]
mosquitto_sub -t 'topic/#' mosquitto_pub -t 'topic' sub client can not receive topic.
Wildcard '#' subscription is not correct
https://api.github.com/repos/nanomq/nanomq/issues/434/comments
0
2022-03-16T02:00:46Z
2022-03-18T03:22:24Z
https://github.com/nanomq/nanomq/issues/434
1,170,448,803
434
[ "emqx", "nanomq" ]
When run bridge function, set config ``` bridge.mqtt.forwards=topic1/topic2/# ``` subscribe to remote broker ``` $ mosquitto_sub -t 'topic1' -h ip -p port ``` publish to ``` mosquitto_pub -t topic1 -m "forward_msg" ``` sub client receive msg., but it should not receive msg.
Bridge bug.
https://api.github.com/repos/nanomq/nanomq/issues/431/comments
0
2022-03-15T09:34:13Z
2022-03-17T12:28:33Z
https://github.com/nanomq/nanomq/issues/431
1,169,409,887
431
[ "emqx", "nanomq" ]
NanoMQ compile failed on mac, here is the cmd and log ``` $ cmake -G Ninja -DCFG_METHOD=CMAKE_CONFIG -DCMAKE_BUILD_TYPE=Debug -DNOLOG=ON -DMQ=OFF .. $ ninja [1/2] Building C object nanomq/CMakeFiles/nanomq.dir/rest_api.c.o FAILED: nanomq/CMakeFiles/nanomq.dir/rest_api.c.o /usr/bin/clang -DNNG_STATIC_LIB -DNOLOG -DPARALLEL=32 -DSUPP_CLIENT -I../nanomq/. -I../nanomq/include -I../nng/include/nng -I../nanolib/include -I../nng/include -std=gnu99 -g -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -MD -MT nanomq/CMakeFiles/nanomq.dir/rest_api.c.o -MF nanomq/CMakeFiles/nanomq.dir/rest_api.c.o.d -o nanomq/CMakeFiles/nanomq.dir/rest_api.c.o -c ../nanomq/rest_api.c ../nanomq/rest_api.c:678:9: error: implicit declaration of function 'getcwd' is invalid in C99 [-Werror,-Wimplicit-function-declaration] if (getcwd(dir, sizeof(dir)) != NULL) { ^ ../nanomq/rest_api.c:678:34: warning: comparison between pointer and integer ('int' and 'void *') [-Wpointer-integer-compare] if (getcwd(dir, sizeof(dir)) != NULL) { ~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~ ../nanomq/rest_api.c:697:9: error: implicit declaration of function 'getcwd' is invalid in C99 [-Werror,-Wimplicit-function-declaration] if (getcwd(dir, sizeof(dir)) != NULL) { ^ ../nanomq/rest_api.c:697:34: warning: comparison between pointer and integer ('int' and 'void *') [-Wpointer-integer-compare] if (getcwd(dir, sizeof(dir)) != NULL) { ~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~ ../nanomq/rest_api.c:716:9: error: implicit declaration of function 'getcwd' is invalid in C99 [-Werror,-Wimplicit-function-declaration] if (getcwd(dir, sizeof(dir)) != NULL) { ^ ../nanomq/rest_api.c:716:34: warning: comparison between pointer and integer ('int' and 'void *') [-Wpointer-integer-compare] if (getcwd(dir, sizeof(dir)) != NULL) { ~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~ 3 warnings and 3 errors generated. ninja: build stopped: subcommand failed.
NanoMQ compile failed on mac
https://api.github.com/repos/nanomq/nanomq/issues/429/comments
0
2022-03-15T07:22:45Z
2022-03-15T08:44:34Z
https://github.com/nanomq/nanomq/issues/429
1,169,280,420
429
[ "emqx", "nanomq" ]
null
NanoMQ toolkit documents
https://api.github.com/repos/nanomq/nanomq/issues/427/comments
0
2022-03-15T06:44:05Z
2022-03-16T02:22:37Z
https://github.com/nanomq/nanomq/issues/427
1,169,252,242
427
[ "emqx", "nanomq" ]
```bash ./nanomq/nanomq pub start --url "mqtt-tcp://127.0.0.1:1883" -t "cmd/topic1" -m "cmd_msg" ``` ```bash connect_cb: connected! nng_send_aio:Invalid argument ================================================================= ==2734221==ERROR: AddressSanitizer: heap-use-after-free on address 0x60f000000260 at pc 0x55abfcd74973 bp 0x7f1241ef2a80 sp 0x7f1241ef2a70 READ of size 8 at 0x60f000000260 thread T13 (nng:task) #0 0x55abfcd74972 in nni_msg_dup ../nng/src/core/message.c:431 #1 0x55abfcd67096 in nng_msg_dup ../nng/src/nng.c:1818 #2 0x55abfcd4b151 in client_cb ../nanomq/apps/client.c:753 #3 0x55abfcd8444f in nni_taskq_thread ../nng/src/core/taskq.c:50 #4 0x55abfcd856be in nni_thr_wrap ../nng/src/core/thread.c:94 #5 0x55abfcd8deb8 in nni_plat_thr_main ../nng/src/platform/posix/posix_thread.c:266 #6 0x7f124b7ee58f in start_thread nptl/pthread_create.c:463 #7 0x7f124b709222 in __clone (/lib/x86_64-linux-gnu/libc.so.6+0x119222) 0x60f000000260 is located 64 bytes inside of 168-byte region [0x60f000000220,0x60f0000002c8) freed by thread T13 (nng:task) here: #0 0x7f124b9147cf in __interceptor_free (/lib/x86_64-linux-gnu/libasan.so.5+0x10d7cf) #1 0x55abfcd89b30 in nni_free ../nng/src/platform/posix/posix_alloc.c:33 #2 0x55abfcd74d30 in nni_msg_free ../nng/src/core/message.c:469 #3 0x55abfcd63b29 in nng_msg_free ../nng/src/nng.c:1431 #4 0x55abfcd4b0e4 in client_cb ../nanomq/apps/client.c:749 #5 0x55abfcd8444f in nni_taskq_thread ../nng/src/core/taskq.c:50 #6 0x55abfcd856be in nni_thr_wrap ../nng/src/core/thread.c:94 #7 0x55abfcd8deb8 in nni_plat_thr_main ../nng/src/platform/posix/posix_thread.c:266 #8 0x7f124b7ee58f in start_thread nptl/pthread_create.c:463 previously allocated by thread T0 here: #0 0x7f124b914dc6 in calloc (/lib/x86_64-linux-gnu/libasan.so.5+0x10ddc6) #1 0x55abfcd89b07 in nni_zalloc ../nng/src/platform/posix/posix_alloc.c:26 #2 0x55abfcd747fe in nni_msg_alloc ../nng/src/core/message.c:388 #3 0x55abfcdcb82d in nni_mqtt_msg_alloc ../nng/src/supplemental/mqtt/mqtt_msg.c:38 #4 0x55abfcdc1a7e in nng_mqtt_msg_alloc ../nng/src/supplemental/mqtt/mqtt_public.c:18 #5 0x55abfcd4a308 in publish_msg ../nanomq/apps/client.c:676 #6 0x55abfcd4a937 in client_cb ../nanomq/apps/client.c:701 #7 0x55abfcd4c98d in create_client ../nanomq/apps/client.c:929 #8 0x55abfcd4cf7b in client ../nanomq/apps/client.c:959 #9 0x55abfcd4d66b in pub_start ../nanomq/apps/client.c:995 #10 0x55abfcd1a1e1 in main ../nanomq/nanomq.c:187 #11 0x7f124b618cb1 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x28cb1) Thread T13 (nng:task) created by T0 here: #0 0x7f124b841805 in pthread_create (/lib/x86_64-linux-gnu/libasan.so.5+0x3a805) #1 0x55abfcd8dfe8 in nni_plat_thr_init ../nng/src/platform/posix/posix_thread.c:279 #2 0x55abfcd85967 in nni_thr_init ../nng/src/core/thread.c:121 #3 0x55abfcd84770 in nni_taskq_init ../nng/src/core/taskq.c:95 #4 0x55abfcd8538e in nni_taskq_sys_init ../nng/src/core/taskq.c:284 #5 0x55abfcd70998 in nni_init_helper ../nng/src/core/init.c:35 #6 0x55abfcd8e33c in nni_plat_init ../nng/src/platform/posix/posix_thread.c:422 #7 0x55abfcd70a16 in nni_init ../nng/src/core/init.c:58 #8 0x55abfcd7ce0a in nni_sock_open ../nng/src/core/socket.c:630 #9 0x55abfcda5025 in nni_proto_open ../nng/src/sp/protocol.c:22 #10 0x55abfcd92df9 in nng_mqtt_client_open ../nng/src/mqtt/protocol/mqtt/mqtt_client.c:833 #11 0x55abfcd4c4b4 in create_client ../nanomq/apps/client.c:894 #12 0x55abfcd4cf7b in client ../nanomq/apps/client.c:959 #13 0x55abfcd4d66b in pub_start ../nanomq/apps/client.c:995 #14 0x55abfcd1a1e1 in main ../nanomq/nanomq.c:187 #15 0x7f124b618cb1 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x28cb1) SUMMARY: AddressSanitizer: heap-use-after-free ../nng/src/core/message.c:431 in nni_msg_dup Shadow bytes around the buggy address: 0x0c1e7fff7ff0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0c1e7fff8000: fa fa fa fa fa fa fa fa 00 00 00 00 00 00 00 00 0x0c1e7fff8010: 00 00 00 00 00 00 00 00 00 00 00 00 00 fa fa fa 0x0c1e7fff8020: fa fa fa fa fa fa 00 00 00 00 00 00 00 00 00 00 0x0c1e7fff8030: 00 00 00 00 00 00 00 00 00 00 00 fa fa fa fa fa =>0x0c1e7fff8040: fa fa fa fa fd fd fd fd fd fd fd fd[fd]fd fd fd 0x0c1e7fff8050: fd fd fd fd fd fd fd fd fd fa fa fa fa fa fa fa 0x0c1e7fff8060: fa fa fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x0c1e7fff8070: fd fd fd fd fd fd fd fa fa fa fa fa fa fa fa fa 0x0c1e7fff8080: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c1e7fff8090: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa Shadow byte legend (one shadow byte represents 8 application bytes): Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 Heap left redzone: fa Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack after return: f5 Stack use after scope: f8 Global redzone: f9 Global init order: f6 Poisoned by user: f7 Container overflow: fc Array cookie: ac Intra object redzone: bb ASan internal: fe Left alloca redzone: ca Right alloca redzone: cb Shadow gap: cc ==2734221==ABORTING```
nanomq toolkit : pub client
https://api.github.com/repos/nanomq/nanomq/issues/424/comments
0
2022-03-14T03:13:10Z
2022-04-15T07:30:32Z
https://github.com/nanomq/nanomq/issues/424
1,167,831,307
424
[ "emqx", "nanomq" ]
null
Memory leaks if no clients subscribe will message.
https://api.github.com/repos/nanomq/nanomq/issues/421/comments
0
2022-03-12T09:05:38Z
2022-03-12T13:54:29Z
https://github.com/nanomq/nanomq/issues/421
1,167,229,923
421
[ "emqx", "nanomq" ]
when run nanomq help, cmd show below will get error info. ``` $ ./nanomq/nanomq --help Error - the app '--help' was not found Usage: nanomq broker | pub | sub | conn | bench | nngcat [--help] EMQ X Edge Computing Kit v0.6.0-3 Copyright 2022 EMQ X Edge Team ```
nanomq help info not correct.
https://api.github.com/repos/nanomq/nanomq/issues/416/comments
2
2022-03-11T03:15:31Z
2022-04-11T03:07:59Z
https://github.com/nanomq/nanomq/issues/416
1,165,951,353
416
[ "emqx", "nanomq" ]
NanoMQ seems to do a few checks in variable items (like utf8 string). So, this will cause security problems of memory. For example. A message whose remaining length is 20 but with a 50 bytes client identify. Maybe we should build a mechanism to prevent overflow or underflow problems in messages.
Overflow or underflow problems in messages
https://api.github.com/repos/nanomq/nanomq/issues/414/comments
1
2022-03-10T10:28:19Z
2022-05-01T05:27:56Z
https://github.com/nanomq/nanomq/issues/414
1,165,036,218
414
[ "emqx", "nanomq" ]
Change default http server port from 8081 to 8082? Because if an EMQX broker is lauched on your machine, Collision will always occured on default port 8081. But on real scene, maybe that is not a question.
Should we change default http server port from 8081 to 8082?
https://api.github.com/repos/nanomq/nanomq/issues/411/comments
0
2022-03-10T05:04:44Z
2022-11-21T11:12:27Z
https://github.com/nanomq/nanomq/issues/411
1,164,757,598
411
[ "emqx", "nanomq" ]
Launched broker, use mosquitto subscribe shared subscription. Cmd and log show below: ```shell $ mosquitto_sub -t '$share/a/topic' $ mosquitto_sub -t '$share/a/topic' $ mosquitto_sub -t 'topic' $ mosquitto_pub -t topic -m topic ``` Two shared subscription can receive message, but non shared can not receive. Hit Ctrl-C to broker caused memory leak ```shell Broker exit(0). ================================================================= ==11243==ERROR: LeakSanitizer: detected memory leaks Direct leak of 256 byte(s) in 8 object(s) allocated from: #0 0x7f63ed27f527 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:145 #1 0x563e97d8bf81 in foreach_client ../nanomq/pub_handler.c:122 #2 0x563e97d8cbad in handle_pub ../nanomq/pub_handler.c:192 #3 0x563e97da6a45 in server_cb ../nanomq/apps/broker.c:187 #4 0x563e97de2366 in nni_task_exec ../nng/src/core/taskq.c:144 #5 0x563e97dc6f37 in nni_aio_finish_impl ../nng/src/core/aio.c:450 #6 0x563e97dc6fb9 in nni_aio_finish_sync ../nng/src/core/aio.c:467 #7 0x563e97e01486 in nano_pipe_recv_cb ../nng/src/sp/protocol/mqtt/nmq_mqtt.c:891 #8 0x563e97de2366 in nni_task_exec ../nng/src/core/taskq.c:144 #9 0x563e97dc6f37 in nni_aio_finish_impl ../nng/src/core/aio.c:450 #10 0x563e97dc6fb9 in nni_aio_finish_sync ../nng/src/core/aio.c:467 #11 0x563e97e60d17 in tcptran_pipe_recv_cb ../nng/src/sp/transport/mqtt/broker_tcp.c:718 #12 0x563e97de1b71 in nni_taskq_thread ../nng/src/core/taskq.c:50 #13 0x563e97de2dde in nni_thr_wrap ../nng/src/core/thread.c:94 #14 0x563e97deb5c4 in nni_plat_thr_main ../nng/src/platform/posix/posix_thread.c:266 #15 0x7f63ed1b658f in start_thread nptl/pthread_create.c:463 SUMMARY: AddressSanitizer: 256 byte(s) leaked in 8 allocation(s). ```
when shared subscription and non shared subscription subscribe at the same time ,non shared sub can not receive message.
https://api.github.com/repos/nanomq/nanomq/issues/409/comments
0
2022-03-09T08:27:11Z
2022-03-10T01:15:57Z
https://github.com/nanomq/nanomq/issues/409
1,163,632,768
409
[ "emqx", "nanomq" ]
log from asan ``` ==137444==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x7f9be10d05f5 bp 0x7f9bd79f29e0 sp 0x7f9bd79f2148 T13) ==137444==The signal is caused by a READ memory access. ==137444==Hint: address points to the zero page. #0 0x7f9be10d05f4 (/lib/x86_64-linux-gnu/libc.so.6+0x1885f4) #1 0x7f9be1229cf5 in __interceptor_strcpy ../../../../src/libsanitizer/asan/asan_interceptors.cc:428 #2 0x55e8c0e89c1a in cli_ctx_merge ../nanomq/sub_handler.c:429 #3 0x55e8c0e8870f in sub_ctx_handle ../nanomq/sub_handler.c:306 #4 0x55e8c0e9f4e0 in server_cb ../nanomq/apps/broker.c:347 #5 0x55e8c0ed9969 in nni_taskq_thread ../nng/src/core/taskq.c:50 #6 0x55e8c0edabd8 in nni_thr_wrap ../nng/src/core/thread.c:94 #7 0x55e8c0ee33d2 in nni_plat_thr_main ../nng/src/platform/posix/posix_thread.c:266 #8 0x7f9be1173608 in start_thread /build/glibc-sMfBJT/glibc-2.31/nptl/pthread_create.c:477 #9 0x7f9be1067162 in __clone (/lib/x86_64-linux-gnu/libc.so.6+0x11f162) ``` ## How to reproduce Caused by fuzzing. Maybe caused by reconnecting fastly or sub/unsub frequently and fastly ...
error in cli_ctx_merge
https://api.github.com/repos/nanomq/nanomq/issues/405/comments
0
2022-03-09T07:09:08Z
2022-03-14T02:37:08Z
https://github.com/nanomq/nanomq/issues/405
1,163,569,709
405
[ "emqx", "nanomq" ]
log from asan ``` ==136739==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x7fd0d873b00c bp 0x7fd0ceff25f0 sp 0x7fd0ceff1d58 T13) ==136739==The signal is caused by a READ memory access. ==136739==Hint: address points to the zero page. #0 0x7fd0d873b00b (/lib/x86_64-linux-gnu/libc.so.6+0x18800b) #1 0x7fd0d886db1b in __interceptor_strchr ../../../../src/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:668 #2 0x55bd404e2af9 in decode_pub_message ../nanomq/pub_handler.c:673 #3 0x55bd404e0a59 in handle_pub ../nanomq/pub_handler.c:144 #4 0x55bd404fadab in server_cb ../nanomq/apps/broker.c:187 #5 0x55bd40537160 in nni_task_exec ../nng/src/core/taskq.c:144 #6 0x55bd4051bba2 in nni_aio_finish_impl ../nng/src/core/aio.c:450 #7 0x55bd4051bc24 in nni_aio_finish_sync ../nng/src/core/aio.c:467 #8 0x55bd40556cfb in nano_pipe_recv_cb ../nng/src/sp/protocol/mqtt/nmq_mqtt.c:1021 #9 0x55bd40537160 in nni_task_exec ../nng/src/core/taskq.c:144 #10 0x55bd4051bba2 in nni_aio_finish_impl ../nng/src/core/aio.c:450 #11 0x55bd4051bc24 in nni_aio_finish_sync ../nng/src/core/aio.c:467 #12 0x55bd405b729f in tcptran_pipe_recv_cb ../nng/src/sp/transport/mqtt/broker_tcp.c:720 #13 0x55bd40536969 in nni_taskq_thread ../nng/src/core/taskq.c:50 #14 0x55bd40537bd8 in nni_thr_wrap ../nng/src/core/thread.c:94 #15 0x55bd405403d2 in nni_plat_thr_main ../nng/src/platform/posix/posix_thread.c:266 #16 0x7fd0d87de608 in start_thread /build/glibc-sMfBJT/glibc-2.31/nptl/pthread_create.c:477 #17 0x7fd0d86d2162 in __clone (/lib/x86_64-linux-gnu/libc.so.6+0x11f162) ``` ## How to reproduce Caused by fuzz
error in decode_pub_message
https://api.github.com/repos/nanomq/nanomq/issues/404/comments
0
2022-03-09T06:59:09Z
2022-05-01T05:26:59Z
https://github.com/nanomq/nanomq/issues/404
1,163,562,538
404
[ "emqx", "nanomq" ]
Launched broker, use mosquitto subscribe shared subscription. Cmd and log show below: ```shell $ mosquitto_sub -t '$share/a/topic' $ mosquitto_sub -t '$share/a/topic' $ mosquitto_pub -t topic -m topic ``` Two shared subscription can not receive message. Hit Ctrl-C to broker caused memory leak ```shell lee@emqx-sz:~/workspace/nanomq/build$ ./nanomq/nanomq broker start --conf ../etc/nanomq.conf ^C Broker exit(0). ================================================================= ==3411161==ERROR: LeakSanitizer: detected memory leaks Direct leak of 32 byte(s) in 1 object(s) allocated from: #0 0x7f5547865527 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:145 #1 0x55f12bc48326 in nni_alloc ../nng/src/platform/posix/posix_alloc.c:20 #2 0x55f12bc198c1 in nng_alloc ../nng/src/nng.c:58 #3 0x55f12bbf2361 in sub_ctx_handle ../nanomq/sub_handler.c:288 #4 0x55f12bc0931d in server_cb ../nanomq/apps/broker.c:347 #5 0x55f12bc42ca0 in nni_taskq_thread ../nng/src/core/taskq.c:50 #6 0x55f12bc43f0d in nni_thr_wrap ../nng/src/core/thread.c:94 #7 0x55f12bc4c6f3 in nni_plat_thr_main ../nng/src/platform/posix/posix_thread.c:266 #8 0x7f554779c58f in start_thread nptl/pthread_create.c:463 Indirect leak of 80 byte(s) in 1 object(s) allocated from: #0 0x7f5547865527 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:145 #1 0x55f12bc48326 in nni_alloc ../nng/src/platform/posix/posix_alloc.c:20 #2 0x55f12bc198c1 in nng_alloc ../nng/src/nng.c:58 #3 0x55f12bbf2372 in sub_ctx_handle ../nanomq/sub_handler.c:289 #4 0x55f12bc0931d in server_cb ../nanomq/apps/broker.c:347 #5 0x55f12bc42ca0 in nni_taskq_thread ../nng/src/core/taskq.c:50 #6 0x55f12bc43f0d in nni_thr_wrap ../nng/src/core/thread.c:94 #7 0x55f12bc4c6f3 in nni_plat_thr_main ../nng/src/platform/posix/posix_thread.c:266 #8 0x7f554779c58f in start_thread nptl/pthread_create.c:463 Indirect leak of 32 byte(s) in 1 object(s) allocated from: #0 0x7f5547865527 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:145 #1 0x55f12bc48326 in nni_alloc ../nng/src/platform/posix/posix_alloc.c:20 #2 0x55f12bc198c1 in nng_alloc ../nng/src/nng.c:58 #3 0x55f12bbf3a69 in cli_ctx_merge ../nanomq/sub_handler.c:426 #4 0x55f12bbf2647 in sub_ctx_handle ../nanomq/sub_handler.c:306 #5 0x55f12bc0931d in server_cb ../nanomq/apps/broker.c:347 #6 0x55f12bc42ca0 in nni_taskq_thread ../nng/src/core/taskq.c:50 #7 0x55f12bc43f0d in nni_thr_wrap ../nng/src/core/thread.c:94 #8 0x55f12bc4c6f3 in nni_plat_thr_main ../nng/src/platform/posix/posix_thread.c:266 #9 0x7f554779c58f in start_thread nptl/pthread_create.c:463 Indirect leak of 16 byte(s) in 1 object(s) allocated from: #0 0x7f5547865527 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:145 #1 0x55f12bc48326 in nni_alloc ../nng/src/platform/posix/posix_alloc.c:20 #2 0x55f12bc198c1 in nng_alloc ../nng/src/nng.c:58 #3 0x55f12bbf3a5b in cli_ctx_merge ../nanomq/sub_handler.c:425 #4 0x55f12bbf2647 in sub_ctx_handle ../nanomq/sub_handler.c:306 #5 0x55f12bc0931d in server_cb ../nanomq/apps/broker.c:347 #6 0x55f12bc42ca0 in nni_taskq_thread ../nng/src/core/taskq.c:50 #7 0x55f12bc43f0d in nni_thr_wrap ../nng/src/core/thread.c:94 #8 0x55f12bc4c6f3 in nni_plat_thr_main ../nng/src/platform/posix/posix_thread.c:266 #9 0x7f554779c58f in start_thread nptl/pthread_create.c:463 Indirect leak of 15 byte(s) in 1 object(s) allocated from: #0 0x7f5547865527 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:145 #1 0x55f12bc48326 in nni_alloc ../nng/src/platform/posix/posix_alloc.c:20 #2 0x55f12bc198c1 in nng_alloc ../nng/src/nng.c:58 #3 0x55f12bbf3ad7 in cli_ctx_merge ../nanomq/sub_handler.c:427 #4 0x55f12bbf2647 in sub_ctx_handle ../nanomq/sub_handler.c:306 #5 0x55f12bc0931d in server_cb ../nanomq/apps/broker.c:347 #6 0x55f12bc42ca0 in nni_taskq_thread ../nng/src/core/taskq.c:50 #7 0x55f12bc43f0d in nni_thr_wrap ../nng/src/core/thread.c:94 #8 0x55f12bc4c6f3 in nni_plat_thr_main ../nng/src/platform/posix/posix_thread.c:266 #9 0x7f554779c58f in start_thread nptl/pthread_create.c:463 SUMMARY: AddressSanitizer: 175 byte(s) leaked in 5 allocation(s). ```
shared subscription can not receive message and memory leak.
https://api.github.com/repos/nanomq/nanomq/issues/403/comments
0
2022-03-09T02:54:28Z
2022-03-09T08:08:34Z
https://github.com/nanomq/nanomq/issues/403
1,163,428,945
403
[ "emqx", "nanomq" ]
log from asan ``` ==102236==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x603000010106 at pc 0x5652d895a069 bp 0x7f9d24ef5aa0 sp 0x7f9d24ef5a90 READ of size 1 at 0x603000010106 thread T10 (nng:task) #0 0x5652d895a068 in utf8_check ../nng/src/sp/protocol/mqtt/mqtt_parser.c:247 #1 0x5652d8959e38 in copy_utf8_str ../nng/src/sp/protocol/mqtt/mqtt_parser.c:217 #2 0x5652d895be1e in conn_handler ../nng/src/sp/protocol/mqtt/mqtt_parser.c:527 #3 0x5652d89c3dff in tcptran_pipe_nego_cb ../nng/src/sp/transport/mqtt/broker_tcp.c:337 #4 0x5652d8945969 in nni_taskq_thread ../nng/src/core/taskq.c:50 #5 0x5652d8946bd8 in nni_thr_wrap ../nng/src/core/thread.c:94 #6 0x5652d894f3d2 in nni_plat_thr_main ../nng/src/platform/posix/posix_thread.c:266 #7 0x7f9d2cea6608 in start_thread /build/glibc-sMfBJT/glibc-2.31/nptl/pthread_create.c:477 #8 0x7f9d2cd9a162 in __clone (/lib/x86_64-linux-gnu/libc.so.6+0x11f162) 0x603000010106 is located 0 bytes to the right of 22-byte region [0x6030000100f0,0x603000010106) allocated by thread T10 (nng:task) here: #0 0x7f9d2cfce808 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cc:144 #1 0x5652d894aff0 in nni_alloc ../nng/src/platform/posix/posix_alloc.c:20 #2 0x5652d891c3df in nng_alloc ../nng/src/nng.c:58 #3 0x5652d89c3b47 in tcptran_pipe_nego_cb ../nng/src/sp/transport/mqtt/broker_tcp.c:320 #4 0x5652d8945969 in nni_taskq_thread ../nng/src/core/taskq.c:50 #5 0x5652d8946bd8 in nni_thr_wrap ../nng/src/core/thread.c:94 #6 0x5652d894f3d2 in nni_plat_thr_main ../nng/src/platform/posix/posix_thread.c:266 #7 0x7f9d2cea6608 in start_thread /build/glibc-sMfBJT/glibc-2.31/nptl/pthread_create.c:477 ``` ## How to reproduce Cause by fuzzing...
fuzzy testing - issue
https://api.github.com/repos/nanomq/nanomq/issues/402/comments
0
2022-03-08T07:20:21Z
2022-05-01T05:25:40Z
https://github.com/nanomq/nanomq/issues/402
1,162,309,269
402
[ "emqx", "nanomq" ]
log from asan ``` ==101009==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x55c7fb45b936 bp 0x7efe0aff6d10 sp 0x7efe0aff6b90 T9) ==101009==The signal is caused by a READ memory access. ==101009==Hint: address points to the zero page. #0 0x55c7fb45b935 in server_cb ../nanomq/apps/broker.c:361 #1 0x55c7fb495969 in nni_taskq_thread ../nng/src/core/taskq.c:50 #2 0x55c7fb496bd8 in nni_thr_wrap ../nng/src/core/thread.c:94 #3 0x55c7fb49f3d2 in nni_plat_thr_main ../nng/src/platform/posix/posix_thread.c:266 #4 0x7efe1276d608 in start_thread /build/glibc-sMfBJT/glibc-2.31/nptl/pthread_create.c:477 #5 0x7efe12661162 in __clone (/lib/x86_64-linux-gnu/libc.so.6+0x11f162) AddressSanitizer can not provide additional info. SUMMARY: AddressSanitizer: SEGV ../nanomq/apps/broker.c:361 in server_cb Thread T9 (nng:task) created by T0 here: #0 0x7efe127c2815 in __interceptor_pthread_create ../../../../src/libsanitizer/asan/asan_interceptors.cc:208 #1 0x55c7fb49f502 in nni_plat_thr_init ../nng/src/platform/posix/posix_thread.c:279 #2 0x55c7fb496e81 in nni_thr_init ../nng/src/core/thread.c:121 #3 0x55c7fb495c8a in nni_taskq_init ../nng/src/core/taskq.c:95 #4 0x55c7fb4968a8 in nni_taskq_sys_init ../nng/src/core/taskq.c:284 #5 0x55c7fb481fca in nni_init_helper ../nng/src/core/init.c:35 #6 0x55c7fb49f856 in nni_plat_init ../nng/src/platform/posix/posix_thread.c:422 #7 0x55c7fb482048 in nni_init ../nng/src/core/init.c:58 #8 0x55c7fb4b66da in nni_proto_mqtt_open ../nng/src/sp/protocol.c:37 #9 0x55c7fb4b643d in nng_nmq_tcp0_open ../nng/src/sp/protocol/mqtt/nmq_mqtt.c:1173 #10 0x55c7fb45eab2 in broker ../nanomq/apps/broker.c:723 #11 0x55c7fb4613a3 in broker_start ../nanomq/apps/broker.c:1154 #12 0x55c7fb43d355 in main ../nanomq/nanomq.c:187 #13 0x7efe125660b2 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x240b2) ``` ## How to reproduce Cause by fuzzing...
error of msg_ret
https://api.github.com/repos/nanomq/nanomq/issues/401/comments
1
2022-03-08T07:17:20Z
2022-05-11T06:39:03Z
https://github.com/nanomq/nanomq/issues/401
1,162,306,935
401
[ "emqx", "nanomq" ]
==468986==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x603000017938 at pc 0x5555555d1f57 bp 0x7ffff2cfca00 sp 0x7ffff2cfc9f0 READ of size 8 at 0x603000017938 thread T3 #0 0x5555555d1f56 in del_sub_ctx ../nanomq/sub_handler.c:470 #1 0x5555555d3391 in unsub_ctx_handle ../nanomq/unsub_handler.c:237 #2 0x5555555e7bf1 in server_cb ../nanomq/apps/broker.c:389 #3 0x5555556217bf in nni_taskq_thread ../nng/src/core/taskq.c:50 #4 0x555555622a29 in nni_thr_wrap ../nng/src/core/thread.c:94 #5 0x55555562b20f in nni_plat_thr_main ../nng/src/platform/posix/posix_thread.c:266 #6 0x7ffff741a946 in start_thread nptl/pthread_create.c:435 #7 0x7ffff74aaa43 in __clone (/lib/x86_64-linux-gnu/libc.so.6+0x124a43) 0x603000017938 is located 0 bytes to the right of 24-byte region [0x603000017920,0x603000017938) allocated by thread T5 here: #0 0x7ffff7686867 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:145 #1 0x5555555bf7aa in zmalloc ../nanolib/zmalloc.c:50 #2 0x5555555be71b in dbtree_new_ctxt ../nanolib/mqtt_db.c:1808 #3 0x5555555d0921 in sub_ctx_handle ../nanomq/sub_handler.c:329 #4 0x5555555e737d in server_cb ../nanomq/apps/broker.c:347 #5 0x5555556217bf in nni_taskq_thread ../nng/src/core/taskq.c:50 #6 0x555555622a29 in nni_thr_wrap ../nng/src/core/thread.c:94 #7 0x55555562b20f in nni_plat_thr_main ../nng/src/platform/posix/posix_thread.c:266 #8 0x7ffff741a946 in start_thread nptl/pthread_create.c:435 Thread T3 created by T0 here: #0 0x7ffff762a685 in __interceptor_pthread_create ../../../../src/libsanitizer/asan/asan_interceptors.cpp:216 #1 0x55555562b33f in nni_plat_thr_init ../nng/src/platform/posix/posix_thread.c:279 #2 0x555555622cd2 in nni_thr_init ../nng/src/core/thread.c:121 #3 0x555555621ade in nni_taskq_init ../nng/src/core/taskq.c:95 #4 0x5555556226f9 in nni_taskq_sys_init ../nng/src/core/taskq.c:284 #5 0x55555560de33 in nni_init_helper ../nng/src/core/init.c:35 #6 0x55555562b693 in nni_plat_init ../nng/src/platform/posix/posix_thread.c:422 #7 0x55555560deb1 in nni_init ../nng/src/core/init.c:58 #8 0x555555658c34 in nng_thread_create ../nng/src/supplemental/util/platform.c:42 #9 0x5555555d88f3 in start_rest_server ../nanomq/web_server.c:426 #10 0x5555555ed224 in broker_start ../nanomq/apps/broker.c:1147 #11 0x5555555c932c in main ../nanomq/nanomq.c:187 #12 0x7ffff73affcf in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58 Thread T5 created by T0 here: #0 0x7ffff762a685 in __interceptor_pthread_create ../../../../src/libsanitizer/asan/asan_interceptors.cpp:216 #1 0x55555562b33f in nni_plat_thr_init ../nng/src/platform/posix/posix_thread.c:279 #2 0x555555622cd2 in nni_thr_init ../nng/src/core/thread.c:121 #3 0x555555621ade in nni_taskq_init ../nng/src/core/taskq.c:95 #4 0x5555556226f9 in nni_taskq_sys_init ../nng/src/core/taskq.c:284 #5 0x55555560de33 in nni_init_helper ../nng/src/core/init.c:35 #6 0x55555562b693 in nni_plat_init ../nng/src/platform/posix/posix_thread.c:422 #7 0x55555560deb1 in nni_init ../nng/src/core/init.c:58 #8 0x555555658c34 in nng_thread_create ../nng/src/supplemental/util/platform.c:42 #9 0x5555555d88f3 in start_rest_server ../nanomq/web_server.c:426 #10 0x5555555ed224 in broker_start ../nanomq/apps/broker.c:1147 #11 0x5555555c932c in main ../nanomq/nanomq.c:187 #12 0x7ffff73affcf in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58 SUMMARY: AddressSanitizer: heap-buffer-overflow ../nanomq/sub_handler.c:470 in del_sub_ctx
UNSUB failed in 0.6.4
https://api.github.com/repos/nanomq/nanomq/issues/399/comments
0
2022-03-08T01:42:39Z
2022-03-08T05:20:21Z
https://github.com/nanomq/nanomq/issues/399
1,162,120,262
399
[ "emqx", "nanomq" ]
When log is on, http server receive request will caused heap-buffer-overflow. Log show below: ================================================================= ==3399990==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x6040000041fa at pc 0x7fa740f01441 bp 0x7fa739cf7960 sp 0x7fa739cf70d8 READ of size 43 at 0x6040000041fa thread T8 (nng:task) #0 0x7fa740f01440 in printf_common ../../../../src/libsanitizer/sanitizer_common/sanitizer_common_interceptors_format.inc:547 #1 0x7fa740f01d1e in __interceptor_vfprintf ../../../../src/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:1660 #2 0x7fa740f01e2e in __interceptor_fprintf ../../../../src/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:1717 #3 0x5606df91e2d7 in rest_job_cb ../nanomq/web_server.c:146 #4 0x5606df96ca4f in nni_task_exec ../nng/src/core/taskq.c:144 #5 0x5606df950da7 in nni_aio_finish_impl ../nng/src/core/aio.c:450 #6 0x5606df951093 in nni_aio_finish_sync ../nng/src/core/aio.c:467 #7 0x5606df97c1e7 in req0_recv_cb ../nng/src/sp/protocol/reqrep0/req.c:353 #8 0x5606df96c25a in nni_taskq_thread ../nng/src/core/taskq.c:50 #9 0x5606df96d830 in nni_thr_wrap ../nng/src/core/thread.c:94 #10 0x5606df976016 in nni_plat_thr_main ../nng/src/platform/posix/posix_thread.c:266 #11 0x7fa740e8c58f in start_thread nptl/pthread_create.c:463 #12 0x7fa740d82222 in __clone (/lib/x86_64-linux-gnu/libc.so.6+0x119222) 0x6040000041fa is located 0 bytes to the right of 42-byte region [0x6040000041d0,0x6040000041fa) allocated by thread T44 here: #0 0x7fa740f55527 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:145 #1 0x5606df971c49 in nni_alloc ../nng/src/platform/posix/posix_alloc.c:20 #2 0x5606df942262 in nng_alloc ../nng/src/nng.c:58 #3 0x5606df91a374 in put_http_msg ../nanomq/rest_api.c:74 #4 0x5606df91d43e in get_clients ../nanomq/rest_api.c:394 #5 0x5606df91b296 in process_request ../nanomq/rest_api.c:189 #6 0x5606df920628 in inproc_server ../nanomq/web_server.c:367 #7 0x5606df96d830 in nni_thr_wrap ../nng/src/core/thread.c:94 #8 0x5606df976016 in nni_plat_thr_main ../nng/src/platform/posix/posix_thread.c:266 #9 0x7fa740e8c58f in start_thread nptl/pthread_create.c:463 Thread T8 (nng:task) created by T0 here: #0 0x7fa740efca65 in __interceptor_pthread_create ../../../../src/libsanitizer/asan/asan_interceptors.cpp:216 #1 0x5606df976146 in nni_plat_thr_init ../nng/src/platform/posix/posix_thread.c:279 #2 0x5606df96dad9 in nni_thr_init ../nng/src/core/thread.c:121 #3 0x5606df96c579 in nni_taskq_init ../nng/src/core/taskq.c:95 #4 0x5606df96d500 in nni_taskq_sys_init ../nng/src/core/taskq.c:284 #5 0x5606df958859 in nni_init_helper ../nng/src/core/init.c:35 #6 0x5606df97649a in nni_plat_init ../nng/src/platform/posix/posix_thread.c:422 #7 0x5606df9588d7 in nni_init ../nng/src/core/init.c:58 #8 0x5606df9a8dfd in nng_thread_create ../nng/src/supplemental/util/platform.c:42 #9 0x5606df9208ac in start_rest_server ../nanomq/web_server.c:426 #10 0x5606df937875 in broker_start ../nanomq/apps/broker.c:1148 #11 0x5606df90779b in main ../nanomq/nanomq.c:187 #12 0x7fa740c91cb1 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x28cb1) Thread T44 created by T0 here: #0 0x7fa740efca65 in __interceptor_pthread_create ../../../../src/libsanitizer/asan/asan_interceptors.cpp:216 #1 0x5606df976146 in nni_plat_thr_init ../nng/src/platform/posix/posix_thread.c:279 #2 0x5606df96dad9 in nni_thr_init ../nng/src/core/thread.c:121 #3 0x5606df9a8e5c in nng_thread_create ../nng/src/supplemental/util/platform.c:48 #4 0x5606df9208ac in start_rest_server ../nanomq/web_server.c:426 #5 0x5606df937875 in broker_start ../nanomq/apps/broker.c:1148 #6 0x5606df90779b in main ../nanomq/nanomq.c:187 #7 0x7fa740c91cb1 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x28cb1) SUMMARY: AddressSanitizer: heap-buffer-overflow ../../../../src/libsanitizer/sanitizer_common/sanitizer_common_interceptors_format.inc:547 in printf_common Shadow bytes around the buggy address: 0x0c087fff87e0: fa fa 00 00 00 00 00 fa fa fa 00 00 00 00 00 fa 0x0c087fff87f0: fa fa 00 00 00 00 00 fa fa fa 00 00 00 00 00 fa 0x0c087fff8800: fa fa 00 00 00 00 00 00 fa fa 00 00 00 00 00 00 0x0c087fff8810: fa fa 00 00 00 00 00 00 fa fa 00 00 00 00 00 00 0x0c087fff8820: fa fa 00 00 00 00 00 00 fa fa fd fd fd fd fd fa =>0x0c087fff8830: fa fa fd fd fd fd fd fd fa fa 00 00 00 00 00[02] 0x0c087fff8840: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c087fff8850: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c087fff8860: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c087fff8870: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c087fff8880: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa Shadow byte legend (one shadow byte represents 8 application bytes): Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 Heap left redzone: fa Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack after return: f5 Stack use after scope: f8 Global redzone: f9 Global init order: f6 Poisoned by user: f7 Container overflow: fc Array cookie: ac Intra object redzone: bb ASan internal: fe Left alloca redzone: ca Right alloca redzone: cb Shadow gap: cc ==3399990==ABORTING
Http server heap-buffer-overflow error.
https://api.github.com/repos/nanomq/nanomq/issues/396/comments
0
2022-03-07T10:26:25Z
2022-03-08T00:37:54Z
https://github.com/nanomq/nanomq/issues/396
1,161,206,592
396
[ "emqx", "nanomq" ]
log from nng ``` panic: pthread_mutex_lock: Resource deadlock avoided This message is indicative of a BUG. Report this at https://github.com/nanomq/nanomq ./build/nanomq/nanomq(nni_show_backtrace+0xb8) [0x55ba2cc1f870] ./build/nanomq/nanomq(nni_panic+0x1ca) [0x55ba2cc1fb7e] ./build/nanomq/nanomq(+0xd6bca) [0x55ba2cc34bca] ./build/nanomq/nanomq(nni_plat_mtx_lock+0x1c) [0x55ba2cc34d8b] ./build/nanomq/nanomq(nni_mtx_lock+0x1c) [0x55ba2cc2c92a] ./build/nanomq/nanomq(+0xea6af) [0x55ba2cc486af] ./build/nanomq/nanomq(nni_ctx_send+0xca) [0x55ba2cc27209] ./build/nanomq/nanomq(nng_ctx_send+0x1be) [0x55ba2cc04497] ./build/nanomq/nanomq(server_cb+0x2e1d) [0x55ba2cbf24bc] ./build/nanomq/nanomq(+0xcd92a) [0x55ba2cc2b92a] ./build/nanomq/nanomq(+0xceb99) [0x55ba2cc2cb99] ./build/nanomq/nanomq(+0xd7393) [0x55ba2cc35393] /lib/x86_64-linux-gnu/libpthread.so.0(+0x9609) [0x7fcf9ecff609] /lib/x86_64-linux-gnu/libc.so.6(clone+0x43) [0x7fcf9ec1b293] [1] 55281 abort (core dumped) ./build/nanomq/nanomq broker start -D 3 ``` ## How to reproduce ./build/nanomq/nanomq broker start -D 3 mosquitto_sub -t msg/a -i clia -d -c -q 2 Stop mosquitto_pub -t msg/a -q 2 -m "aaa" mosquitto_pub -t msg/a -q 2 -m "aaa" > If the deadlock is not being triggered, try more ...
deadlock
https://api.github.com/repos/nanomq/nanomq/issues/395/comments
1
2022-03-07T10:19:52Z
2022-03-08T01:41:12Z
https://github.com/nanomq/nanomq/issues/395
1,161,199,021
395
[ "emqx", "nanomq" ]
null
There is no hint when log option is OFF and broker exit because web_server address is in use.
https://api.github.com/repos/nanomq/nanomq/issues/388/comments
0
2022-03-05T02:43:48Z
2022-03-05T02:46:42Z
https://github.com/nanomq/nanomq/issues/388
1,160,197,226
388
[ "emqx", "nanomq" ]
## log ``` Direct leak of 168 byte(s) in 1 object(s) allocated from: #0 0x7fb50e1d3dc6 in calloc (/lib/x86_64-linux-gnu/libasan.so.5+0x10ddc6) #1 0x55e4b7398ba4 in nni_zalloc ../nng/src/platform/posix/posix_alloc.c:26 #2 0x55e4b73839cc in nni_msg_alloc ../nng/src/core/message.c:388 #3 0x55e4b7411f42 in tcptran_pipe_recv_cb ../nng/src/sp/transport/mqtt/broker_tcp.c:583 #4 0x55e4b73934ec in nni_taskq_thread ../nng/src/core/taskq.c:50 #5 0x55e4b739475b in nni_thr_wrap ../nng/src/core/thread.c:94 #6 0x55e4b739cf55 in nni_plat_thr_main ../nng/src/platform/posix/posix_thread.c:266 #7 0x7fb50e0ac608 in start_thread /build/glibc-YbNSs7/glibc-2.31/nptl/pthread_create.c:477 ``` ## How to reproduce mosquitto_sub -t msg/a -i clia -d -c -q 2 mosquitto_pub -t msg/a -q 2 -m "aaa" then Stop sub When nni_pipe_send in function nano_pipe_timer_cb triggered, a leakage created.
Leaks detected
https://api.github.com/repos/nanomq/nanomq/issues/385/comments
1
2022-03-04T03:51:35Z
2022-03-04T09:21:56Z
https://github.com/nanomq/nanomq/issues/385
1,159,212,189
385
[ "emqx", "nanomq" ]
When I run nanomq with asan and use postman which set basic auth with username:admin, password:public and payload: { "req": 5, "seq": 1111111 } get response { "code": 103, "seq": 0 }
Http server can not verify correct client
https://api.github.com/repos/nanomq/nanomq/issues/382/comments
0
2022-03-02T11:27:25Z
2022-03-04T03:34:35Z
https://github.com/nanomq/nanomq/issues/382
1,157,062,789
382
[ "emqx", "nanomq" ]
Run ` mosquitto_sub -t xxxx -c -i test` caused error. AddressSanitizer:DEADLYSIGNAL ================================================================= ==3309254==ERROR: AddressSanitizer: SEGV on unknown address 0x6030440fd964 (pc 0x55c90faccf9b bp 0x7f11635f7a90 sp 0x7f11635f79e0 T8) ==3309254==The signal is caused by a WRITE memory access. #0 0x55c90faccf9b in sub_ctx_handle ../nanomq/sub_handler.c:298 #1 0x55c90fae2f70 in server_cb ../nanomq/apps/broker.c:361 #2 0x55c90fb1c8f3 in nni_taskq_thread ../nng/src/core/taskq.c:50 #3 0x55c90fb1db60 in nni_thr_wrap ../nng/src/core/thread.c:94 #4 0x55c90fb26346 in nni_plat_thr_main ../nng/src/platform/posix/posix_thread.c:266 #5 0x7f116a70758f in start_thread nptl/pthread_create.c:463 #6 0x7f116a5fd222 in __clone (/lib/x86_64-linux-gnu/libc.so.6+0x119222) AddressSanitizer can not provide additional info. SUMMARY: AddressSanitizer: SEGV ../nanomq/sub_handler.c:298 in sub_ctx_handle Thread T8 (nng:task) created by T0 here: #0 0x7f116a777a65 in __interceptor_pthread_create ../../../../src/libsanitizer/asan/asan_interceptors.cpp:216 #1 0x55c90fb26476 in nni_plat_thr_init ../nng/src/platform/posix/posix_thread.c:279 #2 0x55c90fb1de09 in nni_thr_init ../nng/src/core/thread.c:121 #3 0x55c90fb1cc12 in nni_taskq_init ../nng/src/core/taskq.c:95 #4 0x55c90fb1d830 in nni_taskq_sys_init ../nng/src/core/taskq.c:284 #5 0x55c90fb090da in nni_init_helper ../nng/src/core/init.c:35 #6 0x55c90fb267ca in nni_plat_init ../nng/src/platform/posix/posix_thread.c:422 #7 0x55c90fb09158 in nni_init ../nng/src/core/init.c:58 #8 0x55c90fb3cbeb in nni_proto_mqtt_open ../nng/src/sp/protocol.c:37 #9 0x55c90fb3c94c in nng_nmq_tcp0_open ../nng/src/sp/protocol/mqtt/nmq_mqtt.c:1043 #10 0x55c90fae6546 in broker ../nanomq/apps/broker.c:737 #11 0x55c90fae8e30 in broker_start ../nanomq/apps/broker.c:1168 #12 0x55c90fac6416 in main ../nanomq/nanomq.c:187 #13 0x7f116a50ccb1 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x28cb1) ==3309254==ABORTING
clean session error.
https://api.github.com/repos/nanomq/nanomq/issues/380/comments
0
2022-03-02T07:00:39Z
2022-03-02T07:40:37Z
https://github.com/nanomq/nanomq/issues/380
1,156,604,369
380
[ "emqx", "nanomq" ]
when I launched nanomq with http server and sent get request, then Ctrl-c to shutdown nanomq will got memory leak. Details see below: `./nanomq/nanomq broker start --conf ../etc/nanomq.conf` `request /api/v1` `Ctrl-c` Broker exit(0). ================================================================= ==3230433==ERROR: LeakSanitizer: detected memory leaks Direct leak of 168 byte(s) in 1 object(s) allocated from: #0 0x7f7b24ab66f7 in __interceptor_calloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:154 #1 0x55924502135f in nni_zalloc ../nng/src/platform/posix/posix_alloc.c:26 #2 0x55924500c2f7 in nni_msg_alloc ../nng/src/core/message.c:388 #3 0x559244ff9c8d in nng_msg_alloc ../nng/src/nng.c:1434 #4 0x559244fd0786 in rest_handle ../nanomq/web_server.c:220 #5 0x55924505866d in http_sconn_rxdone ../nng/src/supplemental/http/http_server.c:757 #6 0x55924501bca8 in nni_taskq_thread ../nng/src/core/taskq.c:50 #7 0x55924501cf15 in nni_thr_wrap ../nng/src/core/thread.c:94 #8 0x5592450256fb in nni_plat_thr_main ../nng/src/platform/posix/posix_thread.c:266 #9 0x7f7b249ed58f in start_thread nptl/pthread_create.c:463 Indirect leak of 64 byte(s) in 1 object(s) allocated from: #0 0x7f7b24ab66f7 in __interceptor_calloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:154 #1 0x55924502135f in nni_zalloc ../nng/src/platform/posix/posix_alloc.c:26 #2 0x55924500b0db in nni_chunk_grow ../nng/src/core/message.c:159 #3 0x55924500c347 in nni_msg_alloc ../nng/src/core/message.c:398 #4 0x559244ff9c8d in nng_msg_alloc ../nng/src/nng.c:1434 #5 0x559244fd0786 in rest_handle ../nanomq/web_server.c:220 #6 0x55924505866d in http_sconn_rxdone ../nng/src/supplemental/http/http_server.c:757 #7 0x55924501bca8 in nni_taskq_thread ../nng/src/core/taskq.c:50 #8 0x55924501cf15 in nni_thr_wrap ../nng/src/core/thread.c:94 #9 0x5592450256fb in nni_plat_thr_main ../nng/src/platform/posix/posix_thread.c:266 #10 0x7f7b249ed58f in start_thread nptl/pthread_create.c:463 SUMMARY: AddressSanitizer: 232 byte(s) leaked in 2 allocation(s).
Http server detected memory leaks
https://api.github.com/repos/nanomq/nanomq/issues/370/comments
0
2022-02-28T03:49:30Z
2022-03-05T02:42:47Z
https://github.com/nanomq/nanomq/issues/370
1,153,591,381
370
[ "emqx", "nanomq" ]
null
protocol error when sending qos 2 & MQTTV5 msg to MQTTV3 qos0 client
https://api.github.com/repos/nanomq/nanomq/issues/368/comments
0
2022-02-26T16:13:55Z
2022-02-26T17:02:53Z
https://github.com/nanomq/nanomq/issues/368
1,151,938,998
368
[ "emqx", "nanomq" ]
this cause memleak & wrong pipe id
broker's app layer is screwing msg pointer
https://api.github.com/repos/nanomq/nanomq/issues/367/comments
0
2022-02-26T16:12:48Z
2022-02-26T17:04:34Z
https://github.com/nanomq/nanomq/issues/367
1,151,937,600
367
[ "emqx", "nanomq" ]
null
MQTTV4 will msg cause segment fault
https://api.github.com/repos/nanomq/nanomq/issues/365/comments
0
2022-02-25T11:26:29Z
2022-02-25T12:04:20Z
https://github.com/nanomq/nanomq/issues/365
1,150,338,427
365
[ "emqx", "nanomq" ]
1) cmake .. 2)make Consolidate compiler generated dependencies of target nng [ 0%] Building C object nng/CMakeFiles/nng.dir/src/platform/posix/posix_atomic.c.o /var/nanomq/nanomq/nng/src/platform/posix/posix_atomic.c:379:20: error: unknown type name ‘nni_atomic_atomic’ nni_atomic_get_ptr(nni_atomic_atomic *v) ^ /var/nanomq/nanomq/nng/src/platform/posix/posix_atomic.c:389:20: error: unknown type name ‘nni_atomic_atomic’ nni_atomic_set_ptr(nni_atomic_atomic *v, void *p) ^ make[2]: *** [nng/CMakeFiles/nng.dir/src/platform/posix/posix_atomic.c.o] Error 1 make[1]: *** [nng/CMakeFiles/nng.dir/all] Error 2 make: *** [all] Error 2
compile error
https://api.github.com/repos/nanomq/nanomq/issues/364/comments
7
2022-02-25T06:41:20Z
2022-07-22T09:42:57Z
https://github.com/nanomq/nanomq/issues/364
1,150,099,836
364
[ "emqx", "nanomq" ]
`mosquitto_sub -t aaa -t +` `mosquitto_pub -t aaa -m aaa` caused output below: ==2962424==ERROR: AddressSanitizer: heap-use-after-free on address 0x603000012020 at pc 0x5643dc5d9364 bp 0x7fa2b1cf4560 sp 0x7fa2b1cf4550 READ of size 4 at 0x603000012020 thread T11 (nng:task) #0 0x5643dc5d9363 in foreach_client ../nanomq/pub_handler.c:110 #1 0x5643dc5d99a6 in handle_pub ../nanomq/pub_handler.c:167 #2 0x5643dc5f23a5 in server_cb ../nanomq/apps/broker.c:188 #3 0x5643dc62fba7 in nni_task_exec ../nng/src/core/taskq.c:144 #4 0x5643dc6147d5 in nni_aio_finish_impl ../nng/src/core/aio.c:450 #5 0x5643dc614857 in nni_aio_finish_sync ../nng/src/core/aio.c:467 #6 0x5643dc658894 in nano_pipe_recv_cb ../nng/src/sp/protocol/mqtt/nmq_mqtt.c:897 #7 0x5643dc62fba7 in nni_task_exec ../nng/src/core/taskq.c:144 #8 0x5643dc6147d5 in nni_aio_finish_impl ../nng/src/core/aio.c:450 #9 0x5643dc614857 in nni_aio_finish_sync ../nng/src/core/aio.c:467 #10 0x5643dc6a66dc in tcptran_pipe_recv_cb ../nng/src/sp/transport/mqtt/broker_tcp.c:718 #11 0x5643dc62f3b2 in nni_taskq_thread ../nng/src/core/taskq.c:50 #12 0x5643dc63061f in nni_thr_wrap ../nng/src/core/thread.c:94 #13 0x5643dc638e05 in nni_plat_thr_main ../nng/src/platform/posix/posix_thread.c:266 #14 0x7fa2ba61d58f in start_thread nptl/pthread_create.c:463 #15 0x7fa2ba513222 in __clone (/lib/x86_64-linux-gnu/libc.so.6+0x119222) 0x603000012020 is located 16 bytes inside of 20-byte region [0x603000012010,0x603000012024) freed by thread T11 (nng:task) here: #0 0x7fa2ba6e68e0 in __interceptor_realloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:164 #1 0x5643dc5bff38 in iterate_client_v5 ../nanolib/mqtt_db.c:933 #2 0x5643dc5c0b21 in search_client ../nanolib/mqtt_db.c:981 #3 0x5643dc5c0e1b in dbtree_find_clients_and_cache_msg ../nanolib/mqtt_db.c:1007 #4 0x5643dc5d991f in handle_pub ../nanomq/pub_handler.c:159 #5 0x5643dc5f23a5 in server_cb ../nanomq/apps/broker.c:188 #6 0x5643dc62fba7 in nni_task_exec ../nng/src/core/taskq.c:144 #7 0x5643dc6147d5 in nni_aio_finish_impl ../nng/src/core/aio.c:450 #8 0x5643dc614857 in nni_aio_finish_sync ../nng/src/core/aio.c:467 #9 0x5643dc658894 in nano_pipe_recv_cb ../nng/src/sp/protocol/mqtt/nmq_mqtt.c:897 #10 0x5643dc62fba7 in nni_task_exec ../nng/src/core/taskq.c:144 #11 0x5643dc6147d5 in nni_aio_finish_impl ../nng/src/core/aio.c:450 #12 0x5643dc614857 in nni_aio_finish_sync ../nng/src/core/aio.c:467 #13 0x5643dc6a66dc in tcptran_pipe_recv_cb ../nng/src/sp/transport/mqtt/broker_tcp.c:718 #14 0x5643dc62f3b2 in nni_taskq_thread ../nng/src/core/taskq.c:50 #15 0x5643dc63061f in nni_thr_wrap ../nng/src/core/thread.c:94 #16 0x5643dc638e05 in nni_plat_thr_main ../nng/src/platform/posix/posix_thread.c:266 #17 0x7fa2ba61d58f in start_thread nptl/pthread_create.c:463 previously allocated by thread T11 (nng:task) here: #0 0x7fa2ba6e6527 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:145 #1 0x5643dc5bf473 in iterate_client_v5 ../nanolib/mqtt_db.c:919 #2 0x5643dc5c0b21 in search_client ../nanolib/mqtt_db.c:981 #3 0x5643dc5c0e1b in dbtree_find_clients_and_cache_msg ../nanolib/mqtt_db.c:1007 #4 0x5643dc5d991f in handle_pub ../nanomq/pub_handler.c:159 #5 0x5643dc5f23a5 in server_cb ../nanomq/apps/broker.c:188 #6 0x5643dc62fba7 in nni_task_exec ../nng/src/core/taskq.c:144 #7 0x5643dc6147d5 in nni_aio_finish_impl ../nng/src/core/aio.c:450 #8 0x5643dc614857 in nni_aio_finish_sync ../nng/src/core/aio.c:467 #9 0x5643dc658894 in nano_pipe_recv_cb ../nng/src/sp/protocol/mqtt/nmq_mqtt.c:897 #10 0x5643dc62fba7 in nni_task_exec ../nng/src/core/taskq.c:144 #11 0x5643dc6147d5 in nni_aio_finish_impl ../nng/src/core/aio.c:450 #12 0x5643dc614857 in nni_aio_finish_sync ../nng/src/core/aio.c:467 #13 0x5643dc6a66dc in tcptran_pipe_recv_cb ../nng/src/sp/transport/mqtt/broker_tcp.c:718 #14 0x5643dc62f3b2 in nni_taskq_thread ../nng/src/core/taskq.c:50 #15 0x5643dc63061f in nni_thr_wrap ../nng/src/core/thread.c:94 #16 0x5643dc638e05 in nni_plat_thr_main ../nng/src/platform/posix/posix_thread.c:266 #17 0x7fa2ba61d58f in start_thread nptl/pthread_create.c:463 Thread T11 (nng:task) created by T0 here: #0 0x7fa2ba68da65 in __interceptor_pthread_create ../../../../src/libsanitizer/asan/asan_interceptors.cpp:216 #1 0x5643dc638f35 in nni_plat_thr_init ../nng/src/platform/posix/posix_thread.c:279 #2 0x5643dc6308c8 in nni_thr_init ../nng/src/core/thread.c:121 #3 0x5643dc62f6d1 in nni_taskq_init ../nng/src/core/taskq.c:95 #4 0x5643dc6302ef in nni_taskq_sys_init ../nng/src/core/taskq.c:284 #5 0x5643dc61b697 in nni_init_helper ../nng/src/core/init.c:41 #6 0x5643dc639289 in nni_plat_init ../nng/src/platform/posix/posix_thread.c:422 #7 0x5643dc61b716 in nni_init ../nng/src/core/init.c:63 #8 0x5643dc65c602 in nni_proto_mqtt_open ../nng/src/sp/protocol.c:37 #9 0x5643dc658fd8 in nng_nmq_tcp0_open ../nng/src/sp/protocol/mqtt/nmq_mqtt.c:1049 #10 0x5643dc5f756b in broker ../nanomq/apps/broker.c:742 #11 0x5643dc5f9e55 in broker_start ../nanomq/apps/broker.c:1173 #12 0x5643dc5d70ed in main ../nanomq/nanomq.c:187 #13 0x7fa2ba422cb1 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x28cb1) SUMMARY: AddressSanitizer: heap-use-after-free ../nanomq/pub_handler.c:110 in foreach_client Shadow bytes around the buggy address: 0x0c067fffa3b0: fd fa fa fa 00 00 00 fa fa fa fd fd fd fa fa fa 0x0c067fffa3c0: 00 00 00 fa fa fa 00 00 00 fa fa fa fd fd fd fa 0x0c067fffa3d0: fa fa 00 00 00 00 fa fa fd fd fd fa fa fa fd fd 0x0c067fffa3e0: fd fa fa fa fd fd fd fa fa fa fd fd fd fa fa fa 0x0c067fffa3f0: fd fd fd fd fa fa fd fd fd fa fa fa fd fd fd fa =>0x0c067fffa400: fa fa fd fd[fd]fa fa fa fd fd fd fa fa fa fd fd 0x0c067fffa410: fd fd fa fa 00 00 00 fa fa fa 00 00 04 fa fa fa 0x0c067fffa420: 00 00 00 00 fa fa 00 00 00 fa fa fa 00 00 00 00 0x0c067fffa430: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c067fffa440: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c067fffa450: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa Shadow byte legend (one shadow byte represents 8 application bytes): Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 Heap left redzone: fa Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack after return: f5 Stack use after scope: f8 Global redzone: f9 Global init order: f6 Poisoned by user: f7 Container overflow: fc Array cookie: ac Intra object redzone: bb ASan internal: fe Left alloca redzone: ca Right alloca redzone: cb Shadow gap: cc ==2962424==ABORTING
Subscribe multi topics caused heap use after free.
https://api.github.com/repos/nanomq/nanomq/issues/360/comments
0
2022-02-25T02:30:16Z
2022-02-25T02:49:26Z
https://github.com/nanomq/nanomq/issues/360
1,149,972,889
360
[ "emqx", "nanomq" ]
``` Thu Feb 24 18:47:30 2022 main: argv ./build/nanomq/nanomq broker app_name /nanomq Segmentation fault (core dumped) ``` ## How to reproduce ``` cmake -DNOLOG=0 -DDEBUG=0 -DASAN=0 .. make ./build/nanomq/nanomq broker start --url 'nmq-tcp://0.0.0.0:1883' ```
Segment fault when nanomq start
https://api.github.com/repos/nanomq/nanomq/issues/359/comments
1
2022-02-24T10:49:37Z
2022-02-25T05:45:33Z
https://github.com/nanomq/nanomq/issues/359
1,149,135,492
359
[ "emqx", "nanomq" ]
log When DEBUG mode is on ``` nanomq: ../nanolib/mqtt_db.c:947: search_client: Assertion `db && topic' failed. ```
Assertion fail
https://api.github.com/repos/nanomq/nanomq/issues/358/comments
0
2022-02-24T10:04:07Z
2022-02-25T06:13:56Z
https://github.com/nanomq/nanomq/issues/358
1,149,089,154
358
[ "emqx", "nanomq" ]
Log from asan ``` AddressSanitizer:DEADLYSIGNAL ================================================================= ==2955491==ERROR: AddressSanitizer: SEGV on unknown address 0x603075ff0800 (pc 0x55e2b39f8dd7 bp 0x7f652b7f5aa0 sp 0x7f652b7f59f0 T10) ==2955491==The signal is caused by a WRITE memory access. #0 0x55e2b39f8dd7 in sub_ctx_handle ../nanomq/sub_handler.c:293 #1 0x55e2b3a0eee7 in server_cb ../nanomq/apps/broker.c:357 #2 0x55e2b3a4ae37 in nni_taskq_thread ../nng/src/core/taskq.c:50 #3 0x55e2b3a4c0a4 in nni_thr_wrap ../nng/src/core/thread.c:94 #4 0x55e2b3a5488a in nni_plat_thr_main ../nng/src/platform/posix/posix_thread.c:266 #5 0x7f65338ca58f in start_thread nptl/pthread_create.c:463 #6 0x7f65337c0222 in __clone (/lib/x86_64-linux-gnu/libc.so.6+0x119222) AddressSanitizer can not provide additional info. SUMMARY: AddressSanitizer: SEGV ../nanomq/sub_handler.c:293 in sub_ctx_handle Thread T10 (nng:task) created by T0 here: #0 0x7f653393aa65 in __interceptor_pthread_create ../../../../src/libsanitizer/asan/asan_interceptors.cpp:216 #1 0x55e2b3a549ba in nni_plat_thr_init ../nng/src/platform/posix/posix_thread.c:279 #2 0x55e2b3a4c34d in nni_thr_init ../nng/src/core/thread.c:121 #3 0x55e2b3a4b156 in nni_taskq_init ../nng/src/core/taskq.c:95 #4 0x55e2b3a4bd74 in nni_taskq_sys_init ../nng/src/core/taskq.c:284 #5 0x55e2b3a3711c in nni_init_helper ../nng/src/core/init.c:41 #6 0x55e2b3a54d0e in nni_plat_init ../nng/src/platform/posix/posix_thread.c:422 #7 0x55e2b3a3719b in nni_init ../nng/src/core/init.c:63 #8 0x55e2b3a78087 in nni_proto_mqtt_open ../nng/src/sp/protocol.c:37 #9 0x55e2b3a74a5d in nng_nmq_tcp0_open ../nng/src/sp/protocol/mqtt/nmq_mqtt.c:1049 #10 0x55e2b3a126a4 in broker ../nanomq/apps/broker.c:742 #11 0x55e2b3a14f8e in broker_start ../nanomq/apps/broker.c:1173 #12 0x55e2b39f21ed in main ../nanomq/nanomq.c:187 #13 0x7f65336cfcb1 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x28cb1) ```
Segment fault
https://api.github.com/repos/nanomq/nanomq/issues/357/comments
2
2022-02-24T09:59:06Z
2022-03-07T06:57:24Z
https://github.com/nanomq/nanomq/issues/357
1,149,083,737
357
[ "emqx", "nanomq" ]
mosquitto_pub -h localhost -d -q 1 -t msg -m qq55555 --will-topic death --will-payload byebye mosquitto_sub -h localhost -d -q 2 -t "death" the second client receives nothing
Will msg does not work?
https://api.github.com/repos/nanomq/nanomq/issues/349/comments
0
2022-02-18T09:03:11Z
2022-02-21T06:13:37Z
https://github.com/nanomq/nanomq/issues/349
1,142,673,731
349
[ "emqx", "nanomq" ]
## Log from asan ``` =401453==ERROR: AddressSanitizer: heap-use-after-free on address 0x603000490db0 at pc 0x5568cff6f843 bp 0x7fd8fc8f1a30 sp 0x7fd8fc8f1a20 READ of size 4 at 0x603000490db0 thread T14 (nng:task) #0 0x5568cff6f842 in foreach_client /home/wangha/docu/git/nanomq/nanomq/pub_handler.c:66 #1 0x5568cff702f5 in handle_pub /home/wangha/docu/git/nanomq/nanomq/pub_handler.c:171 #2 0x5568cffb96b4 in server_cb /home/wangha/docu/git/nanomq/nanomq/apps/broker.c:200 #3 0x5568cfff641f in nni_taskq_thread /home/wangha/docu/git/nanomq/nng/src/core/taskq.c:50 #4 0x5568cfff768e in nni_thr_wrap /home/wangha/docu/git/nanomq/nng/src/core/thread.c:94 #5 0x5568cffffe88 in nni_plat_thr_main /home/wangha/docu/git/nanomq/nng/src/platform/posix/posix_thread.c:266 #6 0x7fd90682d608 in start_thread /build/glibc-YbNSs7/glibc-2.31/nptl/pthread_create.c:477 #7 0x7fd906749292 in __clone (/lib/x86_64-linux-gnu/libc.so.6+0x122292) 0x603000490db0 is located 0 bytes inside of 32-byte region [0x603000490db0,0x603000490dd0) freed by thread T11 (nng:task) here: #0 0x7fd9069547cf in __interceptor_free (/lib/x86_64-linux-gnu/libasan.so.5+0x10d7cf) #1 0x5568cfffbb00 in nni_free /home/wangha/docu/git/nanomq/nng/src/platform/posix/posix_alloc.c:33 #2 0x5568cffcb831 in nng_free /home/wangha/docu/git/nanomq/nng/src/nng.c:70 #3 0x5568cff762f0 in del_sub_ctx /home/wangha/docu/git/nanomq/nanomq/sub_handler.c:509 #4 0x5568cffba505 in server_cb /home/wangha/docu/git/nanomq/nanomq/apps/broker.c:294 #5 0x5568cfff6c16 in nni_task_exec /home/wangha/docu/git/nanomq/nng/src/core/taskq.c:144 #6 0x5568cffdb82f in nni_aio_finish_impl /home/wangha/docu/git/nanomq/nng/src/core/aio.c:450 #7 0x5568cffdb8b1 in nni_aio_finish_sync /home/wangha/docu/git/nanomq/nng/src/core/aio.c:467 #8 0x5568d001e974 in nano_ctx_recv /home/wangha/docu/git/nanomq/nng/src/sp/protocol/mqtt/nmq_mqtt.c:730 #9 0x5568cfff1d66 in nni_ctx_recv /home/wangha/docu/git/nanomq/nng/src/core/socket.c:1371 #10 0x5568cffcd680 in nng_ctx_recv /home/wangha/docu/git/nanomq/nng/src/nng.c:347 #11 0x5568cffbd212 in server_cb /home/wangha/docu/git/nanomq/nanomq/apps/broker.c:527 #12 0x5568cfff641f in nni_taskq_thread /home/wangha/docu/git/nanomq/nng/src/core/taskq.c:50 #13 0x5568cfff768e in nni_thr_wrap /home/wangha/docu/git/nanomq/nng/src/core/thread.c:94 #14 0x5568cffffe88 in nni_plat_thr_main /home/wangha/docu/git/nanomq/nng/src/platform/posix/posix_thread.c:266 #15 0x7fd90682d608 in start_thread /build/glibc-YbNSs7/glibc-2.31/nptl/pthread_create.c:477 previously allocated by thread T14 (nng:task) here: #0 0x7fd906954bc8 in malloc (/lib/x86_64-linux-gnu/libasan.so.5+0x10dbc8) #1 0x5568cfffbaa6 in nni_alloc /home/wangha/docu/git/nanomq/nng/src/platform/posix/posix_alloc.c:20 #2 0x5568cffcb7ea in nng_alloc /home/wangha/docu/git/nanomq/nng/src/nng.c:58 #3 0x5568cff74552 in sub_ctx_handle /home/wangha/docu/git/nanomq/nanomq/sub_handler.c:285 #4 0x5568cffbaf3f in server_cb /home/wangha/docu/git/nanomq/nanomq/apps/broker.c:351 #5 0x5568cfff641f in nni_taskq_thread /home/wangha/docu/git/nanomq/nng/src/core/taskq.c:50 #6 0x5568cfff768e in nni_thr_wrap /home/wangha/docu/git/nanomq/nng/src/core/thread.c:94 #7 0x5568cffffe88 in nni_plat_thr_main /home/wangha/docu/git/nanomq/nng/src/platform/posix/posix_thread.c:266 #8 0x7fd90682d608 in start_thread /build/glibc-YbNSs7/glibc-2.31/nptl/pthread_create.c:477 ``` ## How to reproduce ``` emqtt_bench sub -V 4 -c 200 -t msg emqtt_bench pub -V 4 -c 50 -t msg -I 20 -L 10000 -q 0 Stop Sub before receiving finished ```
data race in the context of subscription
https://api.github.com/repos/nanomq/nanomq/issues/348/comments
3
2022-02-18T08:58:08Z
2022-05-10T08:30:07Z
https://github.com/nanomq/nanomq/issues/348
1,142,665,047
348
[ "emqx", "nanomq" ]
## log from asan ``` ==393837==ERROR: LeakSanitizer: detected memory leaks Direct leak of 39103980 byte(s) in 1955199 object(s) allocated from: #0 0x7f44caa34bc8 in malloc (/lib/x86_64-linux-gnu/libasan.so.5+0x10dbc8) #1 0x55daea82758d in iterate_client_v5 /home/wangha/docu/git/nanomq/nanolib/mqtt_db.c:1022 #2 0x55daea82a068 in search_client /home/wangha/docu/git/nanomq/nanolib/mqtt_db.c:1121 #3 0x55daea82a362 in dbtree_find_clients_and_cache_msg /home/wangha/docu/git/nanomq/nanolib/mqtt_db.c:1148 #4 0x55daea7f86a6 in handle_pub /home/wangha/docu/git/nanomq/nanomq/pub_handler.c:189 #5 0x55daea841769 in server_cb /home/wangha/docu/git/nanomq/nanomq/apps/broker.c:200 #6 0x55daea87e2f8 in nni_taskq_thread /home/wangha/docu/git/nanomq/nng/src/core/taskq.c:50 #7 0x55daea87f567 in nni_thr_wrap /home/wangha/docu/git/nanomq/nng/src/core/thread.c:94 #8 0x55daea887d61 in nni_plat_thr_main /home/wangha/docu/git/nanomq/nng/src/platform/posix/posix_thread.c:266 #9 0x7f44ca90d608 in start_thread /build/glibc-YbNSs7/glibc-2.31/nptl/pthread_create.c:477 Direct leak of 896000 byte(s) in 44800 object(s) allocated from: #0 0x7f44caa34bc8 in malloc (/lib/x86_64-linux-gnu/libasan.so.5+0x10dbc8) #1 0x55daea82758d in iterate_client_v5 /home/wangha/docu/git/nanomq/nanolib/mqtt_db.c:1022 #2 0x55daea82a068 in search_client /home/wangha/docu/git/nanomq/nanolib/mqtt_db.c:1121 #3 0x55daea82a362 in dbtree_find_clients_and_cache_msg /home/wangha/docu/git/nanomq/nanolib/mqtt_db.c:1148 #4 0x55daea7f86a6 in handle_pub /home/wangha/docu/git/nanomq/nanomq/pub_handler.c:189 #5 0x55daea841769 in server_cb /home/wangha/docu/git/nanomq/nanomq/apps/broker.c:200 #6 0x55daea87eaef in nni_task_exec /home/wangha/docu/git/nanomq/nng/src/core/taskq.c:144 #7 0x55daea863708 in nni_aio_finish_impl /home/wangha/docu/git/nanomq/nng/src/core/aio.c:450 #8 0x55daea86378a in nni_aio_finish_sync /home/wangha/docu/git/nanomq/nng/src/core/aio.c:467 #9 0x55daea8a776a in nano_pipe_recv_cb /home/wangha/docu/git/nanomq/nng/src/sp/protocol/mqtt/nmq_mqtt.c:897 #10 0x55daea87eaef in nni_task_exec /home/wangha/docu/git/nanomq/nng/src/core/taskq.c:144 #11 0x55daea863708 in nni_aio_finish_impl /home/wangha/docu/git/nanomq/nng/src/core/aio.c:450 #12 0x55daea86378a in nni_aio_finish_sync /home/wangha/docu/git/nanomq/nng/src/core/aio.c:467 #13 0x55daea8f555c in tcptran_pipe_recv_cb /home/wangha/docu/git/nanomq/nng/src/sp/transport/mqtt/broker_tcp.c:712 #14 0x55daea87e2f8 in nni_taskq_thread /home/wangha/docu/git/nanomq/nng/src/core/taskq.c:50 #15 0x55daea87f567 in nni_thr_wrap /home/wangha/docu/git/nanomq/nng/src/core/thread.c:94 #16 0x55daea887d61 in nni_plat_thr_main /home/wangha/docu/git/nanomq/nng/src/platform/posix/posix_thread.c:266 #17 0x7f44ca90d608 in start_thread /build/glibc-YbNSs7/glibc-2.31/nptl/pthread_create.c:477 SUMMARY: AddressSanitizer: 39999980 byte(s) leaked in 1999999 allocation(s). ```
Memory leak happens
https://api.github.com/repos/nanomq/nanomq/issues/347/comments
0
2022-02-18T08:46:28Z
2022-02-22T08:59:32Z
https://github.com/nanomq/nanomq/issues/347
1,142,645,459
347
[ "emqx", "nanomq" ]
Hi there, after uncompressing the zip and run cmake, an error ooccured nng does not contain a CMakeLists.txt file.
can't run cmake
https://api.github.com/repos/nanomq/nanomq/issues/344/comments
0
2022-02-18T01:33:13Z
2022-02-18T01:34:22Z
https://github.com/nanomq/nanomq/issues/344
1,142,155,858
344
[ "emqx", "nanomq" ]
+ These options don't make sense in pipe_ct. for example qos, cmd, etc. + Move pipe content(session about) to TCP layer for future.
Invalid options in pipe_ct structure & recompose msg in tcp layer for future
https://api.github.com/repos/nanomq/nanomq/issues/342/comments
1
2022-02-17T07:41:56Z
2022-03-23T08:00:45Z
https://github.com/nanomq/nanomq/issues/342
1,140,979,264
342
[ "emqx", "nanomq" ]
null
Some properties in connection package are not assigned
https://api.github.com/repos/nanomq/nanomq/issues/339/comments
0
2022-02-16T10:59:32Z
2022-02-23T06:32:00Z
https://github.com/nanomq/nanomq/issues/339
1,139,859,421
339
[ "emqx", "nanomq" ]
@wanghaEMQ pls check. `$ mosquitto_sub -t a/b/c -d -V 5` Client (null) sending CONNECT Client nanomq-7c3fd1d5 received CONNACK (0) Client nanomq-7c3fd1d5 sending SUBSCRIBE (Mid: 1, Topic: a/b/c, QoS: 0, Options: 0x00) Client nanomq-7c3fd1d5 sending PINGREQ Client nanomq-7c3fd1d5 sending CONNECT Client nanomq-7c3fd1d5 received CONNACK (0) Client nanomq-7c3fd1d5 sending SUBSCRIBE (Mid: 2, Topic: a/b/c, QoS: 0, Options: 0x00) `$ mosquitto_sub -t a/b/c -d` Client (null) sending CONNECT Client (null) received CONNACK (0) Client (null) sending SUBSCRIBE (Mid: 1, Topic: a/b/c, QoS: 0, Options: 0x00) Client (null) received SUBACK Subscribed (mid: 1): 0
Mqtt v5 client subscribe topic can not receive suback, but v311 can receive?
https://api.github.com/repos/nanomq/nanomq/issues/337/comments
2
2022-02-16T09:15:19Z
2022-02-17T03:34:22Z
https://github.com/nanomq/nanomq/issues/337
1,139,747,212
337
[ "emqx", "nanomq" ]
@wanghaEMQ Subscription can not get subscribe identifer?
Subscription can not get subscribe identifer?
https://api.github.com/repos/nanomq/nanomq/issues/335/comments
1
2022-02-15T07:05:08Z
2022-02-15T07:35:32Z
https://github.com/nanomq/nanomq/issues/335
1,138,272,696
335
[ "emqx", "nanomq" ]
## How to reproduce? ``` mosquitto_sub -t topic/# -V mqttv5 mosquitto_sub -t aaa -V mqttv5 mosquitto_pub -t aaa -m "xxx" -V mqttv5 ```
Searching error in shared subscription(Find repeat pipes)
https://api.github.com/repos/nanomq/nanomq/issues/333/comments
0
2022-02-15T03:43:56Z
2022-02-15T06:46:53Z
https://github.com/nanomq/nanomq/issues/333
1,138,138,748
333
[ "emqx", "nanomq" ]
@JaylinYu, have you tried to run nanomq on an ESP32 (maybe the S3)?
Does it runs on a ESP32?
https://api.github.com/repos/nanomq/nanomq/issues/332/comments
6
2022-02-15T03:27:04Z
2022-03-30T03:49:41Z
https://github.com/nanomq/nanomq/issues/332
1,138,129,710
332
[ "emqx", "nanomq" ]
## How to reproduce? ``` mosquitto_sub -t aaa -i clia -V mqttv5 mosquitto_sub -t bbb -i clib -V mqttv5 mosquitto_sub -t topic/# -i clic -V mqttv5 mosquitto_pub -t topic/aa -m "aa" -V mqttv5 ```
Sub client received messages from a unsubscribed topic
https://api.github.com/repos/nanomq/nanomq/issues/330/comments
2
2022-02-15T02:56:00Z
2022-03-10T12:37:43Z
https://github.com/nanomq/nanomq/issues/330
1,138,109,260
330
[ "emqx", "nanomq" ]
refer to file pub_handler.c:66 line ```c while (tn) { if (0 == strcmp(tn->it->topic_filter.body, pub_work->pub_packet->variable_header.publish.topic_name.body)) { sub_qos = tn->it->qos; break; } tn = tn->next; } ```
sub qos is not available when topic includes wildcard '+' or '#'...
https://api.github.com/repos/nanomq/nanomq/issues/327/comments
4
2022-02-14T08:44:46Z
2022-02-14T09:52:46Z
https://github.com/nanomq/nanomq/issues/327
1,136,965,755
327
[ "emqx", "nanomq" ]
null
Shall we support mqtt v5(pub) send to mqtt v311(sub)?
https://api.github.com/repos/nanomq/nanomq/issues/326/comments
2
2022-02-14T07:29:05Z
2022-02-14T11:37:40Z
https://github.com/nanomq/nanomq/issues/326
1,136,890,076
326
[ "emqx", "nanomq" ]
null
MQTTV5 feature: Subscription Identifier
https://api.github.com/repos/nanomq/nanomq/issues/324/comments
1
2022-02-14T03:23:26Z
2022-04-07T03:22:10Z
https://github.com/nanomq/nanomq/issues/324
1,136,705,885
324
[ "emqx", "nanomq" ]
null
MQTTV5 feature: Retain Handling option
https://api.github.com/repos/nanomq/nanomq/issues/323/comments
0
2022-02-14T03:21:44Z
2022-04-13T02:44:56Z
https://github.com/nanomq/nanomq/issues/323
1,136,704,435
323
[ "emqx", "nanomq" ]
null
MQTTV5 new feature: Retain As Published option
https://api.github.com/repos/nanomq/nanomq/issues/322/comments
1
2022-02-14T03:20:41Z
2022-04-07T03:21:29Z
https://github.com/nanomq/nanomq/issues/322
1,136,703,484
322
[ "emqx", "nanomq" ]
null
MQTTV5 new feature: no local
https://api.github.com/repos/nanomq/nanomq/issues/321/comments
1
2022-02-14T03:18:41Z
2022-02-16T02:22:22Z
https://github.com/nanomq/nanomq/issues/321
1,136,701,430
321
[ "emqx", "nanomq" ]
```bash AddressSanitizer:DEADLYSIGNAL ================================================================= ==3232146==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x7f5d60215b9c bp 0x7f5d588f6600 sp 0x7f5d588f5d68 T9) ==3232146==The signal is caused by a READ memory access. ==3232146==Hint: address points to the zero page. AddressSanitizer:DEADLYSIGNAL #0 0x7f5d60215b9b (/lib/x86_64-linux-gnu/libc.so.6+0x181b9b) #1 0x7f5d6031fb0b (/lib/x86_64-linux-gnu/libasan.so.5+0x74b0b) #2 0x55cbcb53a95b in decode_pub_message ../nanomq/pub_handler.c:656 #3 0x55cbcb5386a5 in handle_pub ../nanomq/pub_handler.c:103 #4 0x55cbcb551661 in server_cb ../nanomq/apps/broker.c:200 #5 0x55cbcb58e4a9 in nni_task_exec ../nng/src/core/taskq.c:144 #6 0x55cbcb572faa in nni_aio_finish_impl ../nng/src/core/aio.c:450 #7 0x55cbcb57302c in nni_aio_finish_sync ../nng/src/core/aio.c:467 #8 0x55cbcb5b6e1c in nano_pipe_recv_cb ../nng/src/sp/protocol/mqtt/nmq_mqtt.c:883 #9 0x55cbcb58e4a9 in nni_task_exec ../nng/src/core/taskq.c:144 #10 0x55cbcb572faa in nni_aio_finish_impl ../nng/src/core/aio.c:450 #11 0x55cbcb57302c in nni_aio_finish_sync ../nng/src/core/aio.c:467 #12 0x55cbcb602756 in tlstran_pipe_recv_cb ../nng/src/sp/transport/mqtts/broker_tls.c:609 #13 0x55cbcb58dcb2 in nni_taskq_thread ../nng/src/core/taskq.c:50 #14 0x55cbcb58ef21 in nni_thr_wrap ../nng/src/core/thread.c:94 #15 0x55cbcb59771b in nni_plat_thr_main ../nng/src/platform/posix/posix_thread.c:266 #16 0x7f5d6029258f in start_thread nptl/pthread_create.c:463 #17 0x7f5d601ad222 in __clone (/lib/x86_64-linux-gnu/libc.so.6+0x119222) AddressSanitizer can not provide additional info. SUMMARY: AddressSanitizer: SEGV (/lib/x86_64-linux-gnu/libc.so.6+0x181b9b) Thread T9 (nng:task) created by T0 here: #0 0x7f5d602e5805 in pthread_create (/lib/x86_64-linux-gnu/libasan.so.5+0x3a805) #1 0x55cbcb59784b in nni_plat_thr_init ../nng/src/platform/posix/posix_thread.c:279 #2 0x55cbcb58f1ca in nni_thr_init ../nng/src/core/thread.c:121 #3 0x55cbcb58dfd3 in nni_taskq_init ../nng/src/core/taskq.c:95 #4 0x55cbcb58ebf1 in nni_taskq_sys_init ../nng/src/core/taskq.c:284 #5 0x55cbcb579e6c in nni_init_helper ../nng/src/core/init.c:41 #6 0x55cbcb597b9f in nni_plat_init ../nng/src/platform/posix/posix_thread.c:422 #7 0x55cbcb579eeb in nni_init ../nng/src/core/init.c:63 #8 0x55cbcb5bab88 in nni_proto_mqtt_open ../nng/src/sp/protocol.c:37 #9 0x55cbcb5b755e in nng_nmq_tcp0_open ../nng/src/sp/protocol/mqtt/nmq_mqtt.c:1035 #10 0x55cbcb555b91 in broker ../nanomq/apps/broker.c:669 #11 0x55cbcb558482 in broker_start ../nanomq/apps/broker.c:1100 #12 0x55cbcb536767 in main ../nanomq/nanomq.c:187 #13 0x7f5d600bccb1 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x28cb1) ==3232146==ABORTING ```
ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000
https://api.github.com/repos/nanomq/nanomq/issues/319/comments
2
2022-02-11T03:23:34Z
2022-02-14T02:33:25Z
https://github.com/nanomq/nanomq/issues/319
1,131,594,715
319
[ "emqx", "nanomq" ]
log from asan ``` AddressSanitizer:DEADLYSIGNAL ================================================================= ==26895==ERROR: AddressSanitizer: BUS on unknown address 0x000000000000 (pc 0x7f7949699a06 bp 0xbebebebebebebeae sp 0x7f79406f2a30 T12) #0 0x7f7949699a05 (/lib/x86_64-linux-gnu/libasan.so.5+0x28a05) #1 0x7f794977e798 in __interceptor_free (/lib/x86_64-linux-gnu/libasan.so.5+0x10d798) #2 0x558824f33e56 in nni_free /home/wangha/docu/git/nanomq/nng/src/platform/posix/posix_alloc.c:33 #3 0x558824f038ca in nng_free /home/wangha/docu/git/nanomq/nng/src/nng.c:70 #4 0x558824ea0bb1 in del_sub_ctx /home/wangha/docu/git/nanomq/nanomq/sub_handler.c:508 #5 0x558824ef1998 in server_cb /home/wangha/docu/git/nanomq/nanomq/apps/broker.c:275 #6 0x558824f2ec03 in nni_task_exec /home/wangha/docu/git/nanomq/nng/src/core/taskq.c:144 #7 0x558824f12fa3 in nni_aio_finish_impl /home/wangha/docu/git/nanomq/nng/src/core/aio.c:456 #8 0x558824f1328f in nni_aio_finish_sync /home/wangha/docu/git/nanomq/nng/src/core/aio.c:473 #9 0x558824f5b281 in nano_pipe_close /home/wangha/docu/git/nanomq/nng/src/sp/protocol/mqtt/nmq_mqtt.c:646 #10 0x558824f22ba2 in nni_pipe_close /home/wangha/docu/git/nanomq/nng/src/core/pipe.c:154 #11 0x558824f5cd0e in nano_pipe_recv_cb /home/wangha/docu/git/nanomq/nng/src/sp/protocol/mqtt/nmq_mqtt.c:818 #12 0x558824f2ec03 in nni_task_exec /home/wangha/docu/git/nanomq/nng/src/core/taskq.c:144 #13 0x558824f12fa3 in nni_aio_finish_impl /home/wangha/docu/git/nanomq/nng/src/core/aio.c:456 #14 0x558824f1328f in nni_aio_finish_sync /home/wangha/docu/git/nanomq/nng/src/core/aio.c:473 #15 0x558824facd5c in tcptran_pipe_recv_cb /home/wangha/docu/git/nanomq/nng/src/sp/transport/mqtt/broker_tcp.c:605 #16 0x558824f2e40c in nni_taskq_thread /home/wangha/docu/git/nanomq/nng/src/core/taskq.c:50 #17 0x558824f2f9e4 in nni_thr_wrap /home/wangha/docu/git/nanomq/nng/src/core/thread.c:94 #18 0x558824f381de in nni_plat_thr_main /home/wangha/docu/git/nanomq/nng/src/platform/posix/posix_thread.c:266 #19 0x7f7949657608 in start_thread /build/glibc-YbNSs7/glibc-2.31/nptl/pthread_create.c:477 #20 0x7f7949573292 in __clone (/lib/x86_64-linux-gnu/libc.so.6+0x122292) ```
Error happened in subscribing of mqttv5
https://api.github.com/repos/nanomq/nanomq/issues/315/comments
1
2022-02-09T04:39:17Z
2022-02-11T01:10:22Z
https://github.com/nanomq/nanomq/issues/315
1,128,044,957
315
[ "emqx", "nanomq" ]
null
MQTTV5: Will Message Expiry Interval
https://api.github.com/repos/nanomq/nanomq/issues/313/comments
2
2022-02-09T02:11:37Z
2022-04-01T07:11:13Z
https://github.com/nanomq/nanomq/issues/313
1,127,964,535
313
[ "emqx", "nanomq" ]
null
MQTT5 features: Will Properties
https://api.github.com/repos/nanomq/nanomq/issues/312/comments
0
2022-02-09T02:10:55Z
2022-03-24T03:37:39Z
https://github.com/nanomq/nanomq/issues/312
1,127,964,146
312
[ "emqx", "nanomq" ]
null
#nanosdk Unable to set keepalive timeout length
https://api.github.com/repos/nanomq/nanomq/issues/308/comments
0
2022-01-30T10:01:45Z
2022-01-30T13:43:03Z
https://github.com/nanomq/nanomq/issues/308
1,118,478,069
308
[ "emqx", "nanomq" ]
null
Client fail to establish TLS connection.
https://api.github.com/repos/nanomq/nanomq/issues/306/comments
0
2022-01-27T09:14:07Z
2022-01-28T08:24:53Z
https://github.com/nanomq/nanomq/issues/306
1,115,956,994
306
[ "emqx", "nanomq" ]
We should make "NanoMQ conn start " is capable of establishing multiple connections at a time.
Add "conn" func for Command Line toolkit
https://api.github.com/repos/nanomq/nanomq/issues/300/comments
0
2022-01-21T11:30:07Z
2022-02-17T06:58:41Z
https://github.com/nanomq/nanomq/issues/300
1,110,365,804
300
[ "emqx", "nanomq" ]
NNG already has a built-in tls lib. NanoMQ should support TLS in MQTT's transport layer.
NanoMQ support MQTT TLS port
https://api.github.com/repos/nanomq/nanomq/issues/294/comments
0
2022-01-20T11:45:26Z
2022-02-12T08:23:59Z
https://github.com/nanomq/nanomq/issues/294
1,109,202,278
294
[ "emqx", "nanomq" ]
null
Support environment variables for settings.
https://api.github.com/repos/nanomq/nanomq/issues/291/comments
0
2022-01-20T10:13:42Z
2022-01-22T07:51:00Z
https://github.com/nanomq/nanomq/issues/291
1,109,109,627
291
[ "emqx", "nanomq" ]
## How to reproduce ./emqtt_bench sub -V 4 -c 50 -t msg ./emqtt_bench pub -V 4 -c 100 -t msg -I 20 -L 100000 -q 1 Ctrl-C Interrupt before pub finish (probabilistic trigger) ## Log from Asan ``` ================================================================= ==236999==ERROR: AddressSanitizer: heap-use-after-free on address 0x612000ab0dc4 at pc 0x564b0008bcd6 bp 0x7f0a144f8960 sp 0x7f0a144f8950 READ of size 1 at 0x612000ab0dc4 thread T7 (nng:task) #0 0x564b0008bcd5 in conn_param_get_protover /home/wangha/docu/git/nanomq/nng/src/nng.c:2194 #1 0x564b0001a207 in encode_pub_message /home/wangha/docu/git/nanomq/nanomq/pub_handler.c:313 #2 0x564b00074f27 in server_cb /home/wangha/docu/git/nanomq/nanomq/apps/broker.c:412 #3 0x564b000a8a4a in nni_taskq_thread /home/wangha/docu/git/nanomq/nng/src/core/taskq.c:50 #4 0x564b000a9cb9 in nni_thr_wrap /home/wangha/docu/git/nanomq/nng/src/core/thread.c:94 #5 0x564b000b24b3 in nni_plat_thr_main /home/wangha/docu/git/nanomq/nng/src/platform/posix/posix_thread.c:266 #6 0x7f0a1ae68608 in start_thread /build/glibc-YbNSs7/glibc-2.31/nptl/pthread_create.c:477 #7 0x7f0a1ab87292 in __clone (/lib/x86_64-linux-gnu/libc.so.6+0x122292) 0x612000ab0dc4 is located 4 bytes inside of 296-byte region [0x612000ab0dc0,0x612000ab0ee8) freed by thread T9 (nng:task) here: #0 0x7f0a1af8f7cf in __interceptor_free (/lib/x86_64-linux-gnu/libasan.so.5+0x10d7cf) #1 0x564b000ae12b in nni_free /home/wangha/docu/git/nanomq/nng/src/platform/posix/posix_alloc.c:33 #2 0x564b0007ecf4 in nng_free /home/wangha/docu/git/nanomq/nng/src/nng.c:70 #3 0x564b000caadd in conn_param_free /home/wangha/docu/git/nanomq/nng/src/sp/protocol/mqtt/mqtt_parser.c:766 #4 0x564b00073756 in server_cb /home/wangha/docu/git/nanomq/nanomq/apps/broker.c:287 #5 0x564b000a9241 in nni_task_exec /home/wangha/docu/git/nanomq/nng/src/core/taskq.c:144 #6 0x564b0008de5a in nni_aio_finish_impl /home/wangha/docu/git/nanomq/nng/src/core/aio.c:456 #7 0x564b0008dedc in nni_aio_finish_sync /home/wangha/docu/git/nanomq/nng/src/core/aio.c:473 #8 0x564b000d0274 in nano_ctx_recv /home/wangha/docu/git/nanomq/nng/src/sp/protocol/mqtt/nmq_mqtt.c:728 #9 0x564b000a4391 in nni_ctx_recv /home/wangha/docu/git/nanomq/nng/src/core/socket.c:1371 #10 0x564b00080b43 in nng_ctx_recv /home/wangha/docu/git/nanomq/nng/src/nng.c:347 #11 0x564b000763e3 in server_cb /home/wangha/docu/git/nanomq/nanomq/apps/broker.c:518 #12 0x564b000a8a4a in nni_taskq_thread /home/wangha/docu/git/nanomq/nng/src/core/taskq.c:50 #13 0x564b000a9cb9 in nni_thr_wrap /home/wangha/docu/git/nanomq/nng/src/core/thread.c:94 #14 0x564b000b24b3 in nni_plat_thr_main /home/wangha/docu/git/nanomq/nng/src/platform/posix/posix_thread.c:266 #15 0x7f0a1ae68608 in start_thread /build/glibc-YbNSs7/glibc-2.31/nptl/pthread_create.c:477 previously allocated by thread T7 (nng:task) here: #0 0x7f0a1af8fbc8 in malloc (/lib/x86_64-linux-gnu/libasan.so.5+0x10dbc8) #1 0x564b000ae0d1 in nni_alloc /home/wangha/docu/git/nanomq/nng/src/platform/posix/posix_alloc.c:20 #2 0x564b0007ecad in nng_alloc /home/wangha/docu/git/nanomq/nng/src/nng.c:58 #3 0x564b000ca309 in conn_param_alloc /home/wangha/docu/git/nanomq/nng/src/sp/protocol/mqtt/mqtt_parser.c:729 #4 0x564b00120fd1 in tcptran_pipe_nego_cb /home/wangha/docu/git/nanomq/nng/src/sp/transport/mqtt/broker_tcp.c:319 #5 0x564b000a8a4a in nni_taskq_thread /home/wangha/docu/git/nanomq/nng/src/core/taskq.c:50 #6 0x564b000a9cb9 in nni_thr_wrap /home/wangha/docu/git/nanomq/nng/src/core/thread.c:94 #7 0x564b000b24b3 in nni_plat_thr_main /home/wangha/docu/git/nanomq/nng/src/platform/posix/posix_thread.c:266 #8 0x7f0a1ae68608 in start_thread /build/glibc-YbNSs7/glibc-2.31/nptl/pthread_create.c:477 SUMMARY: AddressSanitizer: heap-use-after-free /home/wangha/docu/git/nanomq/nng/src/nng.c:2194 in conn_param_get_protover Shadow bytes around the buggy address: 0x0c248014e160: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x0c248014e170: fd fd fd fd fd fd fd fd fd fd fa fa fa fa fa fa 0x0c248014e180: fa fa fa fa fa fa fa fa fd fd fd fd fd fd fd fd 0x0c248014e190: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x0c248014e1a0: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd =>0x0c248014e1b0: fa fa fa fa fa fa fa fa[fd]fd fd fd fd fd fd fd 0x0c248014e1c0: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x0c248014e1d0: fd fd fd fd fd fd fd fd fd fd fd fd fd fa fa fa 0x0c248014e1e0: fa fa fa fa fa fa fa fa fd fd fd fd fd fd fd fd 0x0c248014e1f0: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x0c248014e200: fd fd fd fd fd fd fd fd fd fd fd fd fd fa fa fa Shadow byte legend (one shadow byte represents 8 application bytes): Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 Heap left redzone: fa Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack after return: f5 Stack use after scope: f8 Global redzone: f9 Global init order: f6 Poisoned by user: f7 Container overflow: fc Array cookie: ac Intra object redzone: bb ASan internal: fe Left alloca redzone: ca Right alloca redzone: cb Shadow gap: cc ==236999==ABORTING ```
Heap-use-after-free when test with bench
https://api.github.com/repos/nanomq/nanomq/issues/289/comments
0
2022-01-20T07:12:47Z
2022-01-26T10:33:01Z
https://github.com/nanomq/nanomq/issues/289
1,108,942,302
289
[ "emqx", "nanomq" ]
null
<nanomq/nanolib/Makefile> line 3 : has a error <INC = -I./inlcude>.
https://api.github.com/repos/nanomq/nanomq/issues/287/comments
1
2022-01-20T06:28:55Z
2022-01-20T07:17:30Z
https://github.com/nanomq/nanomq/issues/287
1,108,913,804
287
[ "emqx", "nanomq" ]
<nanomq/nanolib/Makefile> line 3 old : <INC = -I./inlcude> into new <INC = -I./include> from Hans-Uwe on Slack
nanolib makefile typing error
https://api.github.com/repos/nanomq/nanomq/issues/286/comments
0
2022-01-20T06:21:27Z
2022-01-20T07:19:41Z
https://github.com/nanomq/nanomq/issues/286
1,108,908,501
286
[ "emqx", "nanomq" ]
Consider for efficiency, and to make keepalive timeout length configurable , we should move it to transport layer.
#nanosdk: Move keepalive timer to transport layer
https://api.github.com/repos/nanomq/nanomq/issues/285/comments
0
2022-01-19T10:43:36Z
2022-01-30T13:43:11Z
https://github.com/nanomq/nanomq/issues/285
1,107,940,644
285
[ "emqx", "nanomq" ]
OS: ubuntu gcc:10.2.0 cmake:3.130 或者 3.19.1 In file included from /usr/include/features.h:367:0, from /usr/include/assert.h:35, from /home/tlc/nanomq/nanolib/include/cvector.h:5, from /home/tlc/nanomq/nanolib/include/hash.h:4, from /home/tlc/nanomq/nanolib/hash.cc:9: /usr/include/x86_64-linux-gnu/bits/mathcalls.h:109:1: error: expected unqualified-id before ‘throw’ __MATHCALL_VEC (log,, (_Mdouble_ __x)); ^ In file included from /usr/include/c++/5/random:38:0, from /usr/include/c++/5/bits/stl_algo.h:66, from /usr/include/c++/5/algorithm:62, from /home/tlc/nanomq/nanolib/hash.cc:11: /usr/include/c++/5/cmath:353:11: error: ‘::log’ has not been declared using ::log; ^ In file included from /usr/include/c++/5/random:49:0, from /usr/include/c++/5/bits/stl_algo.h:66, from /usr/include/c++/5/algorithm:62, from /home/tlc/nanomq/nanolib/hash.cc:11: /usr/include/c++/5/bits/random.h: In member function ‘void std::geometric_distribution<_IntType>::param_type::_M_initialize()’: /usr/include/c++/5/bits/random.h:3876:36: error: call of overloaded ‘log(double)’ is ambiguous { _M_log_1_p = std::log(1.0 - _M_p); } ^ In file included from /usr/include/c++/5/random:38:0, from /usr/include/c++/5/bits/stl_algo.h:66, from /usr/include/c++/5/algorithm:62, from /home/tlc/nanomq/nanolib/hash.cc:11: /usr/include/c++/5/cmath:357:3: note: candidate: constexpr float std::log(float) log(float __x) ^ /usr/include/c++/5/cmath:361:3: note: candidate: constexpr long double std::log(long double) log(long double __x) ^ In file included from /usr/include/c++/5/random:51:0, from /usr/include/c++/5/bits/stl_algo.h:66, from /usr/include/c++/5/algorithm:62, from /home/tlc/nanomq/nanolib/hash.cc:11: /usr/include/c++/5/bits/random.tcc: In member function ‘void std::poisson_distribution<_IntType>::param_type::_M_initialize()’: /usr/include/c++/5/bits/random.tcc:1249:32: error: call of overloaded ‘log(double&)’ is ambiguous _M_lm_thr = std::log(_M_mean); ^ In file included from /usr/include/c++/5/random:38:0, from /usr/include/c++/5/bits/stl_algo.h:66, from /usr/include/c++/5/algorithm:62, from /home/tlc/nanomq/nanolib/hash.cc:11: /usr/include/c++/5/cmath:357:3: note: candidate: constexpr float std::log(float) log(float __x) ^ /usr/include/c++/5/cmath:361:3: note: candidate: constexpr long double std::log(long double) log(long double __x) ^ In file included from /usr/include/c++/5/random:51:0, from /usr/include/c++/5/bits/stl_algo.h:66, from /usr/include/c++/5/algorithm:62, from /home/tlc/nanomq/nanolib/hash.cc:11: /usr/include/c++/5/bits/random.tcc:1255:22: error: call of overloaded ‘log(double)’ is ambiguous / __pi_4)); ^ In file included from /usr/include/c++/5/random:38:0, from /usr/include/c++/5/bits/stl_algo.h:66, from /usr/include/c++/5/algorithm:62, from /home/tlc/nanomq/nanolib/hash.cc:11: /usr/include/c++/5/cmath:357:3: note: candidate: constexpr float std::log(float) log(float __x) ^ /usr/include/c++/5/cmath:361:3: note: candidate: constexpr long double std::log(long double) log(long double __x) ^ In file included from /usr/include/c++/5/random:51:0, from /usr/include/c++/5/bits/stl_algo.h:66, from /usr/include/c++/5/algorithm:62, from /home/tlc/nanomq/nanolib/hash.cc:11: /usr/include/c++/5/bits/random.tcc: In member function ‘void std::binomial_distribution<_IntType>::param_type::_M_initialize()’: /usr/include/c++/5/bits/random.tcc:1463:33: error: call of overloaded ‘log(double)’ is ambiguous / (81 * __pi_4 * __1p))); ^ In file included from /usr/include/c++/5/random:38:0, from /usr/include/c++/5/bits/stl_algo.h:66, from /usr/include/c++/5/algorithm:62, from /home/tlc/nanomq/nanolib/hash.cc:11: /usr/include/c++/5/cmath:357:3: note: candidate: constexpr float std::log(float) log(float __x) ^ /usr/include/c++/5/cmath:361:3: note: candidate: constexpr long double std::log(long double) log(long double __x) ^ In file included from /usr/include/c++/5/random:51:0, from /usr/include/c++/5/bits/stl_algo.h:66, from /usr/include/c++/5/algorithm:62, from /home/tlc/nanomq/nanolib/hash.cc:11: /usr/include/c++/5/bits/random.tcc:1486:34: error: call of overloaded ‘log(double)’ is ambiguous _M_lp1p = std::log(__pa / __1p); ^ In file included from /usr/include/c++/5/random:38:0, from /usr/include/c++/5/bits/stl_algo.h:66, from /usr/include/c++/5/algorithm:62, from /home/tlc/nanomq/nanolib/hash.cc:11: /usr/include/c++/5/cmath:357:3: note: candidate: constexpr float std::log(float) log(float __x) ^ /usr/include/c++/5/cmath:361:3: note: candidate: constexpr long double std::log(long double) log(long double __x) ^ In file included from /usr/include/c++/5/random:51:0, from /usr/include/c++/5/bits/stl_algo.h:66, from /usr/include/c++/5/algorithm:62, from /home/tlc/nanomq/nanolib/hash.cc:11: /usr/include/c++/5/bits/random.tcc:1488:46: error: call of overloaded ‘log(double)’ is ambiguous _M_q = -std::log(1 - (__p12 - __pa) / __1p); ^ In file included from /usr/include/c++/5/random:38:0, from /usr/include/c++/5/bits/stl_algo.h:66, from /usr/include/c++/5/algorithm:62, from /home/tlc/nanomq/nanolib/hash.cc:11: /usr/include/c++/5/cmath:357:3: note: candidate: constexpr float std::log(float) log(float __x) ^ /usr/include/c++/5/cmath:361:3: note: candidate: constexpr long double std::log(long double) log(long double __x) ^ In file included from /usr/include/c++/5/random:51:0, from /usr/include/c++/5/bits/stl_algo.h:66, from /usr/include/c++/5/algorithm:62, from /home/tlc/nanomq/nanolib/hash.cc:11: /usr/include/c++/5/bits/random.tcc:1492:28: error: call of overloaded ‘log(double)’ is ambiguous _M_q = -std::log(1 - __p12); ^ In file included from /usr/include/c++/5/random:38:0, from /usr/include/c++/5/bits/stl_algo.h:66, from /usr/include/c++/5/algorithm:62, from /home/tlc/nanomq/nanolib/hash.cc:11: /usr/include/c++/5/cmath:357:3: note: candidate: constexpr float std::log(float) log(float __x) ^ /usr/include/c++/5/cmath:361:3: note: candidate: constexpr long double std::log(long double) log(long double __x) ^ nanolib/CMakeFiles/nanolib.dir/build.make:62: recipe for target 'nanolib/CMakeFiles/nanolib.dir/hash.cc.o' failed make[2]: *** [nanolib/CMakeFiles/nanolib.dir/hash.cc.o] Error 1 CMakeFiles/Makefile2:2684: recipe for target 'nanolib/CMakeFiles/nanolib.dir/all' failed make[1]: *** [nanolib/CMakeFiles/nanolib.dir/all] Error 2 Makefile:151: recipe for target 'all' failed make: *** [all] Error 2
ubuntu nanomq build erro
https://api.github.com/repos/nanomq/nanomq/issues/283/comments
3
2022-01-17T08:05:29Z
2022-02-25T16:36:36Z
https://github.com/nanomq/nanomq/issues/283
1,105,503,333
283
[ "emqx", "nanomq" ]
In Windows 10 using GCC v11.2.0 Ninja v1.10.2 Cmake 3.22.1 Build steps : ``` git clone https://github.com/nanomq/nanomq.git ; cd nanomq git submodule update --init --recursive mkdir build && cd build cmake -G Ninja .. ninja ``` Gives error : ``` ../nanomq/nng/include/nng/nng_debug.h:13:10: fatal error: syslog.h: No such file or directory 13 | #include <syslog.h> compilation terminated. ninja: build stopped: subcommand failed. ```
Ninja Build Fails on Windows 10
https://api.github.com/repos/nanomq/nanomq/issues/282/comments
3
2022-01-17T01:08:30Z
2022-04-16T15:26:58Z
https://github.com/nanomq/nanomq/issues/282
1,105,253,897
282
[ "emqx", "nanomq" ]
## How to reproduce? Using sender and recver in demo/file in nanosdk. Send some files in a complicated format. ``` Fri Jan 14 17:30:55 2022 nni_aio_schedule: aio->a_cancel_fn NULL 1? Fri Jan 14 17:30:55 2022 nni_aio_finish: Hunky dory(0) Fri Jan 14 17:30:55 2022 nano_pipe_recv_cb: currently processing pipe_id: 743877015 Fri Jan 14 17:30:55 2022 tcptran_pipe_recv_cb: tcptran_pipe_recv_cb 0x6120000601c0 Fri Jan 14 17:30:55 2022 nni_aio_finish_sync: Hunky dory(0) Fri Jan 14 17:30:55 2022 tcptran_pipe_recv_cb: new 2 recevied 2 header e0 0 pos: 2 len : 0 Fri Jan 14 17:30:55 2022 server_cb: RECV ^^^^ ctx19 ^^^^ Fri Jan 14 17:30:55 2022 tcptran_pipe_recv_cb: still need byte count:0 > 0 Fri Jan 14 17:30:55 2022 decode_pub_message: cmd: 3, retain: 0, qos: 0, dup: 0, remaining length: 24 Fri Jan 14 17:30:55 2022 tcptran_pipe_recv_cb: pipe 0x6120000601c0 header got: e0 0 0 4 4d, 2!! Fri Jan 14 17:30:55 2022 decode_pub_message: topic: [files], qos: 0 Fri Jan 14 17:30:55 2022 tcptran_pipe_recv_cb: remain_len 0 cparam 0x612000070240 clientid mosq-3sQ3jlPCDZBdRZOmah username (null) proto 4 Fri Jan 14 17:30:55 2022 decode_pub_message: NOMQTT5ERR [4] [5] Fri Jan 14 17:30:55 2022 tcptran_pipe_recv_cb: The type of msg is e0 Fri Jan 14 17:30:55 2022 tcptran_pipe_recv_start: *** tcptran_pipe_recv_start *** Fri Jan 14 17:30:55 2022 nni_aio_finish_sync: Hunky dory(0) Fri Jan 14 17:30:55 2022 nano_pipe_recv_cb: ######### nano_pipe_recv_cb ############ Fri Jan 14 17:30:55 2022 nano_pipe_close: ################# nano_pipe_close ############## Fri Jan 14 17:30:55 2022 nni_aio_finish_error: Object closed(7) Fri Jan 14 17:30:55 2022 nni_aio_finish_sync: Hunky dory(0) Fri Jan 14 17:30:55 2022 server_cb: RECV ^^^^ ctx18 ^^^^ Fri Jan 14 17:30:55 2022 decode_pub_message: cmd: 3, retain: 0, qos: 0, dup: 0, remaining length: 118 Fri Jan 14 17:30:55 2022 decode_pub_message: topic: [$SYS/brokers/disconnected], qos: 0 Fri Jan 14 17:30:55 2022 decode_pub_message: NOMQTT5ERR [4] [5] Fri Jan 14 17:30:55 2022 decode_pub_message: used pos: [27] Fri Jan 14 17:30:55 2022 decode_pub_message: payload: [{"username":"(null)","ts":18301592,"reason_code":"0","client_id":"mosq-3sQ3jlPCDZBdRZOmah"}], len = 91 [INFO] Fri Jan 14 17:30:55 2022 (140396742006528:dbtree_find_shared_clients:1963) nodes size: 3 Fri Jan 14 17:30:55 2022 handle_pub: pipe_info size: [0] Fri Jan 14 17:30:55 2022 server_cb: ERROR it should not happen Fri Jan 14 17:30:55 2022 conn_param_free: destroy conn param Fri Jan 14 17:30:55 2022 nni_aio_finish: Hunky dory(0) Fri Jan 14 17:30:55 2022 server_cb: WAIT ^^^^ ctx18 ^^^^ Fri Jan 14 17:30:55 2022 nano_pipe_recv_cb: ERROR: pipe is closed abruptly!! Fri Jan 14 17:30:55 2022 server_cb: total pipes: 0 Fri Jan 14 17:30:55 2022 nano_pipe_stop: ##########nano_pipe_stop############### Fri Jan 14 17:30:55 2022 tcptran_pipe_recv_cb: end of tcptran_pipe_recv_cb: synch! 0x6120000601c0 Fri Jan 14 17:30:55 2022 free_pub_packet: free memory topic Fri Jan 14 17:30:55 2022 decode_pub_message: used pos: [7] Fri Jan 14 17:30:55 2022 free_pub_packet: free memory payload Fri Jan 14 17:30:55 2022 decode_pub_message: payload: [./BX037111100.DAT], len = 17 [INFO] Fri Jan 14 17:30:55 2022 (140396708435712:collect_clients:956) Searching client: files [INFO] Fri Jan 14 17:30:55 2022 (140396708435712:collect_clients:959) Searching client: files [INFO] Fri Jan 14 17:30:55 2022 (140396708435712:dbtree_find_shared_clients:1963) nodes size: 3 Fri Jan 14 17:30:55 2022 free_pub_packet: free pub_packet Fri Jan 14 17:30:55 2022 handle_pub: pipe_info size: [1] Fri Jan 14 17:30:55 2022 init_pipe_content: pub_handler: init pipe_info Fri Jan 14 17:30:55 2022 nni_aio_finish: Hunky dory(0) Fri Jan 14 17:30:55 2022 nng_ctx_recv: ######## nng_ctx_recv context id 18 ######## Fri Jan 14 17:30:55 2022 nano_pipe_recv_cb: end of nano_pipe_recv_cb 0x6100000013b0 Fri Jan 14 17:30:55 2022 server_cb: WAIT ^^^^ ctx19 ^^^^ Fri Jan 14 17:30:55 2022 nano_ctx_recv: nano_ctx_recv start 0x6100000012b0 Fri Jan 14 17:30:55 2022 server_cb: total pipes: 1 Fri Jan 14 17:30:55 2022 tcptran_pipe_recv_cb: end of tcptran_pipe_recv_cb: synch! 0x6120000601c0 Fri Jan 14 17:30:55 2022 nni_aio_schedule: aio->a_cancel_fn NULL 1? Fri Jan 14 17:30:55 2022 nano_pipe_fini: ########## nano_pipe_fini ############### ================================================================= ==59474==ERROR: AddressSanitizer: heap-use-after-free on address 0x612000070244 at pc 0x559afb94acd4 bp 0x7fb0abef8680 sp 0x7fb0abef8670 READ of size 1 at 0x612000070244 thread T7 (nng:task) #0 0x559afb94acd3 in conn_param_get_protover /home/wangha/docu/git/nanomq/nng/src/nng.c:2194 #1 0x559afb8bf0ac in encode_pub_message /home/wangha/docu/git/nanomq/nanomq/pub_handler.c:313 #2 0x559afb93234d in server_cb /home/wangha/docu/git/nanomq/nanomq/apps/broker.c:457 #3 0x559afb968653 in nni_taskq_thread /home/wangha/docu/git/nanomq/nng/src/core/taskq.c:50 #4 0x559afb969c2b in nni_thr_wrap /home/wangha/docu/git/nanomq/nng/src/core/thread.c:94 #5 0x559afb972425 in nni_plat_thr_main /home/wangha/docu/git/nanomq/nng/src/platform/posix/posix_thread.c:266 #6 0x7fb0b27fe608 in start_thread /build/glibc-YbNSs7/glibc-2.31/nptl/pthread_create.c:477 #7 0x7fb0b251d292 in __clone (/lib/x86_64-linux-gnu/libc.so.6+0x122292) 0x612000070244 is located 4 bytes inside of 296-byte region [0x612000070240,0x612000070368) freed by thread T11 (nng:task) here: #0 0x7fb0b29257cf in __interceptor_free (/lib/x86_64-linux-gnu/libasan.so.5+0x10d7cf) #1 0x559afb96e09d in nni_free /home/wangha/docu/git/nanomq/nng/src/platform/posix/posix_alloc.c:33 #2 0x559afb93db3f in nng_free /home/wangha/docu/git/nanomq/nng/src/nng.c:70 #3 0x559afb98d94f in conn_param_free /home/wangha/docu/git/nanomq/nng/src/sp/protocol/mqtt/mqtt_parser.c:766 #4 0x559afb92e5da in server_cb /home/wangha/docu/git/nanomq/nanomq/apps/broker.c:290 #5 0x559afb968e4a in nni_task_exec /home/wangha/docu/git/nanomq/nng/src/core/taskq.c:144 #6 0x559afb94d1ea in nni_aio_finish_impl /home/wangha/docu/git/nanomq/nng/src/core/aio.c:456 #7 0x559afb94d4d6 in nni_aio_finish_sync /home/wangha/docu/git/nanomq/nng/src/core/aio.c:473 #8 0x559afb9940b6 in nano_pipe_close /home/wangha/docu/git/nanomq/nng/src/sp/protocol/mqtt/nmq_mqtt.c:647 #9 0x559afb95cde9 in nni_pipe_close /home/wangha/docu/git/nanomq/nng/src/core/pipe.c:154 #10 0x559afb995b43 in nano_pipe_recv_cb /home/wangha/docu/git/nanomq/nng/src/sp/protocol/mqtt/nmq_mqtt.c:819 #11 0x559afb968e4a in nni_task_exec /home/wangha/docu/git/nanomq/nng/src/core/taskq.c:144 #12 0x559afb94d1ea in nni_aio_finish_impl /home/wangha/docu/git/nanomq/nng/src/core/aio.c:456 #13 0x559afb94d4d6 in nni_aio_finish_sync /home/wangha/docu/git/nanomq/nng/src/core/aio.c:473 #14 0x559afb9eaa72 in tcptran_pipe_recv_cb /home/wangha/docu/git/nanomq/nng/src/sp/transport/mqtt/broker_tcp.c:604 #15 0x559afb968653 in nni_taskq_thread /home/wangha/docu/git/nanomq/nng/src/core/taskq.c:50 #16 0x559afb969c2b in nni_thr_wrap /home/wangha/docu/git/nanomq/nng/src/core/thread.c:94 #17 0x559afb972425 in nni_plat_thr_main /home/wangha/docu/git/nanomq/nng/src/platform/posix/posix_thread.c:266 #18 0x7fb0b27fe608 in start_thread /build/glibc-YbNSs7/glibc-2.31/nptl/pthread_create.c:477 previously allocated by thread T13 (nng:task) here: #0 0x7fb0b2925bc8 in malloc (/lib/x86_64-linux-gnu/libasan.so.5+0x10dbc8) #1 0x559afb96e043 in nni_alloc /home/wangha/docu/git/nanomq/nng/src/platform/posix/posix_alloc.c:20 #2 0x559afb93daf8 in nng_alloc /home/wangha/docu/git/nanomq/nng/src/nng.c:58 #3 0x559afb98d090 in conn_param_alloc /home/wangha/docu/git/nanomq/nng/src/sp/protocol/mqtt/mqtt_parser.c:729 #4 0x559afb9e742e in tcptran_pipe_nego_cb /home/wangha/docu/git/nanomq/nng/src/sp/transport/mqtt/broker_tcp.c:319 #5 0x559afb968653 in nni_taskq_thread /home/wangha/docu/git/nanomq/nng/src/core/taskq.c:50 #6 0x559afb969c2b in nni_thr_wrap /home/wangha/docu/git/nanomq/nng/src/core/thread.c:94 #7 0x559afb972425 in nni_plat_thr_main /home/wangha/docu/git/nanomq/nng/src/platform/posix/posix_thread.c:266 #8 0x7fb0b27fe608 in start_thread /build/glibc-YbNSs7/glibc-2.31/nptl/pthread_create.c:477 ```
nanomq crashed when using demo/file in nanosdk
https://api.github.com/repos/nanomq/nanomq/issues/281/comments
1
2022-01-14T09:36:32Z
2022-01-26T10:34:33Z
https://github.com/nanomq/nanomq/issues/281
1,103,350,975
281
[ "emqx", "nanomq" ]
## How to reproduce? ``` mosquitto_sub -t msg -c -i wangha Ctrl-C mosquitto_pub -t msg -m aaaaa -q 1 mosquitto_pub -t msg -m aaaaa -q 1 mosquitto_sub -t msg -c -i wangha ``` log from asan ``` ==105090==ERROR: AddressSanitizer: heap-use-after-free on address 0x60f0000378a8 at pc 0x55fa98d750a5 bp 0x7effe23f1bb0 sp 0x7effe23f1ba0 READ of size 8 at 0x60f0000378a8 thread T14 (nng:task) #0 0x55fa98d750a4 in nni_msg_get_timestamp /home/wangha/docu/git/nanomq/nng/src/core/message.c:787 #1 0x55fa98dabf13 in nano_pipe_timer_cb /home/wangha/docu/git/nanomq/nng/src/sp/protocol/mqtt/nmq_mqtt.c:201 #2 0x55fa98d83653 in nni_taskq_thread /home/wangha/docu/git/nanomq/nng/src/core/taskq.c:50 #3 0x55fa98d84c2b in nni_thr_wrap /home/wangha/docu/git/nanomq/nng/src/core/thread.c:94 #4 0x55fa98d8d425 in nni_plat_thr_main /home/wangha/docu/git/nanomq/nng/src/platform/posix/posix_thread.c:266 #5 0x7effec5bf608 in start_thread /build/glibc-YbNSs7/glibc-2.31/nptl/pthread_create.c:477 #6 0x7effec2de292 in __clone (/lib/x86_64-linux-gnu/libc.so.6+0x122292) 0x60f0000378a8 is located 152 bytes inside of 168-byte region [0x60f000037810,0x60f0000378b8) freed by thread T10 (nng:task) here: #0 0x7effec6e67cf in __interceptor_free (/lib/x86_64-linux-gnu/libasan.so.5+0x10d7cf) #1 0x55fa98d8909d in nni_free /home/wangha/docu/git/nanomq/nng/src/platform/posix/posix_alloc.c:33 #2 0x55fa98d73d79 in nni_msg_free /home/wangha/docu/git/nanomq/nng/src/core/message.c:470 #3 0x55fa98d61966 in nng_msg_free /home/wangha/docu/git/nanomq/nng/src/nng.c:1424 #4 0x55fa98d4dab2 in server_cb /home/wangha/docu/git/nanomq/nanomq/apps/broker.c:490 #5 0x55fa98d83653 in nni_taskq_thread /home/wangha/docu/git/nanomq/nng/src/core/taskq.c:50 #6 0x55fa98d84c2b in nni_thr_wrap /home/wangha/docu/git/nanomq/nng/src/core/thread.c:94 #7 0x55fa98d8d425 in nni_plat_thr_main /home/wangha/docu/git/nanomq/nng/src/platform/posix/posix_thread.c:266 #8 0x7effec5bf608 in start_thread /build/glibc-YbNSs7/glibc-2.31/nptl/pthread_create.c:477 previously allocated by thread T14 (nng:task) here: #0 0x7effec6e6dc6 in calloc (/lib/x86_64-linux-gnu/libasan.so.5+0x10ddc6) #1 0x55fa98d89074 in nni_zalloc /home/wangha/docu/git/nanomq/nng/src/platform/posix/posix_alloc.c:26 #2 0x55fa98d73847 in nni_msg_alloc /home/wangha/docu/git/nanomq/nng/src/core/message.c:389 #3 0x55fa98e04a1c in tcptran_pipe_recv_cb /home/wangha/docu/git/nanomq/nng/src/sp/transport/mqtt/broker_tcp.c:516 #4 0x55fa98d83653 in nni_taskq_thread /home/wangha/docu/git/nanomq/nng/src/core/taskq.c:50 #5 0x55fa98d84c2b in nni_thr_wrap /home/wangha/docu/git/nanomq/nng/src/core/thread.c:94 #6 0x55fa98d8d425 in nni_plat_thr_main /home/wangha/docu/git/nanomq/nng/src/platform/posix/posix_thread.c:266 #7 0x7effec5bf608 in start_thread /build/glibc-YbNSs7/glibc-2.31/nptl/pthread_create.c:477 Thread T14 (nng:task) created by T0 here: #0 0x7effec613805 in pthread_create (/lib/x86_64-linux-gnu/libasan.so.5+0x3a805) #1 0x55fa98d8d555 in nni_plat_thr_init /home/wangha/docu/git/nanomq/nng/src/platform/posix/posix_thread.c:279 #2 0x55fa98d84ed4 in nni_thr_init /home/wangha/docu/git/nanomq/nng/src/core/thread.c:121 #3 0x55fa98d83974 in nni_taskq_init /home/wangha/docu/git/nanomq/nng/src/core/taskq.c:95 #4 0x55fa98d848fb in nni_taskq_sys_init /home/wangha/docu/git/nanomq/nng/src/core/taskq.c:284 #5 0x55fa98d6f73d in nni_init_helper /home/wangha/docu/git/nanomq/nng/src/core/init.c:41 #6 0x55fa98d8d8a9 in nni_plat_init /home/wangha/docu/git/nanomq/nng/src/platform/posix/posix_thread.c:422 #7 0x55fa98d6f7bc in nni_init /home/wangha/docu/git/nanomq/nng/src/core/init.c:63 #8 0x55fa98db5371 in nni_proto_mqtt_open /home/wangha/docu/git/nanomq/nng/src/sp/protocol.c:37 #9 0x55fa98db1d47 in nng_nmq_tcp0_open /home/wangha/docu/git/nanomq/nng/src/sp/protocol/mqtt/nmq_mqtt.c:1035 #10 0x55fa98d4f2e4 in broker /home/wangha/docu/git/nanomq/nanomq/apps/broker.c:655 #11 0x55fa98d5190c in broker_start /home/wangha/docu/git/nanomq/nanomq/apps/broker.c:973 #12 0x55fa98cd574a in main /home/wangha/docu/git/nanomq/nanomq/nanomq.c:184 #13 0x7effec1e30b2 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x270b2) Thread T10 (nng:task) created by T0 here: #0 0x7effec613805 in pthread_create (/lib/x86_64-linux-gnu/libasan.so.5+0x3a805) #1 0x55fa98d8d555 in nni_plat_thr_init /home/wangha/docu/git/nanomq/nng/src/platform/posix/posix_thread.c:279 #2 0x55fa98d84ed4 in nni_thr_init /home/wangha/docu/git/nanomq/nng/src/core/thread.c:121 #3 0x55fa98d83974 in nni_taskq_init /home/wangha/docu/git/nanomq/nng/src/core/taskq.c:95 #4 0x55fa98d848fb in nni_taskq_sys_init /home/wangha/docu/git/nanomq/nng/src/core/taskq.c:284 #5 0x55fa98d6f73d in nni_init_helper /home/wangha/docu/git/nanomq/nng/src/core/init.c:41 #6 0x55fa98d8d8a9 in nni_plat_init /home/wangha/docu/git/nanomq/nng/src/platform/posix/posix_thread.c:422 #7 0x55fa98d6f7bc in nni_init /home/wangha/docu/git/nanomq/nng/src/core/init.c:63 #8 0x55fa98db5371 in nni_proto_mqtt_open /home/wangha/docu/git/nanomq/nng/src/sp/protocol.c:37 #9 0x55fa98db1d47 in nng_nmq_tcp0_open /home/wangha/docu/git/nanomq/nng/src/sp/protocol/mqtt/nmq_mqtt.c:1035 #10 0x55fa98d4f2e4 in broker /home/wangha/docu/git/nanomq/nanomq/apps/broker.c:655 #11 0x55fa98d5190c in broker_start /home/wangha/docu/git/nanomq/nanomq/apps/broker.c:973 #12 0x55fa98cd574a in main /home/wangha/docu/git/nanomq/nanomq/nanomq.c:184 #13 0x7effec1e30b2 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x270b2) SUMMARY: AddressSanitizer: heap-use-after-free /home/wangha/docu/git/nanomq/nng/src/core/message.c:787 in nni_msg_get_timestamp Shadow bytes around the buggy address: 0x0c1e7fffeec0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c1e7fffeed0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c1e7fffeee0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c1e7fffeef0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c1e7fffef00: fa fa fd fd fd fd fd fd fd fd fd fd fd fd fd fd =>0x0c1e7fffef10: fd fd fd fd fd[fd]fd fa fa fa fa fa fa fa fa fa 0x0c1e7fffef20: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c1e7fffef30: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c1e7fffef40: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c1e7fffef50: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c1e7fffef60: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa Shadow byte legend (one shadow byte represents 8 application bytes): Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 Heap left redzone: fa Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack after return: f5 Stack use after scope: f8 Global redzone: f9 Global init order: f6 Poisoned by user: f7 Container overflow: fc Array cookie: ac Intra object redzone: bb ASan internal: fe Left alloca redzone: ca Right alloca redzone: cb Shadow gap: cc ==105090==ABORTING ```
Core dump when using clean session function
https://api.github.com/repos/nanomq/nanomq/issues/279/comments
0
2022-01-13T10:37:00Z
2022-01-20T11:36:11Z
https://github.com/nanomq/nanomq/issues/279
1,101,516,157
279
[ "emqx", "nanomq" ]
to improve bridging performance.
nni_timer is too cpu consuming, we should switch to sleep_aio
https://api.github.com/repos/nanomq/nanomq/issues/278/comments
1
2022-01-07T11:19:41Z
2022-03-10T00:16:22Z
https://github.com/nanomq/nanomq/issues/278
1,096,227,036
278
[ "emqx", "nanomq" ]
``` Tue Jan 4 16:19:16 2022 tcptran_pipe_recv_cb: The type of msg is e0 Tue Jan 4 16:19:16 2022 tcptran_pipe_recv_start: *** tcptran_pipe_recv_start *** Tue Jan 4 16:19:16 2022 nni_aio_finish_sync: Hunky dory(0) Tue Jan 4 16:19:16 2022 nano_pipe_recv_cb: ######### nano_pipe_recv_cb ############ Tue Jan 4 16:19:16 2022 nano_pipe_close: ################# nano_pipe_close ############## Tue Jan 4 16:19:16 2022 nni_aio_finish_error: Object closed(7) Tue Jan 4 16:19:16 2022 nni_aio_finish_sync: Hunky dory(0) Tue Jan 4 16:19:16 2022 server_cb: RECV ^^^^ ctx8 ^^^^ Tue Jan 4 16:19:16 2022 decode_pub_message: cmd: 3, retain: 0, qos: 0, dup: 0, remaining length: 119 Tue Jan 4 16:19:16 2022 decode_pub_message: topic: [$SYS/brokers/disconnected], qos: 0 Tue Jan 4 16:19:16 2022 decode_pub_message: NOMQTT5ERR [4] [5] Tue Jan 4 16:19:16 2022 decode_pub_message: used pos: [27] Tue Jan 4 16:19:16 2022 decode_pub_message: payload: [{"username":"(null)","ts":712618947,"reason_code":"0","client_id":"mosq-BM5JYtGlH6pRHFwz9S"}], len = 92 Tue Jan 4 16:19:16 2022 server_cb: RECV ^^^^ ctx7 ^^^^ Tue Jan 4 16:19:16 2022 handle_pub: pipe_info size: [0] Tue Jan 4 16:19:16 2022 server_cb: ERROR it should not happen Tue Jan 4 16:19:16 2022 conn_param_free: destroy conn param Tue Jan 4 16:19:16 2022 nni_aio_finish: Hunky dory(0) Tue Jan 4 16:19:16 2022 server_cb: WAIT ^^^^ ctx8 ^^^^ Tue Jan 4 16:19:16 2022 nano_pipe_recv_cb: ERROR: pipe is closed abruptly!! Tue Jan 4 16:19:16 2022 nano_pipe_stop: ##########nano_pipe_stop############### Tue Jan 4 16:19:16 2022 server_cb: total pipes: 0 Tue Jan 4 16:19:16 2022 tcptran_pipe_recv_cb: end of tcptran_pipe_recv_cb: synch! 0x612000030040 Tue Jan 4 16:19:16 2022 free_pub_packet: free memory topic ================================================================= Tue Jan 4 16:19:16 2022 free_pub_packet: free memory payload ==416139==ERROR: AddressSanitizer: heap-use-after-free on address 0x61200003ff44 at pc 0x564ba9852b41 bp 0x7f81676f5120 sp 0x7f81676f5110 Tue Jan 4 16:19:16 2022 free_pub_packet: free pub_packet READ of size 1 at 0x61200003ff44 thread T10 (nng:task) Tue Jan 4 16:19:16 2022 init_pipe_content: pub_handler: init pipe_info Tue Jan 4 16:19:16 2022 nng_ctx_recv: ######## nng_ctx_recv context id 8 ######## Tue Jan 4 16:19:16 2022 nano_ctx_recv: nano_ctx_recv start 0x6100000008b0 Tue Jan 4 16:19:16 2022 nni_aio_schedule: aio->a_cancel_fn NULL 1? #0 0x564ba9852b40 in conn_param_get_protover /home/wangha/docu/git/nanomq/nng/src/nng.c:2194 #1 0x564ba97ca2f4 in decode_pub_message /home/wangha/docu/git/nanomq/nanomq/pub_handler.c:596 #2 0x564ba97c6518 in handle_pub /home/wangha/docu/git/nanomq/nanomq/pub_handler.c:103 #3 0x564ba9834718 in server_cb /home/wangha/docu/git/nanomq/nanomq/apps/broker.c:126 #4 0x564ba9870cb7 in nni_task_exec /home/wangha/docu/git/nanomq/nng/src/core/taskq.c:144 #5 0x564ba9855057 in nni_aio_finish_impl /home/wangha/docu/git/nanomq/nng/src/core/aio.c:456 #6 0x564ba9855343 in nni_aio_finish_sync /home/wangha/docu/git/nanomq/nng/src/core/aio.c:473 #7 0x564ba989e251 in nano_pipe_recv_cb /home/wangha/docu/git/nanomq/nng/src/sp/protocol/mqtt/nmq_mqtt.c:883 #8 0x564ba9870cb7 in nni_task_exec /home/wangha/docu/git/nanomq/nng/src/core/taskq.c:144 #9 0x564ba9855057 in nni_aio_finish_impl /home/wangha/docu/git/nanomq/nng/src/core/aio.c:456 #10 0x564ba9855343 in nni_aio_finish_sync /home/wangha/docu/git/nanomq/nng/src/core/aio.c:473 #11 0x564ba98f28df in tcptran_pipe_recv_cb /home/wangha/docu/git/nanomq/nng/src/sp/transport/mqtt/broker_tcp.c:604 #12 0x564ba98704c0 in nni_taskq_thread /home/wangha/docu/git/nanomq/nng/src/core/taskq.c:50 #13 0x564ba9871a98 in nni_thr_wrap /home/wangha/docu/git/nanomq/nng/src/core/thread.c:94 #14 0x564ba987a292 in nni_plat_thr_main /home/wangha/docu/git/nanomq/nng/src/platform/posix/posix_thread.c:266 #15 0x7f816f895608 in start_thread /build/glibc-YbNSs7/glibc-2.31/nptl/pthread_create.c:477 #16 0x7f816f5b4292 in __clone (/lib/x86_64-linux-gnu/libc.so.6+0x122292) 0x61200003ff44 is located 4 bytes inside of 296-byte region [0x61200003ff40,0x612000040068) freed by thread T11 (nng:task) here: #0 0x7f816f9bc7cf in __interceptor_free (/lib/x86_64-linux-gnu/libasan.so.5+0x10d7cf) #1 0x564ba9875f0a in nni_free /home/wangha/docu/git/nanomq/nng/src/platform/posix/posix_alloc.c:33 #2 0x564ba98459ac in nng_free /home/wangha/docu/git/nanomq/nng/src/nng.c:70 #3 0x564ba98957bc in conn_param_free /home/wangha/docu/git/nanomq/nng/src/sp/protocol/mqtt/mqtt_parser.c:766 #4 0x564ba9835743 in server_cb /home/wangha/docu/git/nanomq/nanomq/apps/broker.c:226 #5 0x564ba9870cb7 in nni_task_exec /home/wangha/docu/git/nanomq/nng/src/core/taskq.c:144 #6 0x564ba9855057 in nni_aio_finish_impl /home/wangha/docu/git/nanomq/nng/src/core/aio.c:456 #7 0x564ba9855343 in nni_aio_finish_sync /home/wangha/docu/git/nanomq/nng/src/core/aio.c:473 #8 0x564ba989bf23 in nano_pipe_close /home/wangha/docu/git/nanomq/nng/src/sp/protocol/mqtt/nmq_mqtt.c:647 #9 0x564ba9864c56 in nni_pipe_close /home/wangha/docu/git/nanomq/nng/src/core/pipe.c:154 #10 0x564ba989d9b0 in nano_pipe_recv_cb /home/wangha/docu/git/nanomq/nng/src/sp/protocol/mqtt/nmq_mqtt.c:819 #11 0x564ba9870cb7 in nni_task_exec /home/wangha/docu/git/nanomq/nng/src/core/taskq.c:144 #12 0x564ba9855057 in nni_aio_finish_impl /home/wangha/docu/git/nanomq/nng/src/core/aio.c:456 #13 0x564ba9855343 in nni_aio_finish_sync /home/wangha/docu/git/nanomq/nng/src/core/aio.c:473 #14 0x564ba98f28df in tcptran_pipe_recv_cb /home/wangha/docu/git/nanomq/nng/src/sp/transport/mqtt/broker_tcp.c:604 #15 0x564ba98704c0 in nni_taskq_thread /home/wangha/docu/git/nanomq/nng/src/core/taskq.c:50 #16 0x564ba9871a98 in nni_thr_wrap /home/wangha/docu/git/nanomq/nng/src/core/thread.c:94 #17 0x564ba987a292 in nni_plat_thr_main /home/wangha/docu/git/nanomq/nng/src/platform/posix/posix_thread.c:266 #18 0x7f816f895608 in start_thread /build/glibc-YbNSs7/glibc-2.31/nptl/pthread_create.c:477 previously allocated by thread T13 (nng:task) here: #0 0x7f816f9bcbc8 in malloc (/lib/x86_64-linux-gnu/libasan.so.5+0x10dbc8) #1 0x564ba9875eb0 in nni_alloc /home/wangha/docu/git/nanomq/nng/src/platform/posix/posix_alloc.c:20 #2 0x564ba9845965 in nng_alloc /home/wangha/docu/git/nanomq/nng/src/nng.c:58 #3 0x564ba9894efd in conn_param_alloc /home/wangha/docu/git/nanomq/nng/src/sp/protocol/mqtt/mqtt_parser.c:729 #4 0x564ba98ef29b in tcptran_pipe_nego_cb /home/wangha/docu/git/nanomq/nng/src/sp/transport/mqtt/broker_tcp.c:319 #5 0x564ba98704c0 in nni_taskq_thread /home/wangha/docu/git/nanomq/nng/src/core/taskq.c:50 #6 0x564ba9871a98 in nni_thr_wrap /home/wangha/docu/git/nanomq/nng/src/core/thread.c:94 #7 0x564ba987a292 in nni_plat_thr_main /home/wangha/docu/git/nanomq/nng/src/platform/posix/posix_thread.c:266 #8 0x7f816f895608 in start_thread /build/glibc-YbNSs7/glibc-2.31/nptl/pthread_create.c:477 Thread T10 (nng:task) created by T0 here: #0 0x7f816f8e9805 in pthread_create (/lib/x86_64-linux-gnu/libasan.so.5+0x3a805) #1 0x564ba987a3c2 in nni_plat_thr_init /home/wangha/docu/git/nanomq/nng/src/platform/posix/posix_thread.c:279 #2 0x564ba9871d41 in nni_thr_init /home/wangha/docu/git/nanomq/nng/src/core/thread.c:121 #3 0x564ba98707e1 in nni_taskq_init /home/wangha/docu/git/nanomq/nng/src/core/taskq.c:95 #4 0x564ba9871768 in nni_taskq_sys_init /home/wangha/docu/git/nanomq/nng/src/core/taskq.c:284 #5 0x564ba985c5aa in nni_init_helper /home/wangha/docu/git/nanomq/nng/src/core/init.c:41 #6 0x564ba987a716 in nni_plat_init /home/wangha/docu/git/nanomq/nng/src/platform/posix/posix_thread.c:422 #7 0x564ba985c629 in nni_init /home/wangha/docu/git/nanomq/nng/src/core/init.c:63 #8 0x564ba98a21de in nni_proto_mqtt_open /home/wangha/docu/git/nanomq/nng/src/sp/protocol.c:37 #9 0x564ba989ebb4 in nng_nmq_tcp0_open /home/wangha/docu/git/nanomq/nng/src/sp/protocol/mqtt/nmq_mqtt.c:1035 #10 0x564ba983b448 in broker /home/wangha/docu/git/nanomq/nanomq/apps/broker.c:591 #11 0x564ba983e7b2 in broker_start /home/wangha/docu/git/nanomq/nanomq/apps/broker.c:827 #12 0x564ba97c372a in main /home/wangha/docu/git/nanomq/nanomq/nanomq.c:184 #13 0x7f816f4b90b2 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x270b2) ```
Broker crash due to connection reset of mqtt-client
https://api.github.com/repos/nanomq/nanomq/issues/276/comments
1
2022-01-04T08:22:53Z
2022-01-14T10:28:46Z
https://github.com/nanomq/nanomq/issues/276
1,093,116,138
276
[ "emqx", "nanomq" ]
When I use mqtt client subscribe topic #, and I cancel it by hit Ctrl-c, nanomq broker will output Segmentation fault directly.
nanomq broker Segmentation fault.
https://api.github.com/repos/nanomq/nanomq/issues/273/comments
3
2021-12-30T07:58:19Z
2021-12-30T10:48:20Z
https://github.com/nanomq/nanomq/issues/273
1,090,937,909
273
[ "emqx", "nanomq" ]
I want to configure nanomq with configuration files, but I don't find configuration template from the repository. Could anyone provide a template please? Or where could I find them?
nanomq.conf & nanomq_auth_username.conf template support
https://api.github.com/repos/nanomq/nanomq/issues/257/comments
3
2021-12-12T04:07:27Z
2021-12-17T03:18:26Z
https://github.com/nanomq/nanomq/issues/257
1,077,711,912
257
[ "emqx", "nanomq" ]
When trying to build nng from source using the following command ` sudo make ` it has the following error ``` Scanning dependencies of target nng [ 0%] Building C object CMakeFiles/nng.dir/src/nng.c.o In file included from /home/pi/nanomq/nng/src/core/nng_impl.h:37, from /home/pi/nanomq/nng/src/nng.c:12: /home/pi/nanomq/nng/src/core/message.h:14:10: fatal error: packet.h: No such file or directory #include <packet.h> ^~~~~~~~~~ compilation terminated. make[2]: *** [CMakeFiles/nng.dir/build.make:63: CMakeFiles/nng.dir/src/nng.c.o] Error 1 make[1]: *** [CMakeFiles/Makefile2:902: CMakeFiles/nng.dir/all] Error 2 make: *** [Makefile:163: all] Error 2 ``` and also when trying to build nanolin with the same command it errors the following: ``` [ 36%] Building C object CMakeFiles/nanolib.dir/conf.c.o /home/pi/nanomq/nanolib/conf.c:14:10: fatal error: nanomq.h: No such file or directory #include "nanomq.h" ^~~~~~~~~~ compilation terminated. make[2]: *** [CMakeFiles/nanolib.dir/build.make:102: CMakeFiles/nanolib.dir/conf.c.o] Error 1 make[1]: *** [CMakeFiles/Makefile2:108: CMakeFiles/nanolib.dir/all] Error 2 make: *** [Makefile:130: all] Error 2 ``` i can't seem to build those dependencies from source
nanolib & nng Build Errors on Raspberry pi 3b+
https://api.github.com/repos/nanomq/nanomq/issues/256/comments
5
2021-12-11T17:10:17Z
2022-02-10T05:34:20Z
https://github.com/nanomq/nanomq/issues/256
1,077,592,430
256
[ "emqx", "nanomq" ]
Scenario: Client A subs to 5 topics with different qos levels. Client B pubs qos 2 msg to a topic which A sub with qos 2. then broker failed to pub qos 2 msg to A. After debugging, pub_handler cannot recognize the correct qos level from topic tree.
Broker failed to recognize the correct QoS level
https://api.github.com/repos/nanomq/nanomq/issues/243/comments
0
2021-11-15T11:31:43Z
2021-11-16T03:48:08Z
https://github.com/nanomq/nanomq/issues/243
1,053,557,971
243
[ "emqx", "nanomq" ]
QoS msg resending is broken after ver 0.4.8
qos msg resending failure
https://api.github.com/repos/nanomq/nanomq/issues/234/comments
0
2021-10-02T06:15:07Z
2021-10-02T06:28:34Z
https://github.com/nanomq/nanomq/issues/234
1,013,941,072
234
[ "emqx", "nanomq" ]
the message ID of QoS 2 is not incrementing itself.
message ID of QoS 2 is not incrementing itself.
https://api.github.com/repos/nanomq/nanomq/issues/228/comments
0
2021-09-26T11:24:53Z
2021-09-26T11:28:39Z
https://github.com/nanomq/nanomq/issues/228
1,007,362,778
228
[ "emqx", "nanomq" ]
How to trigger: Connect 100 clients, sub to same topic "nanomq" with qos 1. then lets 10 clients publish some qos 2 msgs to topic "nanomq", after all publish work is done, wait for sub clients disconnecting due to keepalive timeout. nanomq.conf ./etc/nanomq.conf" file not found or unreadable Warning: close pipe & kick client due to KeepAlive timeout! Warning: close pipe & kick client due to KeepAlive timeout! Warning: close pipe & kick client due to KeepAlive timeout! ==973725==ERROR: AddressSanitizer: heap-use-after-free on address 0x60200001c0d0 at pc 0x7fe3b517069a bp 0x7fe3a2de16e0 sp 0x7fe3a2de0e88 READ of size 3 at 0x60200001c0d0 thread T30 (nng:task) Warning: close pipe & kick client due to KeepAlive timeout! Warning: close pipe & kick client due to KeepAlive timeout! Warning: close pipe & kick client due to KeepAlive timeout! Warning: close pipe & kick client due to KeepAlive timeout! Warning: close pipe & kick client due to KeepAlive timeout! Warning: close pipe & kick client due to KeepAlive timeout! Warning: close pipe & kick client due to KeepAlive timeout! Warning: close pipe & kick client due to KeepAlive timeout! Warning: close pipe & kick client due to KeepAlive timeout! Warning: close pipe & kick client due to KeepAlive timeout! Warning: close pipe & kick client due to KeepAlive timeout! Warning: close pipe & kick client due to KeepAlive timeout! Warning: close pipe & kick client due to KeepAlive timeout! Warning: close pipe & kick client due to KeepAlive timeout! Warning: close pipe & kick client due to KeepAlive timeout! Warning: close pipe & kick client due to KeepAlive timeout! Warning: close pipe & kick client due to KeepAlive timeout! #0 0x7fe3b5170699 in __interceptor_memcpy ../../../../src/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:823 #1 0x56372b16b724 in topic_parse ../nanolib/mqtt_db.c:153 #2 0x56372b174ce4 in search_and_delete ../nanolib/mqtt_db.c:1009 #3 0x56372b18c29f in server_cb ../nanomq/apps/broker.c:171 #4 0x56372b1bac9b in nni_task_exec ../nng/src/core/taskq.c:144 #5 0x56372b19fd11 in nni_aio_finish_impl ../nng/src/core/aio.c:457 #6 0x56372b19fd93 in nni_aio_finish_sync ../nng/src/core/aio.c:474 #7 0x56372b1c8d66 in nano_pipe_close ../nng/src/sp/protocol/reqrep0/nano_tcp.c:632 #8 0x56372b1aed05 in nni_pipe_close ../nng/src/core/pipe.c:161 #9 0x56372b1c9916 in nano_pipe_recv_cb ../nng/src/sp/protocol/reqrep0/nano_tcp.c:777 #10 0x56372b1ba4a6 in nni_taskq_thread ../nng/src/core/taskq.c:50 #11 0x56372b1bb710 in nni_thr_wrap ../nng/src/core/thread.c:94 #12 0x56372b1c3c80 in nni_plat_thr_main ../nng/src/platform/posix/posix_thread.c:266 #13 0x7fe3b511d58f in start_thread nptl/pthread_create.c:463 #14 0x7fe3b4cc5222 in __clone (/lib/x86_64-linux-gnu/libc.so.6+0x119222) 0x60200001c0d0 is located 0 bytes inside of 4-byte region [0x60200001c0d0,0x60200001c0d4) freed by thread T33 (nng:task) here: #0 0x7fe3b51e61c7 in __interceptor_free ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:123 #1 0x56372b154ddb in delete_topic_queue ../nanolib/hash.cc:299 #2 0x56372b15594e in del_topic_all ../nanolib/hash.cc:423 #3 0x56372b18c37d in server_cb ../nanomq/apps/broker.c:176 #4 0x56372b1bac9b in nni_task_exec ../nng/src/core/taskq.c:144 #5 0x56372b19fd11 in nni_aio_finish_impl ../nng/src/core/aio.c:457 #6 0x56372b19fd93 in nni_aio_finish_sync ../nng/src/core/aio.c:474 #7 0x56372b1c8d66 in nano_pipe_close ../nng/src/sp/protocol/reqrep0/nano_tcp.c:632 #8 0x56372b1c6f1f in nano_pipe_timer_cb ../nng/src/sp/protocol/reqrep0/nano_tcp.c:194 #9 0x56372b1ba4a6 in nni_taskq_thread ../nng/src/core/taskq.c:50 #10 0x56372b1bb710 in nni_thr_wrap ../nng/src/core/thread.c:94 #11 0x56372b1c3c80 in nni_plat_thr_main ../nng/src/platform/posix/posix_thread.c:266 #12 0x7fe3b511d58f in start_thread nptl/pthread_create.c:463 previously allocated by thread T9 (nng:task) here: #0 0x7fe3b51e6527 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:145 #1 0x56372b154c0b in new_topic_queue ../nanolib/hash.cc:280 #2 0x56372b154ed2 in add_topic ../nanolib/hash.cc:316 #3 0x56372b1880d0 in sub_ctx_handle ../nanomq/sub_handler.c:345 #4 0x56372b18cd47 in server_cb ../nanomq/apps/broker.c:229 #5 0x56372b1ba4a6 in nni_taskq_thread ../nng/src/core/taskq.c:50 #6 0x56372b1bb710 in nni_thr_wrap ../nng/src/core/thread.c:94 #7 0x56372b1c3c80 in nni_plat_thr_main ../nng/src/platform/posix/posix_thread.c:266 #8 0x7fe3b511d58f in start_thread nptl/pthread_create.c:463 Thread T30 (nng:task) created by T0 here: #0 0x7fe3b518da65 in __interceptor_pthread_create ../../../../src/libsanitizer/asan/asan_interceptors.cpp:216 #1 0x56372b1c3db0 in nni_plat_thr_init ../nng/src/platform/posix/posix_thread.c:279 #2 0x56372b1bb9b9 in nni_thr_init ../nng/src/core/thread.c:121 #3 0x56372b1ba7c5 in nni_taskq_init ../nng/src/core/taskq.c:95 #4 0x56372b1bb3e0 in nni_taskq_sys_init ../nng/src/core/taskq.c:284 #5 0x56372b1a69c0 in nni_init_helper ../nng/src/core/init.c:41 #6 0x56372b1c40b5 in nni_plat_init ../nng/src/platform/posix/posix_thread.c:422 #7 0x56372b1a6a3f in nni_init ../nng/src/core/init.c:63 #8 0x56372b1d159b in nni_proto_mqtt_open ../nng/src/sp/protocol.c:37 #9 0x56372b1ca813 in nng_nano_tcp0_open ../nng/src/sp/protocol/reqrep0/nano_tcp.c:1022 #10 0x56372b18f236 in broker ../nanomq/apps/broker.c:492 #11 0x56372b190f5c in broker_start ../nanomq/apps/broker.c:679 #12 0x56372b180fa7 in main ../nanomq/nanomq.c:163 #13 0x7fe3b4bd4cb1 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x28cb1) Thread T33 (nng:task) created by T0 here: #0 0x7fe3b518da65 in __interceptor_pthread_create ../../../../src/libsanitizer/asan/asan_interceptors.cpp:216 #1 0x56372b1c3db0 in nni_plat_thr_init ../nng/src/platform/posix/posix_thread.c:279 #2 0x56372b1bb9b9 in nni_thr_init ../nng/src/core/thread.c:121 #3 0x56372b1ba7c5 in nni_taskq_init ../nng/src/core/taskq.c:95 #4 0x56372b1bb3e0 in nni_taskq_sys_init ../nng/src/core/taskq.c:284 #5 0x56372b1a69c0 in nni_init_helper ../nng/src/core/init.c:41 #6 0x56372b1c40b5 in nni_plat_init ../nng/src/platform/posix/posix_thread.c:422 #7 0x56372b1a6a3f in nni_init ../nng/src/core/init.c:63 #8 0x56372b1d159b in nni_proto_mqtt_open ../nng/src/sp/protocol.c:37 #9 0x56372b1ca813 in nng_nano_tcp0_open ../nng/src/sp/protocol/reqrep0/nano_tcp.c:1022 #10 0x56372b18f236 in broker ../nanomq/apps/broker.c:492 #11 0x56372b190f5c in broker_start ../nanomq/apps/broker.c:679 #12 0x56372b180fa7 in main ../nanomq/nanomq.c:163 #13 0x7fe3b4bd4cb1 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x28cb1) Thread T9 (nng:task) created by T0 here: #0 0x7fe3b518da65 in __interceptor_pthread_create ../../../../src/libsanitizer/asan/asan_interceptors.cpp:216 #1 0x56372b1c3db0 in nni_plat_thr_init ../nng/src/platform/posix/posix_thread.c:279 #2 0x56372b1bb9b9 in nni_thr_init ../nng/src/core/thread.c:121 #3 0x56372b1ba7c5 in nni_taskq_init ../nng/src/core/taskq.c:95 #4 0x56372b1bb3e0 in nni_taskq_sys_init ../nng/src/core/taskq.c:284 #5 0x56372b1a69c0 in nni_init_helper ../nng/src/core/init.c:41 #6 0x56372b1c40b5 in nni_plat_init ../nng/src/platform/posix/posix_thread.c:422 #7 0x56372b1a6a3f in nni_init ../nng/src/core/init.c:63 #8 0x56372b1d159b in nni_proto_mqtt_open ../nng/src/sp/protocol.c:37 #9 0x56372b1ca813 in nng_nano_tcp0_open ../nng/src/sp/protocol/reqrep0/nano_tcp.c:1022 #10 0x56372b18f236 in broker ../nanomq/apps/broker.c:492 #11 0x56372b190f5c in broker_start ../nanomq/apps/broker.c:679 #12 0x56372b180fa7 in main ../nanomq/nanomq.c:163 #13 0x7fe3b4bd4cb1 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x28cb1) SUMMARY: AddressSanitizer: heap-use-after-free ../../../../src/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:823 in __interceptor_memcpy Shadow bytes around the buggy address: 0x0c047fffb7c0: fa fa fa fa fa fa 05 fa fa fa fa fa fa fa fa fa 0x0c047fffb7d0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c047fffb7e0: fa fa 05 fa fa fa fa fa fa fa fa fa fa fa 05 fa 0x0c047fffb7f0: fa fa fa fa fa fa fa fa fa fa 05 fa fa fa fa fa 0x0c047fffb800: fa fa fa fa fa fa fa fa fa fa fd fd fa fa fd fa =>0x0c047fffb810: fa fa fa fa fa fa fd fd fa fa[fd]fa fa fa fa fa 0x0c047fffb820: fa fa fa fa fa fa fa fa fa fa 00 00 fa fa 04 fa 0x0c047fffb830: fa fa fa fa fa fa 00 00 fa fa 04 fa fa fa fa fa 0x0c047fffb840: fa fa fa fa fa fa fa fa fa fa 00 00 fa fa 04 fa 0x0c047fffb850: fa fa fa fa fa fa 00 00 fa fa 04 fa fa fa fa fa 0x0c047fffb860: fa fa fa fa fa fa fa fa fa fa 00 00 fa fa 04 fa Shadow byte legend (one shadow byte represents 8 application bytes): Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 Heap left redzone: fa Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack after return: f5 Stack use after scope: f8 Global redzone: f9 Global init order: f6 Poisoned by user: f7 Container overflow: fc Array cookie: ac Intra object redzone: bb ASan internal: fe Left alloca redzone: ca Right alloca redzone: cb Shadow gap: cc ==973725==ABORTING
Clients disconect cause seg-fault
https://api.github.com/repos/nanomq/nanomq/issues/225/comments
0
2021-09-22T09:15:05Z
2021-09-24T03:39:44Z
https://github.com/nanomq/nanomq/issues/225
1,004,057,307
225
[ "emqx", "nanomq" ]
null
UNSUB with websocket port cause broker seg_fault
https://api.github.com/repos/nanomq/nanomq/issues/223/comments
0
2021-09-20T08:18:41Z
2021-09-22T02:32:18Z
https://github.com/nanomq/nanomq/issues/223
1,000,693,798
223
[ "emqx", "nanomq" ]
#216 introduce pub_extra and nano_lmq, however it doesn't comply with SUB logic.
invalid pointer with SUB
https://api.github.com/repos/nanomq/nanomq/issues/222/comments
0
2021-09-18T04:11:03Z
2021-09-22T02:34:48Z
https://github.com/nanomq/nanomq/issues/222
999,901,598
222
[ "emqx", "nanomq" ]
## Backtrace from asan ``` ==901735==ERROR: AddressSanitizer: heap-use-after-free on address 0x60200004b038 at pc 0x56338d0846c9 bp 0x7f9f627f2950 sp 0x7f9f627f2940 WRITE of size 8 at 0x60200004b038 thread T13 (nng:task) #0 0x56338d0846c8 in pub_extra_set_msg /home/wangha/docu/git/nanomq/nng/src/sp/protocol/mqtt/mqtt_parser.c:76 #1 0x56338d0815b8 in nano_ctx_send /home/wangha/docu/git/nanomq/nng/src/sp/protocol/reqrep0/nano_tcp.c:321 #2 0x56338d06fe1c in nni_ctx_send /home/wangha/docu/git/nanomq/nng/src/core/socket.c:1364 #3 0x56338d04de61 in nng_ctx_send /home/wangha/docu/git/nanomq/nng/src/nng.c:324 #4 0x56338d047604 in server_cb /home/wangha/docu/git/nanomq/nanomq/apps/broker.c:283 #5 0x56338d074696 in nni_taskq_thread /home/wangha/docu/git/nanomq/nng/src/core/taskq.c:50 #6 0x56338d075905 in nni_thr_wrap /home/wangha/docu/git/nanomq/nng/src/core/thread.c:94 #7 0x56338d07de86 in nni_plat_thr_main /home/wangha/docu/git/nanomq/nng/src/platform/posix/posix_thread.c:266 #8 0x7f9f6c117608 in start_thread /build/glibc-YbNSs7/glibc-2.31/nptl/pthread_create.c:477 #9 0x7f9f6be36292 in __clone (/lib/x86_64-linux-gnu/libc.so.6+0x122292) 0x60200004b038 is located 8 bytes inside of 16-byte region [0x60200004b030,0x60200004b040) freed by thread T8 (nng:task) here: #0 0x7f9f6c23e7cf in __interceptor_free (/lib/x86_64-linux-gnu/libasan.so.5+0x10d7cf) #1 0x56338d079d77 in nni_free /home/wangha/docu/git/nanomq/nng/src/platform/posix/posix_alloc.c:33 #2 0x56338d0844ff in pub_extra_free /home/wangha/docu/git/nanomq/nng/src/sp/protocol/mqtt/mqtt_parser.c:39 #3 0x56338d09c7f7 in tcptran_pipe_send_start /home/wangha/docu/git/nanomq/nng/src/sp/transport/tcp/tcp.c:714 #4 0x56338d09d5fd in tcptran_pipe_send /home/wangha/docu/git/nanomq/nng/src/sp/transport/tcp/tcp.c:858 #5 0x56338d068d98 in nni_pipe_send /home/wangha/docu/git/nanomq/nng/src/core/pipe.c:142 #6 0x56338d081410 in nano_ctx_send /home/wangha/docu/git/nanomq/nng/src/sp/protocol/reqrep0/nano_tcp.c:291 #7 0x56338d06fe1c in nni_ctx_send /home/wangha/docu/git/nanomq/nng/src/core/socket.c:1364 #8 0x56338d04de61 in nng_ctx_send /home/wangha/docu/git/nanomq/nng/src/nng.c:324 #9 0x56338d048220 in server_cb /home/wangha/docu/git/nanomq/nanomq/apps/broker.c:373 #10 0x56338d074696 in nni_taskq_thread /home/wangha/docu/git/nanomq/nng/src/core/taskq.c:50 #11 0x56338d075905 in nni_thr_wrap /home/wangha/docu/git/nanomq/nng/src/core/thread.c:94 #12 0x56338d07de86 in nni_plat_thr_main /home/wangha/docu/git/nanomq/nng/src/platform/posix/posix_thread.c:266 #13 0x7f9f6c117608 in start_thread /build/glibc-YbNSs7/glibc-2.31/nptl/pthread_create.c:477 previously allocated by thread T8 (nng:task) here: #0 0x7f9f6c23edc6 in calloc (/lib/x86_64-linux-gnu/libasan.so.5+0x10ddc6) #1 0x56338d079d4e in nni_zalloc /home/wangha/docu/git/nanomq/nng/src/platform/posix/posix_alloc.c:26 #2 0x56338d0844d5 in pub_extra_alloc /home/wangha/docu/git/nanomq/nng/src/sp/protocol/mqtt/mqtt_parser.c:32 #3 0x56338d047f76 in server_cb /home/wangha/docu/git/nanomq/nanomq/apps/broker.c:361 #4 0x56338d074696 in nni_taskq_thread /home/wangha/docu/git/nanomq/nng/src/core/taskq.c:50 #5 0x56338d075905 in nni_thr_wrap /home/wangha/docu/git/nanomq/nng/src/core/thread.c:94 #6 0x56338d07de86 in nni_plat_thr_main /home/wangha/docu/git/nanomq/nng/src/platform/posix/posix_thread.c:266 #7 0x7f9f6c117608 in start_thread /build/glibc-YbNSs7/glibc-2.31/nptl/pthread_create.c:477 Thread T13 (nng:task) created by T0 here: #0 0x7f9f6c16b805 in pthread_create (/lib/x86_64-linux-gnu/libasan.so.5+0x3a805) #1 0x56338d07dfb6 in nni_plat_thr_init /home/wangha/docu/git/nanomq/nng/src/platform/posix/posix_thread.c:279 #2 0x56338d075bae in nni_thr_init /home/wangha/docu/git/nanomq/nng/src/core/thread.c:121 #3 0x56338d0749b7 in nni_taskq_init /home/wangha/docu/git/nanomq/nng/src/core/taskq.c:95 #4 0x56338d0755d5 in nni_taskq_sys_init /home/wangha/docu/git/nanomq/nng/src/core/taskq.c:284 #5 0x56338d060b9b in nni_init_helper /home/wangha/docu/git/nanomq/nng/src/core/init.c:41 #6 0x56338d07e2bb in nni_plat_init /home/wangha/docu/git/nanomq/nng/src/platform/posix/posix_thread.c:422 #7 0x56338d060c1a in nni_init /home/wangha/docu/git/nanomq/nng/src/core/init.c:63 #8 0x56338d08b1f6 in nni_proto_mqtt_open /home/wangha/docu/git/nanomq/nng/src/sp/protocol.c:37 #9 0x56338d084479 in nng_nano_tcp0_open /home/wangha/docu/git/nanomq/nng/src/sp/protocol/reqrep0/nano_tcp.c:984 #10 0x56338d04940c in broker /home/wangha/docu/git/nanomq/nanomq/apps/broker.c:498 #11 0x56338d04b133 in broker_start /home/wangha/docu/git/nanomq/nanomq/apps/broker.c:685 #12 0x56338d00edb5 in main /home/wangha/docu/git/nanomq/nanomq/nanomq.c:163 #13 0x7f9f6bd3b0b2 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x270b2) Thread T8 (nng:task) created by T0 here: #0 0x7f9f6c16b805 in pthread_create (/lib/x86_64-linux-gnu/libasan.so.5+0x3a805) #1 0x56338d07dfb6 in nni_plat_thr_init /home/wangha/docu/git/nanomq/nng/src/platform/posix/posix_thread.c:279 #2 0x56338d075bae in nni_thr_init /home/wangha/docu/git/nanomq/nng/src/core/thread.c:121 #3 0x56338d0749b7 in nni_taskq_init /home/wangha/docu/git/nanomq/nng/src/core/taskq.c:95 #4 0x56338d0755d5 in nni_taskq_sys_init /home/wangha/docu/git/nanomq/nng/src/core/taskq.c:284 #5 0x56338d060b9b in nni_init_helper /home/wangha/docu/git/nanomq/nng/src/core/init.c:41 #6 0x56338d07e2bb in nni_plat_init /home/wangha/docu/git/nanomq/nng/src/platform/posix/posix_thread.c:422 #7 0x56338d060c1a in nni_init /home/wangha/docu/git/nanomq/nng/src/core/init.c:63 #8 0x56338d08b1f6 in nni_proto_mqtt_open /home/wangha/docu/git/nanomq/nng/src/sp/protocol.c:37 #9 0x56338d084479 in nng_nano_tcp0_open /home/wangha/docu/git/nanomq/nng/src/sp/protocol/reqrep0/nano_tcp.c:984 #10 0x56338d04940c in broker /home/wangha/docu/git/nanomq/nanomq/apps/broker.c:498 #11 0x56338d04b133 in broker_start /home/wangha/docu/git/nanomq/nanomq/apps/broker.c:685 #12 0x56338d00edb5 in main /home/wangha/docu/git/nanomq/nanomq/nanomq.c:163 #13 0x7f9f6bd3b0b2 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x270b2) SUMMARY: AddressSanitizer: heap-use-after-free /home/wangha/docu/git/nanomq/nng/src/sp/protocol/mqtt/mqtt_parser.c:76 in pub_extra_set_msg Shadow bytes around the buggy address: 0x0c04800015b0: fa fa fd fd fa fa fd fd fa fa fa fa fa fa fd fd 0x0c04800015c0: fa fa fd fd fa fa fd fd fa fa fd fd fa fa fd fd 0x0c04800015d0: fa fa fd fd fa fa fa fa fa fa fd fd fa fa fd fd 0x0c04800015e0: fa fa fd fd fa fa fa fa fa fa fa fa fa fa fa fa 0x0c04800015f0: fa fa fd fd fa fa fd fd fa fa fd fd fa fa fd fd =>0x0c0480001600: fa fa fd fd fa fa fd[fd]fa fa fd fd fa fa fd fd 0x0c0480001610: fa fa fd fd fa fa fd fd fa fa fd fd fa fa fd fd 0x0c0480001620: fa fa fd fd fa fa fd fd fa fa fd fd fa fa fd fd 0x0c0480001630: fa fa fd fd fa fa 04 fa fa fa 05 fa fa fa fd fd 0x0c0480001640: fa fa fd fd fa fa fd fd fa fa fd fd fa fa fd fd 0x0c0480001650: fa fa fd fd fa fa fd fd fa fa fd fd fa fa fd fd Shadow byte legend (one shadow byte represents 8 application bytes): Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 Heap left redzone: fa Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack after return: f5 Stack use after scope: f8 Global redzone: f9 Global init order: f6 Poisoned by user: f7 Container overflow: fc Array cookie: ac Intra object redzone: bb ASan internal: fe Left alloca redzone: ca Right alloca redzone: cb Shadow gap: cc ``` ## How to trigger? ``` ./build/nanomq/nanomq broker start -tq_thread 8 -max_tq_thread 8 -msq_len 32 -url tcp://127.0.0.1:1883 ./emqtt_bench sub -t msg -V 4 -c 800 ./emqtt_bench pub -t "msg" -V 4 -c 10 -L 10000 -I 50 ``` Run pub before sub was done
Heap use after free
https://api.github.com/repos/nanomq/nanomq/issues/220/comments
4
2021-09-16T06:24:58Z
2021-09-20T12:52:01Z
https://github.com/nanomq/nanomq/issues/220
997,822,483
220
[ "emqx", "nanomq" ]
null
nano_pipe_db doesn't handle unsub event
https://api.github.com/repos/nanomq/nanomq/issues/212/comments
1
2021-09-10T09:04:28Z
2021-09-10T10:58:27Z
https://github.com/nanomq/nanomq/issues/212
993,037,531
212
[ "emqx", "nanomq" ]
null
请问下nanomq部署后 如何通过MQTTX桌面客户端连接测试呢
https://api.github.com/repos/nanomq/nanomq/issues/206/comments
3
2021-08-26T06:52:32Z
2021-12-07T03:34:26Z
https://github.com/nanomq/nanomq/issues/206
979,898,936
206
[ "emqx", "nanomq" ]
# NanoMQ 0.4.5 Null Pointer Dereference ## Affected NanoMQ 0.4.5 DJBHashn @ nng/src/sp/protocol/mqtt/mqtt_parser.c:675 as called from tcptran_pipe_send_start @ nng/src/sp/transport/tcp/tcp.c:743 ## How to Reproduce Send the below CONNECT message to NanoMQ: ``` "\x10\x28\x00\x02\x4d\x51\x54\x54\x04\xc2\x00\x3c\x00\x0b\x74\x65" \ "\x73\x74\x2d\x70\x79\x74\x68\x6f\x6e\x00\x05\x61\x64\x6d\x69\x6e" \ "\x00\x08\x70\x61\x73\x73\x77\x6f\x72\x64" ``` The field triggering the issue in the above message is `mqtt.proto_len` with value `\x00\x02` (bytes #3-4). ## Details ### Backtrace ``` (gdb) bt #0 0x0000562bf89621c2 in DJBHashn () #1 0x0000562bf895f3ac in nano_session_restore () #2 0x0000562bf895fdda in nano_pipe_start () #3 0x0000562bf895749f in nni_listener_add_pipe () #4 0x0000562bf8950577 in listener_accept_cb () #5 0x0000562bf8958f21 in nni_taskq_thread () #6 0x0000562bf8959999 in nni_thr_wrap () #7 0x0000562bf895d206 in nni_plat_thr_main () #8 0x00007fe8a7a35609 in start_thread (arg=<optimized out>) at pthread_create.c:477 #9 0x00007fe8a7754293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95 ``` ### Disassembly ``` (gdb) disas Dump of assembler code for function DJBHashn: 0x0000562bf8962187 <+0>: endbr64 0x0000562bf896218b <+4>: push %rbp 0x0000562bf896218c <+5>: mov %rsp,%rbp 0x0000562bf896218f <+8>: mov %rdi,-0x18(%rbp) 0x0000562bf8962193 <+12>: mov %esi,%eax 0x0000562bf8962195 <+14>: mov %ax,-0x1c(%rbp) 0x0000562bf8962199 <+18>: movl $0x1505,-0x4(%rbp) 0x0000562bf89621a0 <+25>: movw $0x0,-0x6(%rbp) 0x0000562bf89621a6 <+31>: jmp 0x562bf89621d8 <DJBHashn+81> 0x0000562bf89621a8 <+33>: mov -0x4(%rbp),%eax 0x0000562bf89621ab <+36>: shl $0x5,%eax 0x0000562bf89621ae <+39>: mov %eax,%edx 0x0000562bf89621b0 <+41>: mov -0x4(%rbp),%eax 0x0000562bf89621b3 <+44>: lea (%rdx,%rax,1),%ecx 0x0000562bf89621b6 <+47>: mov -0x18(%rbp),%rax 0x0000562bf89621ba <+51>: lea 0x1(%rax),%rdx 0x0000562bf89621be <+55>: mov %rdx,-0x18(%rbp) => 0x0000562bf89621c2 <+59>: movzbl (%rax),%eax 0x0000562bf89621c5 <+62>: movsbl %al,%eax 0x0000562bf89621c8 <+65>: add %ecx,%eax 0x0000562bf89621ca <+67>: mov %eax,-0x4(%rbp) 0x0000562bf89621cd <+70>: movzwl -0x6(%rbp),%eax 0x0000562bf89621d1 <+74>: add $0x1,%eax 0x0000562bf89621d4 <+77>: mov %ax,-0x6(%rbp) 0x0000562bf89621d8 <+81>: movzwl -0x6(%rbp),%eax 0x0000562bf89621dc <+85>: cmp -0x1c(%rbp),%ax 0x0000562bf89621e0 <+89>: jb 0x562bf89621a8 <DJBHashn+33> 0x0000562bf89621e2 <+91>: andl $0x7fffffff,-0x4(%rbp) 0x0000562bf89621e9 <+98>: mov -0x4(%rbp),%eax 0x0000562bf89621ec <+101>: pop %rbp 0x0000562bf89621ed <+102>: retq ``` ### Register ``` (gdb) i r rax 0x0 0 rbx 0x0 0 rcx 0x2b5a5 177573 rdx 0x1 1 rsi 0xffff 65535 rdi 0x0 0 rbp 0x7fe8a4cd7c60 0x7fe8a4cd7c60 rsp 0x7fe8a4cd7c60 0x7fe8a4cd7c60 r8 0x7fe88c001ad0 140636757957328 r9 0x7c 124 r10 0x0 0 r11 0x7fe88c000080 140636757950592 r12 0x7ffe95661bfe 140731404917758 r13 0x7ffe95661bff 140731404917759 r14 0x562bf89a5680 94746854446720 r15 0x7fe8a4cd7fc0 140637174071232 rip 0x562bf89621c2 0x562bf89621c2 <DJBHashn+59> eflags 0x10206 [ PF IF RF ] cs 0x33 51 ss 0x2b 43 ds 0x0 0 es 0x0 0 fs 0x0 0 gs 0x0 0 ```
Null Pointer Dereference
https://api.github.com/repos/nanomq/nanomq/issues/205/comments
1
2021-08-24T08:34:34Z
2021-09-24T06:40:13Z
https://github.com/nanomq/nanomq/issues/205
977,850,221
205
[ "emqx", "nanomq" ]
When the MQTT packet length is tampered with and is lower than expected, a `memcpy` [1] operation receives a `size` value that makes the source buffer location points to or into an unallocated memory area. As a result, nanomq crashes. The below `connect` message can be used to reproduce the issue. ``` "\x10\x07\x00\x04\x4d\x51\x54\x54\x04\xc2\x00\x3c\x00\x0b\x74\x65" +\ "\x73\x74\x2d\x70\x79\x74\x68\x6f\x6e\x00\x05\x61\x64\x6d\x69\x6e" +\ "\x00\x08\x70\x61\x73\x73\x77\x6f\x72\x64" ``` As a result of the above message, `memcpy` receives a very large positive number (0xfffffffc in case of this proof of concept) as the `size` argument. The problem seems to be with how the payload length is calculated [2]. Suspected that the unusual packet length `msg_len` is a smaller value than `used_pos`, therefore the subtraction results in a negative number. However, `memcpy` expects the size as `size_t`, which is *unsigned*. Therefore, due to the "casting" of a negative number to `size_t` the length becomes a very large positive number (0xfffffffc in case of this proof of concept). [1] https://github.com/nanomq/nanomq/blob/10fcd9ccb81a9aca1dc089131e850930eda9466e/nanomq/pub_handler.c#L964 [2] https://github.com/nanomq/nanomq/blob/10fcd9ccb81a9aca1dc089131e850930eda9466e/nanomq/pub_handler.c#L956
Improper Handling of Payload Length
https://api.github.com/repos/nanomq/nanomq/issues/203/comments
2
2021-08-16T13:51:43Z
2021-09-28T13:11:50Z
https://github.com/nanomq/nanomq/issues/203
971,761,160
203
[ "emqx", "nanomq" ]
I build this project on rpi4 with 32bit raspbian,but when i ran nanomq and connect whith mqttx. Process dead immediately. Here is msgs ``` pi@raspberrypi:~/nanomq/build $ nanomq broker start "nanomq.conf ./etc/nanomq.conf" file not found or unreadable INFO: invalid input url, using default url: tcp://0.0.0.0:1883 Set the url by editing nanomq.conf or command-line (-url <url>). Segmentation fault ``` Gdb run ``` pi@raspberrypi:~/nanomq/build $ gdb nanomq GNU gdb (Raspbian 8.2.1-2) 8.2.1 Copyright (C) 2018 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "arm-linux-gnueabihf". Type "show configuration" for configuration details. For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>. Find the GDB manual and other documentation resources online at: <http://www.gnu.org/software/gdb/documentation/>. For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from nanomq...(no debugging symbols found)...done. (gdb) set args broker start (gdb) run Starting program: /usr/local/bin/nanomq broker start [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1". "nanomq.conf ./etc/nanomq.conf" file not found or unreadable INFO: invalid input url, using default url: tcp://0.0.0.0:1883 Set the url by editing nanomq.conf or command-line (-url <url>). [New Thread 0xb6bf4450 (LWP 5801)] [New Thread 0xb63f3450 (LWP 5802)] [New Thread 0xb5bf2450 (LWP 5803)] [New Thread 0xb53f1450 (LWP 5804)] [New Thread 0xb4bf0450 (LWP 5805)] [New Thread 0xb43ef450 (LWP 5806)] [New Thread 0xb3bee450 (LWP 5807)] [New Thread 0xb33ed450 (LWP 5808)] [New Thread 0xb2bec450 (LWP 5809)] [New Thread 0xb23eb450 (LWP 5810)] [New Thread 0xb1bea450 (LWP 5811)] [New Thread 0xb13e9450 (LWP 5812)] [New Thread 0xb0be8450 (LWP 5813)] [New Thread 0xb03e7450 (LWP 5814)] [New Thread 0xafbe6450 (LWP 5815)] [New Thread 0xaf3e5450 (LWP 5816)] [New Thread 0xaebe4450 (LWP 5817)] [New Thread 0xae3e3450 (LWP 5818)] [New Thread 0xadbe2450 (LWP 5819)] [New Thread 0xad3e1450 (LWP 5820)] [New Thread 0xacbe0450 (LWP 5821)] Thread 9 "nng:task" received signal SIGSEGV, Segmentation fault. [Switching to Thread 0xb33ed450 (LWP 5808)] strlen () at ../sysdeps/arm/armv6/strlen.S:26 26 ../sysdeps/arm/armv6/strlen.S: No such file or directory. (gdb) bt #0 strlen () at ../sysdeps/arm/armv6/strlen.S:26 #1 0xb6c39de0 in _IO_vfprintf_internal (s=s@entry=0xb33ec940, format=format@entry=0x7bbb4 "{\"username\":\"%s\", \"ts\":%lu,\"proto_name\":\"%s\",\"keepalive\":%d,\"return_code\":\"%x\",\"proto_ver\":%d,\"client_id\":\"%s\", \"clean_start\":%d}", ap=..., ap@entry=...) at vfprintf.c:1638 #2 0xb6c5d278 in _IO_vsnprintf (string=0xb33eca9c "{\"username\":\"(null)\", \"ts\":1039882450,\"proto_name\":\"", maxlen=<optimized out>, format=0x7bbb4 "{\"username\":\"%s\", \"ts\":%lu,\"proto_name\":\"%s\",\"keepalive\":%d,\"return_code\":\"%x\",\"proto_ver\":%d,\"client_id\":\"%s\", \"clean_start\":%d}", format@entry=0xb33ecbc4 "\314\021\003", args=..., args@entry=...) at vsnprintf.c:114 #3 0xb6c3f4d8 in __GI___snprintf (s=<optimized out>, maxlen=<optimized out>, format=0x7bbb4 "{\"username\":\"%s\", \"ts\":%lu,\"proto_name\":\"%s\",\"keepalive\":%d,\"return_code\":\"%x\",\"proto_ver\":%d,\"client_id\":\"%s\", \"clean_start\":%d}") at snprintf.c:33 #4 0x00050dc8 in nano_msg_notify_connect () #5 0x000311cc in server_cb () #6 0x00046c84 in nni_task_exec () #7 0x00038564 in nni_aio_finish_impl () #8 0x000385f8 in nni_aio_finish_sync () #9 0x00037978 in nng_aio_finish_sync () #10 0x00030670 in server_cb () #11 0x00046c84 in nni_task_exec () #12 0x00038564 in nni_aio_finish_impl () #13 0x000385f8 in nni_aio_finish_sync () #14 0x0004eb70 in nano_pipe_recv_cb () #15 0x00046834 in nni_taskq_thread () #16 0x00047428 in nni_thr_wrap () #17 0x0004b424 in nni_plat_thr_main () #18 0xb6f95494 in start_thread (arg=0xb33ed450) at pthread_create.c:486 #19 0xb6cce578 in ?? () at ../sysdeps/unix/sysv/linux/arm/clone.S:73 from /lib/arm-linux-gnueabihf/libc.so.6 Backtrace stopped: previous frame identical to this frame (corrupt stack?) (gdb) ``` Raspberry Pi OS Lite Release date: May 7th 2021 Kernel version: 5.10 ``` pi@raspberrypi:~/nanomq/build $ uname -a Linux raspberrypi 5.10.52-v7l+ #1441 SMP Tue Aug 3 18:11:56 BST 2021 armv7l GNU/Linux pi@raspberrypi:~/nanomq/build $ cat /etc/os-release PRETTY_NAME="Raspbian GNU/Linux 10 (buster)" NAME="Raspbian GNU/Linux" VERSION_ID="10" VERSION="10 (buster)" VERSION_CODENAME=buster ID=raspbian ID_LIKE=debian HOME_URL="http://www.raspbian.org/" SUPPORT_URL="http://www.raspbian.org/RaspbianForums" BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs" ```
Run failed on 32bit raspberry pi os latest version whith exception /sysdeps/arm/armv6/strlen.S: No such file or directory.
https://api.github.com/repos/nanomq/nanomq/issues/200/comments
1
2021-08-13T05:38:30Z
2021-08-15T06:10:43Z
https://github.com/nanomq/nanomq/issues/200
970,078,940
200
[ "emqx", "nanomq" ]
commit f9ae56e0180d4fc6c5db323964fab52b52f29eac ``` ./build/nanomq/nanomq broker start -tq_thread 8 -max_tq_thread 8 -parallel 1 -msq_len 32 -url tcp://127.0.0.1:1883 ``` ``` mosquitto_sub -h 127.0.0.1 -t 'banana' ``` ``` time $(for i in {1..1000}; do mosquitto_pub --id "f1c21f64" -h 127.0.0.1 -t "banana" -m "x"; done) ``` ``` panic: pthread_mutex_lock: Invalid argument This message is indicative of a BUG. Report this at https://github.com/nanomq/nanomq 1 nanomq 0x0000000101f4136c nni_panic + 524 2 nanomq 0x0000000101f55dba nni_pthread_mutex_lock + 58 3 nanomq 0x0000000101f55d75 nni_plat_mtx_lock + 21 4 nanomq 0x0000000101f4afc5 nni_mtx_lock + 21 5 nanomq 0x0000000101f496e7 nni_task_dispatch + 71 6 nanomq 0x0000000101f37a0b nni_aio_begin + 331 7 nanomq 0x0000000101f69521 tcptran_pipe_recv + 33 8 nanomq 0x0000000101f41519 nni_pipe_recv + 41 9 nanomq 0x0000000101f587c5 nano_ctx_recv + 869 10 nanomq 0x0000000101f44c16 nni_ctx_recv + 54 11 nanomq 0x0000000101f33386 nng_ctx_recv + 310 12 nanomq 0x0000000101f30ad3 server_cb + 8899 13 nanomq 0x0000000101f493f0 nni_taskq_thread + 144 14 nanomq 0x0000000101f4b2ff nni_thr_wrap + 191 15 nanomq 0x0000000101f561f8 nni_plat_thr_main + 120 16 libsystem_pthread.dylib 0x00007fff203398fc _pthread_start + 224 17 libsystem_pthread.dylib 0x00007fff20335443 thread_start + 15 zsh: abort ./build/nanomq/nanomq broker start -tq_thread 8 -max_tq_thread 8 -parallel 1 ```
seg. fault / pthread_mutex_lock
https://api.github.com/repos/nanomq/nanomq/issues/196/comments
11
2021-08-06T17:01:24Z
2022-09-21T13:04:16Z
https://github.com/nanomq/nanomq/issues/196
962,903,079
196
[ "emqx", "nanomq" ]
I would like to create a PoC for implementing a QoS level 3, where the incoming messages are directly published to Kafka using librdkafka. Could you please suggest the best place in the code where the message is available for publishing forward to Kafka as well to back to the client to confirm that the message was persisted? Another possibility would be to subscrible normaly with a client that will persist the messages to kafka, but on nanomq internals be able to detect when the subscriber is connected or not to reply back to the MQTT client at QoS 1/2.
Extending QoS to level 3
https://api.github.com/repos/nanomq/nanomq/issues/195/comments
3
2021-08-05T17:00:53Z
2024-02-28T13:12:53Z
https://github.com/nanomq/nanomq/issues/195
962,020,568
195
[ "emqx", "nanomq" ]
Case. ./emqtt_bench sub -t "msg" -V 4 -c 1000 -i 1 (continuous) ==14387==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x615000716854 at pc 0x5633d4317f8e bp 0x7f3af59f5bc0 sp 0x7f3af59f5bb0 READ of size 4 at 0x615000716854 thread T10 (nng:reap2) #0 0x5633d4317f8d in id_find /home/wangha/docu/git/nanomq/nng/src/core/idhash.c:82 #1 0x5633d431801f in nni_id_get /home/wangha/docu/git/nanomq/nng/src/core/idhash.c:99 #2 0x5633d433ebca in nano_pipe_fini /home/wangha/docu/git/nanomq/nng/src/sp/protocol/reqrep0/nano_tcp.c:713 #3 0x5633d4321b44 in pipe_destroy /home/wangha/docu/git/nanomq/nng/src/core/pipe.c:89 #4 0x5633d4323f3f in reap_worker /home/wangha/docu/git/nanomq/nng/src/core/reap.c:58 #5 0x5633d432f790 in nni_thr_wrap /home/wangha/docu/git/nanomq/nng/src/core/thread.c:94 #6 0x5633d43381ca in nni_plat_thr_main /home/wangha/docu/git/nanomq/nng/src/platform/posix/posix_thread.c:218 #7 0x7f3afdb88608 in start_thread /build/glibc-YbNSs7/glibc-2.31/nptl/pthread_create.c:477 #8 0x7f3afd8a7292 in __clone (/lib/x86_64-linux-gnu/libc.so.6+0x122292) Address 0x615000716854 is a wild pointer. SUMMARY: AddressSanitizer: heap-buffer-overflow /home/wangha/docu/git/nanomq/nng/src/core/idhash.c:82 in id_find Shadow bytes around the buggy address: 0x0c2a800dacb0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c2a800dacc0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c2a800dacd0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c2a800dace0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c2a800dacf0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa =>0x0c2a800dad00: fa fa fa fa fa fa fa fa fa fa[fa]fa fa fa fa fa 0x0c2a800dad10: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c2a800dad20: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c2a800dad30: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c2a800dad40: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c2a800dad50: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa Shadow byte legend (one shadow byte represents 8 application bytes): Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 Heap left redzone: fa Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack after return: f5 Stack use after scope: f8 Global redzone: f9 Global init order: f6 Poisoned by user: f7 Container overflow: fc Array cookie: ac Intra object redzone: bb ASan internal: fe Left alloca redzone: ca Right alloca redzone: cb Shadow gap: cc Thread T10 (nng:reap2) created by T0 here: #0 0x7f3afdbdc805 in pthread_create (/lib/x86_64-linux-gnu/libasan.so.5+0x3a805) #1 0x5633d43382fa in nni_plat_thr_init /home/wangha/docu/git/nanomq/nng/src/platform/posix/posix_thread.c:231 #2 0x5633d432fa39 in nni_thr_init /home/wangha/docu/git/nanomq/nng/src/core/thread.c:121 #3 0x5633d43241d5 in nni_reap_sys_init /home/wangha/docu/git/nanomq/nng/src/core/reap.c:115 #4 0x5633d431940c in nni_init_helper /home/wangha/docu/git/nanomq/nng/src/core/init.c:42 #5 0x5633d43385ff in nni_plat_init /home/wangha/docu/git/nanomq/nng/src/platform/posix/posix_thread.c:368 #6 0x5633d43194b1 in nni_init /home/wangha/docu/git/nanomq/nng/src/core/init.c:61 #7 0x5633d4323aa6 in nni_proto_mqtt_open /home/wangha/docu/git/nanomq/nng/src/core/protocol.c:79 #8 0x5633d4341323 in nng_nano_tcp0_open /home/wangha/docu/git/nanomq/nng/src/sp/protocol/reqrep0/nano_tcp.c:1281 #9 0x5633d4301320 in broker /home/wangha/docu/git/nanomq/nanomq/apps/broker.c:425 #10 0x5633d4303018 in broker_start /home/wangha/docu/git/nanomq/nanomq/apps/broker.c:610 #11 0x5633d42cddd5 in main /home/wangha/docu/git/nanomq/nanomq/nanomq.c:163 #12 0x7f3afd7ac0b2 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x270b2) ==14387==ABORTING
Bug, heap buf overflow on branch wangha/dev_timer.
https://api.github.com/repos/nanomq/nanomq/issues/192/comments
0
2021-08-04T04:52:26Z
2021-09-12T04:40:37Z
https://github.com/nanomq/nanomq/issues/192
959,889,685
192