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

From: Greg Hendershott (greghendershott at gmail.com)
Date: Tue Dec 30 23:46:19 EST 2014

> OTOH I may be the one causing the memory-management problems. The issues are
> arising in my typesetting program, which passes around some large data
> structures as function inputs. By "large" I mean a list of 10e5 to 10e6
> structs, each with its own hashtable. Perhaps this is imprudent. It
> certainly makes the GC huff and puff (about 25-30% of my running time is GC)
> OTOOH, it does seem to be a command-line peculiarity, because I haven't
> found a similar limit for DrRacket yet. For instance, I just typeset a file
> with 1.5M characters, resulting in a ~600 page PDF, and it ran fine.
> When I tried running on the command line with this input, I got a different
> error than before (and within a couple seconds of starting the program):
> Seg fault (internal error during gc) at 0x10aac0000
> Bus error: 10 (core dumped)

In DrRacket, what's the setting for Racket | Limit Memory -- a
specific amount or Unlimited? If it's not already Unlimited, by
changing to that can you get the problem to occur in DrR, too?

IOW perhaps the segfault doesn't happen with smaller, more frequent GCs.

(That wouldn't explain the segfault. But it might suggest a temporary
work-around for command-line Racket: to use custodian-limit-memory or
to use a sandbox with a memory limit -- at whatever value DrR was
using when not segfaulting?)

Posted on the users mailing list.