[bugs:#823] Crash when executing a command from a thread on an in-process device
Status: open
Created: Mon Oct 24, 2016 02:13 PM UTC by Marius Elvert
Last Updated: Mon Oct 24, 2016 02:13 PM UTC
Owner: nobody
Using Tango 9.2.2:
Crash is a null-pointer access in Tango's blackbox.cpp:
omni_thread::value_t *ip = omni_thread::self()->get_value(key);
self() returns nullptr in this case.
To reproduce, let any command do something like this:
std::thread thread([this]() { std::string target = this->device_name; auto proxy = std::make_shared<Tango::DeviceProxy>(target); proxy->command_inout("status"); }); thread.join();
Sent from sourceforge.net because Tango-cs...@lists.sf.net is subscribed to https://sourceforge.net/p/tango-cs/bugs/
To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/tango-cs/admin/bugs/options. Or, if this is a mailing list, you can unsubscribe from the mailing list.
This also causes crashes when talking to other target devices that are in-process, which is our actual use case.
The important bit is that the other server has to live in the same process, so the network system tries to handle it synchronously from within the calling thread.
Do you need to destroy DeviceProxy objects? From my experience no, and therefore you also don't need a shared_ptr for them.
[bugs:#823] Crash when executing a command from a thread on an in-process device
Status: open
Created: Mon Oct 24, 2016 02:13 PM UTC by Marius Elvert
Last Updated: Mon Oct 24, 2016 02:16 PM UTC
Owner: nobody
Hi Marius,
Thanks for the bug report.
I think this is a duplicate of bug 814 which is fixed in svn (Tango_900 branch).
To fix this problem you need to recompile Tango cppapi with the latest version of cppapi/server/blackbox.cpp file (r30193 from Tango_900 branch)
Hoping this helps.
Reynald
[bugs:#823] Crash when executing a command from a thread on an in-process device
Status: open
Created: Mon Oct 24, 2016 02:13 PM UTC by Marius Elvert
Last Updated: Mon Oct 24, 2016 02:28 PM UTC
Owner: nobody
Thank you Reynald, that fixed this and another related crash in Sardana!
[bugs:#823] Crash when executing a command from a thread on an in-process device
Status: open
Created: Mon Oct 24, 2016 02:13 PM UTC by Marius Elvert
Last Updated: Mon Oct 24, 2016 02:38 PM UTC
Owner: nobody
Thank you Marius for the confirmation.
Closed as duplicate of bug 814.
[bugs:#823] Crash when executing a command from a thread on an in-process device
Status: closed-duplicate
Created: Mon Oct 24, 2016 02:13 PM UTC by Marius Elvert
Last Updated: Mon Nov 07, 2016 01:10 PM UTC
Owner: nobody
Excuse me entering in the thread. I'm interested in the Sardana crash that you encountered.
If you think that this is our of topic here, could you please share the details in the sardan...@lists.sourceforge.net. Thanks!
[bugs:#823] Crash when executing a command from a thread on an in-process device
Status: closed-duplicate
Created: Mon Oct 24, 2016 02:13 PM UTC by Marius Elvert
Last Updated: Mon Nov 07, 2016 01:16 PM UTC
Owner: nobody