[racket] why a segfault on the command line, but not in DrRacket?

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Tue Jan 6 15:54:29 EST 2015

Thanks for sorting out that I need to run without ".zo" files to
provoke the crash!

Your program exposed two different bugs in the JIT, both with the same
symptom --- overflowing an internal stack --- and both in the
"surprising that we didn't hit these before" category.

The first bug was in a slow path for `apply`. When the number of items
in the list provided as the last argument to `apply` is too many to fit
on the stack, then a slow path is taken. But the slow path still pushed
each argument to `apply` onto the stack, which can still run out of
space (especially if several extra arguments are provided to `apply`
before the final list argument, although I think that was not the case
heere).

The second bug was in the way that `case-lambda` is JITted. Individual
cases are JITted lazily, and the minimal stack space needed for each
case was not correctly propagated by the to overall `case-lambda`
representation.

I've pushed repairs for those bugs.


Posted on the users mailing list.