Christian,
Many thanks for that. The code is pure R5RS until it hits Termite of course, no #!key or #!rest variables anywhere to be seen. All I/O is done by write, display or newline.
I strongly suspect the problem is in Termite since weird things happen eg if I replace the (+ j j) in the example code with (newline)(write ..) I get the problem, but I also get the problem if I replace it with
(if #t (+ j j) (begin (newline) (write ...)))
Termite seems to pick up the possible I/O and crashes even if I/O is never executed. I therefore suspect a problem in the serialisation of ports but I can't be sure.
NIck
On Tuesday, November 25, 2008, at 01:48PM, "Christian Jaeger" christian@pflanze.mine.nu wrote:
Nicholas Walton wrote:
Any ideas please?
I can't really say anything about the memory leaking (I'm not a regular Termite user).
Regarding the segv's/bus errors, run the code under gdb and look at or show the backtrace, this should give a clue on what's happening. Compile with cc-options -g and with options keep-c or track-scheme for better location reporting.
Just to be sure, check whether you're using |print| or |println| or defining own functions using both the #!key and #!rest syntax at the same time, since Gambit has (afaik still) a known problem in the GC when calling such procedures (it is triggered only when a GC happens in the right place, so you'll only see it when you're calling such procedures often).
People having time to debug (not me currently) might appreciate a complete example to reproduce the problem.
Christian.