Hi Roger,

I'm attaching a simple program (m1-pub.py), the code consistently
crashes with current tip (hg id -> 6afb79f716f8+ (0.16) tip) whereas I
have no problems with the client-thread branch (hg id -> 7bd20a9245f1+
(client-thread)), meaning the code publishes 20k messages with no
issues.

Not sure if it's expected? I'm not sure what sort of thread safety is
there guaranteed, maybe I'm totally off with my code?

Cheers!

*** glibc detected *** python: double free or corruption (fasttop): 
0x0000000002ae8f70 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x78a8f)[0x7f317713aa8f]
/lib/x86_64-linux-gnu/libc.so.6(cfree+0x73)[0x7f317713e8e3]
/usr/lib/libmosquitto.so.0(+0x2d9d)[0x7f31765e9d9d]
/usr/lib/libmosquitto.so.0(mosquitto_loop+0x15b)[0x7f31765e8dab]


** Attachment added: "m1-pub.py"
   
https://bugs.launchpad.net/mosquitto/+bug/842324/+attachment/2768387/+files/m1-pub.py

-- 
You received this bug notification because you are a member of Mosquitto
Development, which is subscribed to mosquitto.
https://bugs.launchpad.net/bugs/842324

Title:
  python mqtt library seems not thread safe

Status in mosquitto: an mqtt message broker:
  Fix Committed

Bug description:
  python mqtt library version: 0.12
  python version: 2.7.1

  when i call python mqtt functions in multi threads, it is crashed or
  throw exception sometimes.

  for example, in every thread, do this:
  new mqtt object
  connect
  loop several times

  sometimes the program is crashed silently, sometimes i get this exception:
  Traceback (most recent call last):
    File "_ctypes/callbacks.c", line 313, in 'calling callback function'
    File "/usr/lib/pymodules/python2.7/mosquitto.py", line 353, in 
_internal_on_message
      topic = message.contents.topic
  ValueError: NULL pointer access

To manage notifications about this bug go to:
https://bugs.launchpad.net/mosquitto/+bug/842324/+subscriptions

-- 
Mailing list: https://launchpad.net/~mosquitto-devel
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~mosquitto-devel
More help   : https://help.launchpad.net/ListHelp

Reply via email to