[gambit-list] Segmentation fault from simple (infinite) loop
Christian Jaeger
christian at pflanze.mine.nu
Sun Feb 10 16:53:47 EST 2008
Lang Martin wrote:
> I'd be curious if display causes a segfault. I had a similar issue and
> was told it was related to a bug in keyword argument handling, and
> that avoiding keyword procedures was the way to go.
>
Seems like this is the case. Either of the following variants work
without segfault for me:
(define (loopy x)
(let* ((s (number->string x))
(len (string-length s)))
(##write-substring s 0 len (current-output-port))
(##write-substring " " 0 1(current-output-port)))
(loopy (+ 1 x)))
(define (main)
(loopy 1))
(define (loopy x)
(print x )
(print " ")
(##gc)
(loopy (+ 1 x)))
(define (main)
(loopy 1))
Note that I also never got a segfault with any variant when being compiled.
Christian.
More information about the Gambit-list
mailing list