[Gc] Re: GC_INIT vs valgrind on Fedora 14

Jim Meyering jim at meyering.net
Tue Dec 21 09:53:17 PST 2010


Ludovic Courtès wrote:
...
>>     $ valgrind ./a.out >& k
>>     zsh: segmentation fault (core dumped)  valgrind ./a.out >&k
>>     [Exit 139 (SEGV)]
>
> Fortunately there’s now a workaround, see:
>
>   http://lists.gnu.org/archive/html/guile-devel/2010-11/msg00037.html

Hi Ludo,

Thanks for the quick reply and suggestion.
I've just done the following:

# Check out latest sources from cvs and
# Build, as recommended:

    (export CFLAGS=-DUSE_GET_STACKBASE_FOR_MAIN; ./configure && make)

# Rerun my test, using the just-build library:

    $ printf '#include "gc.h"\nint main(){GC_INIT();return 0;}' > k.c
    $ gcc -W -Wall k.c ./.libs/libgc.a -lpthread && ./a.out && echo ok
    $ valgrind ./a.out &> k && echo 'no segfault!'
    no segfault!

Nice!  Thanks again.

However, at least on i686, I do see these:

    $ grep Use.of k
    ==28209== Use of uninitialised value of size 4
    ==28209== Use of uninitialised value of size 4
    ==28209== Use of uninitialised value of size 4
    ==28209== Use of uninitialised value of size 4
    ==28209== Use of uninitialised value of size 4

Has anyone investigated the above?
At worst, I'll just add suppressions for them.



More information about the Gc mailing list