# emerge glibc kills the system

## era3

Doing an:

```
emerge sys-libs/glibc

```

killed my system! The emerge command runs for a couple of hours with no errors, but at the end it finishs being not able to caching services dependencies:

```
Caching service dependencies ...

gawk: /lib/rcscripts/awk/cachedepends.awk:72: fatal error: internal error

/sbin/depscan.sh: line 61: 26038 Aborted                 /bin/gawk -f /lib/rcscripts/awk/functions.awk -f /lib/rcscripts/awk/cachedepends.awk

bash: /var/lib/init.d/depcache: No such file or directory

Failed to cache service dependencies

```

Fortunatly I did a partimage backup copy of my root partition so I restored the system and started to investigate the forum messages. Since that I emerged succesfully more than 200 packages, now the system is healty and updated quite completely, with the exception of glibc!!! After four tentative I am giving up, this posting is the last resort: ANY HELP WILL BE REALLY APPRECIATED !!!!!

This is a brief environment description:

The system is a Dell C610 laptop I am using starting one year ago with gentoo as the only OS.

emerge --info reports:

```
Gentoo Base System version 1.6.8

Portage 2.0.51-r8 (default-linux/x86/2004.3, gcc-3.4.3, glibc-2.3.3.20040420-r0, 2.6.10-gentoo-r1 i686)

=================================================================

System uname: 2.6.10-gentoo-r1 i686 Intel(R) Pentium(R) III Mobile CPU      1200MHz

Python:              dev-lang/python-2.3.4 [2.3.4 (#1, Jun  5 2004, 04:05:46)]

dev-lang/python:     2.3.4

sys-devel/autoconf:  2.59-r6, 2.13

sys-devel/automake:  1.8.5-r2, 1.5, 1.4_p6, 1.6.3, 1.7.9, 1.9.3

sys-devel/binutils:  2.15.92.0.2-r2

sys-devel/libtool:   1.5.10-r2

virtual/os-headers:  2.6.8.1-r1

ACCEPT_KEYWORDS="x86 ~x86"

AUTOCLEAN="yes"

CFLAGS="-O2 -march=pentium3 -fomit-frame-pointer -pipe -mfpmath=sse -msse -mmmx"

CHOST="i686-pc-linux-gnu"

CONFIG_PROTECT="/etc /etc/tomcat /usr/kde/2/share/config /usr/kde/3.2/share/config /usr/kde/3/share/config /usr/lib/X11/xkb /usr/share/config /var/qmail/control"

CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"

CXXFLAGS="-O2 -march=pentium3 -fomit-frame-pointer -pipe -mfpmath=sse -msse -mmmx"

DISTDIR="/usr/portage/distfiles"

FEATURES="autoaddcvs autoconfig ccache distlocks sandbox sfperms"

GENTOO_MIRRORS="http://pandemonium.tiscali.de/pub/gentoo/ http://ftp.linux.ee/pub/gentoo/distfiles/ http://www.mirrorservice.org/sites/www.ibiblio.org/gentoo/ http://ftp.snt.utwente.nl/pub/os/linux/gentoo"

LDFLAGS=""

MAKEOPTS="-j2"

PKGDIR="/usr/portage/packages"

PORTAGE_TMPDIR="/var/tmp"

PORTDIR="/usr/portage"

PORTDIR_OVERLAY=""

SYNC="rsync://rsync.gentoo.org/gentoo-portage"

USE="X acl alsa apm arts avi berkdb bitmap-fonts bonobo cdr crypt cups dvd encode esd fam flac foomaticdb fortran gdbm gdm gif gnome gpm gstreamer gtk gtk2 imlib ipv6 java jpeg ldap libg++ libwww mad mikmod mmx motif mpeg ncurses nls nptl oggvorbis opengl oss pam pdflib perl png python quicktime readline samba sasl sdl slang spell sse ssl svga tcltk tcpd tiff truetype x86 xml xml2 xmms xv zlib video_cards_radeon video_cards_i830"
```

emerge --pretend glibc reports:

```
[ebuild     U ] sys-libs/glibc-2.3.4.20041102 [2.3.3.20040420]
```

