https://code.cor-lab.de/https://code.cor-lab.de/favicon.ico?14019720732015-03-09T12:45:19ZOpen Source Collaboration PlatformRobotics Service Bus - Bug #2193: Crash in CPP introspection when destructing a participanthttps://code.cor-lab.de/issues/2193?journal_id=66392015-03-09T12:45:19ZJ. Wienkejwienke@techfak.uni-bielefeld.de
<ul></ul><p>This line points to the logger debug statement. I suspect this is caused by printing out the whole participant in this logging statement. Since concrete participant subclasses are already destructed at the point in time where the participant is being printed, their print methods will access invalid memory.</p> Robotics Service Bus - Bug #2193: Crash in CPP introspection when destructing a participanthttps://code.cor-lab.de/issues/2193?journal_id=66402015-03-09T12:45:25ZJ. Wienkejwienke@techfak.uni-bielefeld.de
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>In Progress</i></li><li><strong>Assignee</strong> changed from <i>J. Moringen</i> to <i>J. Wienke</i></li></ul> Robotics Service Bus - Bug #2193: Crash in CPP introspection when destructing a participanthttps://code.cor-lab.de/issues/2193?journal_id=66412015-03-09T12:57:03ZJ. Wienkejwienke@techfak.uni-bielefeld.de
<ul></ul><p>Maybe this is not the explanation. Listener does not implement <code>printContents</code>. Therefore only the print method of <code>Participant</code> itself exists and this one won't access memory of the <code>Listener</code> instance. Still, we should ensure in the plugin that this can never happen.</p> Robotics Service Bus - Bug #2193: Crash in CPP introspection when destructing a participanthttps://code.cor-lab.de/issues/2193?journal_id=66422015-03-09T13:00:58ZJ. Wienkejwienke@techfak.uni-bielefeld.de
<ul><li><strong>% Done</strong> changed from <i>0</i> to <i>10</i></li></ul><p>Viktor, can you try again after these fixes whether the problem persists? I suspect this isn't fixed, but I am also not sure about the origin now.</p> Robotics Service Bus - Bug #2193: Crash in CPP introspection when destructing a participanthttps://code.cor-lab.de/issues/2193?journal_id=66452015-03-10T11:42:43ZV. Richtervrichter@techfak.uni-bielefeld.de
<ul></ul><p>Tested. No it does not seem to solve it (assuming I rebuilt the right components).</p>
<p>It seems to come from deleting Participants after the corresponing Factory is out of scope. The following code reproduces the error:</p>
<pre>
#include <rsb/Factory.h>
rsb::patterns::RemoteServerPtr server;
int main(int n, char**ppc){
server = rsb::getFactory().createRemoteServer("/");
return 0;
}
</pre>
<p>Is it intended that the Factory <strong>must</strong> be held all the time?</p> Robotics Service Bus - Bug #2193: Crash in CPP introspection when destructing a participanthttps://code.cor-lab.de/issues/2193?journal_id=66462015-03-10T12:05:23ZV. Richtervrichter@techfak.uni-bielefeld.de
<ul></ul><p>V. Richter wrote:</p>
<blockquote>
<p>Tested. No it does not seem to solve it (assuming I rebuilt the right components).</p>
<p>It seems to come from deleting Participants after the corresponing Factory is out of scope. The following code reproduces the error:</p>
<p>[...]</p>
<p>Is it intended that the Factory <strong>must</strong> be held all the time?</p>
</blockquote>
<p>Looking into my environment configuration I found that the following is needed in the environment:</p>
<pre>
export RSB_PLUGINS_CPP_LOAD=rsbintrospection
</pre> Robotics Service Bus - Bug #2193: Crash in CPP introspection when destructing a participanthttps://code.cor-lab.de/issues/2193?journal_id=66792015-03-19T22:11:41ZJ. Wienkejwienke@techfak.uni-bielefeld.de
<ul></ul><p>V. Richter wrote:</p>
<blockquote>
<p>Tested. No it does not seem to solve it (assuming I rebuilt the right components).</p>
<p>It seems to come from deleting Participants after the corresponing Factory is out of scope. The following code reproduces the error:</p>
<p>[...]</p>
<p>Is it intended that the Factory <strong>must</strong> be held all the time?</p>
</blockquote>
<p>This shouldn't be the case. The factory is statically maintained inside the RSB code and one and only one instance should exist all the time. You only receive a reference to that instance in the <code>getFactory</code> call.</p> Robotics Service Bus - Bug #2193: Crash in CPP introspection when destructing a participanthttps://code.cor-lab.de/issues/2193?journal_id=66802015-03-19T22:13:00ZJ. Wienkejwienke@techfak.uni-bielefeld.de
<ul></ul><p>V. Richter wrote:</p>
<blockquote>
<p>Looking into my environment configuration I found that the following is needed in the environment:</p>
</blockquote>
<p>This is always needed for using the introspection. Without the plugin, introspection simply isn't available. So I assume it only crashes in case the introspection module is loaded?</p> Robotics Service Bus - Bug #2193: Crash in CPP introspection when destructing a participanthttps://code.cor-lab.de/issues/2193?journal_id=66872015-03-20T08:34:07ZV. Richtervrichter@techfak.uni-bielefeld.de
<ul></ul><p>J. Wienke wrote:</p>
<blockquote>
<p>V. Richter wrote:</p>
<blockquote>
<p>Looking into my environment configuration I found that the following is needed in the environment:</p>
</blockquote>
<p>This is always needed for using the introspection. Without the plugin, introspection simply isn't available. So I assume it only crashes in case the introspection module is loaded?</p>
</blockquote>
<p>Yes. The code snippet crashes with the environment variable set and does not without setting the variable.</p> Robotics Service Bus - Bug #2193: Crash in CPP introspection when destructing a participanthttps://code.cor-lab.de/issues/2193?journal_id=66902015-03-20T10:45:49ZJ. Wienkejwienke@techfak.uni-bielefeld.de
<ul></ul><p>Ok, I can reproduce the issue.</p> Robotics Service Bus - Bug #2193: Crash in CPP introspection when destructing a participanthttps://code.cor-lab.de/issues/2193?journal_id=66912015-03-20T10:58:28ZJ. Wienkejwienke@techfak.uni-bielefeld.de
<ul></ul><p>Ouch, this is a problem of static deconstruction order. The logging factory is already destroyed at the time the participant is going to be deconstructed. Therefore, logging does not work anymore.</p> Robotics Service Bus - Bug #2193: Crash in CPP introspection when destructing a participanthttps://code.cor-lab.de/issues/2193?journal_id=66922015-03-20T11:14:02ZJ. Wienkejwienke@techfak.uni-bielefeld.de
<ul></ul><p>I have no idea how to solve this. We would have to eliminate all references to static variables inside the introspection plugin to be sure that such a thing doesn't happen. But that is basically impossible. Even the introspection sender instance of the plugin could already be destroyed at the time the participant is going to be destructed.</p>
<p>Any ideas Jan?</p> Robotics Service Bus - Bug #2193: Crash in CPP introspection when destructing a participanthttps://code.cor-lab.de/issues/2193?journal_id=67162015-03-27T17:30:09ZJ. Moringenjmoringe@cor-lab.uni-bielefeld.de
<ul><li><strong>Status</strong> changed from <i>In Progress</i> to <i>Resolved</i></li><li><strong>% Done</strong> changed from <i>10</i> to <i>100</i></li></ul><p>Applied in changeset <a href="https://code.cor-lab.de/projects/rsb/repository/rsb-cpp/revisions/493f80cc77517c7b7966eac37e454a7a26df3398" class="changeset" title="fixes #2193: Improved introspection destruction">rsb-cpp|493f80cc77517c7b7966eac37e454a7a26df3398</a>.</p>