<div dir="ltr">Hi Phillipe,<div><br></div><div>Thank you for quick answer! I studied that thread but I see that it refers to well-known "dlclose" problem: trace provider as part of dlclose-ed .so is unloaded before lttng-ust is unloaded which leads to segfault. </div><div><br></div><div>But in my case both .so containing tracepoints (and trace provider) and lttng-ust are linked to application at link-time. So both are supposed load before application starts and unload after it ends. </div><div><br></div><div>Also, it would be very inconvenient for me to put trace provider into separate ".so" for some reasons.</div><div><br></div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature"><div dir="ltr">-- <br>Regards,<br>Sergei Dyshel</div></div></div>
<br><div class="gmail_quote">On Mon, Aug 10, 2015 at 10:52 PM, Philippe Proulx <span dir="ltr"><<a href="mailto:eeppeliteloop@gmail.com" target="_blank">eeppeliteloop@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Mon, Aug 10, 2015 at 1:27 PM, Sergei Dyshel <<a href="mailto:qyron.private@gmail.com">qyron.private@gmail.com</a>> wrote:<br>
> Hi all,<br>
><br>
> I have some code using traces compiled as shared object (together with trace<br>
> provider).<br>
> This ".so" is linked to main code during compile-time.<br>
> When I run main application and try to read traces after that I get errors<br>
> about corrupted trace file.<br>
><br>
> I've read docs about dynamical linking of trace provider which recommends<br>
> compiling trace provider into separate .so and using LD_PRELOAD to preload<br>
> it. But that is only needed for shared objects loaded with "dlopen". In my<br>
> case "dlclose" isn't called and shared object is unloaded on the exit (i.e.<br>
> after all traces produced).<br>
><br>
> So this shouldn't be a problem... Am I right?<br>
<br>
</span>Hello there,<br>
<br>
See if this thread helps:<br>
<<a href="http://lists.lttng.org/pipermail/lttng-dev/2014-December/023953.html" rel="noreferrer" target="_blank">http://lists.lttng.org/pipermail/lttng-dev/2014-December/023953.html</a>>.<br>
<br>
I'm not the author of LTTng-UST and I do not have a comprehensive understanding<br>
of its inner mechanics, but I believe that it's good practice to always use<br>
LD_PRELOAD with a tracepoint provider that is not statically linked with the<br>
application.<br>
<br>
Phil<br>
<span class="HOEnZb"><font color="#888888"><br>
> --<br>
> Regards,<br>
> Sergei Dyshel<br>
><br>
> _______________________________________________<br>
> lttng-dev mailing list<br>
> <a href="mailto:lttng-dev@lists.lttng.org">lttng-dev@lists.lttng.org</a><br>
> <a href="http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev" rel="noreferrer" target="_blank">http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev</a><br>
><br>
</font></span></blockquote></div><br></div>