[Tango-cs-bug-info] [tango-cs:bugs] #823 Crash when executing a command from a thread on an in-process device

3 views
Skip to first unread message

tango-cs...@lists.sourceforge.net

unread,
Oct 24, 2016, 10:14:45 AM10/24/16
to Tango-cs...@lists.sf.net

[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.

message-footer.txt

tango-cs...@lists.sourceforge.net

unread,
Oct 24, 2016, 10:16:52 AM10/24/16
to Tango-cs...@lists.sf.net

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.

message-footer.txt

tango-cs...@lists.sourceforge.net

unread,
Oct 24, 2016, 10:29:39 AM10/24/16
to Tango-cs...@lists.sf.net

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

message-footer.txt

tango-cs...@lists.sourceforge.net

unread,
Oct 24, 2016, 10:39:13 AM10/24/16
to Tango-cs...@lists.sf.net

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

message-footer.txt

tango-cs...@lists.sourceforge.net

unread,
Nov 7, 2016, 8:11:27 AM11/7/16
to Tango-cs...@lists.sf.net

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

message-footer.txt

tango-cs...@lists.sourceforge.net

unread,
Nov 7, 2016, 8:17:03 AM11/7/16
to Tango-cs...@lists.sf.net
  • status: open --> closed-duplicate
  • Comment:

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

message-footer.txt

tango-cs...@lists.sourceforge.net

unread,
Nov 8, 2016, 5:40:11 AM11/8/16
to Tango-cs...@lists.sf.net

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

message-footer.txt
Reply all
Reply to author
Forward
0 new messages