Re: nhc98-1.{00,01} produce crashing programs



About this list Date view Thread view Subject view Author view

Malcolm Wallace (malcolm-nhc@cs.york.ac.uk)
Mon, 1 Jan 2001 19:36:15 +0000


| ... | produces a program which prints 13*60-1 dots and one slash instead | of 13*60 dots. The first byte of malloced memory is from time to time | (perhaps after gc) magically increased, unless it was already '\xFF'. Ok, this was a very amusing bug. If you change the heapsize at runtime, with e.g. +RTS -H3k -RTS to set a 3 kilobyte heap, you see many more accidental increments. This confirms it is a GC-related bug. Fortunately, I didn't need to grovel around in the GC algorithm, just change the run-time representation of Addrs. It's a one-line change in the compiler, with a corresponding one-line change in GreenCard as well. Committed to CVS today. | You may also get a crashing program if you prefer: import malloc and | pokeElemOff from module FFI instead of using versions provided here. Indeed. This bad behaviour is also fixed by the one-line change above. | Another bug: passing Int16 to C functions produces code which refers | to nonexistant GET_16BIT_VALUE function. Similarly GET_64BIT_VALUE. Ok, I'm working on this at the moment. Int/Word 8/16/64 are not really supported properly at all right now. But tomorrow they will be. :-) | ghc from version 4.09 upwards (not released yet) has no longer a driver | written in Perl, and thus confhc magic for getting its libdir does | not work. Thank you for pointing this out before ghc gets a new full release. I shall have to ask the ghc people what the best libdir magic should be. | QForeign, my Haskell<->C interfacing library, now supports nhc. Excellent news. Thanks! Regards, Malcolm


About this list Date view Thread view Subject view Author view