Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mosquitto(all versions) crashes with websockets enabled, segfault error 6 in libwebsockets.so.3.0.0 #253

Closed
cordovapolymer opened this issue Aug 28, 2016 · 10 comments

Comments

@cordovapolymer
Copy link

cordovapolymer commented Aug 28, 2016

Mosquitto crashes every second day, I have to restart it manually.
kernel: [1006237.390667] mosquitto[25279]: segfault at 54 ip 00007f367c6bd6e4 sp 00007fff389dcd60 error 6 in libwebsockets.so.3.0.0[7f367c6b9000+10000]

Most interesting thing that I run it on two ports: mqtt 1883 and websockets 8000, it stops listening on mqtt 1883 port but continues operation on websockets 8000. After a restart it fully recovers until the next crash.

I'm running mosquitto on debian 8.5 jessie installed from the official repository . Current stable Debian 8.5 Jessie comes with libwebsockets 1.2.2-1.

The issue happened both on 1.4.8 and 1.4.9, I've just updated it to 1.4.10, and it crashed again with exactly the same error and memory addresses.

This issue also has been described in gost/server#40 and #227

@cordovapolymer
Copy link
Author

any hope that the issue will be fixed?

@ralight
Copy link
Contributor

ralight commented Sep 14, 2016

Honestly, libwebsockets 1.2.2 is buggy anyway so there is little point trying to fix problems associated with it. I think the best thing for me to do is disable websockets support for debian jessie as well.

You can of course go and get a more recent version of libwebsockets and compile it yourself.

@cordovapolymer
Copy link
Author

cordovapolymer commented Sep 24, 2016

Honestly, libwebsockets 1.2.2 is buggy anyway so there is little point trying to fix problems associated with it. I think the best thing for me to do is disable websockets support for debian jessie as well.

Please do not, Debian will definitely update libwebsocket, because there's a 1.7.3-1 version in the testing branch and the issue will disappear then.
The workaround for now is not to send large messages, the issue doesn't happen anymore after I started splitting messages larger than 2048 bytes(a limit may be higher, but I didn't test it).

@ralight
Copy link
Contributor

ralight commented Feb 11, 2017

There hasn't been an update here for a while so I'm going to close this issue. If you think this is still a problem, please reopen and add more information.

@ralight ralight closed this as completed Feb 11, 2017
@mdavids
Copy link

mdavids commented May 4, 2017

It happend to me yesterday - but in general the daemon runs pretty stable.

May 3 17:49:44 localhost kernel: [1189759.369692] mosquitto[776]: segfault at c0ba44d1 ip b73fb66a sp bf81c714 error 5 in libwebsockets.so.7[b73e8000+22000]

1.4.11-0mosquitto2xenial1

Ubuntu 16.04.2 LTS

@AlReem
Copy link

AlReem commented Jun 11, 2017

I am also having the same issue with the following installations.

Server: Ubuntu 16.04.2 LTS (Xenial)
Mosquitto: v1.4.8
libwebsockets: v2.2.0 (Compiled from source)

Extract from journalctl:
Jun 11 05:57:28 myserver kernel: mosquitto[23293]: segfault at 8 ip 00007a55e0779b29 sp 00007ffd5a966a80 error 4 in libwebsockets.so.7[7a65f0771000+1f000]

Please help

@fezeev
Copy link

fezeev commented Jun 19, 2017

By the way. This:

libwebsockets: v2.2.0 (Compiled from source)

confronts with this:

Extract from journalctl:
Jun 11 05:57:28 myserver kernel: mosquitto[23293]: segfault at 8 ip 00007a55e0779b29 sp 00007ffd5a966a80 error 4 in libwebsockets.so.7[7a65f0771000+1f000]

libwebsockets.so.7 is filename for libwebsocket with 1.7.* versions.
correct libwebsocket 2.2.0 filename will be libwebsockets.so.10

@silky
Copy link

silky commented Nov 13, 2017

i'm definitely seeing this as a problem

i don't see segfaults, i just see that connections are defined.

restarting the mosquitto service fixes it

my configuration:

# Place your local configuration in /etc/mosquitto/conf.d/
#
# A full description of the configuration file is at
# /usr/share/doc/mosquitto/examples/mosquitto.conf.example

pid_file /var/run/mosquitto.pid

listener 1883
listener 1884
protocol websockets

persistence true
persistence_location /var/lib/mosquitto/

log_dest file /var/log/mosquitto/mosquitto.log

include_dir /etc/mosquitto/conf.d

edit: i'm using mqtt.js for the JS side

and i have mosquitto:

mosquitto version 1.4.8 (build date Mon, 26 Jun 2017 09:31:02 +0100)

@silky
Copy link

silky commented Nov 14, 2017

@ralight - anything i can do to get some more info for you on why this might be failing?

@wsw70
Copy link

wsw70 commented Jun 3, 2019

@silky: if this is still relevant, maybe #1004 (comment) would help?

@lock lock bot locked as resolved and limited conversation to collaborators Sep 1, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants