<div dir="ltr">Thanks Mathieu.</div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jul 12, 2016 at 7:25 PM, Mathieu Desnoyers <span dir="ltr"><<a href="mailto:mathieu.desnoyers@efficios.com" target="_blank">mathieu.desnoyers@efficios.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div style="font-family:arial,helvetica,sans-serif;font-size:12pt;color:#000000"><span class=""><div><span>----- On Jul 12, 2016, at 7:05 AM, Aravind HT <<a href="mailto:aravind.ht@gmail.com" target="_blank">aravind.ht@gmail.com</a>> wrote:<br></span></div></span><div><span class=""><blockquote style="border-left:2px solid #1010ff;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt"><div dir="ltr">Hi,<br><div>Below is a recent core that I saw. Unfortunately the code is optimized, but still it points to a call to free(lttng_chan);</div><br><div><pre style="margin-top:0px;margin-bottom:0px;padding:0px;white-space:pre-wrap;word-wrap:break-word;font-size:13px;color:black">(gdb) bt
#0  0x00007f3cbb0df367 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:55
#1  0x00007f3cbb0e233a in __GI_abort () at abort.c:89
#2  0x00007f3cbb11928c in __libc_message (do_abort=do_abort@entry=2, fmt=fmt@entry=0x7f3cbb2158c8 "*** Error in `%s': %s: 0x%s ***\n") at ../sysdeps/posix/libc_fatal.c:175
#3  0x00007f3cbb122cbe in malloc_printerr (action=3, str=0x7f3cbb211a87 "free(): invalid pointer", ptr=<optimized out>) at malloc.c:4960
#4  0x00007f3cbb12349b in _int_free (av=<optimized out>, p=<optimized out>, have_lock=0) at malloc.c:3831
#5  0x00007f3cb79551c5 in lttng_abi_map_channel () from /var/tmp/iso-path.24284/altroot/usr/lib64/liblttng-ust.so.0
#6  0x00007f3cb79554c8 in ?? () from /var/tmp/iso-path.24284/altroot/usr/lib64/liblttng-ust.so.0
#7  0x00007f3cb7952846 in ?? () from /var/tmp/iso-path.24284/altroot/usr/lib64/liblttng-ust.so.0
#8  0x00007f3cb8974294 in start_thread (arg=0x7f3cb1ad7700) at pthread_create.c:336
#9  0x00007f3cbb19413d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109</pre><pre style="margin-top:0px;margin-bottom:0px;padding:0px;white-space:pre-wrap;word-wrap:break-word;font-size:13px;color:black"><br></pre><pre style="margin-top:0px;margin-bottom:0px;padding:0px;white-space:pre-wrap;word-wrap:break-word;font-size:13px;color:black">Think we should not be freeing lttng_chan here.</pre><pre style="margin-top:0px;margin-bottom:0px;padding:0px;white-space:pre-wrap;word-wrap:break-word;font-size:13px;color:black"><span style="font-family:arial,sans-serif"><br></span></pre><pre style="margin-top:0px;margin-bottom:0px;padding:0px;white-space:pre-wrap;word-wrap:break-word;font-size:13px;color:black"><span style="font-family:arial,sans-serif"><a href="https://github.com/dgoulet/lttng-ust-dev/blob/master/liblttng-ust/lttng-ust-abi.c#L516" target="_blank">https://github.com/dgoulet/lttng-ust-dev/blob/master/liblttng-ust/lttng-ust-abi.c#L516</a></span><br></pre></div></div></blockquote></span><div>By the way, this is an old repository. You should refer to <a href="https://github.com/lttng/lttng-ust/" target="_blank">https://github.com/lttng/lttng-ust/</a><br></div><div>instead.<br></div><div><br></div><div>There is indeed an issue there. I pushed the following fix into master,<br></div><div>cherry-picked into stable 2.7 and 2.8:<br></div><div><br></div><div>commit 3eae1fb99c6821530888b470528299ff187021a8<br>Author: Mathieu Desnoyers <<a href="mailto:mathieu.desnoyers@efficios.com" target="_blank">mathieu.desnoyers@efficios.com</a>><br>Date: Tue Jul 12 09:51:40 2016 -0400<br><br> Fix: remove invalid free<br> <br> On this error path, we should not free lttng_chan, because it is located<br> within an allocated shm memory area associated with the channel now. It<br> is invalid to free this pointer.<br> <br> This is invoked on a channel creation error path.<br> <br> Reported-by: Aravind HT <<a href="mailto:aravind.ht@gmail.com" target="_blank">aravind.ht@gmail.com</a>><br> Signed-off-by: Mathieu Desnoyers <<a href="mailto:mathieu.desnoyers@efficios.com" target="_blank">mathieu.desnoyers@efficios.com</a>></div><div><br></div><div>Thanks,<br></div><div><br></div><div>Mathieu<br></div><div><br></div><div><br></div><blockquote style="border-left:2px solid #1010ff;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt"><div dir="ltr"><div><pre style="margin-top:0px;margin-bottom:0px;padding:0px;white-space:pre-wrap;word-wrap:break-word;font-size:13px;color:black"><br></pre><pre style="margin-top:0px;margin-bottom:0px;padding:0px;white-space:pre-wrap;word-wrap:break-word;font-size:13px;color:black">Regards,
Aravind.</pre></div></div><br>_______________________________________________<br>lttng-dev mailing list<br><a href="mailto:lttng-dev@lists.lttng.org" target="_blank">lttng-dev@lists.lttng.org</a><br><a href="https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev" target="_blank">https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev</a><span class="HOEnZb"><font color="#888888"><br></font></span></blockquote></div><span class="HOEnZb"><font color="#888888"><div><br></div><div>-- <br></div><div>Mathieu Desnoyers<br>EfficiOS Inc.<br><a href="http://www.efficios.com" target="_blank">http://www.efficios.com</a></div></font></span></div></div></blockquote></div><br></div>