Skip to content

Please don't ignore SIGPIPE in the mosquitto client library #2564

@nmeum

Description

@nmeum

Hello,

Presently, the mosquitto MQTT library ignores SIGPIPE:

https://github.com/eclipse/mosquitto/blob/d5970ca9985f4d3193fe7a359707723090bb13e9/lib/mosquitto.c#L112-L114

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 ignore SIGPIPE 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 require SIGPIPE 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Component: libmosquittoStatus: CompletedNothing further to be done with this issue, it can be closed by the requestor or committer.

    Type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions