segmentation fault when subscribing to events
|
|
---|---|
Hi, i wrote a Device Server that subscribe to events with many device attributes and different data types… I implements only one callback method which is triggered when the events are received (push model). I have an segmentation fault when receiving an event with data type different from the subscription one… The problem comes from the allocation of the array in the cb. i simply tried with tangotest and i have the same error ;( extract of example subscribe event (data type of the attribute is DevDouble):
extract of the callback (array declaration in DevLong):
Is it the good way to do this when i have to subsribe to events on dynamic attributes unknown in advance ? Thanks for help |
|
|
---|---|
Hi, In your callback, gives you the type of the received event data (int corresponding to the index of the type in enum CmdArgType type declared in tango_const.h include file).You can then adapt your code depending on the received type.
Rosenberg's Law: Software is easy to make, except when you want it to do something new.
Corollary: The only software that's worth making is software that does something new. |
|
|
---|---|
By the way, you should catch Tango::DevFailed exceptions (not int exceptions) in your callback when you try to extract the data.
Rosenberg's Law: Software is easy to make, except when you want it to do something new.
Corollary: The only software that's worth making is software that does something new. |
|
|
---|---|
JCM |
|
|
---|---|
JCM Did you prefix it with the namespace Tango? e.g.: Tango::DEV_SHORT ? JCM The data type is transmitted on the network only since Tango 9 (IDL 5). Are you subscribing to Tango 8 devices? Maybe what you are observing is a consequence of the fix of https://github.com/tango-controls/cppTango/issues/248 ?
Rosenberg's Law: Software is easy to make, except when you want it to do something new.
Corollary: The only software that's worth making is software that does something new. |
|
|
---|---|
Late answer ![]() Reynald Not effectively. I'm going to try. Reynald All Tango 9 devices. Thanks again. |