[gambit-list] Consistent, small program segmentation fault between 4.6.7 and 4.5.8

Bakul Shah bakul at bitblocks.com
Wed Jun 5 21:01:39 EDT 2013

FWIW, it fails with a heap overflow on FreeBSD-91 (x86-64) as
well. gsi was built from yesterday's git pull) but its
behavior is peculiar. It fails for pi 20K-something but
succeeds for (pi 200000) so I wrote a little test program to
see for what N in (pi N) it fails in the hope this reveals
some pattern.

cat > tst.sh <<'EOF'
if [ .$start = "." ]; then start=20000; fi
if [ .$end = "." ]; then end=$(($start + 10000)); fi
if [ .$incr = "." ]; then incr=1000; fi

while [ $i -le $end ]; do
    echo "$i"
    x=$(echo "(define x (pi " $i "))")
    gsi/gsi chud.scm -e "$x"
    i=$(($i + $incr))
chmod +x tst.sh

# Now I ran it for 1..10000 digits of pi.
$ tst.sh 1 10000 1 >& foo
$ grep -B 1 FATAL foo
*** FATAL ERROR -- Heap overflow
*** FATAL ERROR -- Heap overflow
*** FATAL ERROR -- Heap overflow
*** FATAL ERROR -- Heap overflow
*** FATAL ERROR -- Heap overflow

Next I turned tracing on for ch-split.  Unfortunately gsi
sends its own debugging output to the console while the FATAL
ERROR message goes to stderr and the two are not synchronized
so we don't know see exactly where it faulted.

Anyway, this pattern doesn't reveal anything interesting at
the moment....

We know it works for v6.6.1 so may be it is worth doing a
binary search over git commits?

More information about the Gambit-list mailing list