Follow-up Comment #3, bug #46988 (project gforth):
Valgrind reports some usage of uninitialized memory with gforth-ditc, the
other engines don't have such reports.
> valgrind --track-origins=yes ./gforth-ditc
==31224== Memcheck, a memory error detector
==31224== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==31224== Using Valgrind-3.10.1 and LibVEX; rerun with -h for copyright info
==31224== Command: ./gforth-ditc
==31224==
==31224== Conditional jump or move depends on uninitialised value(s)
==31224== at 0x40AC1C: gforth_loader (in
/home/bernd/gforths/gforth/gforth-ditc)
==31224== by 0x40BCF9: gforth_start (in
/home/bernd/gforths/gforth/gforth-ditc)
==31224== by 0x40BDA5: gforth_main (in
/home/bernd/gforths/gforth/gforth-ditc)
==31224== by 0x404BE8: main (in /home/bernd/gforths/gforth/gforth-ditc)
==31224== Uninitialised value was created by a heap allocation
==31224== at 0x4C2A00F: malloc (in
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==31224== by 0x404DA2: gforth_engine (in
/home/bernd/gforths/gforth/gforth-ditc)
==31224== by 0x40ABE2: gforth_loader (in
/home/bernd/gforths/gforth/gforth-ditc)
==31224== by 0x40BCF9: gforth_start (in
/home/bernd/gforths/gforth/gforth-ditc)
==31224== by 0x40BDA5: gforth_main (in
/home/bernd/gforths/gforth/gforth-ditc)
==31224== by 0x404BE8: main (in /home/bernd/gforths/gforth/gforth-ditc)
==31224==
==31224== Conditional jump or move depends on uninitialised value(s)
==31224== at 0x40A544: gforth_relocate (in
/home/bernd/gforths/gforth/gforth-ditc)
==31224== by 0x40B1B2: gforth_loader (in
/home/bernd/gforths/gforth/gforth-ditc)
==31224== by 0x40BCF9: gforth_start (in
/home/bernd/gforths/gforth/gforth-ditc)
==31224== by 0x40BDA5: gforth_main (in
/home/bernd/gforths/gforth/gforth-ditc)
==31224== by 0x404BE8: main (in /home/bernd/gforths/gforth/gforth-ditc)
==31224== Uninitialised value was created by a heap allocation
==31224== at 0x4C2A00F: malloc (in
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==31224== by 0x404DA2: gforth_engine (in
/home/bernd/gforths/gforth/gforth-ditc)
==31224== by 0x40ABE2: gforth_loader (in
/home/bernd/gforths/gforth/gforth-ditc)
==31224== by 0x40BCF9: gforth_start (in
/home/bernd/gforths/gforth/gforth-ditc)
==31224== by 0x40BDA5: gforth_main (in
/home/bernd/gforths/gforth/gforth-ditc)
==31224== by 0x404BE8: main (in /home/bernd/gforths/gforth/gforth-ditc)
==31224==
This report goes away with the calloc() fix. Setting the arrays to junk
doesn't cause a crash even with gforth-ditc; so I read it as "might crash"
rather than "does crash".
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?46988>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
_______________________________________________
bug-gforth mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-gforth