On 2012-01-06 08:04 +0100, Raphael Geissert wrote: > On Thursday 05 January 2012 15:36:47 Raphael Geissert wrote: >> Apparently nobody had run valgrind on the collector for a long time and >> there are lots of bugs, but those have been there for a long time. Will >> probably address them by tomorrow and post a patch, so that if you have no >> luck with the backtrace you can run it on valgrind and get a meaningful >> output.
How should I proceed to obtain a backtrace? Running readahead-collector manually does not seem to do anything, and the manpage is rather terse. > Attached is the patch. The only things that valgrind still complains about > are > some leaks[1] and the use of some uninitialized memory in auparse (which I'll > try to investigate sts.) > > To run valgrind do something like: > touch /.readahead_collect > edit /etc/init.d/early-readahead to replace s-s-d's > --exec $READAHEAD_COLLECT_CMD > with > --exec /usr/bin/valgrind -- --trace-children=yes --track-origins=yes > $READAHEAD_COLLECT_CMD 2> /run/rac-valgrind.log Thanks, that may have produced some meaningful output (attached). Cheers, Sven
==240== Memcheck, a memory error detector ==240== Copyright (C) 2002-2010, and GNU GPL'd, by Julian Seward et al. ==240== Using Valgrind-3.6.1 and LibVEX; rerun with -h for copyright info ==240== Command: /sbin/readahead-collector ==240== ==240== Warning: ignored attempt to set SIGKILL handler in sigaction(); ==240== the SIGKILL signal is uncatchable ==240== Warning: ignored attempt to set SIGSTOP handler in sigaction(); ==240== the SIGSTOP signal is uncatchable ==240== ==240== HEAP SUMMARY: ==240== in use at exit: 335 bytes in 23 blocks ==240== total heap usage: 24 allocs, 1 frees, 687 bytes allocated ==240== ==240== LEAK SUMMARY: ==240== definitely lost: 0 bytes in 0 blocks ==240== indirectly lost: 0 bytes in 0 blocks ==240== possibly lost: 0 bytes in 0 blocks ==240== still reachable: 335 bytes in 23 blocks ==240== suppressed: 0 bytes in 0 blocks ==240== Rerun with --leak-check=full to see details of leaked memory ==240== ==240== For counts of detected and suppressed errors, rerun with: -v ==240== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 15 from 6) ==243== Conditional jump or move depends on uninitialised value(s) ==243== at 0x491717D: auparse_init (in /lib/libauparse.so.0.0.0) ==243== by 0x804B75E: parse_events (readahead-collector.c:1035) ==243== by 0x67B3E45: (below main) (libc-start.c:228) ==243== Uninitialised value was created by a heap allocation ==243== at 0x48CC018: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so) ==243== by 0x804A6FF: main (readahead-collector.c:926) ==243== ==243== Conditional jump or move depends on uninitialised value(s) ==243== at 0x49171C8: auparse_init (in /lib/libauparse.so.0.0.0) ==243== by 0x804B75E: parse_events (readahead-collector.c:1035) ==243== by 0x67B3E45: (below main) (libc-start.c:228) ==243== Uninitialised value was created by a heap allocation ==243== at 0x48CC018: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so) ==243== by 0x804A6FF: main (readahead-collector.c:926) ==243== ==243== Conditional jump or move depends on uninitialised value(s) ==243== at 0x48CB1DF: free (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so) ==243== by 0x804BDC2: parse_events (readahead-collector.c:1204) ==243== by 0x804A7FB: main (readahead-collector.c:962) ==243== Uninitialised value was created by a stack allocation ==243== at 0x804B704: parse_events (readahead-collector.c:1024) ==243== ==243== Invalid free() / delete / delete[] ==243== at 0x48CB21C: free (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so) ==243== by 0x804BDC2: parse_events (readahead-collector.c:1204) ==243== by 0x804A7FB: main (readahead-collector.c:962) ==243== Address 0xfe8cba16 is on thread 1's stack ==243== ==243== Invalid read of size 4 ==243== at 0x804BDB8: parse_events (readahead-collector.c:1204) ==243== by 0x804A7FB: main (readahead-collector.c:962) ==243== Address 0xfe8ca99c is just below the stack ptr. To suppress, use: --workaround-gcc296-bugs=yes ==243== ==243== ==243== Process terminating with default action of signal 11 (SIGSEGV) ==243== Access not within mapped region at address 0xFE8C5FFC ==243== at 0x804BDB8: parse_events (readahead-collector.c:1204) ==243== by 0x804A7FB: main (readahead-collector.c:962) ==243== If you believe this happened as a result of a stack ==243== overflow in your program's main thread (unlikely but ==243== possible), you can try to increase the size of the ==243== main thread stack using the --main-stacksize= flag. ==243== The main thread stack size used in this run was 8388608. ==243== ==243== HEAP SUMMARY: ==243== in use at exit: 10,407 bytes in 26 blocks ==243== total heap usage: 177 allocs, 551 frees, 1,062,674 bytes allocated ==243== ==243== LEAK SUMMARY: ==243== definitely lost: 1,040 bytes in 1 blocks ==243== indirectly lost: 0 bytes in 0 blocks ==243== possibly lost: 0 bytes in 0 blocks ==243== still reachable: 9,367 bytes in 25 blocks ==243== suppressed: 0 bytes in 0 blocks ==243== Rerun with --leak-check=full to see details of leaked memory ==243== ==243== For counts of detected and suppressed errors, rerun with: -v ==243== ERROR SUMMARY: 5121 errors from 5 contexts (suppressed: 15 from 6)