Can anyone help to shed the light on mysterious bug in SBCL (probably)?

Matthew Dillon dillon at
Mon Apr 14 09:50:25 PDT 2014

:Hello. I use DragonFlyBSD on x86-64 machine:
:Fatal error 'Cannot allocate red zone for initial thread' at line 275 in
:file /usr/src/lib/libthread_xu/thread/thr_init.c (errno = 12)

    Hmm.  It sounds like the threading system is being started late.
    What is happening is that the main program has already allocated stack
    past the initial thread stack size before trying to start the pthreads
    subsystem.  This is a lot of space... 2MB or so.  I don't know why it
    is doing that.

    Either that or some part of SBCL did some specific mmap()'s into
    the user stack space which it should not have done.  It is one of those
    two things.

    Here is something to try real quick as a patch to libthread_xu.  It
    requires DragonFly sources in /usr/src (if you haven't already) to test

	cd /usr/src/lib/libthread_xu

	THR_STACK_DEFAULT * 4 in thread/thr_private.h.

	Then recompile libthread_xu:

	cd /usr/srclib/libthread_xu
	make clean
	make obj
	make clean
	make -j 4
	make install

    If that doesn't work then try * 8... I don't know how much stack lisp
    is trying to use.  The default 2MB is already a lot.  So if it still
    doesn't work then it must be trying to do specific mmap()'s into the
    user stack area which the program should definitely not be doing.


More information about the Users mailing list