<div dir="ltr">Dear David and all,<div><br></div><div>I confirm that the latest patch to Jana that David created this morning solved the segfault problems that I was seeing. Thank you for the rapid response, am switching production to the new Jana now.</div>
<div><br></div><div>-Richard J.</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Mar 25, 2014 at 9:52 AM, Mark Ito &lt;<a href="mailto:marki@jlab.org">marki@jlab.org</a>&gt; wrote:<br>
<blockquote class="gmail_quote">Richard and David,<br>
<br>
Sounds like we should switch to this new release for everyone, though I admit that that is not obvious. For me, I think I would like to eliminate the problem as a possibility. Note that in any case, everything we have done so far is OK output-file-wise, so we are not under the gun to do the switch &quot;now, now, now!&quot; Probably should be done soon though, if we are going to switch everyone.<br>

<br>
&nbsp; -- Mark<div class="HOEnZb"><div class="h5"><br>
<br>
On 03/25/2014 09:45 AM, David Lawrence wrote:<br>
<blockquote class="gmail_quote">
Hi Richard and Mark,<br>
<br>
&nbsp; &nbsp;I believe I now have a fix for this. I was able to reproduce the problem and after making a &ldquo;minor&rdquo; modification, it seems to have gone away. The only change was to add the RTLD_NODELETE flag to the call to dlopen when attaching a plugin. This basically prevents the shared object from actually being detached, therefore, preventing the multiple destructor calls. I&rsquo;ve made a new JANA release, 0.7.1p2 that has this one change in it. You can download the tar ball from here:<br>

<br>
<a href="http://www.jlab.org/JANA/releases/jana_0.7.1p2.tgz">http://www.jlab.org/JANA/<u></u>releases/jana_0.7.1p2.tgz</a><br>
<br>
or check out the source from subversion here:<br>
<br>
svn co <a href="https://phys12svn.jlab.org/repos/tags/jana_0.7.1p2">https://phys12svn.jlab.org/<u></u>repos/tags/jana_0.7.1p2</a><br>
<br>
<br>
The minimal set of unit tests I have seemed to work OK with this so hopefully it will not give you any problems.<br>
<br>
Regards,<br>
-David<br>
<br>
On Mar 25, 2014, at 6:55 AM, David Lawrence &lt;<a href="mailto:davidl@jlab.org">davidl@jlab.org</a>&gt; wrote:<br>
<br>
<blockquote class="gmail_quote">
Hi Richard,<br>
<br>
&nbsp; This is a problem that I have seen before and thought I fixed. It is because the linker automatically connects the global jout and jerr objects of the plugins and the main executable when they are attached. When a plugin is detached (via dlclose) the destructor is automatically called. The other plugin though still has reference to jout and jerr which causes a seg. fault when it tries to use them (even if that is just calling the destructors).<br>

<br>
&nbsp; This is an annoying problem that did not always exist and seems to have come about with a change in the system somehow rather than a change in the code. It shouldn&rsquo;t affect the output files, but does cause the program to report that it crashed which causes confusion and needs to be fixed. I&rsquo;ll take another look to see what can be done.<br>

<br>
Regards,<br>
-Dave<br>
<br>
<br>
On Mar 25, 2014, at 6:47 AM, Richard Jones &lt;<a href="mailto:richard.t.jones@uconn.edu">richard.t.jones@uconn.edu</a>&gt; wrote:<br>
<br>
<blockquote class="gmail_quote">
Hello Dave, Mark,<br>
<br>
I am getting jobs failing with segfault at the end of the hd_root command, as documented on the wiki page. &nbsp;As long as I only declare one plugin, all ends well, but as soon as I declare two as in &quot;-PPLUGINS=monitoring_hists,<u></u>danarest&quot; then the job crashes at the end with a segfault. &nbsp;The error seems to be in the output to jout at the end of the ~JApplication destructor, second time around the loop. &nbsp;The first time around the loop it is fine, but the second time (after dlclose() has been called on danarest.so) the std::ostream::operator&lt;&lt;() method goes belly-up.<br>

<br>
As a workaround, I have split the monitoring_hists and danarest plugins into separate runs, and both seem to complete ok. &nbsp;It is a bit of a waste of time, though. &nbsp;I guess there is some dependency somewhere in an existing object associated with jout that is being invalidated by the dlclose on danarest.so ?<br>

<br>
-Richard J.<br>
</blockquote></blockquote></blockquote>
<br></div></div><font color="#888888">
-- <br>
Mark M. Ito, Jefferson Lab, <a href="mailto:marki@jlab.org">marki@jlab.org</a>, <a href="tel:%28757%29269-5295">(757)269-5295</a><br>
<br>
</font></blockquote></div><br></div>