[Gc] Valgrind/gc: failure in GC_malloc ?

Hugo fbauza at carriers-interconnect.com
Fri Jan 19 13:44:05 PST 2007


Hi all,

I have a problem (big problem ?):

When run valgrind with garbage collector (GC_MALLOC) the programm finnished 
with segmentation fault. This code it's only example, the true mission it's 
other programm much more complex 

i'am use garbage collector 6.8 and valgrind 3.2.1, 
platform 
uname -m = i686
uname -r = 2.6.9-5.ELsmp
uname -s = Linux
uname -v = #1 SMP Wed Jan 5 19:30:39 EST 2005

compiler
gcc version 3.2.3 20030502 (Red Hat Linux 3.2.3-47.3)

I thank for answer, Thanks for its understanding  
 
#include <stdlib.h>
#include <stdio.h>
#include "gc.h"

int main()
{
    char *p;

    p = NULL;

    GC_INIT();

    p = GC_MALLOC(400);

    GC_FREE(p);
}

Valgrind Output

==23903== Memcheck, a memory error detector.
==23903== Copyright (C) 2002-2006, and GNU GPL'd, by Julian Seward et al.
==23903== Using LibVEX rev 1658, a library for dynamic binary translation.
==23903== Copyright (C) 2004-2006, and GNU GPL'd, by OpenWorks LLP.
==23903== Using valgrind-3.2.1, a dynamic binary instrumentation framework.
==23903== Copyright (C) 2000-2006, and GNU GPL'd, by Julian Seward et al.
==23903==
==23903== My PID = 23903, parent PID = 21274.  Prog and args are:
==23903==    solo_gc
==23903==
--23903--
--23903-- Command line
--23903--    solo_gc
--23903-- Startup, with flags:
--23903--    -v
--23903--    --tool=memcheck
--23903--    --log-file=valoriza
--23903--    --show-reachable=no
--23903--    --suppressions=/home/fbauza/local/lib/valgrind/libgc.supp
--23903--    --error-limit=no
--23903--    --leak-check=yes
--23903--    --memcheck:leak-check=yes
--23903-- Contents of /proc/version:
--23903--   Linux version 2.6.9-5.ELsmp (bhcompile at decompose.build.redhat.com) 
(gcc version 3.4.3 20041212 (Red Hat 3.4.3-9.EL4)) #1 SMP Wed Jan 5 19:30:39 
EST 2005
--23903-- Arch and hwcaps: X86, x86-sse1-sse2
--23903-- Valgrind library directory: /home/fbauza/local/lib/valgrind
--23903-- Reading syms from /lib/ld-2.3.4.so (0x9CD000)
--23903-- Reading syms from /home/fbauza/ejemplos/gcmalloc/solo_gc (0x8048000)
--23903-- Reading syms from /home/fbauza/local/lib/valgrind/x86-linux/memcheck 
(0x38000000)
--23903--    object doesn't have a dynamic symbol table
--23903-- Reading suppressions file: /home/fbauza/local/lib/valgrind/libgc.supp
--23903-- Reading suppressions 
file: /home/fbauza/local/lib/valgrind/default.supp
--23903-- REDIR: 0x9DEAE0 (index) redirected to 0x38020F17 
(vgPlain_x86_linux_REDIR_FOR_index)
--23903-- Reading syms from /home/fbauza/local/lib/valgrind/x86-
linux/vgpreload_core.so (0x4000000)
--23903-- Reading syms from /home/fbauza/local/lib/valgrind/x86-
linux/vgpreload_memcheck.so (0x4003000)
==23903== WARNING: new redirection conflicts with existing -- ignoring it
--23903--     new: 0x009DEAE0 (index     ) R-> 0x04005FD4 index
--23903-- REDIR: 0x9DEC80 (strlen) redirected to 0x4006228 (strlen)
--23903-- Reading syms from /usr/lib/libcwait.so (0x4009000)
--23903--    object doesn't have a symbol table
--23903-- Reading syms from /lib/tls/libc-2.3.4.so (0x9EA000)
--23903-- Reading syms from /usr/local/lib/libgc.so.1.0.2 (0x401C000)
--23903-- Reading syms from /lib/tls/libpthread-2.3.4.so (0xB40000)
--23903-- Reading syms from /lib/libdl-2.3.4.so (0xB3A000)
--23903-- REDIR: 0xA53B60 (memset) redirected to 0x4006B08 (memset)
--23903-- REDIR: 0xA54080 (memcpy) redirected to 0x40065A0 (memcpy)
--23903-- REDIR: 0xA52D10 (rindex) redirected to 0x4005EFC (rindex)
--23903-- REDIR: 0xA52930 (strlen) redirected to 0x400620C (strlen)
--23903-- REDIR: 0xA52B30 (strncmp) redirected to 0x4006468 (strncmp)
==23903==
==23903== Process terminating with default action of signal 11 (SIGSEGV): 
dumping core
==23903==  Access not within mapped region at address 0xBF0001F8
==23903==    at 0x402C557: GC_mark_from (mark.c:759)
==23903==    by 0x402C243: GC_mark_some (mark.c:378)
==23903==    by 0x4026309: GC_stopped_mark (alloc.c:531)
==23903==    by 0x4025FD9: GC_try_to_collect_inner (alloc.c:378)
==23903==    by 0x402EAFE: GC_init_inner (misc.c:787)
==23903==    by 0x402ABC4: GC_generic_malloc_inner (malloc.c:127)
==23903==    by 0x402ACF6: GC_generic_malloc (malloc.c:194)
==23903==    by 0x402B010: GC_malloc (malloc.c:319)
==23903==    by 0x80486AC: main (in /home/fbauza/ejemplos/gcmalloc/solo_gc)
--23903-- REDIR: 0xA4BA40 (free) redirected to 0x4005057 (free)
==23903==
==23903== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 126 from 4)
--23903--
--23903-- supp:   19 Ubuntu-stripped-ld.so
--23903-- supp:   70 GC_mark_from
--23903-- supp:    1 GC_* Addr4
--23903-- supp:   36 GC_* Cond
==23903== malloc/free: in use at exit: 0 bytes in 0 blocks.
==23903== malloc/free: 0 allocs, 0 frees, 0 bytes allocated.
==23903==
==23903== All heap blocks were freed -- no leaks are possible.
--23903--  memcheck: sanity checks: 1 cheap, 1 expensive
--23903--  memcheck: auxmaps: 0 auxmap entries (0k, 0M) in use
--23903--  memcheck: auxmaps: 0 searches, 0 comparisons
--23903--  memcheck: SMs: n_issued      = 15 (240k, 0M)
--23903--  memcheck: SMs: n_deissued    = 0 (0k, 0M)
--23903--  memcheck: SMs: max_noaccess  = 65535 (1048560k, 1023M)
--23903--  memcheck: SMs: max_undefined = 0 (0k, 0M)
--23903--  memcheck: SMs: max_defined   = 22 (352k, 0M)
--23903--  memcheck: SMs: max_non_DSM   = 15 (240k, 0M)
--23903--  memcheck: max sec V bit nodes:    1 (0k, 0M)
--23903--  memcheck: set_sec_vbits8 calls: 1 (new: 1, updates: 0)
--23903--  memcheck: max shadow mem size:   544k, 0M
--23903-- translate:            fast SP updates identified: 2,924 ( 89.7%)
--23903-- translate:   generic_known SP updates identified: 116 (  3.5%)
--23903-- translate: generic_unknown SP updates identified: 217 (  6.6%)
--23903--     tt/tc: 5,109 tt lookups requiring 5,175 probes
--23903--     tt/tc: 5,109 fast-cache updates, 3 flushes
--23903--  transtab: new        2,445 (50,617 -> 845,475; ratio 167:10) [0 scs]
--23903--  transtab: dumped     0 (0 -> ??)
--23903--  transtab: discarded  9 (222 -> ??)
--23903-- scheduler: 113,707 jumps (bb entries).
--23903-- scheduler: 1/2,858 major/minor sched events.
--23903--    sanity: 2 cheap, 1 expensive checks.
--23903--    exectx: 30,011 lists, 16 contexts (avg 0 per list)
--23903--    exectx: 126 searches, 110 full compares (873 per 1000)
--23903--    exectx: 0 cmp2, 342 cmp4, 0 cmpAll





More information about the Gc mailing list