Thread 3 "MQTTAsync_rcv" received signal SIGSEGV, Segmentation fault.
Gitxiaozhu-oss opened this issue · 6 comments
Thread 3 "MQTTAsync_rcv" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7ffff65cc700 (LWP 20626)]
MQTTProperties_free (props=0x7fffe801b100) at src/MQTTProperties.c:407
407 int type = MQTTProperty_getType(id);
#0 MQTTProperties_free (props=0x7fffe801b100) at src/MQTTProperties.c:407
#1 0x00007ffff773088b in MQTTAsync_freeMessage (message=0x7ffff65cbd00) at src/MQTTAsync.c:1822
#2 0x00000000004031e2 in messageArrived (context=0x6e01f8, topicName=0x7fffe80202f8 "", topicLen=45, message=0x7fffe801b0d8)
at terminal_pro.c:223
#3 0x00007ffff77288c9 in MQTTAsync_receiveThread (n=) at src/MQTTAsyncUtils.c:2054
#4 0x00007ffff7702609 in start_thread (arg=) at pthread_create.c:477
#5 0x00007ffff7627133 in clone () from /lib/x86_64-linux-gnu/libc.so.6
pahoo Version, OS?
Product name: Eclipse Paho Synchronous MQTT C Client Library
Version: 1.3.12
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.7 LTS
Release: 16.04
Codename: xenial
Linux ubuntu-virtual-machine 4.15.0-142-generic #146~16.04.1-Ubuntu SMP Tue Apr 13 09:27:15 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
As this appears to be in the messageArrived callback, you should give me an idea of what you're doing within it - maybe the code within it.
Is this consistently reproducible or a one-off? If reproducible then a client library trace as described in the README could be useful.
I'm not clear how the statement pointed to can cause a segfault, without being affected by processing elsewhere.
Hi @icraggs
Facing the same issue with same version 1.3.12
Code - paho.mqtt.c/src/samples/MQTTAsync_publish_time.c
Reproduce
- Start MQTTAsync_publish_time.o
- Stop Broker
@sandippatelec if that's the connection lost cause parameter, I put a change into that sample yesterday for that: 357c392
@icraggs
Test with updated code, Still it is crashing, Kindly take a look
#0 __GI___writev (iovcnt=2, iov=0x7ffff74d4af0, fd=3) at ../sysdeps/unix/sysv/linux/writev.c:26
#1 __GI___writev (fd=fd@entry=3, iov=iov@entry=0x7ffff74d4af0, iovcnt=iovcnt@entry=2)
at ../sysdeps/unix/sysv/linux/writev.c:24
#2 0x00007ffff7ef4f71 in Socket_writev (socket=socket@entry=3, iovecs=iovecs@entry=0x7ffff74d4af0,
count=count@entry=2, bytes=bytes@entry=0x7ffff74d4ad0) at src/Socket.c:737
#3 0x00007ffff7ef50e7 in Socket_putdatas (socket=3, buf0=, buf0len=2, bufs=...)
at src/Socket.c:795
#4 0x00007ffff7f04f87 in WebSocket_putdatas (net=net@entry=0x555555578cb0,
buf0=buf0@entry=0x7ffff74d4c30, buf0len=buf0len@entry=0x7ffff74d4c28,
bufs=bufs@entry=0x7ffff74d4c40) at src/WebSocket.c:972
#5 0x00007ffff7f06217 in MQTTPacket_send (net=net@entry=0x555555578cb0, header=...,
header@entry=..., buffer=, buffer@entry=0x0, buflen=,
buflen@entry=0, freeData=, freeData@entry=0, MQTTVersion=0)
at src/MQTTPacket.c:227
#6 0x00007ffff7f06b16 in MQTTPacket_send_disconnect (client=client@entry=0x555555578c78,
reason=reason@entry=MQTTREASONCODE_SUCCESS, props=props@entry=0x0) at src/MQTTPacket.c:540
#7 0x00007ffff7ef6d51 in MQTTAsync_closeOnly (client=0x555555578c78,
reasonCode=MQTTREASONCODE_SUCCESS, props=0x0) at src/MQTTAsyncUtils.c:2383
#8 0x00007ffff7ef8bad in nextOrClose (m=m@entry=0x555555578728, rc=-1,
message=0x7ffff7f0dcc1 "socket error") at src/MQTTAsyncUtils.c:1610
#9 0x00007ffff7ef9e82 in MQTTAsync_receiveThread (n=) at src/MQTTAsyncUtils.c:2305