/lib/libc.so.6 reports:

```
GNU C Library stable release version 2.3.3, by Roland McGrath et al.

Copyright (C) 2004 Free Software Foundation, Inc.

This is free software; see the source for copying conditions.

There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A

PARTICULAR PURPOSE.

Compiled by GNU CC version 3.3.3 20040412 (Gentoo Linux 3.3.3-r5, ssp-3.3-7, pie-8.7.5.3).

Compiled on a Linux 2.6.5-gentoo-r1 system on 2004-06-26.

Available extensions:

        GNU libio by Per Bothner

        crypt add-on version 2.1 by Michael Glad and others

        NPTL 0.61 by Ulrich Drepper

        BIND-8.2.3-T5B

        NIS(YP)/NIS+ NSS modules 0.19 by Thorsten Kukuk

Thread-local storage support included.

Report bugs using the `glibcbug' script to <bugs@gnu.org>.
```

after doing the "emerge glibc", /lib/libc.so.6 reports:

```
GNU C Library 20041102 release version 2.3.4, by Roland McGrath et al.

Copyright (C) 2004 Free Software Foundation, Inc.

This is free software; see the source for copying conditions.

There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A

PARTICULAR PURPOSE.

Compiled by GNU CC version 3.4.3 20041125 (Gentoo Linux 3.4.3-r1, ssp-3.4.3-0, pie-8.7.7).

Compiled on a Linux 2.6.8 system on 2004-12-31.

Available extensions:

        GNU libio by Per Bothner

        crypt add-on version 2.1 by Michael Glad and others

        linuxthreads-0.10 by Xavier Leroy

        The C stubs add-on version 2.1.2.

        GNU Libidn by Simon Josefsson

        BIND-8.2.3-T5B

        libthread_db work sponsored by Alpha Processor Inc

        NIS(YP)/NIS+ NSS modules 0.19 by Thorsten Kukuk

Thread-local storage support included.

For bug reporting instructions, please see:

<http://www.gnu.org/software/libc/bugs.html>.
```

After the "emerge glibc" the already opened shells are still working, the "emerge" command returns a "Segmentation fault" message and "depscan.sh"  returns the same error reported at the end of the "emerge glibc" process.

My opinion, after reading the forum messages, is that the problem is connected with NPLT and having two different versions of the glibc libraries with and without nptl enabled and that the system is no longer able to execute the line:

```
extension("/lib/rcscripts/filefuncs.so", "dlload")
```

into the awk script launched by the "depscan.sh" command.

Please, again, HELP ME, I have no idea in how to solve this Issue, libc package is far too important to stay in that stale situation!!!

----------

## era3

I forgot to mention that after the "emerge glibc" the system is no longer able to reboot correctly because it is not able to load the devfs module and it starts in single mode user. The "emerge command" still gives segmentation fault.

----------

## era3

executing:

```
USE="nptl nptlonly" emerge glibc
```

solved this issue. The system is working fine and the command "/lib/libc.so.6" returns:

```
GNU C Library 20041102 release version 2.3.4, by Roland McGrath et al.

Copyright (C) 2004 Free Software Foundation, Inc.

This is free software; see the source for copying conditions.

There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A

PARTICULAR PURPOSE.

Compiled by GNU CC version 3.4.3 20041125 (Gentoo Linux 3.4.3-r1, ssp-3.4.3-0, pie-8.7.7).

Compiled on a Linux 2.6.8 system on 2005-01-02.

Available extensions:

        GNU libio by Per Bothner

        crypt add-on version 2.1 by Michael Glad and others

        Native POSIX Threads Library by Ulrich Drepper et al

        The C stubs add-on version 2.1.2.

        GNU Libidn by Simon Josefsson

        BIND-8.2.3-T5B

        NIS(YP)/NIS+ NSS modules 0.19 by Thorsten Kukuk

Thread-local storage support included.

For bug reporting instructions, please see:

