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.
Afficher les réponses par date
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.
What if you give explicitely the output port with |CURRENT-OUTPUT-PORT|?
P!
Nicholas Walton wrote:
(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.
Ports can't be serialized, but Termite does port proxying (only optionally, I think, with spawn-{output,input}-port).
Your best bet (short of someone going to debug it for you) really is running Gambit under gdb and see where it crashes. Just run "gdb gsc" and from there load your program as usual (assuming you're using, or know how to use, |compile-file| and |load| for your programs), or "gdb yourlinkedprogram" or "gdb gsi-script" or whatever. Then "run eventualprogramarguments" then "backtrace" when it crashed.
Christian.
Christian Jaeger wrote:
Your best bet (short of someone going to debug it for you) really is running Gambit under gdb and see where it crashes. Just run "gdb gsc" and from there load your program as usual (assuming you're using, or know how to use, |compile-file| and |load| for your programs), or "gdb yourlinkedprogram" or "gdb gsi-script" or whatever. Then "run eventualprogramarguments" then "backtrace" when it crashed.
PS. I once wrote a script named "with-gdb-backtrace-to" which makes running apps under gdb trivial, I've now put it up here:
http://repo.or.cz/w/with-gdb-backtrace-to.git?a=blob_plain;f=with-gdb-backtr... http://repo.or.cz/w/with-gdb-backtrace-to.git
Christian.