[racket-dev] calling make-keyword-procedure from inside a thread produces a stack overflow in scheme_uncopy_stack

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Wed May 15 11:22:37 EDT 2013

Your example made it easy to find the problem (which would have been
difficult to track down otherwise), and I've pushed a repair.

Thanks again!

At Wed, 15 May 2013 06:47:43 -0600, Matthew Flatt wrote:
> I didn't get from your earlier message that provoking the crash is as
> easy as running the expression below, but I am indeed able to replicate
> the problem immediately.
> 
> Also, I have been swamped for the last couple of weeks, but I should be
> able to get to this soon.
> 
> Thanks!
> 
> At Wed, 15 May 2013 13:40:04 +0100, Matthew Eric Bassett wrote:
> > This is related to 
> > http://www.mail-archive.com/users@racket-lang.org/msg17597.html. Forgive 
> > me for posting it again, I wanted to make sure it didn't disappear into 
> > a black hole.
> > 
> > Launching a racket thread that calls make-keyword-procedure may produce 
> > a seg fault.  For instance,
> > 
> > (let loop () (thread (make-keyword-procedure (lambda (x y) '()))) 
> > (loop))
> > 
> > Reliably causes a seg fault.  Repeatedly calling
> > 
> > (thread (make-keyword-procedure (lambda (x y) '())))
> > 
> > will eventually (but not consistently) produce a seg fault.  Functions 
> > defined with make-keyword-procedure, such as const and thunk* suffer the 
> > same fate (plain ol' thunk is fine).
> > 
> > A coredump of the racket repl from this segfault shows a stack overflow 
> > in scheme_uncopy_stack, with the Scheme_Jumpup_Buf zeroed out.  Please 
> > see our gdp session at http://pastebin.com/aBx2FTcK (This is from racket 
> > compiled without optimization)  or cause your own seg fault with the 
> > above code.
> > 
> > Perhaps we're being incredibly daft to write code where we'd need to 
> > const or thunk* something inside a thread, or perhaps this is a bug in 
> > racket.  We might just be incredibly daft by calling a const inside a 
> > thread, or this is a bug in racket, or something else is up.  In any 
> > case, we've exhausted our abilities to investigate it further and would 
> > appreciate advice from those more familiar with the code.
> > 
> > Regards,
> > 
> > --
> > Matthew Eric Bassett | http://mebassett.info
> > _________________________
> >   Racket Developers list:
> >   http://lists.racket-lang.org/dev
> _________________________
>   Racket Developers list:
>   http://lists.racket-lang.org/dev

Posted on the dev mailing list.