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

Matthew Dillon dillon at apollo.backplane.com
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
    this:

	cd /usr/src/lib/libthread_xu

	Change THR_STACK_INITIAL from THR_STACK_DEFAULT * 2 to
	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.

						    -Matt




More information about the Users mailing list