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" ]
emqx docker: emqx/emqx:5.0.14 nanomq docker: emqx/nanomq:0.15-full when authentication activated on emqx, eemqt client publish message over quic successfully But using nanomq i have problems. I have two docker container emqx and nanomq. Quic protocol is activated. If I do not activate authentication for emqx server, nanomq quic bridging works fine. If I activate authentication for emqx server, nanomq quic bridging not works and gives error below connector settings in nanomq.conf/bridges.mqtt `{ server = "mqtt-quic://172.17.0.2:14567" proto_ver = 4 username = test123 password = 123123 clean_start = true keepalive = 60s ssl { enable = false keyfile = "/etc/certs/key.pem" certfile = "/etc/certs/cert.pem" cacertfile = "/etc/certs/cacert.pem" } }` **docker logs when nanomq container starts** 2023-01-22 17:42:32 [1] WARN /home/runner/work/nanomq/nanomq/nng/src/supplemental/quic/quic_api.c:518 quic_connection_cb: [conn][0x55823bfde900] Resumption ticket received (1764 bytes): 2023-01-22 17:42:32 [1] WARN /home/runner/work/nanomq/nanomq/nng/src/supplemental/quic/quic_api.c:372 quic_strm_cb: [strm][0x7fe0280281c0] Peer shut down **docker logs from nanomq container when pub from nanomq_cli** 2023-01-22 17:41:04 [1] ERROR /home/runner/work/nanomq/nanomq/nanomq/apps/broker.c:197 bridge_handler: ctx id 7
Quic Bridging do not works when authentication activated
https://api.github.com/repos/nanomq/nanomq/issues/1022/comments
8
2023-01-22T17:48:29Z
2023-02-15T05:22:49Z
https://github.com/nanomq/nanomq/issues/1022
1,552,216,923
1,022
[ "emqx", "nanomq" ]
MQTT v5 standard defines two properties for handling sessions: Clean Start and Session Expiry Interval. 1. The first one is documented on the doc site: https://nanomq.io/docs/en/latest/config-description/v014.html#parameter-description `bridge.mqtt.nodes[0].connector.clean_start | Boolean | Clean session. ` 2. Documentation is missing for the second one, "Session Expiry Interval" Could you please guide us how to set this property? Also It would be nice to have it documented. Thanks
[MQTT V5] Clean Start and Session Expiry Interval
https://api.github.com/repos/nanomq/nanomq/issues/1009/comments
4
2023-01-13T08:52:33Z
2023-02-15T04:32:07Z
https://github.com/nanomq/nanomq/issues/1009
1,531,932,594
1,009
[ "emqx", "nanomq" ]
**Describe the bug** Context id used in multi-channel bridging will over flow cause crash! **Expected behavior** nothing happen when id rotates **Actual Behavior** heap buffer overflow **To Reproduce** use a small number of ctx ** Environment Details ** - NanoMQ version 0.15.0
Context ID overflow!
https://api.github.com/repos/nanomq/nanomq/issues/1005/comments
0
2023-01-12T11:32:34Z
2023-01-12T11:34:11Z
https://github.com/nanomq/nanomq/issues/1005
1,530,556,990
1,005
[ "emqx", "nanomq" ]
**Describe the bug** version 0.14.8 ERROR /home/runner/work/nanomq/nanomq/nng/src/sp/protocol/mqtt/nmq_mqtt.c:1066: no ctx found!! create more ctxs! 日志报了这个错后,部分客户端就无法连接了。
no ctx found! (There is no enough logic threads)
https://api.github.com/repos/nanomq/nanomq/issues/996/comments
1
2023-01-10T03:58:00Z
2024-04-18T06:29:29Z
https://github.com/nanomq/nanomq/issues/996
1,526,721,754
996
[ "emqx", "nanomq" ]
**Describe the bug** I try to receive msg in a nonblock way. and add NNG_FLAG_NONBLOCK flag when calling nng_recvmsg as follows. ``` nng_recvmsg(sock, &msg, NNG_FLAG_NONBLOCK) ``` But it is still in a block way. **Expected behavior** Receive msg in a nonblock way. **Actual Behavior** nng_recvmsg works in a block way. **To Reproduce** . ** Environment Details ** - NanoMQ version. Latest - Operating system and version. osx - Compiler and language used. gcc - testing scenario. **Client SDK** The builtin nanosdk. **Additional context** .
nng_recvmsg can not work in a nonblock way.
https://api.github.com/repos/nanomq/nanomq/issues/981/comments
2
2022-12-29T06:30:15Z
2024-05-10T14:35:32Z
https://github.com/nanomq/nanomq/issues/981
1,513,426,823
981
[ "emqx", "nanomq" ]
**Describe the bug** 1. Max downstream data will caused reconnect failed 2. Quic launch failed when network is disable **To Reproduce** ``` nanomq start --conf nanomq.conf emqtt_bench sub -t cmd/topic1 -c 1 emqtt_bench pub -t cmd/topic1 -L 100000 -c 200 -I 1 -h 54.75.171.11 ```
Quic bridge incorrect behavior
https://api.github.com/repos/nanomq/nanomq/issues/964/comments
0
2022-12-13T03:52:25Z
2022-12-15T11:32:31Z
https://github.com/nanomq/nanomq/issues/964
1,493,296,814
964
[ "emqx", "nanomq" ]
null
NanoMQ 0.14.1 doesn't read /etc/nanomq.conf by default
https://api.github.com/repos/nanomq/nanomq/issues/955/comments
0
2022-12-08T13:06:59Z
2022-12-11T03:48:15Z
https://github.com/nanomq/nanomq/issues/955
1,484,604,231
955
[ "emqx", "nanomq" ]
**Describe the bug** I cannot get rule engine working well when use it with newly added HOCON style config file **Expected behavior** just work as before **Actual Behavior** HOCON parser cannot parse complex SQL to JSON successfully **To Reproduce** just enable rule engine ** Environment Details ** - NanoMQ version: master branch (0.14)
Rule Engine is not working with HOCON config file
https://api.github.com/repos/nanomq/nanomq/issues/949/comments
0
2022-12-02T07:18:27Z
2022-12-07T14:00:05Z
https://github.com/nanomq/nanomq/issues/949
1,472,424,960
949
[ "emqx", "nanomq" ]
如何实现nanomq节点发送的消息,emqx节点能收到,并且emqx节点发送的消息,nanomq节点能收到。
关于emqx与nanomq(Clustering between NanoMQ & EMQX)
https://api.github.com/repos/nanomq/nanomq/issues/947/comments
3
2022-12-01T09:24:09Z
2022-12-11T04:06:54Z
https://github.com/nanomq/nanomq/issues/947
1,470,969,522
947
[ "emqx", "nanomq" ]
According to CodeQL: https://github.com/emqx/nanomq/pull/944/checks?check_run_id=9811522912 Need to enhance the security issue on ACL conf parser.
Fix Security issue reported by CodeQL
https://api.github.com/repos/nanomq/nanomq/issues/945/comments
0
2022-12-01T03:46:54Z
2023-05-10T04:00:28Z
https://github.com/nanomq/nanomq/issues/945
1,470,619,416
945
[ "emqx", "nanomq" ]
This bug is introduced by #937
Bridging event msg cause double free of conn_param struct
https://api.github.com/repos/nanomq/nanomq/issues/942/comments
0
2022-11-30T07:34:38Z
2022-11-30T07:38:46Z
https://github.com/nanomq/nanomq/issues/942
1,469,179,369
942
[ "emqx", "nanomq" ]
**Describe the bug** currently, the error code in event msg is invalid and cannot reflect correct status of connection **Expected behavior** gonna set MQTTV5 error code in msg (result/reason code)
return MQTTV5 error code in $SYS event msg (online/offline)
https://api.github.com/repos/nanomq/nanomq/issues/938/comments
0
2022-11-29T09:20:12Z
2022-12-01T03:39:00Z
https://github.com/nanomq/nanomq/issues/938
1,467,718,835
938
[ "emqx", "nanomq" ]
null
DISCONNECT event msg of MQTT/QUIC need to bypass ACL
https://api.github.com/repos/nanomq/nanomq/issues/935/comments
0
2022-11-28T10:52:36Z
2022-11-29T09:58:13Z
https://github.com/nanomq/nanomq/issues/935
1,466,206,568
935
[ "emqx", "nanomq" ]
**Describe the bug** Cached QoS msg only being resent once, no matter if ACK msg is received or not. **Expected behavior** broker keep resending QoS msg until it is acknowledged or length is full
Broker only resend cached msg one time
https://api.github.com/repos/nanomq/nanomq/issues/928/comments
0
2022-11-24T06:24:19Z
2022-11-24T09:29:03Z
https://github.com/nanomq/nanomq/issues/928
1,462,825,052
928
[ "emqx", "nanomq" ]
**Describe the bug** CI failed when processing Topic alias AddressSanitizer:DEADLYSIGNAL ================================================================= AddressSanitizer:DEADLYSIGNAL AddressSanitizer:DEADLYSIGNAL ==11907==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x7f4e46cc7482 bp 0x7f4e3d3f88d0 sp 0x7f4e3d3f8058 T7) ==11907==The signal is caused by a READ memory access. ==11907==Hint: address points to the zero page. #0 0x7f4e46cc7482 (/lib/x86_64-linux-gnu/libc.so.6+0x1b1482) #1 0x7f4e46d9fe2b in __interceptor_strchr ../../../../src/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:705 #2 0x561f32781c85 in nng_mqtt_msg_set_publish_topic /home/runner/work/nanomq/nanomq/nng/src/supplemental/mqtt/mqtt_public.c:304 #3 0x561f326d7c29 in bridge_publish_msg /home/runner/work/nanomq/nanomq/nanomq/bridge.c:68 #4 0x561f32700652 in bridge_handler /home/runner/work/nanomq/nanomq/nanomq/apps/broker.c:173 #5 0x561f32703e47 in server_cb /home/runner/work/nanomq/nanomq/nanomq/apps/broker.c:512 #6 0x561f32736438 in nni_taskq_thread /home/runner/work/nanomq/nanomq/nng/src/core/taskq.c:50 #7 0x561f327377f0 in nni_thr_wrap /home/runner/work/nanomq/nanomq/nng/src/core/thread.c:94 #8 0x561f327409a5 in nni_plat_thr_main /home/runner/work/nanomq/nanomq/nng/src/platform/posix/posix_thread.c:266 #9 0x7f4e46baab42 (/lib/x86_64-linux-gnu/libc.so.6+0x94b42) #10 0x7f4e46c3c9ff (/lib/x86_64-linux-gnu/libc.so.6+0x1269ff) AddressSanitizer can not provide additional info. SUMMARY: AddressSanitizer: SEGV (/lib/x86_64-linux-gnu/libc.so.6+0x1b1482) Thread T7 created by T0 here: #0 0x7f4e46dba685 in __interceptor_pthread_create ../../../../src/libsanitizer/asan/asan_interceptors.cpp:216 #1 0x561f32740ad5 in nni_plat_thr_init /home/runner/work/nanomq/nanomq/nng/src/platform/posix/posix_thread.c:279 #2 0x561f32737a9c in nni_thr_init /home/runner/work/nanomq/nanomq/nng/src/core/thread.c:121 #3 0x561f3273675a in nni_taskq_init /home/runner/work/nanomq/nanomq/nng/src/core/taskq.c:95 #4 0x561f327374ba in nni_taskq_sys_init /home/runner/work/nanomq/nanomq/nng/src/core/taskq.c:294 #5 0x561f3272[13](https://github.com/emqx/nanomq/actions/runs/3520245674/jobs/5902165200#step:6:14)de in nni_init_helper /home/runner/work/nanomq/nanomq/nng/src/core/init.c:35 #6 0x561f32740e7a in nni_plat_init /home/runner/work/nanomq/nanomq/nng/src/platform/posix/posix_thread.c:422 #7 0x561f3272[14](https://github.com/emqx/nanomq/actions/runs/3520245674/jobs/5902165200#step:6:15)5f in nni_init /home/runner/work/nanomq/nanomq/nng/src/core/init.c:58 #8 0x561f32780d58 in nng_mtx_alloc /home/runner/work/nanomq/nanomq/nng/src/supplemental/util/platform.c:93 #9 0x561f326d70f6 in log_init /home/runner/work/nanomq/nanomq/nanomq/mqtt_api.c:223 #10 0x561f3270a5e6 in broker_start /home/runner/work/nanomq/nanomq/nanomq/apps/broker.c:[15](https://github.com/emqx/nanomq/actions/runs/3520245674/jobs/5902165200#step:6:16)52 #11 0x561f326d749f in main /home/runner/work/nanomq/nanomq/nanomq/nanomq.c:142 #12 0x7f4e46b3fd8f (/lib/x86_64-linux-gnu/libc.so.6+0x29d8f) ==11907==ABORTING Sub client did not receive message * 10 mosquitto_sub -h 127.0.0.1 -p [18](https://github.com/emqx/nanomq/actions/runs/3520245674/jobs/5902165200#step:6:19)83 -t 'topic' mosquitto_pub -h 1[27](https://github.com/emqx/nanomq/actions/runs/3520245674/jobs/5902165200#step:6:28).0.0.1 -p 1883 -t topic -V 5 -m message -D Publish topic-alias 10 -d --repeat 10 Topic alias test failed! mqtt v5 test failed
Topic alias test failed
https://api.github.com/repos/nanomq/nanomq/issues/918/comments
1
2022-11-22T07:07:37Z
2022-12-17T08:38:10Z
https://github.com/nanomq/nanomq/issues/918
1,459,262,264
918
[ "emqx", "nanomq" ]
unexpectedly freed in bridge_aio send_cb
QUIC bridging msg is freed before it being sent
https://api.github.com/repos/nanomq/nanomq/issues/914/comments
0
2022-11-21T12:06:08Z
2022-11-21T12:14:24Z
https://github.com/nanomq/nanomq/issues/914
1,457,829,634
914
[ "emqx", "nanomq" ]
**Describe the bug** clean session test passed! ==12039==ERROR: AddressSanitizer: heap-use-after-free on address 0x611000035f48 at pc 0x564945d63747 bp 0x7f2413bf9b00 sp 0x7f2413bf9af0 READ of size 4 at 0x611000035f48 thread T6 #0 0x564945d63746 in tlstran_pipe_nego_cb /home/runner/work/nanomq/nanomq/nng/src/sp/transport/mqtts/broker_tls.c:371 #1 0x564945c6e484 in nni_taskq_thread /home/runner/work/nanomq/nanomq/nng/src/core/taskq.c:50 #2 0x564945c6f83c in nni_thr_wrap /home/runner/work/nanomq/nanomq/nng/src/core/thread.c:94 #3 0x564945c789f1 in nni_plat_thr_main /home/runner/work/nanomq/nanomq/nng/src/platform/posix/posix_thread.c:266 #4 0x7f241c2e4b42 (/lib/x86_64-linux-gnu/libc.so.6+0x94b42) #5 0x7f241c3769ff (/lib/x86_64-linux-gnu/libc.so.6+0x1269ff) 0x611000035f48 is located 136 bytes inside of 256-byte region [0x611000035ec0,0x611000035fc0) freed by thread T7 here: #0 0x7f241c550517 in __interceptor_free ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:127 #1 0x564945c740b3 in nni_free /home/runner/work/nanomq/nanomq/nng/src/platform/posix/posix_alloc.c:33 #2 0x564945c431b0 in nng_free /home/runner/work/nanomq/nanomq/nng/src/nng.c:78 #3 0x564945c8d775 in conn_param_free /home/runner/work/nanomq/nanomq/nng/src/sp/protocol/mqtt/mqtt_parser.c:852 #4 0x564945c3c017 in server_cb /home/runner/work/nanomq/nanomq/nanomq/apps/broker.c:532 #5 0x564945c6e484 in nni_taskq_thread /home/runner/work/nanomq/nanomq/nng/src/core/taskq.c:50 #6 0x564945c6f83c in nni_thr_wrap /home/runner/work/nanomq/nanomq/nng/src/core/thread.c:94 #7 0x564945c789f1 in nni_plat_thr_main /home/runner/work/nanomq/nanomq/nng/src/platform/posix/posix_thread.c:266 #8 0x7f241c2e4b42 (/lib/x86_64-linux-gnu/libc.so.6+0x94b42) previously allocated by thread T6 here: #0 0x7f241c550867 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:145 #1 0x564945c74059 in nni_alloc /home/runner/work/nanomq/nanomq/nng/src/platform/posix/posix_alloc.c:[20](https://github.com/emqx/nanomq/actions/runs/3511408213/jobs/5882155581#step:6:21) #2 0x564945c4314a in nng_alloc /home/runner/work/nanomq/nanomq/nng/src/nng.c:60 #3 0x564945c8d36c in conn_param_alloc /home/runner/work/nanomq/nanomq/nng/src/sp/protocol/mqtt/mqtt_parser.c:8[21](https://github.com/emqx/nanomq/actions/runs/3511408213/jobs/5882155581#step:6:22) #4 0x564945d63416 in tlstran_pipe_nego_cb /home/runner/work/nanomq/nanomq/nng/src/sp/transport/mqtts/broker_tls.c:355 #5 0x564945c6e484 in nni_taskq_thread /home/runner/work/nanomq/nanomq/nng/src/core/taskq.c:50 #6 0x564945c6f83c in nni_thr_wrap /home/runner/work/nanomq/nanomq/nng/src/core/thread.c:94 #7 0x564945c789f1 in nni_plat_thr_main /home/runner/work/nanomq/nanomq/nng/src/platform/posix/posix_thread.c:266 #8 0x7f241c2e4b42 (/lib/x86_64-linux-gnu/libc.so.6+0x94b42) Thread T6 created by T0 here: Retain test passed! tls v311 test end tls v5 test start #0 0x7f241c4f4685 in __interceptor_pthread_create ../../../../src/libsanitizer/asan/asan_interceptors.cpp:216 #1 0x564945c78b21 in nni_plat_thr_init /home/runner/work/nanomq/nanomq/nng/src/platform/posix/posix_thread.c:279 #2 0x564945c6fae8 in nni_thr_init /home/runner/work/nanomq/nanomq/nng/src/core/thread.c:121 #3 0x564945c6e7a6 in nni_taskq_init /home/runner/work/nanomq/nanomq/nng/src/core/taskq.c:95 #4 0x564945c6f506 in nni_taskq_sys_init /home/runner/work/nanomq/nanomq/nng/src/core/taskq.c:294 #5 0x564945c5942a in nni_init_helper /home/runner/work/nanomq/nanomq/nng/src/core/init.c:35 #6 0x564945c78ec6 in nni_plat_init /home/runner/work/nanomq/nanomq/nng/src/platform/posix/posix_thread.c:4[22](https://github.com/emqx/nanomq/actions/runs/3511408213/jobs/5882155581#step:6:23) #7 0x564945c594ab in nni_init /home/runner/work/nanomq/nanomq/nng/src/core/init.c:58 #8 0x564945cb8da4 in nng_mtx_alloc /home/runner/work/nanomq/nanomq/nng/src/supplemental/util/platform.c:93 #9 0x564945c0f0f6 in log_init /home/runner/work/nanomq/nanomq/nanomq/mqtt_api.c:2[23](https://github.com/emqx/nanomq/actions/runs/3511408213/jobs/5882155581#step:6:24) #10 0x564945c42632 in broker_start /home/runner/work/nanomq/nanomq/nanomq/apps/broker.c:1555 #11 0x564945c0f49f in main /home/runner/work/nanomq/nanomq/nanomq/nanomq.c:142 #12 0x7f[24](https://github.com/emqx/nanomq/actions/runs/3511408213/jobs/5882155581#step:6:25)1c279d8f (/lib/x86_64-linux-gnu/libc.so.6+0x29d8f) Thread T7 created by T0 here: #0 0x7f241c4f4685 in __interceptor_pthread_create ../../../../src/libsanitizer/asan/asan_interceptors.cpp:216 #1 0x564945c78b21 in nni_plat_thr_init /home/runner/work/nanomq/nanomq/nng/src/platform/posix/posix_thread.c:279 #2 0x564945c6fae8 in nni_thr_init /home/runner/work/nanomq/nanomq/nng/src/core/thread.c:121 #3 0x564945c6e7a6 in nni_taskq_init /home/runner/work/nanomq/nanomq/nng/src/core/taskq.c:95 #4 0x564945c6f506 in nni_taskq_sys_init /home/runner/work/nanomq/nanomq/nng/src/core/taskq.c:294 #5 0x564945c5942a in nni_init_helper /home/runner/work/nanomq/nanomq/nng/src/core/init.c:35 #6 0x564945c78ec6 in nni_plat_init /home/runner/work/nanomq/nanomq/nng/src/platform/posix/posix_thread.c:422 #7 0x564945c594ab in nni_init /home/runner/work/nanomq/nanomq/nng/src/core/init.c:58 #8 0x564945cb8da4 in nng_mtx_alloc /home/runner/work/nanomq/nanomq/nng/src/supplemental/util/platform.c:93 #9 0x564945c0f0f6 in log_init /home/runner/work/nanomq/nanomq/nanomq/mqtt_api.c:223 #10 0x564945c4[26](https://github.com/emqx/nanomq/actions/runs/3511408213/jobs/5882155581#step:6:27)32 in broker_start /home/runner/work/nanomq/nanomq/nanomq/apps/broker.c:1555 #11 0x564945c0f49f in main /home/runner/work/nanomq/nanomq/nanomq/nanomq.c:142 #12 0x7f241c[27](https://github.com/emqx/nanomq/actions/runs/3511408213/jobs/5882155581#step:6:28)9d8f (/lib/x86_64-linux-gnu/libc.so.6+0x[29](https://github.com/emqx/nanomq/actions/runs/3511408213/jobs/5882155581#step:6:30)d8f) SUMMARY: AddressSanitizer: heap-use-after-free /home/runner/work/nanomq/nanomq/nng/src/sp/transport/mqtts/broker_tls.c:371 in tlstran_pipe_nego_cb Shadow bytes around the buggy address: 0x0c227fffeb90: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x0c227fffeba0: fd fd fd fd fd fd fd fd fa fa fa fa fa fa fa fa 0x0c227fffebb0: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x0c227fffebc0: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x0c227fffebd0: fa fa fa fa fa fa fa fa fd fd fd fd fd fd fd fd =>0x0c227fffebe0: fd fd fd fd fd fd fd fd fd[fd]fd fd fd fd fd fd 0x0c227fffebf0: fd fd fd fd fd fd fd fd fa fa fa fa fa fa fa fa 0x0c227fffec00: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c227fffec10: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c227fffec20: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c227fffec[30](https://github.com/emqx/nanomq/actions/runs/3511408213/jobs/5882155581#step:6:31): 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 ==120[39](https://github.com/emqx/nanomq/actions/runs/3511408213/jobs/5882155581#step:6:40)==ABORTING Error: A TLS error occurred. Session message was not received before session message expire mosquitto_sub -h 127.0.0.1 -p 88[83](https://github.com/emqx/nanomq/actions/runs/3511408213/jobs/5882155581#step:6:84) --cafile etc/certs/cacert.pem --insecure -t 'topic_test' --id client -x 5 -c -q 1 -V 5 mosquitto_pub -h 127.0.0.1 -p [88](https://github.com/emqx/nanomq/actions/runs/3511408213/jobs/5882155581#step:6:89)83 --cafile etc/certs/cacert.pem --insecure -t topic_test -m message -V 5 -q 1 Session expiry interval test failed tls v5 test failed **Expected behavior** no errors **Actual Behavior** crashed due to heap use after free **To Reproduce** https://github.com/emqx/nanomq/actions/runs/3511408213/jobs/5882155581 ** Environment Details ** - NanoMQ version : master branch
Failed CI needs a deep look
https://api.github.com/repos/nanomq/nanomq/issues/910/comments
2
2022-11-21T06:21:59Z
2024-04-18T06:09:48Z
https://github.com/nanomq/nanomq/issues/910
1,457,371,096
910
[ "emqx", "nanomq" ]
**Describe the bug** '2022-11-17 17:11:44 [77992] WARN /home/jaylin/Projects/EdgeComputing/nanomq/nng/src/supplemental/quic/quic_api.c:354 quic_strm_cb: QUIC_STREAM_EVENT_IDEAL_SEND_BUFFER_SIZE 2022-11-17 17:11:58 [77992] WARN /home/jaylin/Projects/EdgeComputing/nanomq/nng/src/mqtt/protocol/mqtt/mqtt_quic.c:892 mqtt_timer_cb: Close the quic connection due to timeout 2022-11-17 17:11:58 [77992] WARN /home/jaylin/Projects/EdgeComputing/nanomq/nng/src/supplemental/quic/quic_api.c:343 quic_strm_cb: [strm][0x6] QUIC_STREAM_EVENT shutdown: All done 2022-11-17 17:11:58 [77992] WARN /home/jaylin/Projects/EdgeComputing/nanomq/nng/src/supplemental/quic/quic_api.c:343 quic_strm_cb: [strm][0x7] QUIC_STREAM_EVENT shutdown: All done 2022-11-17 17:11:58 [77992] WARN /home/jaylin/Projects/EdgeComputing/nanomq/nng/src/supplemental/quic/quic_api.c:345 quic_strm_cb: close the QUIC stream! 2022-11-17 17:12:00 [77992] INFO /home/jaylin/Projects/EdgeComputing/nanomq/nng/src/supplemental/quic/quic_api.c:418 quic_connection_cb: [conn][0x620000011080] QUIC_CONNECTION_EVENT_SHUTDOWN_COMPLETE: All done panic: pthread_mutex_lock: Invalid argument This message is indicative of a BUG. Report this at https://github.com/emqx/nanomq ./nanomq/nanomq(nni_show_backtrace+0xb8) [0x559cc8bc068c] ./nanomq/nanomq(nni_panic+0x1d0) [0x559cc8bc09a0] ./nanomq/nanomq(+0xf2c45) [0x559cc8bd6c45] ./nanomq/nanomq(nni_plat_mtx_lock+0x1c) [0x559cc8bd6e15] ./nanomq/nanomq(nni_mtx_lock+0x1c) [0x559cc8bce00b] ./nanomq/nanomq(quic_connection_cb+0x505) [0x559cc8ec6a22] /home/jaylin/Projects/EdgeComputing/nanomq/build/nng/src/supplemental/quic/msquic/msquic/bin/Debug/libmsquic.so.2(+0xa67a3) [0x7f4838d757a3] /home/jaylin/Projects/EdgeComputing/nanomq/build/nng/src/supplemental/quic/msquic/msquic/bin/Debug/libmsquic.so.2(+0xa9626) [0x7f4838d78626] /home/jaylin/Projects/EdgeComputing/nanomq/build/nng/src/supplemental/quic/msquic/msquic/bin/Debug/libmsquic.so.2(+0xc35b6) [0x7f4838d925b6] /home/jaylin/Projects/EdgeComputing/nanomq/build/nng/src/supplemental/quic/msquic/msquic/bin/Debug/libmsquic.so.2(+0x884a8) [0x7f4838d574a8] /home/jaylin/Projects/EdgeComputing/nanomq/build/nng/src/supplemental/quic/msquic/msquic/bin/Debug/libmsquic.so.2(+0x8953c) [0x7f4838d5853c] /home/jaylin/Projects/EdgeComputing/nanomq/build/nng/src/supplemental/quic/msquic/msquic/bin/Debug/libmsquic.so.2(+0x120175) [0x7f4838def175] /home/jaylin/Projects/EdgeComputing/nanomq/build/nng/src/supplemental/quic/msquic/msquic/bin/Debug/libmsquic.so.2(+0x120a95) [0x7f4838defa95] /lib/x86_64-linux-gnu/libc.so.6(+0x94b43) [0x7f4838a3fb43] /lib/x86_64-linux-gnu/libc.so.6(+0x126a00) [0x7f4838ad1a00] Aborted (core dumped) ' **Expected behavior** normal bridging **Actual Behavior** crashed **To Reproduce** If possible include actual reproduction test code here. Minimal C test cases are perferred. ** Environment Details ** - NanoMQ version 0.13.0 - Operating system and version not related - Compiler and language used not related - testing scenario QUIC bridging **Client SDK** None **Additional context** Gonna fix this soon
NanoMQ QUIC reconnect cause invalid argument in pthread_lock
https://api.github.com/repos/nanomq/nanomq/issues/903/comments
0
2022-11-17T08:00:15Z
2022-11-17T10:16:56Z
https://github.com/nanomq/nanomq/issues/903
1,452,887,389
903
[ "emqx", "nanomq" ]
https://github.com/emqx/nanomq/actions/runs/3438075774
Docker build failed
https://api.github.com/repos/nanomq/nanomq/issues/898/comments
0
2022-11-11T13:29:00Z
2022-11-14T02:47:42Z
https://github.com/nanomq/nanomq/issues/898
1,445,478,442
898
[ "emqx", "nanomq" ]
### Discussed in https://github.com/emqx/nanomq/discussions/896 <div type='discussions-op-text'> <sup>Originally posted by **Donadominic** November 11, 2022</sup> While using NanoMQ when the client is disconnected and connected back again the order in which the messages are published is not preserved. It is reading data in some random order. But when the client is connected the messages are received in proper order. How to receive messages in proper order? I was sending a sequence of messages when the client was disconnected. And when the client is connected back again I am expecting the messages to be received in the proper order they are send. Publisher Code public class Publisher { public static void main(String[] args) { try { //publishing a message MqttClient client=new MqttClient("tcp://192.168.2.8:1885",MqttClient.generateClientId(),new MemoryPersistence()); MqttConnectOptions options = new MqttConnectOptions(); options.setCleanSession(false); options.setUserName("user1"); options.setPassword("password".toCharArray()); client.connect(options); MqttMessage message=new MqttMessage(); SimpleDateFormat simpleDateFormat = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss"); for(int i=1;i<=20;i++) { Date date = new Date(); String str=simpleDateFormat.format(date)+" message "+i; message.setPayload(str.getBytes()); message.setQos(2); message.setRetained(true); client.publish("iot_data_1",message); } client.disconnect(); } catch(MqttException me) { System.out.println(me); } } } Consumer Code public class Subscriber3 { public static void main(String[]args) throws MqttException { MqttClient client =new MqttClient("tcp://192.168.2.8:1885","subscriber004",new MemoryPersistence()); MqttConnectOptions options=new MqttConnectOptions(); options.setCleanSession(false); options.setUserName("user009"); options.setPassword("password008".toCharArray()); client.connect(options); client.setCallback(new MqttCallback() { @Override public void connectionLost(Throwable cause) { System.out.println("Connection lost"); } @Override public void messageArrived(String topic, MqttMessage message) throws Exception { System.out.println(new String(message.getPayload())); } @Override public void deliveryComplete(IMqttDeliveryToken token) { System.out.println("Delivery Complete"); } }); client.subscribe("iot_data_1"); //client.disconnect(); } } But messages are received in some random order. All the messages are received. But I need them in the order they are published. NanoMQ latest version Java Client in Windows and NanoMq on ubuntu centos in docker container Java- Eclipse Paho Publishing a sequence of messages when the client is disconnected and when client is connected back need persisted messages in order I need messages in the order in which they are published not in some random order.</div>
Message Order Not Preserved
https://api.github.com/repos/nanomq/nanomq/issues/897/comments
1
2022-11-11T06:53:39Z
2022-11-11T06:57:20Z
https://github.com/nanomq/nanomq/issues/897
1,445,019,027
897
[ "emqx", "nanomq" ]
While using NanoMQ when the client is disconnected and connected back again the order in which the messages are published is not preserved. It is reading data in some random order. But when the client is connected the messages are received in proper order. How to receive messages in proper order? I was sending a sequence of messages when the client was disconnected. And when the client is connected back again I am expecting the messages to be received in the proper order they are send. Publisher Code -------------------- public class Publisher { public static void main(String[] args) { try { //publishing a message MqttClient client=new MqttClient("tcp://192.168.2.8:1885",MqttClient.generateClientId(),new MemoryPersistence()); MqttConnectOptions options = new MqttConnectOptions(); options.setCleanSession(false); options.setUserName("user1"); options.setPassword("password".toCharArray()); client.connect(options); MqttMessage message=new MqttMessage(); SimpleDateFormat simpleDateFormat = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss"); for(int i=1;i<=20;i++) { Date date = new Date(); String str=simpleDateFormat.format(date)+" message "+i; message.setPayload(str.getBytes()); message.setQos(2); message.setRetained(true); client.publish("iot_data_1",message); } client.disconnect(); } catch(MqttException me) { System.out.println(me); } } } Consumer Code -------------------- public class Subscriber3 { public static void main(String[]args) throws MqttException { MqttClient client =new MqttClient("tcp://192.168.2.8:1885","subscriber004",new MemoryPersistence()); MqttConnectOptions options=new MqttConnectOptions(); options.setCleanSession(false); options.setUserName("user009"); options.setPassword("password008".toCharArray()); client.connect(options); client.setCallback(new MqttCallback() { @Override public void connectionLost(Throwable cause) { System.out.println("Connection lost"); } @Override public void messageArrived(String topic, MqttMessage message) throws Exception { System.out.println(new String(message.getPayload())); } @Override public void deliveryComplete(IMqttDeliveryToken token) { System.out.println("Delivery Complete"); } }); client.subscribe("iot_data_1"); //client.disconnect(); } } But messages are received in some random order. All the messages are received. But I need them in the order they are published. - NanoMQ latest version - Java Client in Windows and NanoMq on ubuntu centos in docker container - Java- Eclipse Paho - Publishing a sequence of messages when the client is disconnected and when client is connected back need persisted messages in order
Message Order Not Preserved.
https://api.github.com/repos/nanomq/nanomq/issues/894/comments
2
2022-11-11T05:29:17Z
2022-11-24T09:29:30Z
https://github.com/nanomq/nanomq/issues/894
1,444,954,390
894
[ "emqx", "nanomq" ]
null
bridging DDS with MQTT
https://api.github.com/repos/nanomq/nanomq/issues/891/comments
2
2022-11-09T07:43:57Z
2023-01-10T07:03:38Z
https://github.com/nanomq/nanomq/issues/891
1,441,578,868
891
[ "emqx", "nanomq" ]
This is a bug introduced by Reload cmd. Would cause NanoMQ restart failed with "address in use" when IPC file is left from last time booting.
NanoMQ restart/start failed when IPC path is already existed
https://api.github.com/repos/nanomq/nanomq/issues/884/comments
0
2022-11-03T10:03:04Z
2022-11-04T15:22:27Z
https://github.com/nanomq/nanomq/issues/884
1,434,394,468
884
[ "emqx", "nanomq" ]
**Describe the bug** As title said, "-DNNG_ENABLE_QUIC" is incompatible with "-DBUILD_SHARED_LIBS=ON", these two would cause build fail of NanoMQ **Expected behavior** .so requires more work, as we have to move libmosquic.so to a proper folder before entering next compiling stage THis is just an inform, we will enhance this in short future, for now, plz don't enable DNNG_ENABLE_QUIC and DBUILD_SHARED_LIBS together.
"-DNNG_ENABLE_QUIC" incompatible with "-DBUILD_SHARED_LIBS=ON"
https://api.github.com/repos/nanomq/nanomq/issues/864/comments
1
2022-10-09T11:25:08Z
2024-04-18T06:09:25Z
https://github.com/nanomq/nanomq/issues/864
1,402,244,065
864
[ "emqx", "nanomq" ]
**Describe the bug** Node is null when executing ```nanomq_cli quic sub ``` **Expected behavior** No error happened when using nanomq_cli **Actual Behavior** Segment fault happened **To Reproduce** . ** Environment Details ** - NanoMQ version - lastest - Operating system and version - osx - Compiler and language used - gcc - testing scenario . **Client SDK** . **Additional context** .
Node is null in LoadConfiguration when executing ```nanomq_cli quic sub ```
https://api.github.com/repos/nanomq/nanomq/issues/862/comments
2
2022-10-08T08:51:54Z
2023-03-17T07:50:00Z
https://github.com/nanomq/nanomq/issues/862
1,401,876,825
862
[ "emqx", "nanomq" ]
**Is your feature request related to a problem? Please describe.** https://nanomq.io/docs/en/latest/http-api/v4.html#get-configuration need to print out all the configurations as possible, including authentication. so that we can get detailed conf info to deal with #797
Enhance HTTP API (get conf info)
https://api.github.com/repos/nanomq/nanomq/issues/852/comments
0
2022-09-21T12:34:01Z
2022-09-21T12:34:10Z
https://github.com/nanomq/nanomq/issues/852
1,380,859,009
852
[ "emqx", "nanomq" ]
**Describe the bug** num_taskq_thread and max_taskq_thread is not taking effect properly **Expected behavior** set the taskq num as expected
set thread number not success in nanomq.conf
https://api.github.com/repos/nanomq/nanomq/issues/851/comments
0
2022-09-21T12:06:04Z
2022-09-22T10:03:29Z
https://github.com/nanomq/nanomq/issues/851
1,380,821,018
851
[ "emqx", "nanomq" ]
**Describe the bug** When I print the log, it seems to buffer is overflowing. The log are as follows #0 0x100c223fc in printf_common(void*, char const*, char*)+0x748 (libclang_rt.asan_osx_dynamic.dylib:arm64e+0x1e3fc) #1 0x100c22530 in wrap_vfprintf+0x6c (libclang_rt.asan_osx_dynamic.dylib:arm64e+0x1e530) #2 0x1001b424c in stdout_callback log.c:71 #3 0x1001b4868 in log_log log.c:279 #4 0x10000774c in hybridger_cb bridge.c:391 #5 0x1000861f8 in nni_thr_wrap thread.c:94 #6 0x1000a22dc in nni_plat_thr_main posix_thread.c:266 #7 0x1a06b8268 in _pthread_start+0x90 (libsystem_pthread.dylib:arm64e+0x7268) #8 0x1a06b3088 in thread_start+0x4 (libsystem_pthread.dylib:arm64e+0x2088) **Expected behavior** No overflow in log. **Actual Behavior** - **To Reproduce** - It occurs by accident ** Environment Details ** - NanoMQ version - the latest - Operating system and version. osx - Compiler and language used - clang - testing scenario **Client SDK** - **Additional context** -
Stack buffer overflow when loging?
https://api.github.com/repos/nanomq/nanomq/issues/850/comments
1
2022-09-21T07:57:46Z
2022-09-21T08:06:42Z
https://github.com/nanomq/nanomq/issues/850
1,380,494,356
850
[ "emqx", "nanomq" ]
Sometimes will loss message when publish multi qos 0 message with option topic alias ``` mosquitto_pub -t topic -V 5 -m message -D Publish topic-alias 10 -d --repeat 10 mosquitto_sub -t 'topic' ```
qos 0 message with option topic alias being dropped occasionally
https://api.github.com/repos/nanomq/nanomq/issues/848/comments
1
2022-09-16T10:33:24Z
2023-01-10T23:59:08Z
https://github.com/nanomq/nanomq/issues/848
1,375,757,983
848
[ "emqx", "nanomq" ]
null
nanomq_cli crashed when network is down
https://api.github.com/repos/nanomq/nanomq/issues/842/comments
0
2022-09-15T04:15:56Z
2022-09-15T07:56:49Z
https://github.com/nanomq/nanomq/issues/842
1,373,892,945
842
[ "emqx", "nanomq" ]
When NanoMQ start with rule option turning on will caused crushed. ```shell  ~/workspace/nanomq/build/ ./nanomq/nanomq start --log_level warn --http --rule ../etc/nanomq_rule.conf AddressSanitizer:DEADLYSIGNAL ================================================================= ==2814629==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x7f8220f7a97d bp 0x7fff3c1f86f0 sp 0x7fff3c1f7e88 T0) ==2814629==The signal is caused by a READ memory access. ==2814629==Hint: address points to the zero page. #0 0x7f8220f7a97d (/lib/x86_64-linux-gnu/libc.so.6+0x19d97d) #1 0x7f82216eea1b in __interceptor_strlen ../../../../src/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:387 #2 0x564a0b9a92f1 in nni_strdup /home/lee/workspace/nanomq/nng/src/core/strs.c:32 #3 0x564a0b9ad4b0 in nni_url_parse /home/lee/workspace/nanomq/nng/src/core/url.c:307 #4 0x564a0b990708 in nni_dialer_create /home/lee/workspace/nanomq/nng/src/core/dialer.c:224 #5 0x564a0b982ab2 in nng_dialer_create /home/lee/workspace/nanomq/nng/src/nng.c:694 #6 0x564a0b971c56 in nano_client /home/lee/workspace/nanomq/nanomq/nanomq_rule.c:115 #7 0x564a0b979cf3 in broker /home/lee/workspace/nanomq/nanomq/apps/broker.c:831 #8 0x564a0b97dfb5 in broker_start /home/lee/workspace/nanomq/nanomq/apps/broker.c:1550 #9 0x564a0b94160a in main /home/lee/workspace/nanomq/nanomq/nanomq.c:142 #10 0x7f8220e06d8f in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58 #11 0x7f8220e06e3f in __libc_start_main_impl ../csu/libc-start.c:392 #12 0x564a0b93f864 in _start (/home/lee/workspace/nanomq/build/nanomq/nanomq+0x7d864) AddressSanitizer can not provide additional info. SUMMARY: AddressSanitizer: SEGV (/lib/x86_64-linux-gnu/libc.so.6+0x19d97d) ==2814629==ABORTING ```
When NanoMQ start with rule option turning on will caused crushed.
https://api.github.com/repos/nanomq/nanomq/issues/826/comments
0
2022-09-02T02:53:49Z
2022-09-02T03:38:26Z
https://github.com/nanomq/nanomq/issues/826
1,359,641,667
826
[ "emqx", "nanomq" ]
**Describe the bug** The memleak happens when bridging client reconnects This is an issue with 0.11.0
NanoMQ bridge has a potential memleak problem
https://api.github.com/repos/nanomq/nanomq/issues/823/comments
0
2022-09-01T10:39:49Z
2022-09-01T11:18:20Z
https://github.com/nanomq/nanomq/issues/823
1,358,628,755
823
[ "emqx", "nanomq" ]
**Describe the bug** The content in function prinf_conf() is not printed when I set the log level to info **Expected behavior** the content in print_conf() could be printed. **Actual Behavior** No log was printed to console. **To Reproduce** ``` ./build/nanomq/nanomq start -- ./etc/nanomq.conf ``` ** Environment Details ** - NanoMQ version. lastest - Operating system and version. OSX - Compiler and language used. clang14 - testing scenario **Client SDK** - **Additional context** -
The content of function prinf_conf() are not printed as the log level is set to info
https://api.github.com/repos/nanomq/nanomq/issues/820/comments
0
2022-08-31T07:41:16Z
2022-09-21T07:53:59Z
https://github.com/nanomq/nanomq/issues/820
1,356,934,950
820
[ "emqx", "nanomq" ]
**Describe the bug** High msg rate cause memory corruption when enabling QUIC bridging **Expected behavior** no crash no mem leak no corruption **Actual Behavior** ==50890==ERROR: AddressSanitizer: heap-use-after-free on address 0x61f0000126a0 at pc 0x7f343029c397 bp 0x7f34189d7950 sp 0x7f34189d70f8 READ of size 3010 at 0x61f0000126a0 thread T40 #0 0x7f343029c396 in __interceptor_memcpy ../../../../src/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:827 #1 0x7f342ff0c5a5 in memcpy /usr/include/x86_64-linux-gnu/bits/string_fortified.h:29 #2 0x7f342ff0c5a5 in QuicStreamSendBufferRequest ../nng/extern/msquic/src/core/stream_send.c:449 #3 0x7f342ff95ae7 in QuicSendBufferFill ../nng/extern/msquic/src/core/send_buffer.c:181 #4 0x7f342ff0e4e1 in QuicStreamSendFlush ../nng/extern/msquic/src/core/stream_send.c:594 #5 0x7f342ff522a5 in QuicConnProcessApiOperation ../nng/extern/msquic/src/core/connection.c:7194 #6 0x7f342ff527cb in QuicConnDrainOperations ../nng/extern/msquic/src/core/connection.c:7329 #7 0x7f342ff18dd5 in QuicWorkerProcessConnection ../nng/extern/msquic/src/core/worker.c:510 #8 0x7f342ff19e80 in QuicWorkerLoop ../nng/extern/msquic/src/core/worker.c:668 #9 0x7f342ff1a603 in QuicWorkerThread ../nng/extern/msquic/src/core/worker.c:733 #10 0x7f342fbec946 in start_thread nptl/pthread_create.c:435 #11 0x7f342fc7ca43 in __clone (/lib/x86_64-linux-gnu/libc.so.6+0x124a43) 0x61f0000126a0 is located 32 bytes inside of 3042-byte region [0x61f000012680,0x61f000013262) freed by thread T3 here: #0 0x7f3430316517 in __interceptor_free ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:127 #1 0x55e69a7fd724 in nni_free ../nng/src/platform/posix/posix_alloc.c:33 #2 0x55e69a7e9727 in nni_chunk_grow ../nng/src/core/message.c:147 #3 0x55e69a7e9ef8 in nni_chunk_append ../nng/src/core/message.c:244 #4 0x55e69a7eb20d in nni_msg_append ../nng/src/core/message.c:524 #5 0x55e69a84d693 in nni_mqttv5_msg_encode_publish ../nng/src/supplemental/mqtt/mqtt_codec.c:1204 #6 0x55e69a848297 in nni_mqttv5_msg_encode ../nng/src/supplemental/mqtt/mqtt_codec.c:194 #7 0x55e69a8466e1 in nng_mqttv5_msg_encode ../nng/src/supplemental/mqtt/mqtt_public.c:37 #8 0x55e69a7c6657 in bridge_handler ../nanomq/apps/broker.c:219 #9 0x55e69a7c974b in server_cb ../nanomq/apps/broker.c:504 #10 0x55e69a7f7b61 in nni_taskq_thread ../nng/src/core/taskq.c:50 #11 0x55e69a7f8ef8 in nni_thr_wrap ../nng/src/core/thread.c:94 #12 0x55e69a801e00 in nni_plat_thr_main ../nng/src/platform/posix/posix_thread.c:266 #13 0x7f342fbec946 in start_thread nptl/pthread_create.c:435 **To Reproduce** just sending massive msg to quick bridging topics ** Environment Details ** - NanoMQ version 0.11 **Client SDK** not related **Additional context** Add any other context about the problem here.
High msg rate cause memory corruption when enabling QUIC bridging
https://api.github.com/repos/nanomq/nanomq/issues/815/comments
1
2022-08-30T08:31:55Z
2022-08-30T08:46:37Z
https://github.com/nanomq/nanomq/issues/815
1,355,378,803
815
[ "emqx", "nanomq" ]
**Is your feature request related to a problem? Please describe.** A tool to check configure files for bridge and others. **Describe the solution you'd like** For example. nanomq_cli test ./bridge.conf **Describe alternatives you've considered** - **Additional context** Users may make mistakes in modify configure files.
NanoMQ should check the validity of all config files and return error
https://api.github.com/repos/nanomq/nanomq/issues/805/comments
0
2022-08-26T08:40:36Z
2022-08-26T10:37:48Z
https://github.com/nanomq/nanomq/issues/805
1,351,948,990
805
[ "emqx", "nanomq" ]
**Is your feature request related to a problem? Please describe.** When using the nanomq_cli tool for subscribing topics, I find there is no option to specific clientid when I want to use the clean session function. **Describe the solution you'd like** Provide an option to determine clientid on the command line **Describe alternatives you've considered** There are -I option on pub tool, but not on sub tool. **Additional context**
Specific clientid in nanomq_cli sub tools
https://api.github.com/repos/nanomq/nanomq/issues/802/comments
0
2022-08-25T08:47:51Z
2022-08-26T10:37:56Z
https://github.com/nanomq/nanomq/issues/802
1,350,554,015
802
[ "emqx", "nanomq" ]
Hi, Apologies, but I cannot find an obvious answer in docs. Does nanomq implement ACL support like EMQX (or similar)? https://docs.emqx.com/en/enterprise/v4.4/modules/internal_acl.html#builtin-acl-file-2 Thank you for the answer
Does nanomq implement ACL support?
https://api.github.com/repos/nanomq/nanomq/issues/800/comments
6
2022-08-24T09:03:15Z
2023-01-10T12:37:41Z
https://github.com/nanomq/nanomq/issues/800
1,349,108,812
800
[ "emqx", "nanomq" ]
**Describe the bug** I recently upgraded to version `0.10.8` of NanoMQ from `0.5.0`. I am using the Paho MQTT client embedded client inside my application to connect to the broker. In the connection configuration I am disabling clean sessions and sending all MQTT payloads with QOS level 1. In this configuration if the client disconnects from the broker and reconnects, the broker will stop forwarding the MQTT payloads for the subscribed topics to the client. NOTE: from the clients perspective the connection request as well as the subscription requests were all valid upon reconnection. **Expected behavior** With clean session disabled and all payloads published using QOS 1; if a client disconnects and reconnects to the MQTT broker, the broker will forward all payloads for topics subscribed to by the client to the client. This includes any payloads that were sent while the client was disconnected as well as new payloads that were sent after the client reconnected. **Actual Behavior** The client does not receive any payloads from the broker after reconnecting. **To Reproduce** 1. Run the NanoMQ broker `nanomq start --url nmq-tcp://127.0.0.1:1243` 2. Connect a client to the broker with clean sessions disabled 3. Continuously publish messages to a topic that the client is subscribed to 4. If the client disconnects and reconnects the client will no longer receive any data One note, the exact same configuration on the client side is used between using versions `0.5.0` and `0.10.8`. If I revert back to 0.5.0 I do not see this behaviour and after a disconnect+reconnect the client still receives all data from the broker. ** Environment Details ** - NanoMQ versionL `0.10.8` - Operating system and version: `20.04.1-Ubuntu` - Compiler and language used: `Clang-10` **Client SDK** Paho MQTT Embedded-C Client **Additional context** Terminating NanoMQ and relaunching it resolves the issue and my application is able to receive the payloads.
NanoMQ not forwarding data to client using persistent sessions upon re-connection
https://api.github.com/repos/nanomq/nanomq/issues/799/comments
13
2022-08-24T06:16:11Z
2023-03-20T10:26:16Z
https://github.com/nanomq/nanomq/issues/799
1,348,922,680
799
[ "emqx", "nanomq" ]
**Describe the bug** When define `--auth` with default [etc/nanomq_auth_username.conf](https://github.com/emqx/nanomq/blob/master/etc/nanomq_auth_username.conf) **Segmentation fault** happens **Expected behavior** Run nanomq **Actual Behavior** Segmentation fault **To Reproduce** ``` root@mqtt-test:~# docker run --rm -it -e NANOMQ_CONF_PATH=/etc/nanomq/nanomq.conf -v /docker/nanomq/etc:/etc/nanomq --name nanomq --entrypoint /bin/sh emqx/nanomq:0.10.8-alpine /usr/local/nanomq # ./nanomq start --auth /etc/nanomq/nanomq_auth_username.conf Segmentation fault (core dumped) ``` **Environment Details** - NanoMQ version: dockerized `emqx/nanomq:0.10.8-alpine` - Operating system and version `Ubuntu 20.04.4 LTS` - Compiler and language used: NA - testing scenario: NA
auth option causes Segmentation fault
https://api.github.com/repos/nanomq/nanomq/issues/797/comments
16
2022-08-22T10:11:33Z
2022-11-22T07:08:22Z
https://github.com/nanomq/nanomq/issues/797
1,346,154,583
797
[ "emqx", "nanomq" ]
File: [/docs/en_US/README.md](https://nanomq.io/docs/en/latest/) Missing information about MQTT 5.0 support.
Missing information about MQTT 5.0 support.
https://api.github.com/repos/nanomq/nanomq/issues/794/comments
2
2022-08-19T16:01:43Z
2022-08-31T04:00:52Z
https://github.com/nanomq/nanomq/issues/794
1,344,625,223
794
[ "emqx", "nanomq" ]
**Describe the bug** No helper information when using nanomq_cli tool **Expected behavior** Show help infos **Actual Behavior** No help infos. **To Reproduce** ./build/nanomq_cli/nanomq_cli -h ** Environment Details ** - NanoMQ version latest master branch **Client SDK** - **Additional context** -
No helper information when using nanomq_cli tool
https://api.github.com/repos/nanomq/nanomq/issues/775/comments
0
2022-08-02T08:52:49Z
2022-08-04T12:34:28Z
https://github.com/nanomq/nanomq/issues/775
1,325,506,150
775
[ "emqx", "nanomq" ]
**Describe the bug** memleak when send ubsub to broker **Expected behavior** no memleak **Actual Behavior** ==41744==ERROR: LeakSanitizer: detected memory leaks Direct leak of 24 byte(s) in 1 object(s) allocated from: #0 0x7fa05aec1867 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:145 #1 0x55e641355be7 in nni_alloc ../nng/src/platform/posix/posix_alloc.c:20 #2 0x55e641324a20 in nng_alloc ../nng/src/nng.c:60 #3 0x55e64131afb1 in server_cb ../nanomq/apps/broker.c:349 #4 0x55e6413505bf in nni_task_exec ../nng/src/core/taskq.c:144 #5 0x55e641333908 in nni_aio_finish_impl ../nng/src/core/aio.c:454 #6 0x55e64133398a in nni_aio_finish_sync ../nng/src/core/aio.c:469 #7 0x55e64137d334 in nano_pipe_recv_cb ../nng/src/sp/protocol/mqtt/nmq_mqtt.c:1087 #8 0x55e6413505bf in nni_task_exec ../nng/src/core/taskq.c:144 #9 0x55e641333908 in nni_aio_finish_impl ../nng/src/core/aio.c:454 #10 0x55e64133398a in nni_aio_finish_sync ../nng/src/core/aio.c:469 #11 0x55e641437abf in tcptran_pipe_recv_cb ../nng/src/sp/transport/mqtt/broker_tcp.c:787 #12 0x55e64134fdca in nni_taskq_thread ../nng/src/core/taskq.c:50 #13 0x55e641351415 in nni_thr_wrap ../nng/src/core/thread.c:94 #14 0x55e64135a31d in nni_plat_thr_main ../nng/src/platform/posix/posix_thread.c:266 #15 0x7fa05ac55946 in start_thread nptl/pthread_create.c:435 SUMMARY: AddressSanitizer: 24 byte(s) leaked in 1 allocation(s). **To Reproduce** just send sub and ubsub ** Environment Details ** - NanoMQ version 0.9.5
UNSUB cause memleak
https://api.github.com/repos/nanomq/nanomq/issues/768/comments
0
2022-07-29T17:16:12Z
2022-07-30T02:36:00Z
https://github.com/nanomq/nanomq/issues/768
1,322,499,938
768
[ "emqx", "nanomq" ]
Run command below three times ``` mosquitto_sub -t topic -h localhost -p 1883 -i id -q 1 -c ``` Error log: ```  ~/workspace/nanomq/build/ [master*] ./nanomq/nanomq start --conf ../etc/nanomq.conf set client_id id -> pipe_id 1217634549 remove client_id id set client_id id -> pipe_id 1217634550 remove client_id id set client_id id -> pipe_id 1217634551 remove client_id id set client_id id -> pipe_id 1217634552 remove client_id id set client_id id -> pipe_id 1217634553 remove client_id id set client_id id -> pipe_id 1217634554 remove client_id id set client_id id -> pipe_id 1217634555 remove client_id id set client_id id -> pipe_id 1217634556 remove client_id id set client_id id -> pipe_id 1217634557 remove client_id id set client_id id -> pipe_id 1217634558 remove client_id id ^C Broker exit(0).  ~/workspace/nanomq/build/ [master*] ./nanomq/nanomq start --conf ../etc/nanomq.conf set client_id id -> pipe_id 1367064390 remove client_id id set client_id id -> pipe_id 1367064391 remove client_id id ^C Broker exit(0).  ~/workspace/nanomq/build/ [master*] ./nanomq/nanomq start --conf ../etc/nanomq.conf set client_id id -> pipe_id 1545188824 remove client_id id set client_id id -> pipe_id 1545188825 set client_id id -> pipe_id 1545188825 ================================================================= ==4097302==ERROR: AddressSanitizer: heap-use-after-free on address 0x60200000d050 at pc 0x7f358794a638 bp 0x7f35817f9500 sp 0x7f35817f8ca8 READ of size 2 at 0x60200000d050 thread T6 #0 0x7f358794a637 in MemcmpInterceptorCommon(void*, int (*)(void const*, void const*, unsigned long), void const*, void const*, unsigned long) ../../../../src/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:860 #1 0x7f358794aba6 in __interceptor_memcmp ../../../../src/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:892 #2 0x7f358794aba6 in __interceptor_memcmp ../../../../src/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:887 #3 0x564e3b99f507 in hashmap_match_helper /home/lee/workspace/nanomq/nanomq/hashmap.c:366 #4 0x564e3b99f6a3 in hashmap_hash_helper /home/lee/workspace/nanomq/nanomq/hashmap.c:391 #5 0x564e3b99e9f3 in hashmap_put /home/lee/workspace/nanomq/nanomq/hashmap.c:158 #6 0x564e3b99e723 in nano_hashmap_put /home/lee/workspace/nanomq/nanomq/hashmap.c:102 #7 0x564e3b9b68c4 in server_cb /home/lee/workspace/nanomq/nanomq/apps/broker.c:424 #8 0x564e3b9e928d in nni_task_exec /home/lee/workspace/nanomq/nng/src/core/taskq.c:144 #9 0x564e3b9cc751 in nni_aio_finish_impl /home/lee/workspace/nanomq/nng/src/core/aio.c:454 #10 0x564e3b9cc7d3 in nni_aio_finish_sync /home/lee/workspace/nanomq/nng/src/core/aio.c:469 #11 0x564e3ba12788 in nano_pipe_recv_cb /home/lee/workspace/nanomq/nng/src/sp/protocol/mqtt/nmq_mqtt.c:1087 #12 0x564e3b9e928d in nni_task_exec /home/lee/workspace/nanomq/nng/src/core/taskq.c:144 #13 0x564e3b9cc751 in nni_aio_finish_impl /home/lee/workspace/nanomq/nng/src/core/aio.c:454 #14 0x564e3b9cc7d3 in nni_aio_finish_sync /home/lee/workspace/nanomq/nng/src/core/aio.c:469 #15 0x564e3ba10785 in nano_pipe_start /home/lee/workspace/nanomq/nng/src/sp/protocol/mqtt/nmq_mqtt.c:726 #16 0x564e3b9e536e in nni_listener_add_pipe /home/lee/workspace/nanomq/nng/src/core/socket.c:1604 #17 0x564e3b9d5c70 in listener_accept_cb /home/lee/workspace/nanomq/nng/src/core/listener.c:357 #18 0x564e3b9e8a95 in nni_taskq_thread /home/lee/workspace/nanomq/nng/src/core/taskq.c:50 #19 0x564e3b9e9d86 in nni_thr_wrap /home/lee/workspace/nanomq/nng/src/core/thread.c:94 #20 0x564e3b9f2d2d in nni_plat_thr_main /home/lee/workspace/nanomq/nng/src/platform/posix/posix_thread.c:266 #21 0x7f35876feb42 in start_thread nptl/pthread_create.c:442 #22 0x7f35877909ff (/lib/x86_64-linux-gnu/libc.so.6+0x1269ff) 0x60200000d050 is located 0 bytes inside of 3-byte region [0x60200000d050,0x60200000d053) freed by thread T10 here: #0 0x7f358796a517 in __interceptor_free ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:127 #1 0x564e3b9ee5fd in nni_free /home/lee/workspace/nanomq/nng/src/platform/posix/posix_alloc.c:33 #2 0x564e3b9bda59 in nng_free /home/lee/workspace/nanomq/nng/src/nng.c:78 #3 0x564e3ba081e4 in conn_param_free /home/lee/workspace/nanomq/nng/src/sp/protocol/mqtt/mqtt_parser.c:838 #4 0x564e3ba0f021 in nano_pipe_fini /home/lee/workspace/nanomq/nng/src/sp/protocol/mqtt/nmq_mqtt.c:565 #5 0x564e3b9dcb4c in pipe_destroy /home/lee/workspace/nanomq/nng/src/core/pipe.c:76 #6 0x564e3b9de83b in reap_worker /home/lee/workspace/nanomq/nng/src/core/reap.c:58 #7 0x564e3b9e9d86 in nni_thr_wrap /home/lee/workspace/nanomq/nng/src/core/thread.c:94 #8 0x564e3b9f2d2d in nni_plat_thr_main /home/lee/workspace/nanomq/nng/src/platform/posix/posix_thread.c:266 #9 0x7f35876feb42 in start_thread nptl/pthread_create.c:442 previously allocated by thread T9 here: #0 0x7f358796a867 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:145 #1 0x564e3b9ee5a3 in nni_alloc /home/lee/workspace/nanomq/nng/src/platform/posix/posix_alloc.c:20 #2 0x564e3b9bd9f3 in nng_alloc /home/lee/workspace/nanomq/nng/src/nng.c:60 #3 0x564e3ba04217 in copyn_utf8_str /home/lee/workspace/nanomq/nng/src/sp/protocol/mqtt/mqtt_parser.c:222 #4 0x564e3ba06620 in conn_handler /home/lee/workspace/nanomq/nng/src/sp/protocol/mqtt/mqtt_parser.c:611 #5 0x564e3bd005aa in tcptran_pipe_nego_cb /home/lee/workspace/nanomq/nng/src/sp/transport/mqtt/broker_tcp.c:349 #6 0x564e3b9e8a95 in nni_taskq_thread /home/lee/workspace/nanomq/nng/src/core/taskq.c:50 #7 0x564e3b9e9d86 in nni_thr_wrap /home/lee/workspace/nanomq/nng/src/core/thread.c:94 #8 0x564e3b9f2d2d in nni_plat_thr_main /home/lee/workspace/nanomq/nng/src/platform/posix/posix_thread.c:266 #9 0x7f35876feb42 in start_thread nptl/pthread_create.c:442 Thread T6 created by T0 here: #0 0x7f358790e685 in __interceptor_pthread_create ../../../../src/libsanitizer/asan/asan_interceptors.cpp:216 #1 0x564e3b9f2e5d in nni_plat_thr_init /home/lee/workspace/nanomq/nng/src/platform/posix/posix_thread.c:279 #2 0x564e3b9ea032 in nni_thr_init /home/lee/workspace/nanomq/nng/src/core/thread.c:121 #3 0x564e3b9e8db7 in nni_taskq_init /home/lee/workspace/nanomq/nng/src/core/taskq.c:95 #4 0x564e3b9e9a50 in nni_taskq_sys_init /home/lee/workspace/nanomq/nng/src/core/taskq.c:294 #5 0x564e3b9d3b7d in nni_init_helper /home/lee/workspace/nanomq/nng/src/core/init.c:35 #6 0x564e3b9f3202 in nni_plat_init /home/lee/workspace/nanomq/nng/src/platform/posix/posix_thread.c:422 #7 0x564e3b9d3bfe in nni_init /home/lee/workspace/nanomq/nng/src/core/init.c:58 #8 0x564e3ba2d52e in nng_mtx_alloc /home/lee/workspace/nanomq/nng/src/supplemental/util/platform.c:93 #9 0x564e3b99e6d1 in nano_hashmap_create /home/lee/workspace/nanomq/nanomq/hashmap.c:93 #10 0x564e3b9b98c5 in broker /home/lee/workspace/nanomq/nanomq/apps/broker.c:904 #11 0x564e3b9bd205 in broker_start /home/lee/workspace/nanomq/nanomq/apps/broker.c:1549 #12 0x564e3b996d0f in main /home/lee/workspace/nanomq/nanomq/nanomq.c:139 #13 0x7f3587693d8f in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58 Thread T10 created by T0 here: #0 0x7f358790e685 in __interceptor_pthread_create ../../../../src/libsanitizer/asan/asan_interceptors.cpp:216 #1 0x564e3b9f2e5d in nni_plat_thr_init /home/lee/workspace/nanomq/nng/src/platform/posix/posix_thread.c:279 #2 0x564e3b9ea032 in nni_thr_init /home/lee/workspace/nanomq/nng/src/core/thread.c:121 #3 0x564e3b9deabc in nni_reap_sys_init /home/lee/workspace/nanomq/nng/src/core/reap.c:110 #4 0x564e3b9d3b8b in nni_init_helper /home/lee/workspace/nanomq/nng/src/core/init.c:36 #5 0x564e3b9f3202 in nni_plat_init /home/lee/workspace/nanomq/nng/src/platform/posix/posix_thread.c:422 #6 0x564e3b9d3bfe in nni_init /home/lee/workspace/nanomq/nng/src/core/init.c:58 #7 0x564e3ba2d52e in nng_mtx_alloc /home/lee/workspace/nanomq/nng/src/supplemental/util/platform.c:93 #8 0x564e3b99e6d1 in nano_hashmap_create /home/lee/workspace/nanomq/nanomq/hashmap.c:93 #9 0x564e3b9b98c5 in broker /home/lee/workspace/nanomq/nanomq/apps/broker.c:904 #10 0x564e3b9bd205 in broker_start /home/lee/workspace/nanomq/nanomq/apps/broker.c:1549 #11 0x564e3b996d0f in main /home/lee/workspace/nanomq/nanomq/nanomq.c:139 #12 0x7f3587693d8f in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58 Thread T9 created by T0 here: #0 0x7f358790e685 in __interceptor_pthread_create ../../../../src/libsanitizer/asan/asan_interceptors.cpp:216 #1 0x564e3b9f2e5d in nni_plat_thr_init /home/lee/workspace/nanomq/nng/src/platform/posix/posix_thread.c:279 #2 0x564e3b9ea032 in nni_thr_init /home/lee/workspace/nanomq/nng/src/core/thread.c:121 #3 0x564e3b9e8db7 in nni_taskq_init /home/lee/workspace/nanomq/nng/src/core/taskq.c:95 #4 0x564e3b9e9a50 in nni_taskq_sys_init /home/lee/workspace/nanomq/nng/src/core/taskq.c:294 #5 0x564e3b9d3b7d in nni_init_helper /home/lee/workspace/nanomq/nng/src/core/init.c:35 #6 0x564e3b9f3202 in nni_plat_init /home/lee/workspace/nanomq/nng/src/platform/posix/posix_thread.c:422 #7 0x564e3b9d3bfe in nni_init /home/lee/workspace/nanomq/nng/src/core/init.c:58 #8 0x564e3ba2d52e in nng_mtx_alloc /home/lee/workspace/nanomq/nng/src/supplemental/util/platform.c:93 #9 0x564e3b99e6d1 in nano_hashmap_create /home/lee/workspace/nanomq/nanomq/hashmap.c:93 #10 0x564e3b9b98c5 in broker /home/lee/workspace/nanomq/nanomq/apps/broker.c:904 #11 0x564e3b9bd205 in broker_start /home/lee/workspace/nanomq/nanomq/apps/broker.c:1549 #12 0x564e3b996d0f in main /home/lee/workspace/nanomq/nanomq/nanomq.c:139 #13 0x7f3587693d8f in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58 SUMMARY: AddressSanitizer: heap-use-after-free ../../../../src/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:860 in MemcmpInterceptorCommon(void*, int (*)(void const*, void const*, unsigned long), void const*, void const*, unsigned long) Shadow bytes around the buggy address: 0x0c047fff99b0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c047fff99c0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c047fff99d0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c047fff99e0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c047fff99f0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa =>0x0c047fff9a00: fa fa fd fd fa fa fd fa fa fa[fd]fa fa fa fd fa 0x0c047fff9a10: fa fa fd fa fa fa fd fd fa fa fa fa fa fa fa fa 0x0c047fff9a20: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c047fff9a30: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c047fff9a40: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c047fff9a50: 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 ==4097302==ABORTING  ~/workspace/nanomq/build/ [master*] ninja [3/3] Linking C executable nanomq/nanomq  ~/workspace/nanomq/build/ [master*] ./nanomq/nanomq start --conf ../etc/nanomq.conf set client_id id -> pipe_id 1345855775 set client_id id -> pipe_id 1345855775 ================================================================= ==4097513==ERROR: AddressSanitizer: heap-use-after-free on address 0x60200000c050 at pc 0x7f97a432e638 bp 0x7f979d1f75c0 sp 0x7f979d1f6d68 READ of size 2 at 0x60200000c050 thread T8 #0 0x7f97a432e637 in MemcmpInterceptorCommon(void*, int (*)(void const*, void const*, unsigned long), void const*, void const*, unsigned long) ../../../../src/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:860 #1 0x7f97a432eba6 in __interceptor_memcmp ../../../../src/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:892 #2 0x7f97a432eba6 in __interceptor_memcmp ../../../../src/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:887 #3 0x55d3e57e5507 in hashmap_match_helper /home/lee/workspace/nanomq/nanomq/hashmap.c:366 #4 0x55d3e57e4f79 in hashmap_remove /home/lee/workspace/nanomq/nanomq/hashmap.c:213 #5 0x55d3e57e47c9 in nano_hashmap_remove /home/lee/workspace/nanomq/nanomq/hashmap.c:122 #6 0x55d3e57fc7fa in server_cb /home/lee/workspace/nanomq/nanomq/apps/broker.c:423 #7 0x55d3e582f281 in nni_task_exec /home/lee/workspace/nanomq/nng/src/core/taskq.c:144 #8 0x55d3e5812745 in nni_aio_finish_impl /home/lee/workspace/nanomq/nng/src/core/aio.c:454 #9 0x55d3e58127c7 in nni_aio_finish_sync /home/lee/workspace/nanomq/nng/src/core/aio.c:469 #10 0x55d3e585877c in nano_pipe_recv_cb /home/lee/workspace/nanomq/nng/src/sp/protocol/mqtt/nmq_mqtt.c:1087 #11 0x55d3e582f281 in nni_task_exec /home/lee/workspace/nanomq/nng/src/core/taskq.c:144 #12 0x55d3e5812745 in nni_aio_finish_impl /home/lee/workspace/nanomq/nng/src/core/aio.c:454 #13 0x55d3e58127c7 in nni_aio_finish_sync /home/lee/workspace/nanomq/nng/src/core/aio.c:469 #14 0x55d3e5856779 in nano_pipe_start /home/lee/workspace/nanomq/nng/src/sp/protocol/mqtt/nmq_mqtt.c:726 #15 0x55d3e582b362 in nni_listener_add_pipe /home/lee/workspace/nanomq/nng/src/core/socket.c:1604 #16 0x55d3e581bc64 in listener_accept_cb /home/lee/workspace/nanomq/nng/src/core/listener.c:357 #17 0x55d3e582ea89 in nni_taskq_thread /home/lee/workspace/nanomq/nng/src/core/taskq.c:50 #18 0x55d3e582fd7a in nni_thr_wrap /home/lee/workspace/nanomq/nng/src/core/thread.c:94 #19 0x55d3e5838d21 in nni_plat_thr_main /home/lee/workspace/nanomq/nng/src/platform/posix/posix_thread.c:266 #20 0x7f97a40e2b42 in start_thread nptl/pthread_create.c:442 #21 0x7f97a41749ff (/lib/x86_64-linux-gnu/libc.so.6+0x1269ff) 0x60200000c050 is located 0 bytes inside of 3-byte region [0x60200000c050,0x60200000c053) freed by thread T10 here: #0 0x7f97a434e517 in __interceptor_free ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:127 #1 0x55d3e58345f1 in nni_free /home/lee/workspace/nanomq/nng/src/platform/posix/posix_alloc.c:33 #2 0x55d3e5803a4d in nng_free /home/lee/workspace/nanomq/nng/src/nng.c:78 #3 0x55d3e584e1d8 in conn_param_free /home/lee/workspace/nanomq/nng/src/sp/protocol/mqtt/mqtt_parser.c:838 #4 0x55d3e5855015 in nano_pipe_fini /home/lee/workspace/nanomq/nng/src/sp/protocol/mqtt/nmq_mqtt.c:565 #5 0x55d3e5822b40 in pipe_destroy /home/lee/workspace/nanomq/nng/src/core/pipe.c:76 #6 0x55d3e582482f in reap_worker /home/lee/workspace/nanomq/nng/src/core/reap.c:58 #7 0x55d3e582fd7a in nni_thr_wrap /home/lee/workspace/nanomq/nng/src/core/thread.c:94 #8 0x55d3e5838d21 in nni_plat_thr_main /home/lee/workspace/nanomq/nng/src/platform/posix/posix_thread.c:266 #9 0x7f97a40e2b42 in start_thread nptl/pthread_create.c:442 previously allocated by thread T8 here: #0 0x7f97a434e867 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:145 #1 0x55d3e5834597 in nni_alloc /home/lee/workspace/nanomq/nng/src/platform/posix/posix_alloc.c:20 #2 0x55d3e58039e7 in nng_alloc /home/lee/workspace/nanomq/nng/src/nng.c:60 #3 0x55d3e584a20b in copyn_utf8_str /home/lee/workspace/nanomq/nng/src/sp/protocol/mqtt/mqtt_parser.c:222 #4 0x55d3e584c614 in conn_handler /home/lee/workspace/nanomq/nng/src/sp/protocol/mqtt/mqtt_parser.c:611 #5 0x55d3e5b4659e in tcptran_pipe_nego_cb /home/lee/workspace/nanomq/nng/src/sp/transport/mqtt/broker_tcp.c:349 #6 0x55d3e582ea89 in nni_taskq_thread /home/lee/workspace/nanomq/nng/src/core/taskq.c:50 #7 0x55d3e582fd7a in nni_thr_wrap /home/lee/workspace/nanomq/nng/src/core/thread.c:94 #8 0x55d3e5838d21 in nni_plat_thr_main /home/lee/workspace/nanomq/nng/src/platform/posix/posix_thread.c:266 #9 0x7f97a40e2b42 in start_thread nptl/pthread_create.c:442 Thread T8 created by T0 here: #0 0x7f97a42f2685 in __interceptor_pthread_create ../../../../src/libsanitizer/asan/asan_interceptors.cpp:216 #1 0x55d3e5838e51 in nni_plat_thr_init /home/lee/workspace/nanomq/nng/src/platform/posix/posix_thread.c:279 #2 0x55d3e5830026 in nni_thr_init /home/lee/workspace/nanomq/nng/src/core/thread.c:121 #3 0x55d3e582edab in nni_taskq_init /home/lee/workspace/nanomq/nng/src/core/taskq.c:95 #4 0x55d3e582fa44 in nni_taskq_sys_init /home/lee/workspace/nanomq/nng/src/core/taskq.c:294 #5 0x55d3e5819b71 in nni_init_helper /home/lee/workspace/nanomq/nng/src/core/init.c:35 #6 0x55d3e58391f6 in nni_plat_init /home/lee/workspace/nanomq/nng/src/platform/posix/posix_thread.c:422 #7 0x55d3e5819bf2 in nni_init /home/lee/workspace/nanomq/nng/src/core/init.c:58 #8 0x55d3e5873522 in nng_mtx_alloc /home/lee/workspace/nanomq/nng/src/supplemental/util/platform.c:93 #9 0x55d3e57e46d1 in nano_hashmap_create /home/lee/workspace/nanomq/nanomq/hashmap.c:93 #10 0x55d3e57ff8b9 in broker /home/lee/workspace/nanomq/nanomq/apps/broker.c:908 #11 0x55d3e58031f9 in broker_start /home/lee/workspace/nanomq/nanomq/apps/broker.c:1553 #12 0x55d3e57dcd0f in main /home/lee/workspace/nanomq/nanomq/nanomq.c:139 #13 0x7f97a4077d8f in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58 Thread T10 created by T0 here: #0 0x7f97a42f2685 in __interceptor_pthread_create ../../../../src/libsanitizer/asan/asan_interceptors.cpp:216 #1 0x55d3e5838e51 in nni_plat_thr_init /home/lee/workspace/nanomq/nng/src/platform/posix/posix_thread.c:279 #2 0x55d3e5830026 in nni_thr_init /home/lee/workspace/nanomq/nng/src/core/thread.c:121 #3 0x55d3e5824ab0 in nni_reap_sys_init /home/lee/workspace/nanomq/nng/src/core/reap.c:110 #4 0x55d3e5819b7f in nni_init_helper /home/lee/workspace/nanomq/nng/src/core/init.c:36 #5 0x55d3e58391f6 in nni_plat_init /home/lee/workspace/nanomq/nng/src/platform/posix/posix_thread.c:422 #6 0x55d3e5819bf2 in nni_init /home/lee/workspace/nanomq/nng/src/core/init.c:58 #7 0x55d3e5873522 in nng_mtx_alloc /home/lee/workspace/nanomq/nng/src/supplemental/util/platform.c:93 #8 0x55d3e57e46d1 in nano_hashmap_create /home/lee/workspace/nanomq/nanomq/hashmap.c:93 #9 0x55d3e57ff8b9 in broker /home/lee/workspace/nanomq/nanomq/apps/broker.c:908 #10 0x55d3e58031f9 in broker_start /home/lee/workspace/nanomq/nanomq/apps/broker.c:1553 #11 0x55d3e57dcd0f in main /home/lee/workspace/nanomq/nanomq/nanomq.c:139 #12 0x7f97a4077d8f in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58 SUMMARY: AddressSanitizer: heap-use-after-free ../../../../src/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:860 in MemcmpInterceptorCommon(void*, int (*)(void const*, void const*, unsigned long), void const*, void const*, unsigned long) Shadow bytes around the buggy address: 0x0c047fff97b0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c047fff97c0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c047fff97d0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c047fff97e0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c047fff97f0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa =>0x0c047fff9800: fa fa fd fd fa fa fd fa fa fa[fd]fa fa fa 00 fa 0x0c047fff9810: fa fa 00 fa fa fa 00 fa fa fa fd fa fa fa fd fa 0x0c047fff9820: fa fa fd fd fa fa fd fd fa fa 05 fa fa fa 03 fa 0x0c047fff9830: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c047fff9840: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c047fff9850: 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 ==4097513==ABORTING  ~/workspace/nanomq/build/ [master*] ninja [3/3] Linking C executable nanomq/nanomq  ~/workspace/nanomq/build/ [master*] ./nanomq/nanomq start --conf ../etc/nanomq.conf set client_id id -> pipe_id 563881600 set client_id id -> pipe_id 563881600 set client_id id -> pipe_id 563881600 ================================================================= ==4097693==ERROR: AddressSanitizer: heap-use-after-free on address 0x60200000d050 at pc 0x7f47e7adb638 bp 0x7f47e00f65c0 sp 0x7f47e00f5d68 READ of size 2 at 0x60200000d050 thread T9 #0 0x7f47e7adb637 in MemcmpInterceptorCommon(void*, int (*)(void const*, void const*, unsigned long), void const*, void const*, unsigned long) ../../../../src/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:860 #1 0x7f47e7adbba6 in __interceptor_memcmp ../../../../src/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:892 #2 0x7f47e7adbba6 in __interceptor_memcmp ../../../../src/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:887 #3 0x5587c8f4c507 in hashmap_match_helper /home/lee/workspace/nanomq/nanomq/hashmap.c:366 #4 0x5587c8f4bf79 in hashmap_remove /home/lee/workspace/nanomq/nanomq/hashmap.c:213 #5 0x5587c8f4b7c9 in nano_hashmap_remove /home/lee/workspace/nanomq/nanomq/hashmap.c:122 #6 0x5587c8f637fa in server_cb /home/lee/workspace/nanomq/nanomq/apps/broker.c:423 #7 0x5587c8f96281 in nni_task_exec /home/lee/workspace/nanomq/nng/src/core/taskq.c:144 #8 0x5587c8f79745 in nni_aio_finish_impl /home/lee/workspace/nanomq/nng/src/core/aio.c:454 #9 0x5587c8f797c7 in nni_aio_finish_sync /home/lee/workspace/nanomq/nng/src/core/aio.c:469 #10 0x5587c8fbf77c in nano_pipe_recv_cb /home/lee/workspace/nanomq/nng/src/sp/protocol/mqtt/nmq_mqtt.c:1087 #11 0x5587c8f96281 in nni_task_exec /home/lee/workspace/nanomq/nng/src/core/taskq.c:144 #12 0x5587c8f79745 in nni_aio_finish_impl /home/lee/workspace/nanomq/nng/src/core/aio.c:454 #13 0x5587c8f797c7 in nni_aio_finish_sync /home/lee/workspace/nanomq/nng/src/core/aio.c:469 #14 0x5587c8fbd779 in nano_pipe_start /home/lee/workspace/nanomq/nng/src/sp/protocol/mqtt/nmq_mqtt.c:726 #15 0x5587c8f92362 in nni_listener_add_pipe /home/lee/workspace/nanomq/nng/src/core/socket.c:1604 #16 0x5587c8f82c64 in listener_accept_cb /home/lee/workspace/nanomq/nng/src/core/listener.c:357 #17 0x5587c8f95a89 in nni_taskq_thread /home/lee/workspace/nanomq/nng/src/core/taskq.c:50 #18 0x5587c8f96d7a in nni_thr_wrap /home/lee/workspace/nanomq/nng/src/core/thread.c:94 #19 0x5587c8f9fd21 in nni_plat_thr_main /home/lee/workspace/nanomq/nng/src/platform/posix/posix_thread.c:266 #20 0x7f47e788fb42 in start_thread nptl/pthread_create.c:442 #21 0x7f47e79219ff (/lib/x86_64-linux-gnu/libc.so.6+0x1269ff) 0x60200000d050 is located 0 bytes inside of 3-byte region [0x60200000d050,0x60200000d053) freed by thread T10 here: #0 0x7f47e7afb517 in __interceptor_free ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:127 #1 0x5587c8f9b5f1 in nni_free /home/lee/workspace/nanomq/nng/src/platform/posix/posix_alloc.c:33 #2 0x5587c8f6aa4d in nng_free /home/lee/workspace/nanomq/nng/src/nng.c:78 #3 0x5587c8fb51d8 in conn_param_free /home/lee/workspace/nanomq/nng/src/sp/protocol/mqtt/mqtt_parser.c:838 #4 0x5587c8fbc015 in nano_pipe_fini /home/lee/workspace/nanomq/nng/src/sp/protocol/mqtt/nmq_mqtt.c:565 #5 0x5587c8f89b40 in pipe_destroy /home/lee/workspace/nanomq/nng/src/core/pipe.c:76 #6 0x5587c8f8b82f in reap_worker /home/lee/workspace/nanomq/nng/src/core/reap.c:58 #7 0x5587c8f96d7a in nni_thr_wrap /home/lee/workspace/nanomq/nng/src/core/thread.c:94 #8 0x5587c8f9fd21 in nni_plat_thr_main /home/lee/workspace/nanomq/nng/src/platform/posix/posix_thread.c:266 #9 0x7f47e788fb42 in start_thread nptl/pthread_create.c:442 previously allocated by thread T6 here: #0 0x7f47e7afb867 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:145 #1 0x5587c8f9b597 in nni_alloc /home/lee/workspace/nanomq/nng/src/platform/posix/posix_alloc.c:20 #2 0x5587c8f6a9e7 in nng_alloc /home/lee/workspace/nanomq/nng/src/nng.c:60 #3 0x5587c8fb120b in copyn_utf8_str /home/lee/workspace/nanomq/nng/src/sp/protocol/mqtt/mqtt_parser.c:222 #4 0x5587c8fb3614 in conn_handler /home/lee/workspace/nanomq/nng/src/sp/protocol/mqtt/mqtt_parser.c:611 #5 0x5587c92ad59e in tcptran_pipe_nego_cb /home/lee/workspace/nanomq/nng/src/sp/transport/mqtt/broker_tcp.c:349 #6 0x5587c8f95a89 in nni_taskq_thread /home/lee/workspace/nanomq/nng/src/core/taskq.c:50 #7 0x5587c8f96d7a in nni_thr_wrap /home/lee/workspace/nanomq/nng/src/core/thread.c:94 #8 0x5587c8f9fd21 in nni_plat_thr_main /home/lee/workspace/nanomq/nng/src/platform/posix/posix_thread.c:266 #9 0x7f47e788fb42 in start_thread nptl/pthread_create.c:442 Thread T9 created by T0 here: #0 0x7f47e7a9f685 in __interceptor_pthread_create ../../../../src/libsanitizer/asan/asan_interceptors.cpp:216 #1 0x5587c8f9fe51 in nni_plat_thr_init /home/lee/workspace/nanomq/nng/src/platform/posix/posix_thread.c:279 #2 0x5587c8f97026 in nni_thr_init /home/lee/workspace/nanomq/nng/src/core/thread.c:121 #3 0x5587c8f95dab in nni_taskq_init /home/lee/workspace/nanomq/nng/src/core/taskq.c:95 #4 0x5587c8f96a44 in nni_taskq_sys_init /home/lee/workspace/nanomq/nng/src/core/taskq.c:294 #5 0x5587c8f80b71 in nni_init_helper /home/lee/workspace/nanomq/nng/src/core/init.c:35 #6 0x5587c8fa01f6 in nni_plat_init /home/lee/workspace/nanomq/nng/src/platform/posix/posix_thread.c:422 #7 0x5587c8f80bf2 in nni_init /home/lee/workspace/nanomq/nng/src/core/init.c:58 #8 0x5587c8fda522 in nng_mtx_alloc /home/lee/workspace/nanomq/nng/src/supplemental/util/platform.c:93 #9 0x5587c8f4b6d1 in nano_hashmap_create /home/lee/workspace/nanomq/nanomq/hashmap.c:93 #10 0x5587c8f668b9 in broker /home/lee/workspace/nanomq/nanomq/apps/broker.c:908 #11 0x5587c8f6a1f9 in broker_start /home/lee/workspace/nanomq/nanomq/apps/broker.c:1553 #12 0x5587c8f43d0f in main /home/lee/workspace/nanomq/nanomq/nanomq.c:139 #13 0x7f47e7824d8f in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58 Thread T10 created by T0 here: #0 0x7f47e7a9f685 in __interceptor_pthread_create ../../../../src/libsanitizer/asan/asan_interceptors.cpp:216 #1 0x5587c8f9fe51 in nni_plat_thr_init /home/lee/workspace/nanomq/nng/src/platform/posix/posix_thread.c:279 #2 0x5587c8f97026 in nni_thr_init /home/lee/workspace/nanomq/nng/src/core/thread.c:121 #3 0x5587c8f8bab0 in nni_reap_sys_init /home/lee/workspace/nanomq/nng/src/core/reap.c:110 #4 0x5587c8f80b7f in nni_init_helper /home/lee/workspace/nanomq/nng/src/core/init.c:36 #5 0x5587c8fa01f6 in nni_plat_init /home/lee/workspace/nanomq/nng/src/platform/posix/posix_thread.c:422 #6 0x5587c8f80bf2 in nni_init /home/lee/workspace/nanomq/nng/src/core/init.c:58 #7 0x5587c8fda522 in nng_mtx_alloc /home/lee/workspace/nanomq/nng/src/supplemental/util/platform.c:93 #8 0x5587c8f4b6d1 in nano_hashmap_create /home/lee/workspace/nanomq/nanomq/hashmap.c:93 #9 0x5587c8f668b9 in broker /home/lee/workspace/nanomq/nanomq/apps/broker.c:908 #10 0x5587c8f6a1f9 in broker_start /home/lee/workspace/nanomq/nanomq/apps/broker.c:1553 #11 0x5587c8f43d0f in main /home/lee/workspace/nanomq/nanomq/nanomq.c:139 #12 0x7f47e7824d8f in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58 Thread T6 created by T0 here: #0 0x7f47e7a9f685 in __interceptor_pthread_create ../../../../src/libsanitizer/asan/asan_interceptors.cpp:216 #1 0x5587c8f9fe51 in nni_plat_thr_init /home/lee/workspace/nanomq/nng/src/platform/posix/posix_thread.c:279 #2 0x5587c8f97026 in nni_thr_init /home/lee/workspace/nanomq/nng/src/core/thread.c:121 #3 0x5587c8f95dab in nni_taskq_init /home/lee/workspace/nanomq/nng/src/core/taskq.c:95 #4 0x5587c8f96a44 in nni_taskq_sys_init /home/lee/workspace/nanomq/nng/src/core/taskq.c:294 #5 0x5587c8f80b71 in nni_init_helper /home/lee/workspace/nanomq/nng/src/core/init.c:35 #6 0x5587c8fa01f6 in nni_plat_init /home/lee/workspace/nanomq/nng/src/platform/posix/posix_thread.c:422 #7 0x5587c8f80bf2 in nni_init /home/lee/workspace/nanomq/nng/src/core/init.c:58 #8 0x5587c8fda522 in nng_mtx_alloc /home/lee/workspace/nanomq/nng/src/supplemental/util/platform.c:93 #9 0x5587c8f4b6d1 in nano_hashmap_create /home/lee/workspace/nanomq/nanomq/hashmap.c:93 #10 0x5587c8f668b9 in broker /home/lee/workspace/nanomq/nanomq/apps/broker.c:908 #11 0x5587c8f6a1f9 in broker_start /home/lee/workspace/nanomq/nanomq/apps/broker.c:1553 #12 0x5587c8f43d0f in main /home/lee/workspace/nanomq/nanomq/nanomq.c:139 #13 0x7f47e7824d8f in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58 SUMMARY: AddressSanitizer: heap-use-after-free ../../../../src/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:860 in MemcmpInterceptorCommon(void*, int (*)(void const*, void const*, unsigned long), void const*, void const*, unsigned long) Shadow bytes around the buggy address: 0x0c047fff99b0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c047fff99c0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c047fff99d0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c047fff99e0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c047fff99f0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa =>0x0c047fff9a00: fa fa fd fd fa fa fd fa fa fa[fd]fa fa fa fd fa 0x0c047fff9a10: fa fa fd fa fa fa fd fd fa fa fa fa fa fa fa fa 0x0c047fff9a20: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c047fff9a30: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c047fff9a40: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c047fff9a50: 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 ==4097693==ABORTING ```
Persist session sub lead to error 'heap used after free'.
https://api.github.com/repos/nanomq/nanomq/issues/764/comments
1
2022-07-29T07:50:25Z
2022-12-01T03:49:42Z
https://github.com/nanomq/nanomq/issues/764
1,321,888,327
764
[ "emqx", "nanomq" ]
https://github.com/emqx/nanomq/issues/755#issuecomment-1197865799 there is no updated docket since 0.8.5
Docker tag is missing since 0.9.0
https://api.github.com/repos/nanomq/nanomq/issues/761/comments
0
2022-07-28T12:47:30Z
2022-08-04T09:41:44Z
https://github.com/nanomq/nanomq/issues/761
1,320,880,963
761
[ "emqx", "nanomq" ]
**Is your feature request related to a problem? Please describe.** The environment variable NANOMQ_WEBSOCKET_URL is listed in the README, but it is quite unclear how to actually use it. **Describe the solution you'd like** I'd like to be able to specify the "path" part of the URL only, e.g. `/ws` instead of the default `/mqtt` without also having to specify the protocol, host and port for both WS and WSS which I do not intend to change anyway, or should be set elsewhere. **Additional context** The README lists the "value" (?) for NANOMQ_WEBSOCKET_URL as: > 'nmq-ws://host:port/path', 'nmq-wss://host:port/path' It's not entirely clear what this means. Do you need to specify a single string (assuming you're using either WS or WSS, not both)? Do you have to specify the protocol, host and port, as well as the path? Or can you simply set the path part and allow the rest to be configured normally?
How to configure NANOMQ_WEBSOCKET_URL properly?
https://api.github.com/repos/nanomq/nanomq/issues/755/comments
5
2022-07-26T11:11:15Z
2022-07-28T12:50:38Z
https://github.com/nanomq/nanomq/issues/755
1,318,083,804
755
[ "emqx", "nanomq" ]
Run ``` dpkg -i nanomq-0.9.2-linux-amd64-sqlite.deb ``` Does't get nanomq exec file.
Install nanomq-0.9.2-linux-amd64-sqlite.deb package failed.
https://api.github.com/repos/nanomq/nanomq/issues/742/comments
0
2022-07-19T06:27:44Z
2022-07-19T07:06:53Z
https://github.com/nanomq/nanomq/issues/742
1,309,043,060
742
[ "emqx", "nanomq" ]
Storing sessions, subscriptions and persisting messages to one of these databases (CassandraDB, ScyllaDB, MongoDB) will make things much easier and better since NoSQL databases are known for their performance and horizontal scalability. Also it's one of the best features in emqx enterprise, we would love to have such a feature in NanoMQ.
Store sessions, subscriptions, topics and persisting messages in CassandraDB, ScyllaDB, MongoDB and MySQL
https://api.github.com/repos/nanomq/nanomq/issues/739/comments
5
2022-07-16T02:24:50Z
2022-11-10T15:25:44Z
https://github.com/nanomq/nanomq/issues/739
1,306,680,245
739
[ "emqx", "nanomq" ]
I've been using Nanomq for a while, it's one of the best mqtt brokers I've used however the lack of publishing messages from the HTTP api is really frustrating. I need to publish mqtt messages from my backend to the client after a specific job is done and this requires publishing messages from the HTTP API, Currently am using the open source version of emqx, it allows publishing messages from the HTTP API, I would love to have this feature in NanoMQ, since its fully open source, unlike emqx some features require the enterprise version.
Publishing messages from the HTTP API
https://api.github.com/repos/nanomq/nanomq/issues/738/comments
2
2022-07-16T02:08:29Z
2022-07-17T17:23:47Z
https://github.com/nanomq/nanomq/issues/738
1,306,675,880
738
[ "emqx", "nanomq" ]
Version: 0.9.2 **Describe the bug** conn_param of bridge/http/webhook client is misuesd
conn_param of bridge client & HTTP is misuesd
https://api.github.com/repos/nanomq/nanomq/issues/736/comments
1
2022-07-14T12:58:53Z
2022-07-15T07:01:28Z
https://github.com/nanomq/nanomq/issues/736
1,304,752,032
736
[ "emqx", "nanomq" ]
规则引擎什么时候支持更多action? 现在只有webhook. 似乎没有 republish webhook的规则也很简单 希望能支持 republish,和shell/bash(就是本地命令行)
规则引擎的问题
https://api.github.com/repos/nanomq/nanomq/issues/728/comments
8
2022-07-08T11:24:47Z
2022-09-15T06:52:23Z
https://github.com/nanomq/nanomq/issues/728
1,298,888,039
728
[ "emqx", "nanomq" ]
this is only exsits in the most updated master branch caused by #714 (merge nanolib with nanonng)
Memleak in work ctx allocation
https://api.github.com/repos/nanomq/nanomq/issues/726/comments
1
2022-07-08T07:26:38Z
2022-07-11T08:30:42Z
https://github.com/nanomq/nanomq/issues/726
1,298,607,385
726
[ "emqx", "nanomq" ]
==1328171==ERROR: LeakSanitizer: detected memory leaks Direct leak of 256 byte(s) in 4 object(s) allocated from: #0 0x7f63fcda7a37 in __interceptor_calloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:154 #1 0x562042179025 in nni_zalloc ../nng/src/platform/posix/posix_alloc.c:26 #2 0x562042149d1c in nng_zalloc ../nng/src/nng.c:66 #3 0x5620421c7f02 in property_alloc ../nng/src/supplemental/mqtt/mqtt_codec.c:2001 #4 0x5620421c9d50 in decode_buf_properties ../nng/src/supplemental/mqtt/mqtt_codec.c:2424 #5 0x5620421ca038 in decode_properties ../nng/src/supplemental/mqtt/mqtt_codec.c:2447 #6 0x56204211b7d9 in decode_sub_msg ../nanomq/sub_handler.c:49 #7 0x562042132458 in server_cb ../nanomq/apps/broker.c:263 #8 0x5620421740ee in nni_task_exec ../nng/src/core/taskq.c:144 #9 0x5620421586b1 in nni_aio_finish_impl ../nng/src/core/aio.c:454 #10 0x562042158733 in nni_aio_finish_sync ../nng/src/core/aio.c:469 #11 0x5620421a1900 in nano_pipe_recv_cb ../nng/src/sp/protocol/mqtt/nmq_mqtt.c:1149 #12 0x5620421740ee in nni_task_exec ../nng/src/core/taskq.c:144 #13 0x5620421586b1 in nni_aio_finish_impl ../nng/src/core/aio.c:454 #14 0x562042158733 in nni_aio_finish_sync ../nng/src/core/aio.c:469 #15 0x56204220a822 in tcptran_pipe_recv_cb ../nng/src/sp/transport/mqtt/broker_tcp.c:777 #16 0x5620421738f9 in nni_taskq_thread ../nng/src/core/taskq.c:50 #17 0x562042174bdb in nni_thr_wrap ../nng/src/core/thread.c:94 #18 0x56204217d5ac in nni_plat_thr_main ../nng/src/platform/posix/posix_thread.c:266 #19 0x7f63fcb3b946 in start_thread nptl/pthread_create.c:435 Direct leak of 32 byte(s) in 4 object(s) allocated from: #0 0x7f63fcda7867 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:145 #1 0x562042178ff4 in nni_alloc ../nng/src/platform/posix/posix_alloc.c:20 #2 0x562042149cfe in nng_alloc ../nng/src/nng.c:60 #3 0x5620421bc631 in nng_atomic_alloc64 ../nng/src/supplemental/util/platform.c:219 #4 0x56204211cac6 in sub_ctx_handle ../nanomq/sub_handler.c:252 #5 0x562042132476 in server_cb ../nanomq/apps/broker.c:264 #6 0x5620421740ee in nni_task_exec ../nng/src/core/taskq.c:144 #7 0x5620421586b1 in nni_aio_finish_impl ../nng/src/core/aio.c:454 #8 0x562042158733 in nni_aio_finish_sync ../nng/src/core/aio.c:469 #9 0x5620421a1900 in nano_pipe_recv_cb ../nng/src/sp/protocol/mqtt/nmq_mqtt.c:1149 #10 0x5620421740ee in nni_task_exec ../nng/src/core/taskq.c:144 #11 0x5620421586b1 in nni_aio_finish_impl ../nng/src/core/aio.c:454 #12 0x562042158733 in nni_aio_finish_sync ../nng/src/core/aio.c:469 #13 0x56204220a822 in tcptran_pipe_recv_cb ../nng/src/sp/transport/mqtt/broker_tcp.c:777 #14 0x5620421738f9 in nni_taskq_thread ../nng/src/core/taskq.c:50 #15 0x562042174bdb in nni_thr_wrap ../nng/src/core/thread.c:94 #16 0x56204217d5ac in nni_plat_thr_main ../nng/src/platform/posix/posix_thread.c:266 #17 0x7f63fcb3b946 in start_thread nptl/pthread_create.c:435 Indirect leak of 256 byte(s) in 4 object(s) allocated from: #0 0x7f63fcda7a37 in __interceptor_calloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:154 #1 0x562042179025 in nni_zalloc ../nng/src/platform/posix/posix_alloc.c:26 #2 0x562042149d1c in nng_zalloc ../nng/src/nng.c:66 #3 0x5620421c7f02 in property_alloc ../nng/src/supplemental/mqtt/mqtt_codec.c:2001 #4 0x5620421c88d8 in property_parse ../nng/src/supplemental/mqtt/mqtt_codec.c:2157 #5 0x5620421c9e16 in decode_buf_properties ../nng/src/supplemental/mqtt/mqtt_codec.c:2431 #6 0x5620421ca038 in decode_properties ../nng/src/supplemental/mqtt/mqtt_codec.c:2447 #7 0x56204211b7d9 in decode_sub_msg ../nanomq/sub_handler.c:49 #8 0x562042132458 in server_cb ../nanomq/apps/broker.c:263 #9 0x5620421740ee in nni_task_exec ../nng/src/core/taskq.c:144 #10 0x5620421586b1 in nni_aio_finish_impl ../nng/src/core/aio.c:454 #11 0x562042158733 in nni_aio_finish_sync ../nng/src/core/aio.c:469 #12 0x5620421a1900 in nano_pipe_recv_cb ../nng/src/sp/protocol/mqtt/nmq_mqtt.c:1149 #13 0x5620421740ee in nni_task_exec ../nng/src/core/taskq.c:144 #14 0x5620421586b1 in nni_aio_finish_impl ../nng/src/core/aio.c:454 #15 0x562042158733 in nni_aio_finish_sync ../nng/src/core/aio.c:469 #16 0x56204220a822 in tcptran_pipe_recv_cb ../nng/src/sp/transport/mqtt/broker_tcp.c:777 #17 0x5620421738f9 in nni_taskq_thread ../nng/src/core/taskq.c:50 #18 0x562042174bdb in nni_thr_wrap ../nng/src/core/thread.c:94 #19 0x56204217d5ac in nni_plat_thr_main ../nng/src/platform/posix/posix_thread.c:266 #20 0x7f63fcb3b946 in start_thread nptl/pthread_create.c:435 SUMMARY: AddressSanitizer: 544 byte(s) leaked in 12 allocation(s).
memleak in sub property
https://api.github.com/repos/nanomq/nanomq/issues/713/comments
1
2022-07-01T08:48:06Z
2022-07-01T08:50:37Z
https://github.com/nanomq/nanomq/issues/713
1,291,110,497
713
[ "emqx", "nanomq" ]
**Describe the bug** The url specified by cmd is covered by config file. I specified a URL and a conf in the command. But nanomq uses the URL in config file instead of the URL in the command **Expected behavior** The URL specified in the command has a higher priority **Actual Behavior** - **To Reproduce** ./build/nanomq/nanomq broker start --conf ./etc/nanomq.conf --url "nmq-tcp://127.0.0.1:1886" ** Environment Details ** - NanoMQ version Latest master branch - Operating system and version ubuntu - Compiler and language used c - testing scenario . **Client SDK** . **Additional context** .
The url specified by command is covered by config file
https://api.github.com/repos/nanomq/nanomq/issues/711/comments
0
2022-07-01T07:47:17Z
2022-07-01T10:44:15Z
https://github.com/nanomq/nanomq/issues/711
1,291,043,307
711
[ "emqx", "nanomq" ]
client func exit abnormally when SQLite is enabled
0.8.5 SQLite breaks nanomq client cli usage
https://api.github.com/repos/nanomq/nanomq/issues/707/comments
0
2022-06-30T10:55:33Z
2022-07-01T08:51:07Z
https://github.com/nanomq/nanomq/issues/707
1,289,958,395
707
[ "emqx", "nanomq" ]
Make mqtt.db in nanolib a lock-free module, this is essential for fixing data racing problem which is bothering us for a long time.
Make mqtt.db (topic trie) lock-free
https://api.github.com/repos/nanomq/nanomq/issues/703/comments
0
2022-06-29T14:26:31Z
2022-07-01T10:44:22Z
https://github.com/nanomq/nanomq/issues/703
1,288,813,424
703
[ "emqx", "nanomq" ]
Enable SQLite in nanomq.conf, then pressure broker with certain amount of QoS 1/2 messages, for a certain period then broker cannot accept new connections. This is probably due to I/O latency caused by SQLite. Will investigate it first. Suggest user do not enable QoS message caching now, only use another SQLite option in nanomq_bridge.conf, which caches data when bridge connection offline, this is most commonly used feature.
Enable QoS msg caching with SQLite cause service halting
https://api.github.com/repos/nanomq/nanomq/issues/702/comments
1
2022-06-29T14:24:41Z
2022-12-01T03:49:22Z
https://github.com/nanomq/nanomq/issues/702
1,288,810,829
702
[ "emqx", "nanomq" ]
broker exits when client unsub one topic. After investigation, the properties ptr in unsub_packet has gone wild.
UNSUN is not working well
https://api.github.com/repos/nanomq/nanomq/issues/699/comments
1
2022-06-28T09:43:43Z
2022-06-28T09:55:54Z
https://github.com/nanomq/nanomq/issues/699
1,287,079,481
699
[ "emqx", "nanomq" ]
null
Rule engine insert sqlite failed.
https://api.github.com/repos/nanomq/nanomq/issues/691/comments
0
2022-06-27T04:34:13Z
2022-06-27T07:56:32Z
https://github.com/nanomq/nanomq/issues/691
1,285,224,849
691
[ "emqx", "nanomq" ]
V0.8.0 Retain msg got double freed.
Broker exits when receive retain msg twice
https://api.github.com/repos/nanomq/nanomq/issues/689/comments
0
2022-06-26T02:49:40Z
2022-06-26T02:53:13Z
https://github.com/nanomq/nanomq/issues/689
1,284,780,922
689
[ "emqx", "nanomq" ]
We need to support multi-targets for MQTT bridging, this is a common request among community.
Multi-channel MQTT bridging
https://api.github.com/repos/nanomq/nanomq/issues/681/comments
0
2022-06-23T07:44:47Z
2022-07-01T09:22:32Z
https://github.com/nanomq/nanomq/issues/681
1,281,962,994
681
[ "emqx", "nanomq" ]
null
Send quota is not working in MQTT over Websocket
https://api.github.com/repos/nanomq/nanomq/issues/668/comments
0
2022-06-18T06:24:06Z
2022-06-18T06:54:21Z
https://github.com/nanomq/nanomq/issues/668
1,275,679,968
668
[ "emqx", "nanomq" ]
Ver 0.8.0 log: ================================================================= ==418945==ERROR: AddressSanitizer: heap-use-after-free on address 0x602000001210 at pc 0x7f1f81a5c6f2 bp 0x7f1f776f1520 sp 0x7f1f776f0cc8 READ of size 1 at 0x602000001210 thread T14 #0 0x7f1f81a5c6f1 in __interceptor_strcmp ../../../../src/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:467 #1 0x557ca045b196 in destroy_sub_client ../nanomq/sub_handler.c:599 #2 0x557ca0454a0c in foreach_client ../nanomq/pub_handler.c:164 #3 0x557ca0455012 in handle_pub ../nanomq/pub_handler.c:594 #4 0x557ca046f78c in server_cb ../nanomq/apps/broker.c:311 #5 0x557ca04b1e8a in nni_task_exec ../nng/src/core/taskq.c:144 #6 0x557ca0496604 in nni_aio_finish_impl ../nng/src/core/aio.c:454 #7 0x557ca0496686 in nni_aio_finish_sync ../nng/src/core/aio.c:469 #8 0x557ca04dea45 in nano_pipe_recv_cb ../nng/src/sp/protocol/mqtt/nmq_mqtt.c:1098 #9 0x557ca04b1e8a in nni_task_exec ../nng/src/core/taskq.c:144 #10 0x557ca0496604 in nni_aio_finish_impl ../nng/src/core/aio.c:454 #11 0x557ca0496686 in nni_aio_finish_sync ../nng/src/core/aio.c:469 #12 0x557ca05479cf in tcptran_pipe_recv_cb ../nng/src/sp/transport/mqtt/broker_tcp.c:781 #13 0x557ca04b1695 in nni_taskq_thread ../nng/src/core/taskq.c:50 #14 0x557ca04b2977 in nni_thr_wrap ../nng/src/core/thread.c:94 #15 0x557ca04bb348 in nni_plat_thr_main ../nng/src/platform/posix/posix_thread.c:266 #16 0x7f1f81812946 in start_thread nptl/pthread_create.c:435 #17 0x7f1f818a2a43 in __clone (/lib/x86_64-linux-gnu/libc.so.6+0x124a43) 0x602000001210 is located 0 bytes inside of 4-byte region [0x602000001210,0x602000001214) freed by thread T14 here: #0 0x7f1f81a7e517 in __interceptor_free ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:127 #1 0x557ca04b6dea in nni_free ../nng/src/platform/posix/posix_alloc.c:33 #2 0x557ca0486e8b in nng_free ../nng/src/nng.c:77 #3 0x557ca045aac3 in del_sub_ctx ../nanomq/sub_handler.c:494 #4 0x557ca045b11d in destroy_sub_client ../nanomq/sub_handler.c:597 #5 0x557ca0454a0c in foreach_client ../nanomq/pub_handler.c:164 #6 0x557ca0455012 in handle_pub ../nanomq/pub_handler.c:594 #7 0x557ca046f78c in server_cb ../nanomq/apps/broker.c:311 #8 0x557ca04b1e8a in nni_task_exec ../nng/src/core/taskq.c:144 #9 0x557ca0496604 in nni_aio_finish_impl ../nng/src/core/aio.c:454 #10 0x557ca0496686 in nni_aio_finish_sync ../nng/src/core/aio.c:469 #11 0x557ca04dea45 in nano_pipe_recv_cb ../nng/src/sp/protocol/mqtt/nmq_mqtt.c:1098 #12 0x557ca04b1e8a in nni_task_exec ../nng/src/core/taskq.c:144 #13 0x557ca0496604 in nni_aio_finish_impl ../nng/src/core/aio.c:454 #14 0x557ca0496686 in nni_aio_finish_sync ../nng/src/core/aio.c:469 #15 0x557ca05479cf in tcptran_pipe_recv_cb ../nng/src/sp/transport/mqtt/broker_tcp.c:781 #16 0x557ca04b1695 in nni_taskq_thread ../nng/src/core/taskq.c:50 #17 0x557ca04b2977 in nni_thr_wrap ../nng/src/core/thread.c:94 #18 0x557ca04bb348 in nni_plat_thr_main ../nng/src/platform/posix/posix_thread.c:266 #19 0x7f1f81812946 in start_thread nptl/pthread_create.c:435 previously allocated by thread T10 here: #0 0x7f1f81a7ea37 in __interceptor_calloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:154 #1 0x557ca04b6dc1 in nni_zalloc ../nng/src/platform/posix/posix_alloc.c:26 #2 0x557ca0486e43 in nng_zalloc ../nng/src/nng.c:66 #3 0x557ca045a4a6 in cli_ctx_merge ../nanomq/sub_handler.c:428 #4 0x557ca04591b9 in sub_ctx_handle ../nanomq/sub_handler.c:304 #5 0x557ca046e9c5 in server_cb ../nanomq/apps/broker.c:222 #6 0x557ca04b1e8a in nni_task_exec ../nng/src/core/taskq.c:144 #7 0x557ca0496604 in nni_aio_finish_impl ../nng/src/core/aio.c:454 #8 0x557ca0496686 in nni_aio_finish_sync ../nng/src/core/aio.c:469 #9 0x557ca04dea45 in nano_pipe_recv_cb ../nng/src/sp/protocol/mqtt/nmq_mqtt.c:1098 #10 0x557ca04b1e8a in nni_task_exec ../nng/src/core/taskq.c:144 #11 0x557ca0496604 in nni_aio_finish_impl ../nng/src/core/aio.c:454 #12 0x557ca0496686 in nni_aio_finish_sync ../nng/src/core/aio.c:469 #13 0x557ca05479cf in tcptran_pipe_recv_cb ../nng/src/sp/transport/mqtt/broker_tcp.c:781 #14 0x557ca04b1695 in nni_taskq_thread ../nng/src/core/taskq.c:50 #15 0x557ca04b2977 in nni_thr_wrap ../nng/src/core/thread.c:94 #16 0x557ca04bb348 in nni_plat_thr_main ../nng/src/platform/posix/posix_thread.c:266 #17 0x7f1f81812946 in start_thread nptl/pthread_create.c:435 Thread T14 created by T0 here: #0 0x7f1f81a22685 in __interceptor_pthread_create ../../../../src/libsanitizer/asan/asan_interceptors.cpp:216 #1 0x557ca04bb478 in nni_plat_thr_init ../nng/src/platform/posix/posix_thread.c:279 #2 0x557ca04b2c20 in nni_thr_init ../nng/src/core/thread.c:121 #3 0x557ca04b19b4 in nni_taskq_init ../nng/src/core/taskq.c:95 #4 0x557ca04b2647 in nni_taskq_sys_init ../nng/src/core/taskq.c:294 #5 0x557ca049d946 in nni_init_helper ../nng/src/core/init.c:35 #6 0x557ca04bb7cc in nni_plat_init ../nng/src/platform/posix/posix_thread.c:422 #7 0x557ca049d9c4 in nni_init ../nng/src/core/init.c:58 #8 0x557ca04e2bcf in nni_proto_mqtt_open ../nng/src/sp/protocol.c:37 #9 0x557ca04df1c1 in nng_nmq_tcp0_open ../nng/src/sp/protocol/mqtt/nmq_mqtt.c:1257 #10 0x557ca04737e3 in broker ../nanomq/apps/broker.c:773 #11 0x557ca04763ec in broker_start ../nanomq/apps/broker.c:1261 #12 0x557ca0452918 in main ../nanomq/nanomq.c:222 #13 0x7f1f817a7fcf in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58 Thread T10 created by T0 here: #0 0x7f1f81a22685 in __interceptor_pthread_create ../../../../src/libsanitizer/asan/asan_interceptors.cpp:216 #1 0x557ca04bb478 in nni_plat_thr_init ../nng/src/platform/posix/posix_thread.c:279 #2 0x557ca04b2c20 in nni_thr_init ../nng/src/core/thread.c:121 #3 0x557ca04b19b4 in nni_taskq_init ../nng/src/core/taskq.c:95 #4 0x557ca04b2647 in nni_taskq_sys_init ../nng/src/core/taskq.c:294 #5 0x557ca049d946 in nni_init_helper ../nng/src/core/init.c:35 #6 0x557ca04bb7cc in nni_plat_init ../nng/src/platform/posix/posix_thread.c:422 #7 0x557ca049d9c4 in nni_init ../nng/src/core/init.c:58 #8 0x557ca04e2bcf in nni_proto_mqtt_open ../nng/src/sp/protocol.c:37 #9 0x557ca04df1c1 in nng_nmq_tcp0_open ../nng/src/sp/protocol/mqtt/nmq_mqtt.c:1257 #10 0x557ca04737e3 in broker ../nanomq/apps/broker.c:773 #11 0x557ca04763ec in broker_start ../nanomq/apps/broker.c:1261 #12 0x557ca0452918 in main ../nanomq/nanomq.c:222 #13 0x7f1f817a7fcf in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58 SUMMARY: AddressSanitizer: heap-use-after-free ../../../../src/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:467 in __interceptor_strcmp Shadow bytes around the buggy address: 0x0c047fff81f0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c047fff8200: fa fa fd fa fa fa fd fd fa fa 00 fa fa fa 00 fa 0x0c047fff8210: fa fa 00 fa fa fa fa fa fa fa fa fa fa fa fd fa 0x0c047fff8220: fa fa fd fd fa fa fa fa fa fa fa fa fa fa fd fa 0x0c047fff8230: fa fa fa fa fa fa fa fa fa fa fd fa fa fa fd fd =>0x0c047fff8240: fa fa[fd]fa fa fa fa fa fa fa 00 04 fa fa 00 00 0x0c047fff8250: fa fa 04 fa fa fa fa fa fa fa 04 fa fa fa fa fa 0x0c047fff8260: fa fa fd fa fa fa 00 fa fa fa 00 00 fa fa 04 fa 0x0c047fff8270: fa fa fa fa fa fa 00 00 fa fa 04 fa fa fa fd fd 0x0c047fff8280: fa fa 05 fa fa fa 04 fa fa fa fa fa fa fa fa fa 0x0c047fff8290: fa fa 00 fa fa fa 00 00 fa fa 04 fa 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 ==418945==ABORTING
destory sub client caused crash
https://api.github.com/repos/nanomq/nanomq/issues/667/comments
1
2022-06-18T03:22:17Z
2022-06-27T02:11:41Z
https://github.com/nanomq/nanomq/issues/667
1,275,649,908
667
[ "emqx", "nanomq" ]
null
broker crashes when trying to pub msg to a disconnected client
https://api.github.com/repos/nanomq/nanomq/issues/666/comments
1
2022-06-17T13:10:51Z
2022-06-21T08:29:09Z
https://github.com/nanomq/nanomq/issues/666
1,275,014,188
666
[ "emqx", "nanomq" ]
client.c line 131, OPT_MSGCOUNT and OPT_CLIENTS are in the opposite positions: static nng_optspec cmd_opts[] = { { .o_name = "help", .o_short = 'h', .o_val = OPT_HELP }, { .o_name = "verbose", .o_short = 'v', .o_val = OPT_VERBOSE }, { .o_name = "parallel", .o_short = 'n', .o_val = OPT_PARALLEL, .o_arg = true }, { .o_name = "interval", .o_short = 'i', .o_val = OPT_INTERVAL, .o_arg = true }, { .o_name = "limit", .o_short = 'L', .o_val = OPT_MSGCOUNT, .o_arg = true }, { .o_name = "count", .o_short = 'C', .o_val = OPT_CLIENTS, .o_arg = true }, { .o_name = "version", .o_short = 'V', .o_val = OPT_VERSION }, ... ...
Command line parsing error:
https://api.github.com/repos/nanomq/nanomq/issues/663/comments
1
2022-06-17T07:06:39Z
2022-06-21T08:43:26Z
https://github.com/nanomq/nanomq/issues/663
1,274,655,508
663
[ "emqx", "nanomq" ]
I installed nanomq-0.8.0-linux-amd64.deb and it's working fine but I couldn't find the config files in the etc folder on my Linux server
NanoMQ config files
https://api.github.com/repos/nanomq/nanomq/issues/656/comments
3
2022-06-14T18:37:47Z
2022-07-16T04:08:24Z
https://github.com/nanomq/nanomq/issues/656
1,271,218,399
656
[ "emqx", "nanomq" ]
环境变量 export NANOMQ_ALLOW_ANONYMOUS=false export NANOMQ_CONF_PATH="/home/pi/source/nanomq/conf/nanomq.conf" export NANOMQ_AUTH_CONF_PATH="/home/pi/source/nanomq/conf/nanomq_auth_username.conf" export NANOMQ_BRIDGE_CONF_PATH="/home/pi/source/nanomq/conf/nanomq_bridge.conf" export NANOMQ_RULE_ENGINE_CONF_PATH="/home/pi/source/nanomq/conf/nanomq_rule_engine.conf" export NANOMQ_AUTH_HTTP_CONF_PATH="/home/pi/source/nanomq/conf/nanomq_auth_http.conf" 其中nanomq_bridge.conf配置如下: bridge.mqtt.address=mqtt-tcp://172.15.0.511:1883 bridge.mqtt.proto_ver=4 bridge.mqtt.bridge_mode=true bridge.mqtt.clientid=umfFvYmW7GENoaF9PODl bridge.mqtt.keepalive=60 bridge.mqtt.clean_start=true bridge.mqtt.username=umfFvYmW7GENoaF9PODl bridge.mqtt.password=password bridge.mqtt.forwards=v1/gateway/attributes,v1/gateway/telemetry bridge.mqtt.parallel=2
NanoMQ 0.8.0 for sqlite arm64架构 桥接配置文件失效问题
https://api.github.com/repos/nanomq/nanomq/issues/644/comments
1
2022-06-06T07:26:33Z
2022-06-06T08:45:47Z
https://github.com/nanomq/nanomq/issues/644
1,261,460,775
644
[ "emqx", "nanomq" ]
主要是消息桥接部分 重点是sqlite落盘、断网续传的配置
docker安装的nanomq:0.8.0-slim如何设置配置项
https://api.github.com/repos/nanomq/nanomq/issues/643/comments
7
2022-06-02T16:47:50Z
2022-11-01T04:25:04Z
https://github.com/nanomq/nanomq/issues/643
1,258,444,890
643
[ "emqx", "nanomq" ]
please find a way to make mqtt_db working without atomic var
nanolib is not compatible with GCC under 4.9 yet
https://api.github.com/repos/nanomq/nanomq/issues/634/comments
0
2022-06-01T04:14:32Z
2022-06-17T10:59:04Z
https://github.com/nanomq/nanomq/issues/634
1,254,886,005
634
[ "emqx", "nanomq" ]
## How to reproduce Subscribing multiple topics will cause leakage. (Using MQTTX) ## log from asan ``` ==606825==ERROR: LeakSanitizer: detected memory leaks Direct leak of 24 byte(s) in 1 object(s) allocated from: #0 0x7f5af08d3808 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cc:144 #1 0x558fbfb7bcfc in zmalloc ../nanolib/zmalloc.c:50 #2 0x558fbfb64c97 in dbtree_new_ctxt ../nanolib/mqtt_db.c:29 #3 0x558fbfb684a0 in dbtree_client_new ../nanolib/mqtt_db.c:377 #4 0x558fbfb6e1bb in dbtree_insert_client ../nanolib/mqtt_db.c:735 #5 0x558fbfba0826 in sub_ctx_handle ../nanomq/sub_handler.c:310 #6 0x558fbfbb3e66 in server_cb ../nanomq/apps/broker.c:355 #7 0x558fbfbf4f2e in nni_taskq_thread ../nng/src/core/taskq.c:50 #8 0x558fbfbf6215 in nni_thr_wrap ../nng/src/core/thread.c:94 #9 0x558fbfbfebfb in nni_plat_thr_main ../nng/src/platform/posix/posix_thread.c:266 #10 0x7f5af07a1608 in start_thread /build/glibc-SzIz7B/glibc-2.31/nptl/pthread_create.c:477 Direct leak of 8 byte(s) in 1 object(s) allocated from: #0 0x7f5af08d3808 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cc:144 #1 0x558fbfbfa62d in nni_alloc ../nng/src/platform/posix/posix_alloc.c:20 #2 0x558fbfbca69f in nng_alloc ../nng/src/nng.c:60 #3 0x558fbfc3c937 in nng_atomic_alloc64 ../nng/src/supplemental/util/platform.c:219 #4 0x558fbfba044a in sub_ctx_handle ../nanomq/sub_handler.c:278 #5 0x558fbfbb3e66 in server_cb ../nanomq/apps/broker.c:355 #6 0x558fbfbf4f2e in nni_taskq_thread ../nng/src/core/taskq.c:50 #7 0x558fbfbf6215 in nni_thr_wrap ../nng/src/core/thread.c:94 #8 0x558fbfbfebfb in nni_plat_thr_main ../nng/src/platform/posix/posix_thread.c:266 #9 0x7f5af07a1608 in start_thread /build/glibc-SzIz7B/glibc-2.31/nptl/pthread_create.c:477 SUMMARY: AddressSanitizer: 32 byte(s) leaked in 2 allocation(s). ```
Memory Leak in ctx->recv_cnt
https://api.github.com/repos/nanomq/nanomq/issues/629/comments
0
2022-05-31T07:05:52Z
2022-06-01T11:15:04Z
https://github.com/nanomq/nanomq/issues/629
1,253,423,019
629
[ "emqx", "nanomq" ]
I have tested nanomq/nanomq/0.6.6 docker image and I have found some issues: ## Subscription Identifier As noted in the OASIS specification: “it is a Protocol Error for a PUBLISH packet to contain any Subscription Identifier other than those received in SUBSCRIBE packet which caused it to flow. A PUBLISH packet sent from a Client to a Server MUST NOT contain a Subscription Identifier [MQTT-3.3.4-6]”. If a client tries to send a PUBLISH packet that includes a “Subscription Identifier” the broker does not report a protocol error, it forwards the packet to subscribers including the property. This happens only if the subscribers do not set themselves a “Subscription Identifier“ for the subscription. ## Including Duplicate Properties As noted in the OASIS specification, to include a property value more than once is a protocol error for most of the properties (except “User Properties” and “Subscription Identifier”). NanoMQ broker ignores the malformed packet and considers the last value set. This behavior could cause ambiguity.. Test: A client connects to broker using a crafted CONNECT packet that includes “Maximum Packet Size” twice (the first value is set to 2100, the second to 1024); then it subscribes to “topic/test” A second client publish a message of little more than 2048 Byte and then a second one of little more than 1024 Byte The first message is discarded by the broker, the second one is received by the first client: so the broker considers the last value set. Other tests were made including “Session Expiry Interval” and “Response Topic” twice in respectively a CONNECT and a PUBLISH packet sent by a client. In both tests only the second value is considered by the broker. In the second test property is published twice. ## NoLocal Flag As noted in the OASIS specification: “it is a Protocol Error to set the No Local bit to 1 on a Shared Subscription [MQTT-3.8.3-4]”. NanoMQ broker ignores the specification and lets clients set No Local bit to 1 on Shared Subscription. ## Unsubscription When a client tries to unsubscribe from a topic the broker often crashes.
MQTTv5 Properties Bugs
https://api.github.com/repos/nanomq/nanomq/issues/626/comments
4
2022-05-30T13:14:28Z
2022-06-13T10:26:27Z
https://github.com/nanomq/nanomq/issues/626
1,252,726,461
626
[ "emqx", "nanomq" ]
There is a bug in nnb_opt.c. Bench clients are not accepting the input argument clean=false.
clean session option bug
https://api.github.com/repos/nanomq/nanomq/issues/614/comments
2
2022-05-24T21:23:26Z
2022-05-25T04:17:10Z
https://github.com/nanomq/nanomq/issues/614
1,247,140,726
614
[ "emqx", "nanomq" ]
we need to make conn_param safe as referenced in rest_api.c _Originally posted by @JaylinYu in https://github.com/emqx/nanomq/pull/604#discussion_r878017072_
HTTP API: potential data racing condition
https://api.github.com/repos/nanomq/nanomq/issues/605/comments
0
2022-05-20T10:55:54Z
2024-01-23T04:23:58Z
https://github.com/nanomq/nanomq/issues/605
1,242,978,996
605
[ "emqx", "nanomq" ]
this cause crashed when client sends 2 sub packet at a time
old ctx's sub_pkt should not be touched in cli_ctx_merge
https://api.github.com/repos/nanomq/nanomq/issues/603/comments
1
2022-05-20T10:26:39Z
2022-05-20T10:48:41Z
https://github.com/nanomq/nanomq/issues/603
1,242,946,135
603
[ "emqx", "nanomq" ]
Launched nanomq by `./nanomq/nanomq broker start`, Run [nnc_test_v5.py](https://github.com/nanomq/nanomq-ci/blob/main/nnc_test_v5.py) Caused nanomq abort. ``` AddressSanitizer:DEADLYSIGNAL ================================================================= ==30416==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000038 (pc 0x000100f95bce bp 0x70000228de30 sp 0x70000228dc90 T13) ==30416==The signal is caused by a READ memory access. ==30416==Hint: address points to the zero page. #0 0x100f95bce in property_dup mqtt_codec.c:2278 #1 0x100e017cd in handle_pub_retain pub_handler.c:409 #2 0x100dffc5d in handle_pub pub_handler.c:381 #3 0x100e23d1d in server_cb broker.c:211 #4 0x100eaebbe in nni_task_exec taskq.c:144 #5 0x100e7f3a4 in nni_aio_finish_impl aio.c:448 #6 0x100e7f3fc in nni_aio_finish_sync aio.c:463 #7 0x100f19bad in nano_pipe_recv_cb nmq_mqtt.c:1079 #8 0x100eaebbe in nni_task_exec taskq.c:144 #9 0x100e7f3a4 in nni_aio_finish_impl aio.c:448 #10 0x100e7f3fc in nni_aio_finish_sync aio.c:463 #11 0x100f42bc1 in tcptran_pipe_recv_cb broker_tcp.c:749 #12 0x100eae4ff in nni_taskq_thread taskq.c:50 #13 0x100eb2897 in nni_thr_wrap thread.c:94 #14 0x100ed18bc in nni_plat_thr_main posix_thread.c:266 #15 0x7fff6b485108 in _pthread_start+0x93 (libsystem_pthread.dylib:x86_64+0x6108) #16 0x7fff6b480b8a in thread_start+0xe (libsystem_pthread.dylib:x86_64+0x1b8a) ==30416==Register values: rax = 0x0000000000000038 rbx = 0x000070000228de80 rcx = 0x0000100000000007 rdx = 0x0000100000000000 rdi = 0x00006060000232c0 rsi = 0x0000000000000000 rbp = 0x000070000228de30 rsp = 0x000070000228dc90 r8 = 0x0000200000000000 r9 = 0x0000000000000000 r10 = 0xffffffffffffffff r11 = 0x00000fffffffffff r12 = 0x0000000000000004 r13 = 0x0000000000000000 r14 = 0x00001e0000451c38 r15 = 0x00001e0000451f1c AddressSanitizer can not provide additional info. SUMMARY: AddressSanitizer: SEGV mqtt_codec.c:2278 in property_dup Thread T13 created by T0 here: #0 0x10111f31a in wrap_pthread_create+0x5a (libclang_rt.asan_osx_dynamic.dylib:x86_64h+0x4331a) #1 0x100ed162d in nni_plat_thr_init posix_thread.c:279 #2 0x100eb253c in nni_thr_init thread.c:121 #3 0x100eae184 in nni_taskq_init taskq.c:95 #4 0x100eaf6d4 in nni_taskq_sys_init taskq.c:284 #5 0x100e89bac in nni_init_helper init.c:35 #6 0x100ed1ce9 in nni_plat_init posix_thread.c:422 #7 0x100e89b8f in nni_init init.c:58 #8 0x100f515bf in nni_proto_mqtt_open protocol.c:37 #9 0x100f12752 in nng_nmq_tcp0_open nmq_mqtt.c:1231 #10 0x100e2bfe7 in broker broker.c:764 #11 0x100e30e4d in broker_start broker.c:1250 #12 0x100dfba0c in main nanomq.c:221 #13 0x7fff6b280cc8 in start+0x0 (libdyld.dylib:x86_64+0x1acc8) ==30416==ABORTING [1] 30416 abort ./nanomq/nanomq broker start ```
Retain As Published test caused abort.
https://api.github.com/repos/nanomq/nanomq/issues/601/comments
1
2022-05-20T08:16:18Z
2022-05-21T02:30:59Z
https://github.com/nanomq/nanomq/issues/601
1,242,795,328
601
[ "emqx", "nanomq" ]
编译完成并启动后,使用MQTTX连接nanomq,报错```segmentation fault``` ![屏幕截图 2022-05-20 151156](https://user-images.githubusercontent.com/37153307/169474308-86c2ce94-882d-4ce5-a8d6-97cbc42860fc.jpg)
请问在编译时将SQLite3打开后,如何使用它的消息持久化?是否需要自行配置?
https://api.github.com/repos/nanomq/nanomq/issues/600/comments
7
2022-05-20T07:19:46Z
2022-05-20T11:01:45Z
https://github.com/nanomq/nanomq/issues/600
1,242,736,205
600
[ "emqx", "nanomq" ]
Regarding to the plan we gonna add more plugins to NanoMQ, I will release a guidance to teach people how to add their own plugins to NanoMQ via NNG msg interfaces
Code Contribute guidence
https://api.github.com/repos/nanomq/nanomq/issues/598/comments
0
2022-05-20T04:01:22Z
2023-11-02T09:56:58Z
https://github.com/nanomq/nanomq/issues/598
1,242,576,453
598
[ "emqx", "nanomq" ]
Launched broker with flag http, and run a sub client. ``` $ ./nanomq/nanomq broker start --http $ mosquitto_sub -t abc ``` then use curl post request ``` curl --location --request POST 'http://localhost:8081/api/v1' \ --header 'Authorization: Basic YWRtaW46cHVibGlj' \ --header 'Content-Type: application/json' \ --data-raw '{ "req": 4, "seq": 111 }' ``` cause broker heap-buffer-overflow ``` ================================================================= ==2062==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x60300000a978 at pc 0x00010a2f8a85 bp 0x7000104fc770 sp 0x7000104fc768 READ of size 8 at 0x60300000a978 thread T26 #0 0x10a2f8a84 in get_subscriptions rest_api.c:490 #1 0x10a2fd0d4 in process_request rest_api.c:325 #2 0x10a3032bd in inproc_server web_server.c:360 #3 0x10a38abc7 in nni_thr_wrap thread.c:94 #4 0x10a3a9bec in nni_plat_thr_main posix_thread.c:266 #5 0x7fff6b485108 in _pthread_start+0x93 (libsystem_pthread.dylib:x86_64+0x6108) #6 0x7fff6b480b8a in thread_start+0xe (libsystem_pthread.dylib:x86_64+0x1b8a) 0x60300000a978 is located 0 bytes to the right of 24-byte region [0x60300000a960,0x60300000a978) allocated by thread T11 here: #0 0x10a5ee17d in wrap_malloc+0x9d (libclang_rt.asan_osx_dynamic.dylib:x86_64h+0x4917d) #1 0x10a2bb2dd in zmalloc zmalloc.c:50 #2 0x10a293185 in dbtree_new_ctxt mqtt_db.c:30 #3 0x10a296e90 in dbtree_client_new mqtt_db.c:362 #4 0x10a296d3d in dbtree_insert_client mqtt_db.c:720 #5 0x10a2f2f62 in sub_ctx_handle sub_handler.c:309 #6 0x10a30b67d in server_cb broker.c:354 #7 0x10a38682f in nni_taskq_thread taskq.c:50 #8 0x10a38abc7 in nni_thr_wrap thread.c:94 #9 0x10a3a9bec in nni_plat_thr_main posix_thread.c:266 #10 0x7fff6b485108 in _pthread_start+0x93 (libsystem_pthread.dylib:x86_64+0x6108) #11 0x7fff6b480b8a in thread_start+0xe (libsystem_pthread.dylib:x86_64+0x1b8a) Thread T26 created by T0 here: #0 0x10a5e831a in wrap_pthread_create+0x5a (libclang_rt.asan_osx_dynamic.dylib:x86_64h+0x4331a) #1 0x10a3a995d in nni_plat_thr_init posix_thread.c:279 #2 0x10a38a86c in nni_thr_init thread.c:121 #3 0x10a446fba in nng_thread_create platform.c:55 #4 0x10a303662 in start_rest_server web_server.c:431 #5 0x10a315d9f in broker_start broker.c:1243 #6 0x10a2e81cc in main nanomq.c:221 #7 0x7fff6b280cc8 in start+0x0 (libdyld.dylib:x86_64+0x1acc8) Thread T11 created by T0 here: #0 0x10a5e831a in wrap_pthread_create+0x5a (libclang_rt.asan_osx_dynamic.dylib:x86_64h+0x4331a) #1 0x10a3a995d in nni_plat_thr_init posix_thread.c:279 #2 0x10a38a86c in nni_thr_init thread.c:121 #3 0x10a3864b4 in nni_taskq_init taskq.c:95 #4 0x10a387a04 in nni_taskq_sys_init taskq.c:284 #5 0x10a361edc in nni_init_helper init.c:35 #6 0x10a3aa019 in nni_plat_init posix_thread.c:422 #7 0x10a361ebf in nni_init init.c:58 #8 0x10a446f38 in nng_thread_create platform.c:49 #9 0x10a303662 in start_rest_server web_server.c:431 #10 0x10a315d9f in broker_start broker.c:1243 #11 0x10a2e81cc in main nanomq.c:221 #12 0x7fff6b280cc8 in start+0x0 (libdyld.dylib:x86_64+0x1acc8) SUMMARY: AddressSanitizer: heap-buffer-overflow rest_api.c:490 in get_subscriptions Shadow bytes around the buggy address: 0x1c06000014d0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x1c06000014e0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x1c06000014f0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x1c0600001500: fa fa fd fd fd fa fa fa fd fd fd fd fa fa fd fd 0x1c0600001510: fd fd fa fa 00 00 00 00 fa fa 00 00 00 fa fa fa =>0x1c0600001520: 00 00 00 00 fa fa 00 00 00 00 fa fa 00 00 00[fa] 0x1c0600001530: fa fa fd fd fd fa fa fa 00 00 00 fa fa fa 00 00 0x1c0600001540: 00 fa fa fa 00 00 00 00 fa fa fd fd fd fa fa fa 0x1c0600001550: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x1c0600001560: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x1c0600001570: 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 ==2062==ABORTING [1] 2062 abort ./nanomq/nanomq broker start --http ```
PR #564 breaks Http API
https://api.github.com/repos/nanomq/nanomq/issues/597/comments
1
2022-05-20T02:26:33Z
2022-05-20T10:56:08Z
https://github.com/nanomq/nanomq/issues/597
1,242,528,657
597
[ "emqx", "nanomq" ]
![111](https://user-images.githubusercontent.com/37153307/169328108-a232b0c1-a447-48f8-a3d0-3a297b83ca13.png)
请问编译后如何启动nanomq?
https://api.github.com/repos/nanomq/nanomq/issues/595/comments
7
2022-05-19T15:02:06Z
2022-05-20T11:09:15Z
https://github.com/nanomq/nanomq/issues/595
1,241,923,188
595
[ "emqx", "nanomq" ]
Compile nanomq with option `cmake -G Ninja -DDEBUG=ON -DTSAN=ON ..` Launch broker with command `./nanomq/nanomq broker start` Launch pub client with command `./nanomq/nanomq pub start -t abc -m abc` Get WARNING below ``` WARNING: ThreadSanitizer: lock-order-inversion (potential deadlock) (pid=407689) Cycle in lock order graph: M115 (0x7b7000000088) => M119 (0x7b4c00000000) => M115 Mutex M119 acquired here while holding mutex M115 in main thread: #0 pthread_mutex_lock ../../../../src/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:4240 (libtsan.so.0+0x53908) #1 nni_pthread_mutex_lock /home/lee/workspace/nanomq/nng/src/platform/posix/posix_thread.c:84 (nanomq+0xad8b7) #2 nni_plat_mtx_lock /home/lee/workspace/nanomq/nng/src/platform/posix/posix_thread.c:146 (nanomq+0xadb1e) #3 nni_mtx_lock /home/lee/workspace/nanomq/nng/src/core/thread.c:27 (nanomq+0xa873b) #4 mqtt_tcptran_ep_connect /home/lee/workspace/nanomq/nng/src/mqtt/transport/tcp/mqtt_tcp.c:1259 (nanomq+0xf20ae) #5 dialer_connect_start /home/lee/workspace/nanomq/nng/src/core/dialer.c:403 (nanomq+0x96a46) #6 nni_dialer_start /home/lee/workspace/nanomq/nng/src/core/dialer.c:428 (nanomq+0x96b67) #7 nng_dialer_start /home/lee/workspace/nanomq/nng/src/nng.c:687 (nanomq+0x8c21e) #8 create_client /home/lee/workspace/nanomq/nanomq/apps/client.c:885 (nanomq+0x81745) #9 client /home/lee/workspace/nanomq/nanomq/apps/client.c:963 (nanomq+0x81fcc) #10 pub_start /home/lee/workspace/nanomq/nanomq/apps/client.c:998 (nanomq+0x82070) #11 main /home/lee/workspace/nanomq/nanomq/nanomq.c:221 (nanomq+0x6b031) Hint: use TSAN_OPTIONS=second_deadlock_stack=1 to get more informative warning message Mutex M115 acquired here while holding mutex M119 in thread T18: #0 pthread_mutex_lock ../../../../src/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:4240 (libtsan.so.0+0x53908) #1 nni_pthread_mutex_lock /home/lee/workspace/nanomq/nng/src/platform/posix/posix_thread.c:84 (nanomq+0xad8b7) #2 nni_plat_mtx_lock /home/lee/workspace/nanomq/nng/src/platform/posix/posix_thread.c:146 (nanomq+0xadb1e) #3 nni_mtx_lock /home/lee/workspace/nanomq/nng/src/core/thread.c:27 (nanomq+0xa873b) #4 dialer_connect_cb /home/lee/workspace/nanomq/nng/src/core/dialer.c:368 (nanomq+0x968ba) #5 nni_task_exec /home/lee/workspace/nanomq/nng/src/core/taskq.c:144 (nanomq+0xa7f2c) #6 nni_aio_finish_impl /home/lee/workspace/nanomq/nng/src/core/aio.c:448 (nanomq+0x93c61) #7 nni_aio_finish_sync /home/lee/workspace/nanomq/nng/src/core/aio.c:463 (nanomq+0x93d05) #8 mqtt_tcptran_ep_match /home/lee/workspace/nanomq/nng/src/mqtt/transport/tcp/mqtt_tcp.c:272 (nanomq+0xee51b) #9 mqtt_tcptran_pipe_nego_cb /home/lee/workspace/nanomq/nng/src/mqtt/transport/tcp/mqtt_tcp.c:375 (nanomq+0xeecf7) #10 nni_taskq_thread /home/lee/workspace/nanomq/nng/src/core/taskq.c:50 (nanomq+0xa78c3) #11 nni_thr_wrap /home/lee/workspace/nanomq/nng/src/core/thread.c:94 (nanomq+0xa89d0) #12 nni_plat_thr_main /home/lee/workspace/nanomq/nng/src/platform/posix/posix_thread.c:266 (nanomq+0xae048) Thread T18 'nng:task' (tid=407708, running) created by main thread at: #0 pthread_create ../../../../src/libsanitizer/tsan/tsan_interceptors_posix.cpp:969 (libtsan.so.0+0x605b8) #1 nni_plat_thr_init /home/lee/workspace/nanomq/nng/src/platform/posix/posix_thread.c:279 (nanomq+0xae0ed) #2 nni_thr_init /home/lee/workspace/nanomq/nng/src/core/thread.c:121 (nanomq+0xa8b82) #3 nni_taskq_init /home/lee/workspace/nanomq/nng/src/core/taskq.c:95 (nanomq+0xa7baa) #4 nni_taskq_sys_init /home/lee/workspace/nanomq/nng/src/core/taskq.c:284 (nanomq+0xa8641) #5 nni_init_helper /home/lee/workspace/nanomq/nng/src/core/init.c:35 (nanomq+0x9904b) #6 nni_plat_init /home/lee/workspace/nanomq/nng/src/platform/posix/posix_thread.c:422 (nanomq+0xae4f2) #7 nni_init /home/lee/workspace/nanomq/nng/src/core/init.c:58 (nanomq+0x99106) #8 nni_sock_open /home/lee/workspace/nanomq/nng/src/core/socket.c:630 (nanomq+0xa1f5b) #9 nni_proto_open /home/lee/workspace/nanomq/nng/src/sp/protocol.c:22 (nanomq+0xc5c14) #10 nng_mqtt_client_open /home/lee/workspace/nanomq/nng/src/mqtt/protocol/mqtt/mqtt_client.c:877 (nanomq+0xb1724) #11 create_client /home/lee/workspace/nanomq/nanomq/apps/client.c:853 (nanomq+0x81545) #12 client /home/lee/workspace/nanomq/nanomq/apps/client.c:963 (nanomq+0x81fcc) #13 pub_start /home/lee/workspace/nanomq/nanomq/apps/client.c:998 (nanomq+0x82070) #14 main /home/lee/workspace/nanomq/nanomq/nanomq.c:221 (nanomq+0x6b031) SUMMARY: ThreadSanitizer: lock-order-inversion (potential deadlock) /home/lee/workspace/nanomq/nng/src/platform/posix/posix_thread.c:84 in nni_pthread_mutex_lock ================== ================== WARNING: ThreadSanitizer: lock-order-inversion (potential deadlock) (pid=407689) Cycle in lock order graph: M97 (0x7b6c00000010) => M119 (0x7b4c00000000) => M97 Mutex M119 acquired here while holding mutex M97 in main thread: #0 pthread_mutex_lock ../../../../src/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:4240 (libtsan.so.0+0x53908) #1 nni_pthread_mutex_lock /home/lee/workspace/nanomq/nng/src/platform/posix/posix_thread.c:84 (nanomq+0xad8b7) #2 nni_plat_mtx_lock /home/lee/workspace/nanomq/nng/src/platform/posix/posix_thread.c:146 (nanomq+0xadb1e) #3 nni_mtx_lock /home/lee/workspace/nanomq/nng/src/core/thread.c:27 (nanomq+0xa873b) #4 mqtt_tcptran_ep_set_recvmaxsz /home/lee/workspace/nanomq/nng/src/mqtt/transport/tcp/mqtt_tcp.c:1322 (nanomq+0xf243f) #5 nni_setopt /home/lee/workspace/nanomq/nng/src/core/options.c:392 (nanomq+0x9e7b0) #6 mqtt_tcptran_dialer_setopt /home/lee/workspace/nanomq/nng/src/mqtt/transport/tcp/mqtt_tcp.c:1472 (nanomq+0xf2a7d) #7 nni_dialer_setopt /home/lee/workspace/nanomq/nng/src/core/dialer.c:482 (nanomq+0x96e87) #8 nni_sock_add_dialer /home/lee/workspace/nanomq/nng/src/core/socket.c:924 (nanomq+0xa2e0f) #9 nni_dialer_create /home/lee/workspace/nanomq/nng/src/core/dialer.c:268 (nanomq+0x96427) #10 nng_dialer_create /home/lee/workspace/nanomq/nng/src/nng.c:668 (nanomq+0x8c120) #11 create_client /home/lee/workspace/nanomq/nanomq/apps/client.c:863 (nanomq+0x81647) #12 client /home/lee/workspace/nanomq/nanomq/apps/client.c:963 (nanomq+0x81fcc) #13 pub_start /home/lee/workspace/nanomq/nanomq/apps/client.c:998 (nanomq+0x82070) #14 main /home/lee/workspace/nanomq/nanomq/nanomq.c:221 (nanomq+0x6b031) Hint: use TSAN_OPTIONS=second_deadlock_stack=1 to get more informative warning message Mutex M97 acquired here while holding mutex M119 in thread T18: #0 pthread_mutex_lock ../../../../src/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:4240 (libtsan.so.0+0x53908) #1 nni_pthread_mutex_lock /home/lee/workspace/nanomq/nng/src/platform/posix/posix_thread.c:84 (nanomq+0xad8b7) #2 nni_plat_mtx_lock /home/lee/workspace/nanomq/nng/src/platform/posix/posix_thread.c:146 (nanomq+0xadb1e) #3 nni_mtx_lock /home/lee/workspace/nanomq/nng/src/core/thread.c:27 (nanomq+0xa873b) #4 nni_dialer_add_pipe /home/lee/workspace/nanomq/nng/src/core/socket.c:1453 (nanomq+0xa49a5) #5 dialer_connect_cb /home/lee/workspace/nanomq/nng/src/core/dialer.c:378 (nanomq+0x96971) #6 nni_task_exec /home/lee/workspace/nanomq/nng/src/core/taskq.c:144 (nanomq+0xa7f2c) #7 nni_aio_finish_impl /home/lee/workspace/nanomq/nng/src/core/aio.c:448 (nanomq+0x93c61) #8 nni_aio_finish_sync /home/lee/workspace/nanomq/nng/src/core/aio.c:463 (nanomq+0x93d05) #9 mqtt_tcptran_ep_match /home/lee/workspace/nanomq/nng/src/mqtt/transport/tcp/mqtt_tcp.c:272 (nanomq+0xee51b) #10 mqtt_tcptran_pipe_nego_cb /home/lee/workspace/nanomq/nng/src/mqtt/transport/tcp/mqtt_tcp.c:375 (nanomq+0xeecf7) #11 nni_taskq_thread /home/lee/workspace/nanomq/nng/src/core/taskq.c:50 (nanomq+0xa78c3) #12 nni_thr_wrap /home/lee/workspace/nanomq/nng/src/core/thread.c:94 (nanomq+0xa89d0) #13 nni_plat_thr_main /home/lee/workspace/nanomq/nng/src/platform/posix/posix_thread.c:266 (nanomq+0xae048) Thread T18 'nng:task' (tid=407708, running) created by main thread at: #0 pthread_create ../../../../src/libsanitizer/tsan/tsan_interceptors_posix.cpp:969 (libtsan.so.0+0x605b8) #1 nni_plat_thr_init /home/lee/workspace/nanomq/nng/src/platform/posix/posix_thread.c:279 (nanomq+0xae0ed) #2 nni_thr_init /home/lee/workspace/nanomq/nng/src/core/thread.c:121 (nanomq+0xa8b82) #3 nni_taskq_init /home/lee/workspace/nanomq/nng/src/core/taskq.c:95 (nanomq+0xa7baa) #4 nni_taskq_sys_init /home/lee/workspace/nanomq/nng/src/core/taskq.c:284 (nanomq+0xa8641) #5 nni_init_helper /home/lee/workspace/nanomq/nng/src/core/init.c:35 (nanomq+0x9904b) #6 nni_plat_init /home/lee/workspace/nanomq/nng/src/platform/posix/posix_thread.c:422 (nanomq+0xae4f2) #7 nni_init /home/lee/workspace/nanomq/nng/src/core/init.c:58 (nanomq+0x99106) #8 nni_sock_open /home/lee/workspace/nanomq/nng/src/core/socket.c:630 (nanomq+0xa1f5b) #9 nni_proto_open /home/lee/workspace/nanomq/nng/src/sp/protocol.c:22 (nanomq+0xc5c14) #10 nng_mqtt_client_open /home/lee/workspace/nanomq/nng/src/mqtt/protocol/mqtt/mqtt_client.c:877 (nanomq+0xb1724) #11 create_client /home/lee/workspace/nanomq/nanomq/apps/client.c:853 (nanomq+0x81545) #12 client /home/lee/workspace/nanomq/nanomq/apps/client.c:963 (nanomq+0x81fcc) #13 pub_start /home/lee/workspace/nanomq/nanomq/apps/client.c:998 (nanomq+0x82070) #14 main /home/lee/workspace/nanomq/nanomq/nanomq.c:221 (nanomq+0x6b031) SUMMARY: ThreadSanitizer: lock-order-inversion (potential deadlock) /home/lee/workspace/nanomq/nng/src/platform/posix/posix_thread.c:84 in nni_pthread_mutex_lock ================== connect_cb: mqtt-tcp://127.0.0.1:1883 connected! ```
Pub client has potential deadlock
https://api.github.com/repos/nanomq/nanomq/issues/592/comments
1
2022-05-18T06:51:28Z
2024-05-09T03:22:29Z
https://github.com/nanomq/nanomq/issues/592
1,239,509,634
592
[ "emqx", "nanomq" ]
``` ➜ build git:(master) ✗ ninja [16/326] Building C object nng/CMakeFiles/nng_testing.dir/src/nng.c.o FAILED: nng/CMakeFiles/nng_testing.dir/src/nng.c.o /usr/bin/clang -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_TEST_LIB -DNNG_TRANSPORT_INPROC -DNNG_TRANSPORT_IPC -DNNG_TRANSPORT_MQTT_BROKER_TCP -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 -DSUPP_NNG_PROXY -D_GNU_SOURCE -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT -D_THREAD_SAFE -I../nng/src -I../nng/src/testing -I../nng/include -I../nanolib/include -I../nanomq/include -std=c99 -Wall -Wextra -fno-omit-frame-pointer -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -std=gnu99 -MD -MT nng/CMakeFiles/nng_testing.dir/src/nng.c.o -MF nng/CMakeFiles/nng_testing.dir/src/nng.c.o.d -o nng/CMakeFiles/nng_testing.dir/src/nng.c.o -c ../nng/src/nng.c ../nng/src/nng.c:2244:2: error: implicit declaration of function 'nni_msg_proto_set_property' is invalid in C99 [-Werror,-Wimplicit-function-declaration] nni_msg_proto_set_property(m, p); ^ ../nng/src/nng.c:2244:2: note: did you mean 'nng_msg_proto_set_property'? ../nng/src/nng.c:2242:1: note: 'nng_msg_proto_set_property' declared here nng_msg_proto_set_property(nng_msg *m, void *p) ^ ../nng/src/nng.c:2263:1: warning: non-void function does not return a value [-Wreturn-type] } ^ 1 warning and 1 error generated. [25/326] Building C object nng/CMakeFiles/nng_testing.dir/src/core/thread.c.o ninja: build stopped: subcommand failed. ```
Implicit declaration of function 'nni_msg_proto_set_property' caused compile error on mac.
https://api.github.com/repos/nanomq/nanomq/issues/584/comments
1
2022-05-11T02:01:55Z
2022-05-11T07:00:27Z
https://github.com/nanomq/nanomq/issues/584
1,231,901,831
584
[ "emqx", "nanomq" ]
hello,when i subscribe '$SYS/brokers/disconnected' or '$SYS/brokers/connected',i got the message '"username":"(null)","ts":3361588438,"reason_code":"0","client_id":"8e4fa98d14f64ddc93e0748cab531c79"}' or '{"username":"(null)", "ts":3361589081,"proto_name":"MQTT","keepalive":60,"return_code":"0","proto_ver":4,"client_id":"8e4fa98d14f64ddc93e0748cab531c79", "clean_start":1}' But the timestamp ts is not correct. I want to get the right time. What should I do? thank you
subscribe system topic $SYS/brokers/+
https://api.github.com/repos/nanomq/nanomq/issues/580/comments
1
2022-05-10T05:35:57Z
2022-05-10T08:24:59Z
https://github.com/nanomq/nanomq/issues/580
1,230,640,815
580
[ "emqx", "nanomq" ]
docker 部署nanomq 进入容器后执行 nanomq sub start 出现 Segmentation fault (core dumped) 镜像使用的是 emqx/nanomq:0.6.8 ![image](https://user-images.githubusercontent.com/49310643/167412982-392f2488-5d80-4fa9-9fbe-94f5161a3d80.png)
sub cli cause Segmentation fault
https://api.github.com/repos/nanomq/nanomq/issues/576/comments
1
2022-05-09T12:49:00Z
2022-05-09T14:23:59Z
https://github.com/nanomq/nanomq/issues/576
1,229,656,391
576
[ "emqx", "nanomq" ]
msg got blocked in protocol layer
memleak in sub logic
https://api.github.com/repos/nanomq/nanomq/issues/573/comments
0
2022-05-09T10:41:36Z
2022-05-09T10:43:32Z
https://github.com/nanomq/nanomq/issues/573
1,229,515,640
573
[ "emqx", "nanomq" ]
Ver 0.7.2 Log from asan ``` ==47488==ERROR: AddressSanitizer: heap-use-after-free on address 0x611000030744 at pc 0x5650093a7639 bp 0x7f1d643f19a0 sp 0x7f1d643f1990 READ of size 1 at 0x611000030744 thread T14 #0 0x5650093a7638 in conn_param_get_protover /home/wangha/docu/nanomq/nng/src/nng.c:2202 #1 0x565009370001 in encode_suback_msg /home/wangha/docu/nanomq/nanomq/sub_handler.c:143 #2 0x56500938349c in server_cb /home/wangha/docu/nanomq/nanomq/apps/broker.c:345 #3 0x5650093c4f47 in nni_taskq_thread /home/wangha/docu/nanomq/nng/src/core/taskq.c:50 #4 0x5650093c61c0 in nni_thr_wrap /home/wangha/docu/nanomq/nng/src/core/thread.c:94 #5 0x5650093cea39 in nni_plat_thr_main /home/wangha/docu/nanomq/nng/src/platform/posix/posix_thread.c:266 #6 0x7f1d6e3a6b42 in start_thread nptl/pthread_create.c:442 #7 0x7f1d6e4389ff (/lib/x86_64-linux-gnu/libc.so.6+0x1269ff) 0x611000030744 is located 4 bytes inside of 256-byte region [0x611000030740,0x611000030840) freed by thread T12 here: #0 0x7f1d6e612517 in __interceptor_free ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:127 #1 0x5650093ca675 in nni_free /home/wangha/docu/nanomq/nng/src/platform/posix/posix_alloc.c:33 #2 0x56500939a575 in nng_free /home/wangha/docu/nanomq/nng/src/nng.c:76 #3 0x5650093e7857 in conn_param_free /home/wangha/docu/nanomq/nng/src/sp/protocol/mqtt/mqtt_parser.c:839 #4 0x565009382b5a in server_cb /home/wangha/docu/nanomq/nanomq/apps/broker.c:282 #5 0x5650093c573f in nni_task_exec /home/wangha/docu/nanomq/nng/src/core/taskq.c:144 #6 0x5650093a9c76 in nni_aio_finish_impl /home/wangha/docu/nanomq/nng/src/core/aio.c:448 #7 0x5650093a9cf8 in nni_aio_finish_sync /home/wangha/docu/nanomq/nng/src/core/aio.c:463 #8 0x5650093efbf3 in nano_pipe_close /home/wangha/docu/nanomq/nng/src/sp/protocol/mqtt/nmq_mqtt.c:811 #9 0x5650093b9606 in nni_pipe_close /home/wangha/docu/nanomq/nng/src/core/pipe.c:144 #10 0x5650093f0892 in nano_pipe_recv_cb /home/wangha/docu/nanomq/nng/src/sp/protocol/mqtt/nmq_mqtt.c:963 #11 0x5650093c4f47 in nni_taskq_thread /home/wangha/docu/nanomq/nng/src/core/taskq.c:50 #12 0x5650093c61c0 in nni_thr_wrap /home/wangha/docu/nanomq/nng/src/core/thread.c:94 #13 0x5650093cea39 in nni_plat_thr_main /home/wangha/docu/nanomq/nng/src/platform/posix/posix_thread.c:266 #14 0x7f1d6e3a6b42 in start_thread nptl/pthread_create.c:442 previously allocated by thread T14 here: #0 0x7f1d6e612867 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:145 #1 0x5650093ca61b in nni_alloc /home/wangha/docu/nanomq/nng/src/platform/posix/posix_alloc.c:20 #2 0x56500939a50f in nng_alloc /home/wangha/docu/nanomq/nng/src/nng.c:59 #3 0x5650093e747d in conn_param_alloc /home/wangha/docu/nanomq/nng/src/sp/protocol/mqtt/mqtt_parser.c:808 #4 0x56500945398f in tcptran_pipe_nego_cb /home/wangha/docu/nanomq/nng/src/sp/transport/mqtt/broker_tcp.c:338 #5 0x5650093c4f47 in nni_taskq_thread /home/wangha/docu/nanomq/nng/src/core/taskq.c:50 #6 0x5650093c61c0 in nni_thr_wrap /home/wangha/docu/nanomq/nng/src/core/thread.c:94 #7 0x5650093cea39 in nni_plat_thr_main /home/wangha/docu/nanomq/nng/src/platform/posix/posix_thread.c:266 #8 0x7f1d6e3a6b42 in start_thread nptl/pthread_create.c:442 ``` # How to reproduce Handle disconnect packet before handling suback suback
Heap use after free in reply suback
https://api.github.com/repos/nanomq/nanomq/issues/572/comments
1
2022-05-09T10:06:30Z
2022-05-09T14:14:45Z
https://github.com/nanomq/nanomq/issues/572
1,229,475,738
572
[ "emqx", "nanomq" ]
**The compiler environment:** nanomq version: 0.7.2 cmake version: 3.13.5 Arch: mips64el gcc version: 4.9.3 LIBC version: 2.20 **The error details:** ------------ CMake Error at nanolib/CMakeLists.txt:123 (install): install TARGETS given no LIBRARY DESTINATION for shared library target "nano_shared". CMake Error at nanomq/CMakeLists.txt:62 (install): install TARGETS given no RUNTIME DESTINATION for executable target "nanomq". -- Configuring incomplete, errors occurred! ----------------------- **How to resolve this error?** [Solution 4](https://localcoder.org/cmake-error-targets-given-no-library-destination-for-shared-library-target)
Compiler from source code by cmake occur an error
https://api.github.com/repos/nanomq/nanomq/issues/571/comments
0
2022-05-09T06:23:04Z
2022-05-10T00:43:38Z
https://github.com/nanomq/nanomq/issues/571
1,229,233,633
571
[ "emqx", "nanomq" ]
This cause memleak and msg lost
message is not handled well when flying window exceed the value set in conf
https://api.github.com/repos/nanomq/nanomq/issues/566/comments
0
2022-05-07T08:57:19Z
2022-05-07T09:08:00Z
https://github.com/nanomq/nanomq/issues/566
1,228,573,759
566
[ "emqx", "nanomq" ]
# log from asan ``` ==248891==ERROR: AddressSanitizer: heap-use-after-free on address 0x61100000ff44 at pc 0x55773715d44e bp 0x7f321bdf73d0 sp 0x7f321bdf73c0 Sat May 7 11:24:46 2022 init_pipe_content: pub_handler: init pipe_info READ of size 1 at 0x61100000ff44 thread T8 (nng:task) Sat May 7 11:24:46 2022 nng_ctx_recv: ######## nng_ctx_recv context id 3 ######## Sat May 7 11:24:46 2022 nano_ctx_recv: nano_ctx_recv start 0x6100000004b0 #0 0x55773715d44d in conn_param_get_protover ../nng/src/nng.c:2202 #1 0x557737134eb8 in server_cb ../nanomq/apps/broker.c:181 #2 0x55773717b4e1 in nni_task_exec ../nng/src/core/taskq.c:144 #3 0x55773715fa6a in nni_aio_finish_impl ../nng/src/core/aio.c:448 #4 0x55773715faec in nni_aio_finish_sync ../nng/src/core/aio.c:463 #5 0x5577371abcb7 in nano_pipe_recv_cb ../nng/src/sp/protocol/mqtt/nmq_mqtt.c:1057 #6 0x55773717b4e1 in nni_task_exec ../nng/src/core/taskq.c:144 #7 0x55773715fa6a in nni_aio_finish_impl ../nng/src/core/aio.c:448 #8 0x55773715faec in nni_aio_finish_sync ../nng/src/core/aio.c:463 #9 0x55773745496c in tcptran_pipe_recv_cb ../nng/src/sp/transport/mqtt/broker_tcp.c:748 #10 0x55773717acea in nni_taskq_thread ../nng/src/core/taskq.c:50 #11 0x55773717c2c2 in nni_thr_wrap ../nng/src/core/thread.c:94 #12 0x557737184abc in nni_plat_thr_main ../nng/src/platform/posix/posix_thread.c:266 #13 0x7f3222def608 in start_thread /build/glibc-sMfBJT/glibc-2.31/nptl/pthread_create.c:477 #14 0x7f3222ce5162 in __clone (/lib/x86_64-linux-gnu/libc.so.6+0x11f162) 0x61100000ff44 is located 4 bytes inside of 256-byte region [0x61100000ff40,0x611000010040) freed by thread T8 (nng:task) here: #0 0x7f3222f2140f in __interceptor_free ../../../../src/libsanitizer/asan/asan_malloc_linux.cc:122 #1 0x557737180734 in nni_free ../nng/src/platform/posix/posix_alloc.c:33 #2 0x5577371501e0 in nng_free ../nng/src/nng.c:76 #3 0x55773719efb3 in conn_param_free ../nng/src/sp/protocol/mqtt/mqtt_parser.c:837 #4 0x557737135fdb in server_cb ../nanomq/apps/broker.c:279 #5 0x55773717b4e1 in nni_task_exec ../nng/src/core/taskq.c:144 #6 0x55773715fa6a in nni_aio_finish_impl ../nng/src/core/aio.c:448 #7 0x55773715faec in nni_aio_finish_sync ../nng/src/core/aio.c:463 #8 0x5577371a96b9 in nano_pipe_close ../nng/src/sp/protocol/mqtt/nmq_mqtt.c:796 #9 0x55773716f542 in nni_pipe_close ../nng/src/core/pipe.c:144 #10 0x5577371ab4bb in nano_pipe_recv_cb ../nng/src/sp/protocol/mqtt/nmq_mqtt.c:998 #11 0x55773717b4e1 in nni_task_exec ../nng/src/core/taskq.c:144 #12 0x55773715fa6a in nni_aio_finish_impl ../nng/src/core/aio.c:448 #13 0x55773715faec in nni_aio_finish_sync ../nng/src/core/aio.c:463 #14 0x55773745496c in tcptran_pipe_recv_cb ../nng/src/sp/transport/mqtt/broker_tcp.c:748 #15 0x55773717acea in nni_taskq_thread ../nng/src/core/taskq.c:50 #16 0x55773717c2c2 in nni_thr_wrap ../nng/src/core/thread.c:94 #17 0x557737184abc in nni_plat_thr_main ../nng/src/platform/posix/posix_thread.c:266 #18 0x7f3222def608 in start_thread /build/glibc-sMfBJT/glibc-2.31/nptl/pthread_create.c:477 previously allocated by thread T7 (nng:task) here: #0 0x7f3222f21808 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cc:144 #1 0x5577371806da in nni_alloc ../nng/src/platform/posix/posix_alloc.c:20 #2 0x55773715017a in nng_alloc ../nng/src/nng.c:59 #3 0x55773719eaee in conn_param_alloc ../nng/src/sp/protocol/mqtt/mqtt_parser.c:806 #4 0x5577374504c5 in tcptran_pipe_nego_cb ../nng/src/sp/transport/mqtt/broker_tcp.c:338 #5 0x55773717acea in nni_taskq_thread ../nng/src/core/taskq.c:50 #6 0x55773717c2c2 in nni_thr_wrap ../nng/src/core/thread.c:94 #7 0x557737184abc in nni_plat_thr_main ../nng/src/platform/posix/posix_thread.c:266 #8 0x7f3222def608 in start_thread /build/glibc-sMfBJT/glibc-2.31/nptl/pthread_create.c:477 Thread T8 (nng:task) created by T0 here: #0 0x7f3222e4e815 in __interceptor_pthread_create ../../../../src/libsanitizer/asan/asan_interceptors.cc:208 #1 0x557737184bec in nni_plat_thr_init ../nng/src/platform/posix/posix_thread.c:279 #2 0x55773717c56b in nni_thr_init ../nng/src/core/thread.c:121 #3 0x55773717b00b in nni_taskq_init ../nng/src/core/taskq.c:95 #4 0x55773717bf92 in nni_taskq_sys_init ../nng/src/core/taskq.c:284 #5 0x55773716709f in nni_init_helper ../nng/src/core/init.c:35 #6 0x557737184f40 in nni_plat_init ../nng/src/platform/posix/posix_thread.c:422 #7 0x55773716711d in nni_init ../nng/src/core/init.c:58 #8 0x5577371ac8b7 in nni_proto_mqtt_open ../nng/src/sp/protocol.c:37 #9 0x5577371ac61a in nng_nmq_tcp0_open ../nng/src/sp/protocol/mqtt/nmq_mqtt.c:1208 #10 0x55773713b515 in broker ../nanomq/apps/broker.c:728 #11 0x55773713e8d5 in broker_start ../nanomq/apps/broker.c:1180 #12 0x557737112f30 in main ../nanomq/nanomq.c:221 #13 0x7f3222bea0b2 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x240b2) Thread T7 (nng:task) created by T0 here: #0 0x7f3222e4e815 in __interceptor_pthread_create ../../../../src/libsanitizer/asan/asan_interceptors.cc:208 #1 0x557737184bec in nni_plat_thr_init ../nng/src/platform/posix/posix_thread.c:279 #2 0x55773717c56b in nni_thr_init ../nng/src/core/thread.c:121 #3 0x55773717b00b in nni_taskq_init ../nng/src/core/taskq.c:95 #4 0x55773717bf92 in nni_taskq_sys_init ../nng/src/core/taskq.c:284 #5 0x55773716709f in nni_init_helper ../nng/src/core/init.c:35 #6 0x557737184f40 in nni_plat_init ../nng/src/platform/posix/posix_thread.c:422 #7 0x55773716711d in nni_init ../nng/src/core/init.c:58 #8 0x5577371ac8b7 in nni_proto_mqtt_open ../nng/src/sp/protocol.c:37 #9 0x5577371ac61a in nng_nmq_tcp0_open ../nng/src/sp/protocol/mqtt/nmq_mqtt.c:1208 #10 0x55773713b515 in broker ../nanomq/apps/broker.c:728 #11 0x55773713e8d5 in broker_start ../nanomq/apps/broker.c:1180 #12 0x557737112f30 in main ../nanomq/nanomq.c:221 #13 0x7f3222bea0b2 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x240b2) SUMMARY: AddressSanitizer: heap-use-after-free ../nng/src/nng.c:2202 in conn_param_get_protover Shadow bytes around the buggy address: 0x0c227fff9f90: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c227fff9fa0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c227fff9fb0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c227fff9fc0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c227fff9fd0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa =>0x0c227fff9fe0: fa fa fa fa fa fa fa fa[fd]fd fd fd fd fd fd fd 0x0c227fff9ff0: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x0c227fffa000: fd fd fd fd fd fd fd fd fa fa fa fa fa fa fa fa 0x0c227fffa010: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x0c227fffa020: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fa fa 0x0c227fffa030: fa fa fa fa fa fa fa fa fd fd fd fd fd fd 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 ==248891==ABORTING ``` # How to reproduce ``` mosquitto_sub -t "abc\#" ``` Not always can you reproduce successfully
Heap use after free in pro_ver in connect param
https://api.github.com/repos/nanomq/nanomq/issues/563/comments
0
2022-05-07T03:33:57Z
2022-05-07T03:39:58Z
https://github.com/nanomq/nanomq/issues/563
1,228,513,489
563
[ "emqx", "nanomq" ]
Log from ASAN ``` [ERROR] (/home/wangha/docu/nanomq/nanolib/mqtt_db.c:776: errno: Resource temporarily unavailable) db or topic is NULL [ERROR] (/home/wangha/docu/nanomq/nanolib/mqtt_db.c:81: errno: Resource temporarily unavailable) topic is NULL AddressSanitizer:DEADLYSIGNAL ================================================================= ==26347==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x56115df91748 bp 0x7fb2adff2580 sp 0x7fb2adff2460 T13) ==26347==The signal is caused by a READ memory access. ==26347==Hint: address points to the zero page. #0 0x56115df91748 in search_client /home/wangha/docu/nanomq/nanolib/mqtt_db.c:798 #1 0x56115df91944 in dbtree_find_clients /home/wangha/docu/nanomq/nanolib/mqtt_db.c:825 #2 0x56115dfb8d69 in handle_pub /home/wangha/docu/nanomq/nanomq/pub_handler.c:191 #3 0x56115dfcdd15 in server_cb /home/wangha/docu/nanomq/nanomq/apps/broker.c:193 #4 0x56115e0117a1 in nni_task_exec /home/wangha/docu/nanomq/nng/src/core/taskq.c:144 #5 0x56115dff5cd8 in nni_aio_finish_impl /home/wangha/docu/nanomq/nng/src/core/aio.c:448 #6 0x56115dff5d5a in nni_aio_finish_sync /home/wangha/docu/nanomq/nng/src/core/aio.c:463 #7 0x56115e03d15b in nano_pipe_recv_cb /home/wangha/docu/nanomq/nng/src/sp/protocol/mqtt/nmq_mqtt.c:1046 #8 0x56115e0117a1 in nni_task_exec /home/wangha/docu/nanomq/nng/src/core/taskq.c:144 #9 0x56115dff5cd8 in nni_aio_finish_impl /home/wangha/docu/nanomq/nng/src/core/aio.c:448 #10 0x56115dff5d5a in nni_aio_finish_sync /home/wangha/docu/nanomq/nng/src/core/aio.c:463 #11 0x56115e0a1eff in tcptran_pipe_recv_cb /home/wangha/docu/nanomq/nng/src/sp/transport/mqtt/broker_tcp.c:748 #12 0x56115e010fa9 in nni_taskq_thread /home/wangha/docu/nanomq/nng/src/core/taskq.c:50 #13 0x56115e012222 in nni_thr_wrap /home/wangha/docu/nanomq/nng/src/core/thread.c:94 #14 0x56115e01aa9b in nni_plat_thr_main /home/wangha/docu/nanomq/nng/src/platform/posix/posix_thread.c:266 #15 0x7fb2b774ab42 in start_thread nptl/pthread_create.c:442 #16 0x7fb2b77dc9ff (/lib/x86_64-linux-gnu/libc.so.6+0x1269ff) AddressSanitizer can not provide additional info. SUMMARY: AddressSanitizer: SEGV /home/wangha/docu/nanomq/nanolib/mqtt_db.c:798 in search_client Thread T13 created by T0 here: #0 0x7fb2b795a685 in __interceptor_pthread_create ../../../../src/libsanitizer/asan/asan_interceptors.cpp:216 #1 0x56115e01abcb in nni_plat_thr_init /home/wangha/docu/nanomq/nng/src/platform/posix/posix_thread.c:279 #2 0x56115e0124ce in nni_thr_init /home/wangha/docu/nanomq/nng/src/core/thread.c:121 #3 0x56115e0112cb in nni_taskq_init /home/wangha/docu/nanomq/nng/src/core/taskq.c:95 #4 0x56115e011eec in nni_taskq_sys_init /home/wangha/docu/nanomq/nng/src/core/taskq.c:284 #5 0x56115dffd104 in nni_init_helper /home/wangha/docu/nanomq/nng/src/core/init.c:35 #6 0x56115e01af70 in nni_plat_init /home/wangha/docu/nanomq/nng/src/platform/posix/posix_thread.c:422 #7 0x56115dffd185 in nni_init /home/wangha/docu/nanomq/nng/src/core/init.c:58 #8 0x56115e03db45 in nni_proto_mqtt_open /home/wangha/docu/nanomq/nng/src/sp/protocol.c:37 #9 0x56115e03d8a0 in nng_nmq_tcp0_open /home/wangha/docu/nanomq/nng/src/sp/protocol/mqtt/nmq_mqtt.c:1197 #10 0x56115dfd2984 in broker /home/wangha/docu/nanomq/nanomq/apps/broker.c:728 #11 0x56115dfd54d9 in broker_start /home/wangha/docu/nanomq/nanomq/apps/broker.c:1180 #12 0x56115dfb65e6 in main /home/wangha/docu/nanomq/nanomq/nanomq.c:221 #13 0x7fb2b76dfd8f in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58 ==26347==ABORTING ```
Crash when searching a null topic
https://api.github.com/repos/nanomq/nanomq/issues/560/comments
0
2022-05-06T08:45:24Z
2022-05-07T03:05:53Z
https://github.com/nanomq/nanomq/issues/560
1,227,585,753
560
[ "emqx", "nanomq" ]
## 复现过程: - 启动: `nanomq broker start` - sub: `$ nanomq sub start --url "mqtt-tcp://191.168.1.130:1883" -t sss -C 100 -q 0 -i ` - pub: `$ nanomq pub start --url "mqtt-tcp://191.168.1.130:1883" -t sss -m "sssssadsa" -C 100 -I 5 -i 30 -q 0 -L 30000` - 在sub接收到数据后 `ctrl + c`终断 sub程序 - 程序异常退出: ``` $ nanomq broker start panic: pthread_mutex_unlock: Invalid argument This message is indicative of a BUG. Report this at https://github.com/emqx/nanomq nanomq(nni_panic+0x114) [0x55ba2f84a8a9] nanomq(+0x632ee) [0x55ba2f8542ee] nanomq(nni_plat_mtx_unlock+0x1c) [0x55ba2f854488] nanomq(nni_mtx_unlock+0x1c) [0x55ba2f850d72] nanomq(+0x6cf80) [0x55ba2f85df80] nanomq(nni_ctx_send+0x45) [0x55ba2f84e230] nanomq(nng_ctx_send+0xab) [0x55ba2f83f0d6] nanomq(server_cb+0x1029) [0x55ba2f837ace] nanomq(+0x5f48a) [0x55ba2f85048a] nanomq(+0x5ff02) [0x55ba2f850f02] nanomq(+0x63813) [0x55ba2f854813] /lib/x86_64-linux-gnu/libpthread.so.0(+0x8609) [0x7fe0c187d609] /lib/x86_64-linux-gnu/libc.so.6(clone+0x43) [0x7fe0c1798133] 已放弃 (核心已转储) ``` 该现象基本必现!! 请问目前有什么合适的解决方法规避这个问题
data racing on p->lk
https://api.github.com/repos/nanomq/nanomq/issues/559/comments
4
2022-05-06T08:36:21Z
2022-05-07T09:59:23Z
https://github.com/nanomq/nanomq/issues/559
1,227,576,997
559
[ "emqx", "nanomq" ]
related to https://github.com/nanomq/NanoNNG/issues/101
Let the Max Packet size of NanoMQ can accept be configurable
https://api.github.com/repos/nanomq/nanomq/issues/557/comments
0
2022-05-06T07:19:18Z
2022-05-30T09:29:42Z
https://github.com/nanomq/nanomq/issues/557
1,227,507,452
557
[ "emqx", "nanomq" ]
null
illegal topic length is ignored in sub_handler
https://api.github.com/repos/nanomq/nanomq/issues/548/comments
0
2022-04-29T10:48:37Z
2022-05-03T14:55:30Z
https://github.com/nanomq/nanomq/issues/548
1,220,501,428
548
[ "emqx", "nanomq" ]
We're testing nanomq for use with our application which uses sparkplug to communicate. We've been having trouble connecting to the broker from our client, and have determined the issue to be caused by trying to connect with a will message that contains control characters. As an example, the will message `test will` will allow us to connect, but `test \n will` will prevent connection. From what I can tell, this completely breaks compatibility with the Sparkplug protocol, as the NDEATH message is sent using the LWT, and this NDEATH message is an encoded protobuf, which often/always contains some control character (from my testing there was consistently a `\n` in the encoded message). I was able to recreate this problem with multiple clients (MQTT.fx and a C++ client using Apache Paho). If we stop using a will message, our clients are able to connect and publish these encoded protobuf messages normally, so I believe the problem lies with how nanomq handles the will message. Are we doing something wrong with the configuration of our broker that would be causing this issue? From what I can tell there are no settings that relate to this. Is this a bug, or are we limited with the contents of our will message? If this is intended, could someone provide the rules for the will message? Let me know if any additional information is needed from my side.
Connection to broker fails when using LWT with control characters
https://api.github.com/repos/nanomq/nanomq/issues/541/comments
8
2022-04-27T23:29:47Z
2022-04-29T16:16:20Z
https://github.com/nanomq/nanomq/issues/541
1,217,981,255
541
[ "emqx", "nanomq" ]
1. Compile nanomq with flag asan on. 2. run nanomq 3. run sub cmd`mosquitto_sub -t topic -h localhost -p 1883` 4. run pub cmd multi times ```mosquitto_pub -t topic -V 5 -m message -D Publish topic-alias 10 -h localhost -p 1883 -d --repeat 100``` Got error below: ``` [ERROR] (../nanolib/mqtt_db.c:771: errno: Resource temporarily unavailable) db or topic is NULL [ERROR] (../nanolib/mqtt_db.c:81: errno: Resource temporarily unavailable) topic is NULL AddressSanitizer:DEADLYSIGNAL ================================================================= ==1716844==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x557a8d8cefc7 bp 0x7fbf861f5570 sp 0x7fbf861f5450 T10) ==1716844==The signal is caused by a READ memory access. ==1716844==Hint: address points to the zero page. #0 0x557a8d8cefc7 in search_client ../nanolib/mqtt_db.c:794 #1 0x557a8d8cf1c3 in dbtree_find_clients ../nanolib/mqtt_db.c:821 #2 0x557a8d8f6044 in handle_pub ../nanomq/pub_handler.c:197 #3 0x557a8d90efa4 in server_cb ../nanomq/apps/broker.c:190 #4 0x557a8d959905 in nni_task_exec ../nng/src/core/taskq.c:144 #5 0x557a8d93e37e in nni_aio_finish_impl ../nng/src/core/aio.c:449 #6 0x557a8d93e400 in nni_aio_finish_sync ../nng/src/core/aio.c:466 #7 0x557a8d9845b4 in nano_pipe_recv_cb ../nng/src/sp/protocol/mqtt/nmq_mqtt.c:1069 #8 0x557a8d959905 in nni_task_exec ../nng/src/core/taskq.c:144 #9 0x557a8d93e37e in nni_aio_finish_impl ../nng/src/core/aio.c:449 #10 0x557a8d93e400 in nni_aio_finish_sync ../nng/src/core/aio.c:466 #11 0x557a8d9e8dc5 in tcptran_pipe_recv_cb ../nng/src/sp/transport/mqtt/broker_tcp.c:755 #12 0x557a8d959110 in nni_taskq_thread ../nng/src/core/taskq.c:50 #13 0x557a8d95a37d in nni_thr_wrap ../nng/src/core/thread.c:94 #14 0x557a8d962b63 in nni_plat_thr_main ../nng/src/platform/posix/posix_thread.c:266 #15 0x7fbf8e2c158f in start_thread nptl/pthread_create.c:463 #16 0x7fbf8e1b7222 in __clone (/lib/x86_64-linux-gnu/libc.so.6+0x119222) AddressSanitizer can not provide additional info. SUMMARY: AddressSanitizer: SEGV ../nanolib/mqtt_db.c:794 in search_client Thread T10 (nng:task) created by T0 here: #0 0x7fbf8e331a65 in __interceptor_pthread_create ../../../../src/libsanitizer/asan/asan_interceptors.cpp:216 #1 0x557a8d962c93 in nni_plat_thr_init ../nng/src/platform/posix/posix_thread.c:279 #2 0x557a8d95a626 in nni_thr_init ../nng/src/core/thread.c:121 #3 0x557a8d95942f in nni_taskq_init ../nng/src/core/taskq.c:95 #4 0x557a8d95a04d in nni_taskq_sys_init ../nng/src/core/taskq.c:284 #5 0x557a8d9456c0 in nni_init_helper ../nng/src/core/init.c:35 #6 0x557a8d962fe7 in nni_plat_init ../nng/src/platform/posix/posix_thread.c:422 #7 0x557a8d94573e in nni_init ../nng/src/core/init.c:58 #8 0x557a8d984f95 in nni_proto_mqtt_open ../nng/src/sp/protocol.c:37 #9 0x557a8d984cf6 in nng_nmq_tcp0_open ../nng/src/sp/protocol/mqtt/nmq_mqtt.c:1220 #10 0x557a8d913b30 in broker ../nanomq/apps/broker.c:751 #11 0x557a8d9165ef in broker_start ../nanomq/apps/broker.c:1203 #12 0x557a8d8f3a7f in main ../nanomq/nanomq.c:221 #13 0x7fbf8e0c6cb1 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x28cb1) ==1716844==ABORTING ```
Topic alias caused core dump.
https://api.github.com/repos/nanomq/nanomq/issues/535/comments
0
2022-04-25T06:20:24Z
2022-04-28T10:26:11Z
https://github.com/nanomq/nanomq/issues/535
1,214,027,727
535
[ "emqx", "nanomq" ]
Run cmd ``` $ python3 nnc_test_V5.py ``` [nnc_test_V5.py](https://github.com/nanomq/nanomq-ci) multi times, I got error. in [nanomq.conf](https://github.com/emqx/nanomq/blob/master/etc/nanomq.conf) qos_duration = 1 ``` lee@emqx-sz:~/workspace/nanomq/build$ ./nanomq/nanomq broker start --con ../etc/nanomq.conf ================================================================= ==1672219==ERROR: AddressSanitizer: heap-use-after-free on address 0x60f00000bb4c at pc 0x555f0d3b7ab8 bp 0x7fbfa89f5b70 sp 0x7fbfa89f5b60 WRITE of size 4 at 0x60f00000bb4c thread T10 (nng:reap2) #0 0x555f0d3b7ab7 in nni_atomic_dec_nv ../nng/src/platform/posix/posix_atomic.c:120 #1 0x555f0d3a1bdd in nni_msg_free ../nng/src/core/message.c:458 #2 0x555f0d3d9868 in nano_pipe_fini ../nng/src/sp/protocol/mqtt/nmq_mqtt.c:569 #3 0x555f0d3a59a6 in pipe_destroy ../nng/src/core/pipe.c:76 #4 0x555f0d3a7659 in reap_worker ../nng/src/core/reap.c:58 #5 0x555f0d3b25ec in nni_thr_wrap ../nng/src/core/thread.c:94 #6 0x555f0d3badd2 in nni_plat_thr_main ../nng/src/platform/posix/posix_thread.c:266 #7 0x7fbfb0b1d58f in start_thread nptl/pthread_create.c:463 #8 0x7fbfb0a13222 in __clone (/lib/x86_64-linux-gnu/libc.so.6+0x119222) 0x60f00000bb4c is located 124 bytes inside of 168-byte region [0x60f00000bad0,0x60f00000bb78) freed by thread T7 (nng:task) here: #0 0x7fbfb0be61c7 in __interceptor_free ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:123 #1 0x555f0d3b6a5f in nni_free ../nng/src/platform/posix/posix_alloc.c:33 #2 0x555f0d3a1cc9 in nni_msg_free ../nng/src/core/message.c:465 #3 0x555f0d43f8bb in nmq_tcptran_pipe_send_cb ../nng/src/sp/transport/mqtt/broker_tcp.c:500 #4 0x555f0d3b137f in nni_taskq_thread ../nng/src/core/taskq.c:50 #5 0x555f0d3b25ec in nni_thr_wrap ../nng/src/core/thread.c:94 #6 0x555f0d3badd2 in nni_plat_thr_main ../nng/src/platform/posix/posix_thread.c:266 #7 0x7fbfb0b1d58f in start_thread nptl/pthread_create.c:463 previously allocated by thread T9 (nng:task) here: #0 0x7fbfb0be66f7 in __interceptor_calloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:154 #1 0x555f0d3b6a36 in nni_zalloc ../nng/src/platform/posix/posix_alloc.c:26 #2 0x555f0d3a1797 in nni_msg_alloc ../nng/src/core/message.c:388 #3 0x555f0d440183 in tcptran_pipe_recv_cb ../nng/src/sp/transport/mqtt/broker_tcp.c:601 #4 0x555f0d3b137f in nni_taskq_thread ../nng/src/core/taskq.c:50 #5 0x555f0d3b25ec in nni_thr_wrap ../nng/src/core/thread.c:94 #6 0x555f0d3badd2 in nni_plat_thr_main ../nng/src/platform/posix/posix_thread.c:266 #7 0x7fbfb0b1d58f in start_thread nptl/pthread_create.c:463 Thread T10 (nng:reap2) created by T0 here: #0 0x7fbfb0b8da65 in __interceptor_pthread_create ../../../../src/libsanitizer/asan/asan_interceptors.cpp:216 #1 0x555f0d3baf02 in nni_plat_thr_init ../nng/src/platform/posix/posix_thread.c:279 #2 0x555f0d3b2895 in nni_thr_init ../nng/src/core/thread.c:121 #3 0x555f0d3a78b6 in nni_reap_sys_init ../nng/src/core/reap.c:110 #4 0x555f0d39d93d in nni_init_helper ../nng/src/core/init.c:36 #5 0x555f0d3bb256 in nni_plat_init ../nng/src/platform/posix/posix_thread.c:422 #6 0x555f0d39d9ad in nni_init ../nng/src/core/init.c:58 #7 0x555f0d3dd204 in nni_proto_mqtt_open ../nng/src/sp/protocol.c:37 #8 0x555f0d3dcf65 in nng_nmq_tcp0_open ../nng/src/sp/protocol/mqtt/nmq_mqtt.c:1220 #9 0x555f0d36bd9f in broker ../nanomq/apps/broker.c:751 #10 0x555f0d36e85e in broker_start ../nanomq/apps/broker.c:1203 #11 0x555f0d34ba7f in main ../nanomq/nanomq.c:221 #12 0x7fbfb0922cb1 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x28cb1) Thread T7 (nng:task) created by T0 here: #0 0x7fbfb0b8da65 in __interceptor_pthread_create ../../../../src/libsanitizer/asan/asan_interceptors.cpp:216 #1 0x555f0d3baf02 in nni_plat_thr_init ../nng/src/platform/posix/posix_thread.c:279 #2 0x555f0d3b2895 in nni_thr_init ../nng/src/core/thread.c:121 #3 0x555f0d3b169e in nni_taskq_init ../nng/src/core/taskq.c:95 #4 0x555f0d3b22bc in nni_taskq_sys_init ../nng/src/core/taskq.c:284 #5 0x555f0d39d92f in nni_init_helper ../nng/src/core/init.c:35 #6 0x555f0d3bb256 in nni_plat_init ../nng/src/platform/posix/posix_thread.c:422 #7 0x555f0d39d9ad in nni_init ../nng/src/core/init.c:58 #8 0x555f0d3dd204 in nni_proto_mqtt_open ../nng/src/sp/protocol.c:37 #9 0x555f0d3dcf65 in nng_nmq_tcp0_open ../nng/src/sp/protocol/mqtt/nmq_mqtt.c:1220 #10 0x555f0d36bd9f in broker ../nanomq/apps/broker.c:751 #11 0x555f0d36e85e in broker_start ../nanomq/apps/broker.c:1203 #12 0x555f0d34ba7f in main ../nanomq/nanomq.c:221 #13 0x7fbfb0922cb1 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x28cb1) Thread T9 (nng:task) created by T0 here: #0 0x7fbfb0b8da65 in __interceptor_pthread_create ../../../../src/libsanitizer/asan/asan_interceptors.cpp:216 #1 0x555f0d3baf02 in nni_plat_thr_init ../nng/src/platform/posix/posix_thread.c:279 #2 0x555f0d3b2895 in nni_thr_init ../nng/src/core/thread.c:121 #3 0x555f0d3b169e in nni_taskq_init ../nng/src/core/taskq.c:95 #4 0x555f0d3b22bc in nni_taskq_sys_init ../nng/src/core/taskq.c:284 #5 0x555f0d39d92f in nni_init_helper ../nng/src/core/init.c:35 #6 0x555f0d3bb256 in nni_plat_init ../nng/src/platform/posix/posix_thread.c:422 #7 0x555f0d39d9ad in nni_init ../nng/src/core/init.c:58 #8 0x555f0d3dd204 in nni_proto_mqtt_open ../nng/src/sp/protocol.c:37 #9 0x555f0d3dcf65 in nng_nmq_tcp0_open ../nng/src/sp/protocol/mqtt/nmq_mqtt.c:1220 #10 0x555f0d36bd9f in broker ../nanomq/apps/broker.c:751 #11 0x555f0d36e85e in broker_start ../nanomq/apps/broker.c:1203 #12 0x555f0d34ba7f in main ../nanomq/nanomq.c:221 #13 0x7fbfb0922cb1 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x28cb1) SUMMARY: AddressSanitizer: heap-use-after-free ../nng/src/platform/posix/posix_atomic.c:120 in nni_atomic_dec_nv Shadow bytes around the buggy address: 0x0c1e7fff9710: fd fd fd fd fd fa fa fa fa fa fa fa fa fa fd fd 0x0c1e7fff9720: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x0c1e7fff9730: fd fd fd fa fa fa fa fa fa fa fa fa fd fd fd fd 0x0c1e7fff9740: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x0c1e7fff9750: fd fa fa fa fa fa fa fa fa fa fd fd fd fd fd fd =>0x0c1e7fff9760: fd fd fd fd fd fd fd fd fd[fd]fd fd fd fd fd fa 0x0c1e7fff9770: fa fa fa fa fa fa fa fa fd fd fd fd fd fd fd fd 0x0c1e7fff9780: fd fd fd fd fd fd fd fd fd fd fd fd fd fa fa fa 0x0c1e7fff9790: fa fa fa fa fa fa fd fd fd fd fd fd fd fd fd fd 0x0c1e7fff97a0: fd fd fd fd fd fd fd fd fd fd fd fa fa fa fa fa 0x0c1e7fff97b0: fa fa fa fa fd fd fd fd fd fd fd fd fd fd 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 ==1672219==ABORTING ```
Potential msg double free
https://api.github.com/repos/nanomq/nanomq/issues/531/comments
1
2022-04-24T09:47:53Z
2022-04-25T03:00:17Z
https://github.com/nanomq/nanomq/issues/531
1,213,604,272
531
[ "emqx", "nanomq" ]
``` ================================================================= Fri Apr 22 18:46:24 2022 tcptran_pipe_recv_cb: end of tcptran_pipe_recv_cb: synch! 0x613000031580 Fri Apr 22 18:46:24 2022 free_pub_packet: free topic Fri Apr 22 18:46:24 2022 free_pub_packet: free payload Fri Apr 22 18:46:24 2022 free_pub_packet: free pub_packet ==1572901==ERROR: AddressSanitizer: heap-use-after-free on address 0x61100001cef0 at pc 0x56467399b44f bp 0x7f38802f7280 sp 0x7f38802f7270 Fri Apr 22 18:46:24 2022 init_pipe_content: pub_handler: init pipe_info Fri Apr 22 18:46:24 2022 nng_ctx_recv: ######## nng_ctx_recv context id 25 ######## READ of size 8 at 0x61100001cef0 thread T8 (nng:task) Fri Apr 22 18:46:24 2022 nano_ctx_recv: nano_ctx_recv start 0x6100000019b0 #0 0x56467399b44e in conn_param_get_clientid ../nng/src/nng.c:2114 #1 0x56467396c55c in server_cb ../nanomq/apps/broker.c:198 #2 0x5646739b9eb1 in nni_task_exec ../nng/src/core/taskq.c:144 #3 0x56467399e0b1 in nni_aio_finish_impl ../nng/src/core/aio.c:449 #4 0x56467399e39d in nni_aio_finish_sync ../nng/src/core/aio.c:466 #5 0x5646739e92cc in nano_pipe_recv_cb ../nng/src/sp/protocol/mqtt/nmq_mqtt.c:1069 #6 0x5646739b9eb1 in nni_task_exec ../nng/src/core/taskq.c:144 #7 0x56467399e0b1 in nni_aio_finish_impl ../nng/src/core/aio.c:449 #8 0x56467399e39d in nni_aio_finish_sync ../nng/src/core/aio.c:466 #9 0x564673a51428 in tcptran_pipe_recv_cb ../nng/src/sp/transport/mqtt/broker_tcp.c:755 #10 0x5646739b96bc in nni_taskq_thread ../nng/src/core/taskq.c:50 #11 0x5646739bac92 in nni_thr_wrap ../nng/src/core/thread.c:94 #12 0x5646739c3478 in nni_plat_thr_main ../nng/src/platform/posix/posix_thread.c:266 #13 0x7f388743b58f in start_thread nptl/pthread_create.c:463 #14 0x7f3887331222 in __clone (/lib/x86_64-linux-gnu/libc.so.6+0x119222) 0x61100001cef0 is located 48 bytes inside of 256-byte region [0x61100001cec0,0x61100001cfc0) freed by thread T9 (nng:task) here: #0 0x7f38875041c7 in __interceptor_free ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:123 #1 0x5646739bf105 in nni_free ../nng/src/platform/posix/posix_alloc.c:33 #2 0x56467398e63e in nng_free ../nng/src/nng.c:76 #3 0x5646739dcb21 in conn_param_free ../nng/src/sp/protocol/mqtt/mqtt_parser.c:744 #4 0x56467396d472 in server_cb ../nanomq/apps/broker.c:300 #5 0x5646739b9eb1 in nni_task_exec ../nng/src/core/taskq.c:144 #6 0x56467399e0b1 in nni_aio_finish_impl ../nng/src/core/aio.c:449 #7 0x56467399e39d in nni_aio_finish_sync ../nng/src/core/aio.c:466 #8 0x5646739e6daa in nano_pipe_close ../nng/src/sp/protocol/mqtt/nmq_mqtt.c:812 #9 0x5646739adf29 in nni_pipe_close ../nng/src/core/pipe.c:144 #10 0x5646739e8a2b in nano_pipe_recv_cb ../nng/src/sp/protocol/mqtt/nmq_mqtt.c:1005 #11 0x5646739b9eb1 in nni_task_exec ../nng/src/core/taskq.c:144 #12 0x56467399e0b1 in nni_aio_finish_impl ../nng/src/core/aio.c:449 #13 0x56467399e39d in nni_aio_finish_sync ../nng/src/core/aio.c:466 #14 0x564673a51428 in tcptran_pipe_recv_cb ../nng/src/sp/transport/mqtt/broker_tcp.c:755 #15 0x5646739b96bc in nni_taskq_thread ../nng/src/core/taskq.c:50 #16 0x5646739bac92 in nni_thr_wrap ../nng/src/core/thread.c:94 #17 0x5646739c3478 in nni_plat_thr_main ../nng/src/platform/posix/posix_thread.c:266 #18 0x7f388743b58f in start_thread nptl/pthread_create.c:463 previously allocated by thread T6 (nng:task) here: #0 0x7f3887504527 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:145 #1 0x5646739bf0ab in nni_alloc ../nng/src/platform/posix/posix_alloc.c:20 #2 0x56467398e5d8 in nng_alloc ../nng/src/nng.c:59 #3 0x5646739dc65c in conn_param_alloc ../nng/src/sp/protocol/mqtt/mqtt_parser.c:714 #4 0x564673a4cf06 in tcptran_pipe_nego_cb ../nng/src/sp/transport/mqtt/broker_tcp.c:340 #5 0x5646739b96bc in nni_taskq_thread ../nng/src/core/taskq.c:50 #6 0x5646739bac92 in nni_thr_wrap ../nng/src/core/thread.c:94 #7 0x5646739c3478 in nni_plat_thr_main ../nng/src/platform/posix/posix_thread.c:266 #8 0x7f388743b58f in start_thread nptl/pthread_create.c:463 Thread T8 (nng:task) created by T0 here: #0 0x7f38874aba65 in __interceptor_pthread_create ../../../../src/libsanitizer/asan/asan_interceptors.cpp:216 #1 0x5646739c35a8 in nni_plat_thr_init ../nng/src/platform/posix/posix_thread.c:279 #2 0x5646739baf3b in nni_thr_init ../nng/src/core/thread.c:121 #3 0x5646739b99db in nni_taskq_init ../nng/src/core/taskq.c:95 #4 0x5646739ba962 in nni_taskq_sys_init ../nng/src/core/taskq.c:284 #5 0x5646739a5a84 in nni_init_helper ../nng/src/core/init.c:35 #6 0x5646739c38fc in nni_plat_init ../nng/src/platform/posix/posix_thread.c:422 #7 0x5646739a5b02 in nni_init ../nng/src/core/init.c:58 #8 0x5646739e9ece in nni_proto_mqtt_open ../nng/src/sp/protocol.c:37 #9 0x5646739e9c2f in nng_nmq_tcp0_open ../nng/src/sp/protocol/mqtt/nmq_mqtt.c:1220 #10 0x5646739729e0 in broker ../nanomq/apps/broker.c:751 #11 0x564673975d9a in broker_start ../nanomq/apps/broker.c:1203 #12 0x56467394593e in main ../nanomq/nanomq.c:221 #13 0x7f3887240cb1 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x28cb1) Thread T9 (nng:task) created by T0 here: #0 0x7f38874aba65 in __interceptor_pthread_create ../../../../src/libsanitizer/asan/asan_interceptors.cpp:216 #1 0x5646739c35a8 in nni_plat_thr_init ../nng/src/platform/posix/posix_thread.c:279 #2 0x5646739baf3b in nni_thr_init ../nng/src/core/thread.c:121 #3 0x5646739b99db in nni_taskq_init ../nng/src/core/taskq.c:95 #4 0x5646739ba962 in nni_taskq_sys_init ../nng/src/core/taskq.c:284 #5 0x5646739a5a84 in nni_init_helper ../nng/src/core/init.c:35 #6 0x5646739c38fc in nni_plat_init ../nng/src/platform/posix/posix_thread.c:422 #7 0x5646739a5b02 in nni_init ../nng/src/core/init.c:58 #8 0x5646739e9ece in nni_proto_mqtt_open ../nng/src/sp/protocol.c:37 #9 0x5646739e9c2f in nng_nmq_tcp0_open ../nng/src/sp/protocol/mqtt/nmq_mqtt.c:1220 #10 0x5646739729e0 in broker ../nanomq/apps/broker.c:751 #11 0x564673975d9a in broker_start ../nanomq/apps/broker.c:1203 #12 0x56467394593e in main ../nanomq/nanomq.c:221 #13 0x7f3887240cb1 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x28cb1) Thread T6 (nng:task) created by T0 here: #0 0x7f38874aba65 in __interceptor_pthread_create ../../../../src/libsanitizer/asan/asan_interceptors.cpp:216 #1 0x5646739c35a8 in nni_plat_thr_init ../nng/src/platform/posix/posix_thread.c:279 #2 0x5646739baf3b in nni_thr_init ../nng/src/core/thread.c:121 #3 0x5646739b99db in nni_taskq_init ../nng/src/core/taskq.c:95 #4 0x5646739ba962 in nni_taskq_sys_init ../nng/src/core/taskq.c:284 #5 0x5646739a5a84 in nni_init_helper ../nng/src/core/init.c:35 #6 0x5646739c38fc in nni_plat_init ../nng/src/platform/posix/posix_thread.c:422 #7 0x5646739a5b02 in nni_init ../nng/src/core/init.c:58 #8 0x5646739e9ece in nni_proto_mqtt_open ../nng/src/sp/protocol.c:37 #9 0x5646739e9c2f in nng_nmq_tcp0_open ../nng/src/sp/protocol/mqtt/nmq_mqtt.c:1220 #10 0x5646739729e0 in broker ../nanomq/apps/broker.c:751 #11 0x564673975d9a in broker_start ../nanomq/apps/broker.c:1203 #12 0x56467394593e in main ../nanomq/nanomq.c:221 #13 0x7f3887240cb1 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x28cb1) SUMMARY: AddressSanitizer: heap-use-after-free ../nng/src/nng.c:2114 in conn_param_get_clientid Shadow bytes around the buggy address: 0x0c227fffb980: fa fa fa fa fa fa fa fa fd fd fd fd fd fd fd fd 0x0c227fffb990: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x0c227fffb9a0: fd fd fd fd fd fa fa fa fa fa fa fa fa fa fa fa 0x0c227fffb9b0: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x0c227fffb9c0: fd fd fd fd fd fd fd fd fd fd fd fd fa fa fa fa =>0x0c227fffb9d0: fa fa fa fa fa fa fa fa fd fd fd fd fd fd[fd]fd 0x0c227fffb9e0: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x0c227fffb9f0: fd fd fd fd fd fd fd fd fa fa fa fa fa fa fa fa 0x0c227fffba00: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x0c227fffba10: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fa fa 0x0c227fffba20: fa fa fa fa fa fa fa fa fd fd fd fd fd fd 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 ==1572901==ABORTING ```
data race condition in webhook publish event
https://api.github.com/repos/nanomq/nanomq/issues/527/comments
2
2022-04-22T10:54:53Z
2022-04-25T06:52:41Z
https://github.com/nanomq/nanomq/issues/527
1,212,210,324
527
[ "emqx", "nanomq" ]
Run cmd below to set message-expiry interval ``` $ mosquitto_pub -t topic_test -m message -V 5 -q 1 -D publish message-expiry-interval 3 -r ``` Run cmd after three seconds, you can receive message too. ``` $ mosquitto_sub -t 'topic_test' -q 1 -V 5 message ```
Messages are not droped when expiry interval is exceeded.
https://api.github.com/repos/nanomq/nanomq/issues/525/comments
1
2022-04-22T07:48:30Z
2022-05-09T11:42:32Z
https://github.com/nanomq/nanomq/issues/525
1,211,954,504
525
[ "emqx", "nanomq" ]
now NanoMQ is able to proxy msg between brokerless and broker networks. If anyone is interested in having a try on this feature, I would be happy to provide support.
New module NNG proxy is finished.but requires docs & demo & configuration files
https://api.github.com/repos/nanomq/nanomq/issues/518/comments
0
2022-04-20T09:45:47Z
2022-06-07T05:40:58Z
https://github.com/nanomq/nanomq/issues/518
1,209,441,540
518
[ "emqx", "nanomq" ]
refers to https://github.com/nanomq/NanoSDK/issues/42. it is a bad demo
Fix mqtt async demo.
https://api.github.com/repos/nanomq/nanomq/issues/517/comments
0
2022-04-20T09:43:55Z
2022-04-21T09:12:46Z
https://github.com/nanomq/nanomq/issues/517
1,209,439,366
517
[ "emqx", "nanomq" ]
I am using nanomq:0.6.6 image with running a docker container to run as mqtt broker.but I can't access http api port 8081. Could somebody know what's going on? docker container show followiing <img width="1352" alt="image" src="https://user-images.githubusercontent.com/11851006/164141400-f7938645-f15e-445e-91d8-4e6846810db7.png"> <img width="450" alt="image" src="https://user-images.githubusercontent.com/11851006/164141568-d2f74128-c65a-4987-8e1f-27a91fcac8ee.png">
How can I enable HTTP api port?
https://api.github.com/repos/nanomq/nanomq/issues/516/comments
2
2022-04-20T02:56:03Z
2022-04-20T06:01:04Z
https://github.com/nanomq/nanomq/issues/516
1,209,097,979
516
[ "emqx", "nanomq" ]
introduced by #475
reason code might exceed the number of sub topics in suback
https://api.github.com/repos/nanomq/nanomq/issues/490/comments
0
2022-04-14T03:42:41Z
2022-04-14T05:12:03Z
https://github.com/nanomq/nanomq/issues/490
1,204,002,840
490