CHICKEN 5 segfault added by Kooda on Sat Oct 20 12:50:52 2018

;; bug.scm
(import srfi-18)

(define (proc)
  (error "coucou"))
  
(define th (thread-start! proc))


;; Run with `csi -:x bug.scm`

Error: segmentation violation

        Call history:

        <syntax>          (define (proc) (error "coucou"))
        <syntax>          (##core#begin (##core#ensure-toplevel-definition proc) (##core#set! proc (##core#lambda () (error "c...
        <syntax>          (##core#ensure-toplevel-definition proc)
        <syntax>          (##core#undefined)
        <syntax>          (##core#set! proc (##core#lambda () (error "coucou")))
        <syntax>          (##core#lambda () (error "coucou"))
        <syntax>          [proc] (##core#begin (error "coucou"))
        <syntax>          [proc] (error "coucou")
        <syntax>          (define th (thread-start! proc))
        <syntax>          (##core#begin (##core#ensure-toplevel-definition th) (##core#set! th (thread-start! proc)))
        <syntax>          (##core#ensure-toplevel-definition th)
        <syntax>          (##core#undefined)
        <syntax>          (##core#set! th (thread-start! proc))
        <syntax>          (thread-start! proc)
        <eval>    (thread-start! proc)  <--