Open mingodad opened 2 years ago
you have a proposed fix ?
Not yet ! I did several tests but didn't got where the problem is right now.
Looking again I found that after commenting out this line on Makefile.in
valgrind doesn't show any invalid memory access anymore:
nodist_msta_SOURCES = yacc.c
CLEANFILES = yacc.c
msta_CFLAGS = -I$(srcdir)/AMMUNITION
#msta_LDFLAGS = -static #!!!!!<<<< commenting this line
Looking again the correct place to comment the offending line is in Makefile.am
.
it's odd that this would make a difference, except in that valgrind requires dynamic linking to inject its shared libraries overriding malloc and friends... otoh forcing a static build probably isn't that good of an idea; it should be up to the user configuring the build.
Yes I agree with you, I don't see the point to link the compiler libraries statically by default.
Valgrind can be very rigorous. There are some algorithms which work fine using uninitialized data and valgrind will complaint about this. The classical example is sparse sets https://www.geeksforgeeks.org/sparse-set/
On a fresh build of this project and executing it under valgrind gives this result: