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

HUP segfaults mosquitto #965

Closed
dustin opened this Issue Sep 16, 2018 · 6 comments

Comments

Projects
None yet
2 participants
@dustin

dustin commented Sep 16, 2018

I've been running 1.5.1 for a couple of days now on debian testing/buster (built from source since the latest released version is 1.5 and has broken bridging). I found something interesting has been occurring:

Sep 15 00:00:02 eve kernel:  [278513.821971] mosquitto[12256]: segfault at bc ip 0000563c12cf703f sp 00007ffd21c740c0 error 4 in mosquitto[563c12ce0000+1e000]
Sep 16 00:00:02 eve kernel:  [364913.396950] mosquitto[28319]: segfault at bc ip 0000557f8414203f sp 00007ffcc2a67770 error 4 in mosquitto[557f8412b000+1e000]

Since this is happening local time, and seems to be fairly aligned with my logs, I assumed it was related to log rotation. I've confirmed that SIGHUP segfaults:

Sep 16 11:01:00 eve kernel: [404571.651633] mosquitto[28833]: segfault at bc ip 000056202bc2903f sp 00007ffcefda5b10 error 4 in mosquitto[56202bc12000+1e000]
@dustin

This comment has been minimized.

Show comment
Hide comment
@dustin

dustin Sep 16, 2018

This may be a dup of #849 -- I started typing the bug before I figured out it was related to log rotation.

dustin commented Sep 16, 2018

This may be a dup of #849 -- I started typing the bug before I figured out it was related to log rotation.

@ralight

This comment has been minimized.

Show comment
Hide comment
@ralight

ralight Sep 18, 2018

Contributor

Could you provide some more details about what platform you are using and your mosquitto configuration?

Contributor

ralight commented Sep 18, 2018

Could you provide some more details about what platform you are using and your mosquitto configuration?

@dustin

This comment has been minimized.

Show comment
Hide comment
@dustin

dustin Sep 18, 2018

dustin@eve:~$ uname -a ; lsb_release -a
Linux eve 4.17.0-3-amd64 #1 SMP Debian 4.17.17-1 (2018-08-18) x86_64 GNU/Linux
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux testing (buster)
Release:        testing
Codename:       buster

/etc/mosquitto.conf

pid_file /var/run/mosquitto.pid

persistence true
persistence_location /var/lib/mosquitto/

per_listener_settings true

listener 1883 0.0.0.0
allow_anonymous true

listener 8883 0.0.0.0
# acl_file /etc/mosquitto/acls
password_file /etc/mosquitto/passwd
allow_anonymous false

cafile /etc/mosquitto/ca_certificates/cacert.pem
certfile /etc/mosquitto/certs/fullchain.pem
keyfile /etc/mosquitto/certs/privkey.pem
tls_version tlsv1


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

include_dir /etc/mosquitto/conf.d

/etc/mosquitto/conf.d/adafruit.conf

I've also got a bridging config to adafruit:

connection adafruit
address io.adafruit.com:8883
bridge_capath /etc/ssl/certs/
notifications false
remote_username ME
remote_password MYPASS
start_type automatic
bridge_protocol_version mqttv311
try_private false

topic + in 0 adafruit.io/ ME/feeds/

topic "" out 0 thing1 ME/feeds/grp.thing1
topic "" out 0 thing2 ME/feeds/grp.thing2
topic "" out 0 thing3 ME/feeds/grp.thing3
topic "" out 0 thing4 ME/feeds/grp.thing4

dustin commented Sep 18, 2018

dustin@eve:~$ uname -a ; lsb_release -a
Linux eve 4.17.0-3-amd64 #1 SMP Debian 4.17.17-1 (2018-08-18) x86_64 GNU/Linux
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux testing (buster)
Release:        testing
Codename:       buster

/etc/mosquitto.conf

pid_file /var/run/mosquitto.pid

persistence true
persistence_location /var/lib/mosquitto/

per_listener_settings true

listener 1883 0.0.0.0
allow_anonymous true

listener 8883 0.0.0.0
# acl_file /etc/mosquitto/acls
password_file /etc/mosquitto/passwd
allow_anonymous false

cafile /etc/mosquitto/ca_certificates/cacert.pem
certfile /etc/mosquitto/certs/fullchain.pem
keyfile /etc/mosquitto/certs/privkey.pem
tls_version tlsv1


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

include_dir /etc/mosquitto/conf.d

/etc/mosquitto/conf.d/adafruit.conf

I've also got a bridging config to adafruit:

connection adafruit
address io.adafruit.com:8883
bridge_capath /etc/ssl/certs/
notifications false
remote_username ME
remote_password MYPASS
start_type automatic
bridge_protocol_version mqttv311
try_private false

topic + in 0 adafruit.io/ ME/feeds/

topic "" out 0 thing1 ME/feeds/grp.thing1
topic "" out 0 thing2 ME/feeds/grp.thing2
topic "" out 0 thing3 ME/feeds/grp.thing3
topic "" out 0 thing4 ME/feeds/grp.thing4
@ralight

This comment has been minimized.

Show comment
Hide comment
@ralight

ralight Sep 19, 2018

Contributor

Lovely, that helps.

Contributor

ralight commented Sep 19, 2018

Lovely, that helps.

ralight added a commit that referenced this issue Sep 19, 2018

Fix segfault on HUP when bridges and security options are configured.
Closes #849. Closes #965. Thanks to Wolfgand Hottgenroth and Dustin Sallings.
@ralight

This comment has been minimized.

Show comment
Hide comment
@ralight

ralight Sep 19, 2018

Contributor

I think this is fixed now in the fixes branch, could you give it a try and close this issue if you're happy?

Contributor

ralight commented Sep 19, 2018

I think this is fixed now in the fixes branch, could you give it a try and close this issue if you're happy?

@ralight ralight added this to the 1.5.2 milestone Sep 19, 2018

@dustin

This comment has been minimized.

Show comment
Hide comment
@dustin

dustin Sep 19, 2018

I'm going to go with "probably" :) HUP doesn't segfault. I'll know if starts happening again. Thanks for the quick fix!

dustin commented Sep 19, 2018

I'm going to go with "probably" :) HUP doesn't segfault. I'll know if starts happening again. Thanks for the quick fix!

@dustin dustin closed this Sep 19, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment