|
From: Suresh <tsu...@gm...> - 2004-07-16 09:10:52
|
Hi,
I tried to debug a C# program under mono for memory leaks. though
my program is small, i have to run using "mono sample.exe". if i give
"valgrind mono sample.exe", it fails to run the program. even, just
giving "valgrind mono" itself fails after printing some messages.
I did some hack (driver.c:532) in mono source code giving some
printf's. the printfs either do not work here, throwing SIGSEGV, if i
pass some parameters to printf. Otherwise, it prints the message
i.e.
at the specific location, reported by the valgrind
printf ("check here"); // works
whereas
printf ("check here %d", 100); // does not work.
Is this the problem of stack got corrupted? I will be glad & thankful
if anyone could suggest to fix this problem. Is there anyway to
increase the stack size for valgrind?
test> valgrind --tool=memcheck mono
==12075== Memcheck, a memory error detector for x86-linux.
==12075== Copyright (C) 2002-2004, and GNU GPL'd, by Julian Seward.
==12075== Using valgrind-2.1.2.CVS, a program supervision framework
for x86-linux.
==12075== Copyright (C) 2000-2004, and GNU GPL'd, by Julian Seward.
==12075== For more details, rerun with: -v
==12075==
Usage is: mono [options] assembly
Runtime and JIT debugging:
--compile METHOD Just compile METHOD in assembly
--ncompile N Number of times to compile METHOD (default: 1)
--regression Runs the regression test contained in the assembly
--print-vtable Print the vtable of all used classes
--trace[=EXPR] Enable tracing, use --help-trace for details
--compile-all Compiles all the methods in the assembly
--breakonex Inserts a breakpoint on exceptions
--break METHOD Inserts a breakpoint at METHOD entry
--debug Enable debugging support
--stats Print statistics about the JIT operations
Development:
--statfile FILE Sets the stat file to FILE
--aot Compiles the assembly to native code
--profile[=profiler] Runs in profiling mode with the specified
profiler module
--graph[=TYPE] METHOD Draws a graph of the specified method:
==12075== Invalid read of size 4
==12075== at 0x1C5BE927: _IO_vfprintf_internal (in /lib/i686/libc.so.6)
==12075== by 0x1C5C7ADF: _IO_printf (in /lib/i686/libc.so.6)
==12075== by 0x1B95E206: mini_usage (driver.c:532)
==12075== by 0x1B95EEFF: mono_main (driver.c:709)
==12075== Address 0x0 is not stack'd, malloc'd or (recently) free'd
==12075==
==12075== Process terminating with default action of signal 11 (SIGSEGV)
==12075== Access not within mapped region at address 0x0
==12075== at 0x1C5BE927: _IO_vfprintf_internal (in /lib/i686/libc.so.6)
==12075== by 0x1C5C7ADF: _IO_printf (in /lib/i686/libc.so.6)
==12075== by 0x1B95E206: mini_usage (driver.c:532)
==12075== by 0x1B95EEFF: mono_main (driver.c:709)
==12075==
==12075== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 39 from 1)
==12075== malloc/free: in use at exit: 348 bytes in 7 blocks.
==12075== malloc/free: 7 allocs, 0 frees, 348 bytes allocated.
==12075== For a detailed leak analysis, rerun with: --leak-check=yes
==12075== For counts of detected errors, rerun with: -v
Segmentation fault
cheers,
suresh.
|