|
From: Juan C. M. S. <jua...@gm...> - 2010-06-22 18:33:15
|
Hello everyone!, I am getting a segmentation fault when I use the bellow command line: valgrind -v --tool=cachegrind --trace-children=yes ./dijkstra_large input.dat > output_large.dat Without using valgrind, the program (dijkstra) works as I expected. This is the whole message... ========================================================== ==2688== Memcheck, a memory error detector. ==2688== Copyright (C) 2002-2005, and GNU GPL'd, by Julian Seward et al. ==2688== Using LibVEX rev 1575, a library for dynamic binary translation. ==2688== Copyright (C) 2004-2005, and GNU GPL'd, by OpenWorks LLP. ==2688== Using valgrind-3.1.1, a dynamic binary instrumentation framework. ==2688== Copyright (C) 2000-2005, and GNU GPL'd, by Julian Seward et al. ==2688== --2688-- Command line --2688-- ./dijkstra_large --2688-- input.dat --2688-- Startup, with flags: --2688-- -v --2688-- Contents of /proc/version: --2688-- Linux version 2.6.9-89.0.25.ELsmp (moc...@bu...) (gcc version 3.4.6 20060404 (Red Hat 3.4.6-11)) #1 SMP Thu May 6 12:28:03 EDT 2010 --2688-- Arch and subarch: X86, x86-sse2 --2688-- Valgrind library directory: /usr/lib/valgrind --2688-- Reading syms from /home/jcmartin78/Downloads/MiBench/network/dijkstra/dijkstra_large (0x8048000) --2688-- object doesn't have a dynamic symbol table --2688-- Reading syms from /usr/lib/valgrind/x86-linux/memcheck (0xB0000000) --2688-- object doesn't have a dynamic symbol table --2688-- Reading suppressions file: /usr/lib/valgrind/default.supp ==2688== Invalid write of size 4 ==2688== at 0x806F13F: _IO_vfscanf (in /home/jcmartin78/Downloads/MiBench/network/dijkstra/dijkstra_large) ==2688== by 0x8070CCA: vfscanf (in /home/jcmartin78/Downloads/MiBench/network/dijkstra/dijkstra_large) ==2688== by 0x8049385: fscanf (in /home/jcmartin78/Downloads/MiBench/network/dijkstra/dijkstra_large) ==2688== by 0x80487D2: main (dijkstra_large.c:161) ==2688== Address 0xBEF2A794 is not stack'd, malloc'd or (recently) free'd ==2688== ==2688== Process terminating with default action of signal 11 (SIGSEGV) ==2688== Access not within mapped region at address 0xBEF2A794 ==2688== at 0x806F13F: _IO_vfscanf (in /home/jcmartin78/Downloads/MiBench/network/dijkstra/dijkstra_large) ==2688== by 0x8070CCA: vfscanf (in /home/jcmartin78/Downloads/MiBench/network/dijkstra/dijkstra_large) ==2688== by 0x8049385: fscanf (in /home/jcmartin78/Downloads/MiBench/network/dijkstra/dijkstra_large) ==2688== by 0x80487D2: main (dijkstra_large.c:161) ==2688== ==2688== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0) ==2688== ==2688== 1 errors in context 1 of 1: ==2688== Invalid write of size 4 ==2688== at 0x806F13F: _IO_vfscanf (in /home/jcmartin78/Downloads/MiBench/network/dijkstra/dijkstra_large) ==2688== by 0x8070CCA: vfscanf (in /home/jcmartin78/Downloads/MiBench/network/dijkstra/dijkstra_large) ==2688== by 0x8049385: fscanf (in /home/jcmartin78/Downloads/MiBench/network/dijkstra/dijkstra_large) ==2688== by 0x80487D2: main (dijkstra_large.c:161) ==2688== Address 0xBEF2A794 is not stack'd, malloc'd or (recently) free'd ==2688== IN SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0) ==2688== ==2688== malloc/free: in use at exit: 0 bytes in 0 blocks. ==2688== malloc/free: 0 allocs, 0 frees, 0 bytes allocated. ==2688== ==2688== All heap blocks were freed -- no leaks are possible. --2688-- memcheck: sanity checks: 0 cheap, 1 expensive --2688-- memcheck: auxmaps: 0 auxmap entries (0k, 0M) in use --2688-- memcheck: auxmaps: 0 searches, 0 comparisons --2688-- memcheck: secondaries: 7 issued (448k, 0M) --2688-- memcheck: secondaries: 6 accessible and distinguished (384k, 0M) --2688-- tt/tc: 968 tt lookups requiring 969 probes --2688-- tt/tc: 968 fast-cache updates, 2 flushes --2688-- translate: new 484 (8,776 -> 146,350; ratio 166:10) [0 scs] --2688-- translate: dumped 0 (0 -> ??) --2688-- translate: discarded 0 (0 -> ??) --2688-- scheduler: 1,226 jumps (bb entries). --2688-- scheduler: 0/492 major/minor sched events. --2688-- sanity: 1 cheap, 1 expensive checks. --2688-- exectx: 30,011 lists, 1 contexts (avg 0 per list) --2688-- exectx: 1 searches, 0 full compares (0 per 1000) --2688-- exectx: 0 cmp2, 0 cmp4, 0 cmpAll ========================================================== -- Juan Carlos |