-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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 library should default to thread-safe #450
Comments
In a single threaded application, calling
|
Does that mean this comment is inaccurate:
|
Well that serves me right for going on memory. I trust the me that wrote that at the time I was properly looking at the problem. A couple of observations:
The other point is that the bug was in version 1.3 and earlier. It's not that 1.3 was thread safe and 1.3.1 onwards isn't, it's that 1.3 incorrectly claimed to be thread safe because it didn't take into account that someone might use their own threads rather than just call What you're asking (in the context of how things work now) is to make external thread mode the default. This has no effect on the people using I think a bit of rumination is in order. |
My misunderstanding is that I wasn't aware 1.3 wasn't thread safe if you were using your own threads. In my application I basically want to have a thread subscribing to a topic and the main thread monitoring a serial port and publishing to a different topic - I'd prefer to manage my own threads (as I have other locking cases and mutex's to deal with) but might look into I definitely don't have that function on my Debian machine at work though, I'll get some extra information and confirm the version number when I'm back at my desk. |
I guess an argument could be made that the library claimed to be thread safe in an earlier version - so that promise should be kept. But - I only opened the issue because I thought thread-safe functionality had been removed as the default behaviour in 1.3.1 when the function was added. Happy for it this to be closed if you wish. |
Just for the information, I ran 'apt-get install libmosquitto-dev' and ended up with this header file ( #define LIBMOSQUITTO_MAJOR 1
#define LIBMOSQUITTO_MINOR 3
#define LIBMOSQUITTO_REVISION 4 However, if I grep the file for I also get this compiling:
|
Right well it looks like there is a bug in the change log as to where that feature appeared. It is only in 1.4 onwards. I'm going to leave this open because I'm still thinking it through. |
Hello,
I've noticed that the mosquitto library in my Debian repositories (v1.3 - I think) doesn't have the function
mosquitto_threaded_set
.The documentation says that if you're using threads you must call this function, but it isn't available in an earlier version that says it's thread safe.
This means that if I wrote a threaded application using v1.3 it would be thread safe, and if I recompiled it using v1.4 it would not be thread safe.
If this is the case, it sounds like a pretty serious bug and potentially a denial-of-service vulnerability.
Cheers,
Andrew
The text was updated successfully, but these errors were encountered: