segmentation fault when chrooting

Pierre Labastie pierre.labastie at neuf.fr
Thu Jun 4 02:45:30 PDT 2015


Le 04/06/2015 09:04, Pol Vangheluwe a écrit :
> I already built several times LFS (6.4, 6.6, 6.8 and 7.2) manually (on 
> old Apple PowerPC computers).  This takes every time several months, 
> because I do it in my sparse free time.
> I recently found a second-hand PowerMac G4 (MDD) and decided to try 
> ALFS on this machine (starting from Ubuntu 14.04.2 LTS).
> Documentation about ALFS is quite limited, but anyway, I managed to 
> start the building process with the following options:
>
> Checking tools required for jhalfs
> SUDO.............. <1.8.9p5> OK (Min version: 1.7.0)
> WGET.............. <1.15> OK (Min version: 1.0.0)
> LIBXML2........... <2.09.01> OK (Min version: 2.06.20)
> LIBXSLT........... <1.01.28> OK (Min version: 1.01.14)
> ------------------------------------------------------------------------------
>
> BOOK.............. </mnt/build_dir/jhalfs/lfs-branch-systemd>
> CUSTOM_TOOLS...... <n>
> BLFS_TOOL......... <n>
> LUSER............. <lfs>
> LGROUP............ <lfs>
> LHOME............. </home>
> BUILDDIR.......... </mnt/build_dir>
> CLEAN............. <n>
> GETPKG............ <y>
> SRC_ARCHIVE....... </mnt/build_dir/archive>
> SERVER............ <ftp://ftp.lfs-matrix.net>
> RETRYSRCDOWNLOAD.. <y>
> RETRYDOWNLOADCNT.. <3>
> DOWNLOADTIMEOUT... <30>
> RUNMAKE........... <y>
> TEST.............. <1>
> BOMB_TEST......... <n>
> STRIP............. <y>
> VIMLANG........... <n>
> FSTAB............. <>
> CONFIG............ <>
> TIMEZONE.......... <GMT>
> PAGE.............. <A4>
> LANG.............. <nl_BE at euro/ISO-8859-15>
> INSTALL_LOG....... <n>
> PKGMNGT........... <n>
> FULL_LOCALE....... <n>
> COMPARE........... <n>
> OPTIMIZE.......... <0>
> REPORT............ <y>
> REBUILD_MAKEFILE.. <n>
>
> The building process was a few times aborted during compilation of gcc 
> (pass-1).  I could fix it by extending ulimit and restarting ‘make’.
> I am now in CHROOT, compiling 082-gcc-5.1.0 and again facing an abort. 
>  However, I cannot proceed anymore because of this:
>
> ------------------------------------------------------------------------------
>
> Creating Makefile... START
> Processing... <Chapter4     ( SETUP ) >
> Processing... <Chapter5     ( LUSER ) >
> Processing... <Chapter6     ( CHROOT ) >
> Processing... <Chapter7/8   ( BOOT ) >
> Creating Makefile... DONE
> ------------------------------------------------------------------------------
>
>
> KERNEL............ <3.13.0-51-powerpc-smp> OK (Min version: 2.6.32)
> BASH.............. <4.3.11(1)-release> OK (Min version: 3.2)
> GCC............... <5.1.0> OK (Min version: 4.1.2)
> G++............... <5.1.0> OK (Min version: 4.1.2)
> GLIBC............. <2.21> OK (Min version: 2.11)
> BINUTILS.......... <2.25> OK (Min version: 2.17)
> TAR............... <1.28> OK (Min version: 1.18)
> BZIP2............. <1.0.6> OK (Min version: 1.0.4)
> BISON............. <3.0.2> OK (Min version: 2.3)
> COREUTILS......... <8.23> OK (Min version: 6.9)
> DIFF.............. <3.3> OK (Min version: 2.8.1)
> FIND.............. <4.4.2> OK (Min version: 4.2.31)
> GAWK.............. <4.1.2> OK (Min version: 4.0.1)
> GREP.............. <2.21> OK (Min version: 2.5.1a)
> GZIP.............. <1.6> OK (Min version: 1.3.12)
> M4................ <1.4.17> OK (Min version: 1.4.10)
> MAKE.............. <4.1> OK (Min version: 3.81)
> PATCH............. <2.7.5> OK (Min version: 2.5.4)
> PERL.............. <5.20.2> OK (Min version: 5.8.8)
> SED............... <4.2.2> OK (Min version: 4.1.5)
> TEXINFO........... <5.2> OK (Min version: 4.7)
> XZ................ <5.2.1> OK (Min version: 5.0.0)
> ------------------------------------------------------------------------------
>
> Building the system...
> make[1]: Entering directory '/mnt/build_dir/jhalfs'
> --------------------------------------------------------------------------------
> mk_CHROOT
> You are going to CHROOT into /mnt/build_dir lfs
> a password is required
> /tools/bin/bash: line 1:  5666 Segmentation fault      (core dumped) 
> make BREAKPOINT= CHROOT
> Makefile:87: recipe for target 'mk_CHROOT' failed
> make[1]: *** [mk_CHROOT] Error 139
> make[1]: Leaving directory '/mnt/build_dir/jhalfs'
>
> ERROR: Error 2 at common/common-functions line 39!
>
>
> <jhalfs-trunk> exit
>
> Makefile:11: recipe for target 'all' failed
> make: *** [all] Error 2
>
> Chrooting manually is no problem:
>
> lfs at ppc125:~$ sudo chroot "$LFS" /tools/bin/env -i \
> > HOME=/root \
> > TERM="$TERM" \
> > PS1='\u:\w\$ ' \
> > PATH=/bin:/usr/bin:/sbin:/usr/sbin:/tools/bin \
> > /tools/bin/bash --login +h
> [sudo] password for lfs:
> root:/# pwd
> /
> root:/# ls -l
> total 120
> drwxrwxr-x  2 1001 1001  4096 May 28 14:57 archive
> drwxr-xr-x  2 root root  4096 Jun  1 19:26 bin
> drwxr-xr-x  2 root root  4096 Jun  1 19:26 boot
> drwxr-xr-x  2 root root  4096 Jun  1 19:26 dev
> drwxr-xr-x  4 root root  4096 Jun  1 22:47 etc
> drwxr-xr-x  2 root root  4096 Jun  1 19:26 home
> drwxrwxrwt  7 1001 1001  4096 Jun  2 20:35 jhalfs
> drwxr-xr-x  4 root root  4096 Jun  1 22:47 lib
> drwx------  2 root root 16384 May 14 16:31 lost+found
> drwxr-xr-x  4 root root  4096 Jun  1 19:26 media
> drwxr-xr-x  2 root root  4096 Jun  1 19:26 mnt
> drwxr-xr-x  2 root root  4096 Jun  1 19:26 opt
> drwxr-xr-x  2 root root  4096 Jun  1 19:26 proc
> drwxr-x---  2 root root  4096 Jun  1 19:26 root
> drwxr-xr-x  2 root root  4096 Jun  1 19:26 run
> drwxr-xr-x  2 root root  4096 Jun  1 22:44 sbin
> drwxrwxrwt  4 1001 root  4096 Jun  2 20:34 sources
> drwxr-xr-x  2 root root  4096 Jun  1 19:26 srv

> drwxr-xr-x  2 root root  4096 Jun  1 19:26 sys
> drwxrwxrwt  2 root root 20480 Jun  2 04:00 tmp
> drwxr-xr-x 12 root root  4096 May 31 21:01 tools
> drwxr-xr-x 10 root root  4096 Jun  1 19:26 usr
> drwxr-xr-x 10 root root  4096 Jun  1 19:26 var
>
> Any suggestion how I can fix this and continue with ALFS?
>
You could try to have a look at the logs in /mnt/build_dir/jhalfs/logs, 
either 000-masterscript.log or 0xx-something.log.
The error message above is not enough to understand what is going on.

Also, instead of restarting make in your jhalfs dir, I would recommend 
to start it directly in the build directory :
make -C /mnt/build_dir/jhalfs
It skips all the "creating Makefile", "check version", etc, steps.

Another important thing to check is that the virtual kernel filesystems 
are still mounted, but I do not think it is related to the segmentation 
fault.

Pierre



More information about the alfs-discuss mailing list