lua-mosquitto icon indicating copy to clipboard operation
lua-mosquitto copied to clipboard

Segmentation fault(core dumped) when using mosquitto client as a thread along with lua lanes

Open Aditya23456 opened this issue 7 years ago • 1 comments

Hi,

I am using lua lanes to run os threads to collect data and have an mqtt client running as one of the thread. After some time or sometimes immediately after connecting with broker, my entire software crashes with segmentation fault error and Ubuntu 16.04 error reporting shows up. I tried running it on openwrt platform too and faced similar issues. I changed mosquitto client library to paho and now its stable. I am wondering if there is some issue which you are aware of. I can share the traceback if interested.

Thanks, Aditya

Aditya23456 avatar Jan 25 '18 02:01 Aditya23456

I've had segfaults when trying to run loop_start() and then accessing objects in my callbacks as well as in my main thread. It doesn't seem to be anything unexpected. You need to be careful with your thread access. If you switched to a different library and language, I presume a lot more changed too, and you simply don't have the access problems anymore.

karlp avatar Jan 25 '18 11:01 karlp