Open leruetkins opened 1 year ago
I have a similar problem. When the connection is lost, my client crashes. Sometimes it works properly and the client reconnect, but very often not.
I've tested this by killing mosquitto server.
Thread 7 "MQTTAsync_rcv" received signal SIGPIPE, Broken pipe.
[Switching to Thread 0x7ffff68b2700 (LWP 1327907)]
__libc_write (nbytes=24, buf=0x7fffd800ed03, fd=9) at ../sysdeps/unix/sysv/linux/write.c:26
26 ../sysdeps/unix/sysv/linux/write.c: No such file or directory.
(gdb) bt
#0 __libc_write (nbytes=24, buf=0x7fffd800ed03, fd=9) at ../sysdeps/unix/sysv/linux/write.c:26
#1 __libc_write (fd=9, buf=0x7fffd800ed03, nbytes=24) at ../sysdeps/unix/sysv/linux/write.c:24
#2 0x00007ffff7cf9489 in ?? () from /lib/x86_64-linux-gnu/libcrypto.so.1.1
#3 0x00007ffff7cf466e in ?? () from /lib/x86_64-linux-gnu/libcrypto.so.1.1
#4 0x00007ffff7cf3684 in ?? () from /lib/x86_64-linux-gnu/libcrypto.so.1.1
#5 0x00007ffff7cf3b47 in BIO_write () from /lib/x86_64-linux-gnu/libcrypto.so.1.1
#6 0x00007ffff7f46dde in ?? () from /lib/x86_64-linux-gnu/libssl.so.1.1
#7 0x00007ffff7f47cd9 in ?? () from /lib/x86_64-linux-gnu/libssl.so.1.1
#8 0x00007ffff7f5188e in ?? () from /lib/x86_64-linux-gnu/libssl.so.1.1
#9 0x00007ffff7f4fa65 in ?? () from /lib/x86_64-linux-gnu/libssl.so.1.1
#10 0x00007ffff7f5aec3 in SSL_shutdown () from /lib/x86_64-linux-gnu/libssl.so.1.1
#11 0x0000555555ad6d36 in SSLSocket_close (net=0x555555eac928) at /home/mmoscicki/.cargo/registry/src/index.crates.io-6f17d22bba15001f/paho-mqtt-sys-0.9.0/paho.mqtt.c/src/SSLSocket.c:957
#12 0x0000555555ad345e in MQTTAsync_closeOnly (client=0x555555eac8f0, reasonCode=MQTTREASONCODE_SUCCESS, props=0x0) at /home/mmoscicki/.cargo/registry/src/index.crates.io-6f17d22bba15001f/paho-mqtt-sys-0.9.0/paho.mqtt.c/src/MQTTAsyncUtils.c:2409
#13 0x0000555555ad34e3 in MQTTAsync_closeSession (client=0x555555eac8f0, reasonCode=MQTTREASONCODE_SUCCESS, props=0x0) at /home/mmoscicki/.cargo/registry/src/index.crates.io-6f17d22bba15001f/paho-mqtt-sys-0.9.0/paho.mqtt.c/src/MQTTAsyncUtils.c:2427
#14 0x0000555555ad0dd9 in nextOrClose (m=0x555555eac6b0, rc=-1, message=0x555555cbbcea "socket error") at /home/mmoscicki/.cargo/registry/src/index.crates.io-6f17d22bba15001f/paho-mqtt-sys-0.9.0/paho.mqtt.c/src/MQTTAsyncUtils.c:1644
#15 0x0000555555ad20ea in MQTTAsync_receiveThread (n=0x555555eac6b0) at /home/mmoscicki/.cargo/registry/src/index.crates.io-6f17d22bba15001f/paho-mqtt-sys-0.9.0/paho.mqtt.c/src/MQTTAsyncUtils.c:2053
#16 0x00007ffff7c0b609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#17 0x00007ffff79d9353 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
I run the program and everything works fine, but after the connection to the server is lost, the program crashes and may have time to catch such an error:
Used code: