HCC:/home/zyd/projects #
valgrind --tool=memcheck --leak-check=full --show-reachable=yes ./test
==24939== Memcheck, a memory error detector.
==24939== Copyright (C) 2002-2008, and GNU GPL'd, by Julian Seward et al.
==24939== Using LibVEX rev 1884, a library for dynamic binary translation.
==24939== Copyright (C) 2004-2008, and GNU GPL'd, by OpenWorks LLP.
==24939== Using valgrind-3.4.1, a dynamic binary instrumentation framework.
==24939== Copyright (C) 2000-2008, and GNU GPL'd, by Julian Seward et al.
==24939== For more details, rerun with: -v
==24939==
--24939-- DWARF2 CFI reader: unhandled CFI instruction 0:10
--24939-- DWARF2 CFI reader: unhandled CFI instruction 0:10
test generic function 11
test generic function 21
exit_stub 1 0xbe8eb050, 0x80488c7
==24939==
==24939== Process terminating with default action of signal 11 (SIGSEGV)
==24939==
Access not within mapped region at address 0x0
==24939==
at 0x1: ???
==24939==
by 0x4196ACD: (below main) (in /lib/libc-2.10.1.so)
==24939==
If you believe this happened as a result of a stack overflow in your
==24939==
program's main thread (unlikely but possible), you can try to increase
==24939==
the size of the main thread stack using the --main-stacksize= flag.
==24939==
The main thread stack size used in this run was 8388608.
==24939==
==24939== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 3 from 1)
==24939== malloc/free: in use at exit: 0 bytes in 0 blocks.
==24939== malloc/free: 0 allocs, 0 frees, 0 bytes allocated.
==24939== For counts of detected errors, rerun with: -v
==24939== All heap blocks were freed -- no leaks are possible.
Segmentation fault
HCC:/home/zyd/projects #
刚才使用valgrind工具打印出一些更详细的信息,但是原因我也还在做进一步分析,如果您有什么新的想法,也希望您能及时指教