Please don't ignore SIGPIPE in the mosquitto client library #2564
Labels
Component: libmosquitto
Status: Completed
Nothing further to be done with this issue, it can be closed by the requestor or committer.
Type: Bug
Milestone
Hello,
Presently, the mosquitto MQTT library ignores
SIGPIPE
:mosquitto/lib/mosquitto.c
Lines 112 to 114 in d5970ca
This is a problem since this will affect all threads of the process running the mosquitto client library. Furthermore, as per
signal(7)
“A child created via fork(2) inherits a copy of its parent's signal dispositions.”. That is, any process forked from the process which uses the mosquitto client library will also ignoreSIGPIPE
by default. I believe it to be a very bad idea to have a C library introduce this sort of side-effect since code using the C library may requireSIGPIPE
to not be ignored.We noticed this at Alpine Linux where we use mosquitto as part of our build infrastructure. See:
Opening this issue here in the hopes that you might consider not modifying signal dispositions in the mosquitto library.
The text was updated successfully, but these errors were encountered: