AutoTangoMonitor crash
I tried the new AutoTangoMonitor
feature with the following code:
import PyTango
from PyTango import server
class MonitorTest(server.Device):
__metaclass__ = server.DeviceMeta
def init_device(self):
self.first = True
self.proxy = PyTango.DeviceProxy('sys/tg_test/1')
self.eid = self.proxy.subscribe_event(
'State', PyTango.EventType.CHANGE_EVENT, self.callback)
def callback(self, event):
if self.first:
print('First callback')
self.set_state(event.attr_value.value)
self.first = False
return
print('Acquiring lock')
with PyTango.AutoTangoMonitor(self):
self.set_state(event.attr_value.value)
print('Releasing lock')
print('Lock released')
def delete_device(self):
self.proxy.unsubscribe_event(self.eid)
if __name__ == '__main__':
MonitorTest.run_server()
Unfortunately it crashes when the lock is being released:
$ python test.py test
First callback
Ready to accept request
Acquiring lock
Releasing lock
*** Error in `python': double free or corruption (fasttop): 0x00007ff3d400ca70 ***
======= Backtrace: =========
/lib64/libc.so.6(+0x7d023)[0x7ff4005ce023]
/usr/lib64/python2.7/site-packages/PyTango/_PyTango.so(_ZN5boost6python7objects12value_holderIN7PyTango16AutoTangoMonitorEED1Ev+0x194)[0x7ff3f9c90154]
/lib64/libboost_python.so.1.53.0(+0x252a7)[0x7ff3f8edb2a7]
/lib64/libpython2.7.so.1.0(+0x9c173)[0x7ff4012d3173]
/lib64/libpython2.7.so.1.0(+0x5509b)[0x7ff40128c09b]
/lib64/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x1696)[0x7ff401314ba6]
/lib64/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x7ed)[0x7ff4013190bd]
/lib64/libpython2.7.so.1.0(+0x6f05d)[0x7ff4012a605d]
/lib64/libpython2.7.so.1.0(PyObject_Call+0x43)[0x7ff4012810b3]
/lib64/libpython2.7.so.1.0(PyEval_EvalFrameEx+0xde7)[0x7ff4013142f7]
/lib64/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x7ed)[0x7ff4013190bd]
/lib64/libpython2.7.so.1.0(+0x6ef68)[0x7ff4012a5f68]
/lib64/libpython2.7.so.1.0(PyObject_Call+0x43)[0x7ff4012810b3]
/lib64/libpython2.7.so.1.0(PyEval_CallObjectWithKeywords+0x47)[0x7ff401312f07]
/lib64/libpython2.7.so.1.0(PyEval_CallFunction+0xb7)[0x7ff40132ff07]
/usr/lib64/python2.7/site-packages/PyTango/_PyTango.so(+0x40a6dc)[0x7ff3f9b286dc]
/usr/lib64/python2.7/site-packages/PyTango/_PyTango.so(_ZN19PyCallBackPushEvent10push_eventEPN5Tango9EventDataE+0x2ad)[0x7ff3f9b2c3dd]
/lib64/libtango.so.8(_ZN5Tango16ZmqEventConsumer14push_zmq_eventERSshRN3zmq9message_tEbRKj+0x5a9)[0x7ff3f945ef49]
/lib64/libtango.so.8(_ZN5Tango16ZmqEventConsumer13process_eventERN3zmq9message_tES3_S3_S3_+0x134)[0x7ff3f9461f74]
/lib64/libtango.so.8(_ZN5Tango16ZmqEventConsumer14run_undetachedEPv+0x6fe)[0x7ff3f946307e]
/lib64/libomnithread.so.3(omni_thread_wrapper+0x5e)[0x7ff3f744b5fe]
/lib64/libpthread.so.0(+0x7dc5)[0x7ff401022dc5]
/lib64/libc.so.6(clone+0x6d)[0x7ff40064728d]
Am I doing it wrong?