Bug #1347

Installworld failed on HEAD

Added by sepherosa almost 5 years ago. Updated almost 5 years ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:-
Target version:-

Description

Hi all,

Both kernel and world are built with buildkernel and buildworld. New
kernel is installed before installing the world.
I got following error from cpdup during installworld:
Fatal error 'Cannot allocate red zone for initial thead' at line 263
in file /usr/src/lib/libthread_xu/thread/thr_init.c (errno = 12)
Seems to be related to recent libthread_xu changes.

Best Regards,
sephe

History

#1 Updated by dillon almost 5 years ago

:
:Hi all,
:
:Both kernel and world are built with buildkernel and buildworld. New
:kernel is installed before installing the world.
:I got following error from cpdup during installworld:
:Fatal error 'Cannot allocate red zone for initial thead' at line 263
:in file /usr/src/lib/libthread_xu/thread/thr_init.c (errno = 12)
:Seems to be related to recent libthread_xu changes.
:
:Best Regards,
:sephe
:
:--
:Live Free or Die

Hmm. This is a bit of a conundrum, but one that ought to only
effect statically-built threaded applications. I figured I
might as well fix the issue close to our libc major change.

cpdup is a statically built threaded application.

libthread_xu had a bug in it where it was trying to map the
guard for the initial user stack using MAP_ANON instead of
MAP_ANON|MAP_FIXED. And now that I think about it, I should
probably use MAP_ANON|MAP_TRYFIXED. But either way the original
cpdup was doing an illegal mmap() call and because there is no
available address space beyond the stack address it passed it
that mmap() call fails instead of returning some other region
of memory.

I will look into fixing cpdup... I think I can adust it so it does
not initialize the threading system if it isn't being run with a
threading option.

-Matt
Matthew Dillon
<>

#2 Updated by dillon almost 5 years ago

::Hi all,
::
::Both kernel and world are built with buildkernel and buildworld. New
::kernel is installed before installing the world.
::I got following error from cpdup during installworld:
::Fatal error 'Cannot allocate red zone for initial thead' at line 263
::in file /usr/src/lib/libthread_xu/thread/thr_init.c (errno = 12)
::Seems to be related to recent libthread_xu changes.
::
::Best Regards,
::sephe
::
::--
::Live Free or Die
:
: I will look into fixing cpdup... I think I can adust it so it does
: not initialize the threading system if it isn't being run with a
: threading option.

cpdup can't be hacked. libthread_xu pre-initializes threading whether
the program creates any threads or not.

installworld should be using the cpdup built in the bootstrap stage.
What I will do is make buildworld build a version of cpdup without
pthreads for the bootstrap binaries. That should work around the
issue.

-Matt
Matthew Dillon
<>

#3 Updated by sepherosa almost 5 years ago

fix committed

Also available in: Atom PDF