<http://www.gnu.org/software/libc/bugs.html>.
```

If someone can replay to this post explaining why is necessary to have two versions of glibc with and without NPTL in a system using nptl, it will be really appreciated. Why the default library if both version are compiled is with no nptl enabled? It was the correct behaviour what happend?

----------

## blueSceaDa

hm....

now I know what I did wrong when I tried out nptl the first time   :Sad: 

I then used a stage3 to fix my system   :Confused: 

----------

## psycho_seba

Sorry to hijack this thread, but I am experiencing an almost identical problem. Unfortunately, the proposed solution (USE="nptl nptlonly" emerge glibc) does not work for me.

After an emerge system (which comprised cpio, tar, perl, rsync, net-tools, texinfo, bc, gnuconfig, m4, cracklib, glibc, and openssh) I noticed the following:

```
 * Caching service dependencies...

gawk: /lib/rcscripts/awk/cachedepends.awk:73: fatal error: internal error

/sbin/depscan.sh: line 44: 20101 Aborted                 /bin/gawk -f /lib/rcscripts/awk/functions.awk -f /lib/rcscripts/awk/cachedepends.awk

/var/lib/init.d/depcache: /var/lib/init.d/depcache: No such file or directory
```

Now almost everything segfaults (including emerge). All I can run are things like cp, ls, mc, screen and links. I tracked the error down to the line

```
extension("/lib/rcscripts/filefuncs.so", "dlload")
```

in /lib/rcscripts/awk/cachedepends.awk. I tried recompiling filefuncs.so by hand (it is part of gawk) but the error remains. Gawk works fine as long as the script does not attempt to load filefuncs.

As a consequence, /var/lib/init.d/depcache does not get built and now I have a truly b0rked system. Even emerge won't work, so I cannot try the above mentioned solution! I can't post my emerge info (it segfaults), but I can tell you some relevant information:

```

NPTL

USE="acl acpi acpi4linux -apm -arts cdf cdparanoia cjk codecs curlwrappers dga divx4linux dnd dv dscreen fbcon freetype gimpprint gmail gs hdf i8x0 ieee1394 mailwrapper mp3 msn mule netcdf no-old-linux nptl -oss pic ppds rtc szip usb wmf xemacs xface xvid -ipv6 mmx sse sse2 softmmu"

CFLAGS="-s -march=pentium4 -O2 -pipe -fomit-frame-pointer -msse -msse2 -mmmx -mfpmath=sse"

LDFLAGS=-Wl,O1

kernel: linux 2.6.9 nitro

Intel Pentium 4 2.4 GHz
```

Please disregard any typos.

What can I do?

Seba

----------

## psycho_seba

*bump* Please see the post above.

----------

## sulu

Maybe your coreutils are borked.

Do programs like ls and rm work ? 

I have a crippeled gateway which suffers from this problem.

No emerge possible with lots of segfaults.

I'll try to fix it with a tbz2-Archive which conatins static builds of the coreutils programs.

----------

## dsd

you failed to mention which version of glibc you are dealing with

----------

## psycho_seba

Thank you both, but I've solved the problem, which had been reported as bug 85555. I followed the steps in comment #19.

Edit: fixed typo

----------

## ronino

 *psycho_seba wrote:*   

> Thank you both, but I've solved the problem, which had been reported as bug 85555. I followed the steps in comment #19.

 

Did you try to re-emerge glibc afterwards?

I'm having nearly the same problem: https://forums.gentoo.org/viewtopic-t-315538.html, but could not solve it so far. Today I came up with the idea to cancel the emerge via ctrl + c after it has installed the new glibc, but before unmerging the old one. After that, there was none of the usual segfaults. Even depscan.sh ran without an error.

Then I tried again to re-emerge glibc without interrupting the process, but then the problems where there again...

This is what depscan.sh says with the broken glibc:

```
 * Caching service dependencies ...

gawk: /lib/rcscripts/awk/cachedepends.awk:72: Fatal: extension: Can't open '/lib/rcscripts/filefuncs.so' ((null))

bash: /var/lib/init.d/depcache: File or directory not found

 * Failed to cache service dependencies                                   [ !! ]

```

----------

## psycho_seba

Sorry for the delay, I hadn't checked this thread in a while. Ronino: yes, I remerged glibc with nptl and nptlonly flags set. This solved the problem.

----------

