My program seg faukts after exit(). It is in C and has no atexit(). The log end (below) looks truncated. No vcore. ==2005-02-22 09:03:53.660 15910== ==2005-02-22 09:03:53.660 15910== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 43 from 1) --2005-02-22 09:03:53.660 15910-- --2005-02-22 09:03:53.660 15910-- supp: 43 Ugly strchr error in /lib/ld-2.3.2.so ==2005-02-22 09:03:53.660 15910== malloc/free: in use at exit: 4765 bytes in 50 blocks. ==2005-02-22 09:03:53.660 15910== malloc/free: 10735 allocs, 10685 frees, 99923376 bytes allocated. ==2005-02-22 09:03:53.660 15910== ==2005-02-22 09:03:53.660 15910== searching for pointers to 50 not-freed blocks.
How are you invoking Valgrind? If you're using --leak-check=yes, try no.
There were a number of problems with leak-checking; try CVS head.
I run it as strace valgrind --tool=memcheck \ --leak-check=yes \ --show-reachable=no \ --num-callers=50 \ --error-limit=no \ --run-libc-freeres=no \ --time-stamp=yes \ --trace-syscalls=yes \ --trace-signals=yes \ -v \ My program and args... *** I do not see a --leak-check option in help, yet it accepts it. *** It fixed the problem too. Magic. Naturally, I AM using cvs head.
No, I mean I just checked in some fixes for leak checking. When you say "it fixed the problem", do you mean not using --leak-check=yes, or using a current CVS head?
I mean both. I updated from cvs hoping to see the unlisted option but it does not show. I only then realised that I was already using --leak-check=yes. I then ran with '=no' and did not have a crash. I now returned to '--leak-check=yes' and it still does not crash. It must be fixed then. I reckon the option should be added to the help though.
It is already; it's a memcheck option, so it will only appear with --tool=memcheck --help.
*** Bug has been marked as fixed ***.