<div dir="auto"><div>It doesn't seem like you don't have the debug symbols in the runtime. Probably you need to install the Debug extension for your runtime.<br><br><div class="gmail_quote"><div dir="ltr">On Thu, Dec 20, 2018, 10:01 AM Jiří Janoušek <<a href="mailto:janousek.jiri@gmail.com">janousek.jiri@gmail.com</a> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello Flatpak friends,<br>
<br>
I have this buggy sample C file from The Valgrind Quick Start Guide:<br>
<br>
------- leak.c -----<br>
#include <stdlib.h><br>
void f(void) {<br>
  int* x = malloc(10 * sizeof(int));<br>
  x[10] = 0;<br>
}<br>
int main(void) {<br>
  f();<br>
  return 0;<br>
}<br>
------ EOF ------<br>
<br>
When I run Valgrind on a host (Fedora 29), I get the expected output:<br>
<br>
host$ gcc -g -O0 leak.c -o leak<br>
host$ valgrind --leak-check=yes ./leak<br>
==10191== Memcheck, a memory error detector<br>
==10191== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.<br>
==10191== Using Valgrind-3.14.0 and LibVEX; rerun with -h for copyright info<br>
==10191== Command: ./leak<br>
==10191==<br>
==10191== Invalid write of size 4<br>
==10191==    at 0x401144: f (leak.c:4)<br>
==10191==    by 0x401155: main (leak.c:7)<br>
==10191==  Address 0x4a3b068 is 0 bytes after a block of size 40 alloc'd<br>
==10191==    at 0x483880B: malloc (vg_replace_malloc.c:299)<br>
==10191==    by 0x401137: f (leak.c:3)<br>
==10191==    by 0x401155: main (leak.c:7)<br>
==10191==<br>
==10191==<br>
==10191== HEAP SUMMARY:<br>
==10191==     in use at exit: 40 bytes in 1 blocks<br>
==10191==   total heap usage: 1 allocs, 0 frees, 40 bytes allocated<br>
==10191==<br>
==10191== 40 bytes in 1 blocks are definitely lost in loss record 1 of 1<br>
==10191==    at 0x483880B: malloc (vg_replace_malloc.c:299)<br>
==10191==    by 0x401137: f (leak.c:3)<br>
==10191==    by 0x401155: main (leak.c:7)<br>
==10191==<br>
==10191== LEAK SUMMARY:<br>
==10191==    definitely lost: 40 bytes in 1 blocks<br>
==10191==    indirectly lost: 0 bytes in 0 blocks<br>
==10191==      possibly lost: 0 bytes in 0 blocks<br>
==10191==    still reachable: 0 bytes in 0 blocks<br>
==10191==         suppressed: 0 bytes in 0 blocks<br>
==10191==<br>
==10191== For counts of detected and suppressed errors, rerun with: -v<br>
==10191== ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0)<br>
<br>
However, when I run Valgrind inside a Flatpak sandbox (flatpak<br>
1.0.6-3.fc29), I get only nonsense:<br>
<br>
host$ flatpak run --devel --filesystem=$PWD org.gnome.Sdk//3.30<br>
sh-4.4$ rm -f leak; gcc -g -O0 leak.c -o leak<br>
sh-4.4$ valgrind --leak-check=yes ./leak<br>
==11== Memcheck, a memory error detector<br>
==11== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.<br>
==11== Using Valgrind-3.13.0 and LibVEX; rerun with -h for copyright info<br>
==11== Command: ./leak<br>
==11==<br>
==11== Conditional jump or move depends on uninitialised value(s)<br>
==11==    at 0x401D248: ??? (in /usr/lib/x86_64-linux-gnu/<a href="http://ld-2.27.so" rel="noreferrer noreferrer" target="_blank">ld-2.27.so</a>)<br>
==11==    by 0x40081DC: ??? (in /usr/lib/x86_64-linux-gnu/<a href="http://ld-2.27.so" rel="noreferrer noreferrer" target="_blank">ld-2.27.so</a>)<br>
==11==<br>
==11== Conditional jump or move depends on uninitialised value(s)<br>
==11==    at 0x401D46E: ??? (in /usr/lib/x86_64-linux-gnu/<a href="http://ld-2.27.so" rel="noreferrer noreferrer" target="_blank">ld-2.27.so</a>)<br>
==11==    by 0x2D34365F3638782E: ???<br>
==11==    by 0x6E672D78756E696B: ???<br>
==11==    by 0x6972676C61762F74: ???<br>
==11==    by 0x65727067762F646D: ???<br>
==11==    by 0x726F635F64616F6B: ???<br>
==11==    by 0x2D3436646D612D64: ???<br>
==11==    by 0x6F732E78756E696B: ???<br>
==11==<br>
==11== Conditional jump or move depends on uninitialised value(s)<br>
==11==    at 0x401D46E: ??? (in /usr/lib/x86_64-linux-gnu/<a href="http://ld-2.27.so" rel="noreferrer noreferrer" target="_blank">ld-2.27.so</a>)<br>
==11==    by 0x400B580: ??? (in /usr/lib/x86_64-linux-gnu/<a href="http://ld-2.27.so" rel="noreferrer noreferrer" target="_blank">ld-2.27.so</a>)<br>
==11==<br>
==11==<br>
==11== HEAP SUMMARY:<br>
==11==     in use at exit: 0 bytes in 0 blocks<br>
==11==   total heap usage: 0 allocs, 0 frees, 0 bytes allocated<br>
==11==<br>
==11== All heap blocks were freed -- no leaks are possible<br>
==11==<br>
==11== For counts of detected and suppressed errors, rerun with: -v<br>
==11== Use --track-origins=yes to see where uninitialised values come from<br>
==11== ERROR SUMMARY: 6 errors from 3 contexts (suppressed: 0 from 0)<br>
<br>
Are there any magic spells to make Valgrind work?<br>
<br>
Best regards,<br>
<br>
Jiri Janousek<br>
_______________________________________________<br>
Flatpak mailing list<br>
<a href="mailto:Flatpak@lists.freedesktop.org" target="_blank" rel="noreferrer">Flatpak@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/flatpak" rel="noreferrer noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/flatpak</a><br>
</blockquote></div></div></div>