Menu

#823 Crash when executing a command from a thread on an in-process device

closed-duplicate
nobody
None
C++ API
5
2016-11-07
2016-10-24
No

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();

Discussion

  • Marius Elvert

    Marius Elvert - 2016-10-24

    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.

     
  • Thomas Braun

    Thomas Braun - 2016-10-24

    Do you need to destroy DeviceProxy objects? From my experience no, and therefore you also don't need a shared_ptr for them.

     
  • Bourtembourg Reynald

    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

     
  • Marius Elvert

    Marius Elvert - 2016-11-07

    Thank you Reynald, that fixed this and another related crash in Sardana!

     
    • Zbigniew Reszela

      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 sardana-devel@lists.sourceforge.net. Thanks!

       
  • Bourtembourg Reynald

    • status: open --> closed-duplicate
     
  • Bourtembourg Reynald

    Thank you Marius for the confirmation.
    Closed as duplicate of bug 814.

     

Log in to post a comment.

MongoDB Logo MongoDB