Bug 99949 - program seg faults after exit()
Summary: program seg faults after exit()
Status: RESOLVED FIXED
Alias: None
Product: valgrind
Classification: Developer tools
Component: memcheck (show other bugs)
Version: 2.3 CVS
Platform: Debian testing Linux
: NOR crash
Target Milestone: ---
Assignee: Julian Seward
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-02-21 23:12 UTC by Eyal Lebedinsky
Modified: 2005-02-22 09:14 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eyal Lebedinsky 2005-02-21 23:12:29 UTC
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.
Comment 1 Jeremy Fitzhardinge 2005-02-22 01:18:25 UTC
How are you invoking Valgrind?  If you're using --leak-check=yes, try no.
Comment 2 Jeremy Fitzhardinge 2005-02-22 03:49:01 UTC
There were a number of problems with leak-checking; try CVS head.
Comment 3 Eyal Lebedinsky 2005-02-22 08:47:30 UTC
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.
Comment 4 Jeremy Fitzhardinge 2005-02-22 08:54:49 UTC
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?
Comment 5 Eyal Lebedinsky 2005-02-22 09:10:43 UTC
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.

Comment 6 Jeremy Fitzhardinge 2005-02-22 09:13:55 UTC
It is already; it's a memcheck option, so it will only appear with --tool=memcheck --help.
Comment 7 Jeremy Fitzhardinge 2005-02-22 09:14:15 UTC
*** Bug has been marked as fixed ***.