Martin Guy | 5 Jun 2005 23:27
Picon
Gravatar

Integer divide bug in nhc98 causes runtime segfault

Hi again!
    Last november I reported a bug in the nhc runtime code that bombs
the program out with Segmentation fault during garbage collection.
Since then there have been 2 more releases of nhc98, but the Integer
divide bug has not gone away nor even made it into the known bug list.
   I've been staring at the C code for several days now without
finding it yet, so here I am reporting it again to the list.

A few example programs that segfault are attached.
Any other code that makes repeated calls to the div, mod, quot or rem
on Integers bombs equally well :)

All run fine under hugs, and their making nhc generate faulty code has
been confirmed by one other person on the net (so it isn't my C
compiler!). I also have a example program (an earlier version just
after its translation from Miranda) that runs correctly under hugs but
gives pi as "3.13785478481Segmentation fault" with hugs98 v1.16 and
1.18 (though it's 65K - hardly a test case).

I'm not an nhcbugs list reader (sorry, too poor to afford it!) -
please CC any replies.

Cheers!

    M
Attachment (s.hs): application/octet-stream, 1737 bytes
Attachment (s2.hs): application/octet-stream, 1809 bytes
Attachment (t.hs): application/octet-stream, 451 bytes
(Continue reading)


Gmane