Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 16612 - Portage 2.0.47-r7 freezes very early during ANY build - ccache bug
Summary: Portage 2.0.47-r7 freezes very early during ANY build - ccache bug
Status: RESOLVED WORKSFORME
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Unclassified (show other bugs)
Hardware: All Linux
: Highest blocker (vote)
Assignee: Zach Welch (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-03-01 05:04 UTC by Robin Johnson
Modified: 2011-10-30 22:21 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Enviroment settings (env.out,5.60 KB, text/plain)
2003-03-01 05:07 UTC, Robin Johnson
Details
Strace output of ccache call (strace.ccache,3.24 KB, text/plain)
2003-03-01 05:10 UTC, Robin Johnson
Details
Direct trace of the ccache call from the configure script (trace,3.21 KB, text/plain)
2003-03-01 05:25 UTC, Robin Johnson
Details
LARGE strace from forked process started by ccache (trace.11643.gz,204.21 KB, application/x-gunzip)
2003-03-01 05:29 UTC, Robin Johnson
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2003-03-01 05:04:29 UTC
I've been away for a few days, so I just updated to portage 2.0.47-r7, did the
usual etc-update to fix things in /etc.
Then updated cccache to ccache-2.2 to speed up the rest of the builds and
etc-update again for good measure.

Now nothing else will build. Traced it down to the fact that ccache is enabled
in make.globals (not enabled in my config). Turned it off there and things work
perfectly.

The compile line of
/usr/lib/ccache/bin/gcc  -c -march=pentium3 -O3 -pipe ztest8937.c
in the zlib directory works fine, so I suspected something with portage directly.

I even tried with all of the enviroment settings that existed in the build
enviroment (attached in env.out), but I can't reproduce it running manually.
Only inside the configure script does the ccache call freeze up.

I'll attach a stack trace of it in a moment as well.

Reproducible: Always
Steps to Reproduce:
1. emerge ANY build 
2.
3.

Actual Results:  
server1 root # emerge sys-libs/zlib
Calculating dependencies ...done!
>>> emerge (1 of 1) sys-libs/zlib-1.1.4-r1 to /
>>> md5 ;-) zlib-1.1.4.tar.bz2
>>> Unpacking source...
>>> Unpacking zlib-1.1.4.tar.bz2 to /var/tmp/portage/zlib-1.1.4-r1/work
 * Applying zlib-1.1.4-gentoo.security.patch...                                
                                                   [ ok ]
>>> Source unpacked.
(hangs here)

I hacked up the zlib configure file for debugging output and ran:
server1 root # ebuild /usr/portage/sys-libs/zlib/zlib-1.1.4-r1.ebuild compile
>>> md5 ;-) zlib-1.1.4.tar.bz2
>>> Checking zlib-1.1.4.tar.bz2's mtime...
>>> WORKDIR is up-to-date, keeping...
which gcc = /usr/lib/ccache/bin/gcc
gcc -c -march=pentium3 -O3 -pipe ztest8937.c

This is part of the very first compiler test.

Expected Results:  
should have merged the software properly.

Emerge info output:
Portage 2.0.47-r7 (default-x86-1.4, gcc-3.2.2, glibc-2.3.2_pre1-r0)
=================================================================
System uname: 2.4.20-gentoo-r1 i686 Pentium III (Katmai)
GENTOO_MIRRORS="http://gentoo.oregonstate.edu "
CONFIG_PROTECT="/etc /var/qmail/control /usr/kde/2/share/config
/usr/kde/3/share/config /usr/X11R6/lib/X11/xkb /usr/kde/3.1/share/config
/usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/
/usr/share/config"
CONFIG_PROTECT_MASK="/etc/gconf /etc/afs/C /etc/afs/afsws /etc/env.d"
PORTDIR="/usr/portage"
DISTDIR="/usr/portage/distfiles"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR_OVERLAY="/usr/local/portage"
USE="x86 libg++ -3dfx -3dnow aalib acl acpi afs alsa apache2 apm arts avi berkdb
bonobo canna cdr cjk crypt cups dga directfb doc dvd encode esd ethereal evo
fbcon flash freewnn gb gd ggi gif -gnome gphoto2 gps gtk gtk2 gtkhtml guile imap
imlib innodb ipv6 java jikes jpeg junit kde -kerberos lcms ldap leim libgda
libwww maildir -matrox mbox mikmod motif mozilla mpeg -mule mysql nas nls oav
-oci8 oggvorbis opengl oss -pcmcia -pda pdflib plotutils png pnp -postgres qt
-qtmt quicktime ruby samba sasl scanner sdl slp snmp socks5 spell sse svga tcltk
tcpd tetex tiff truetype trusted usb -voodoo3 wavelan wmf X xface xml xml2 xmms
xv gdbm gpm mmx ncurses pam perl pic python readline slang ssl zlib mozsvg
mozcalender mozaccess mozinterfaceinfo mozp3p mozxmlterm"
COMPILER="gcc3"
CHOST="i686-pc-linux-gnu"
CFLAGS="-march=pentium3 -O3 -pipe"
CXXFLAGS="-march=pentium3 -O3 -pipe"
ACCEPT_KEYWORDS="x86 ~x86"
MAKEOPTS="-j4"
AUTOCLEAN="yes"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
FEATURES="sandbox ccache buildpkg"
Comment 1 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2003-03-01 05:07:11 UTC
Created attachment 8848 [details]
Enviroment settings

enviroment output right before the call to /usr/lib/ccache/bin/gcc
Comment 2 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2003-03-01 05:10:07 UTC
Created attachment 8849 [details]
Strace output of ccache call

Output of strace directly on the ccache command
Comment 3 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2003-03-01 05:20:55 UTC
tracing it more (via strace -ff), it seems that ccache goes into an infinite loop with calling 'gcc', but actually looping somewhere.

More debug output:
server1 root # ebuild /usr/portage/sys-libs/zlib/zlib-1.1.4-r1.ebuild compile
>>> md5 ;-) zlib-1.1.4.tar.bz2
>>> Checking zlib-1.1.4.tar.bz2's mtime...
>>> WORKDIR is up-to-date, keeping...
-----
-----
gcc -c -march=pentium3 -O3 -pipe ztest28057.c
which gcc = /usr/lib/ccache/bin/gcc
Process 11643 attached (waiting for parent)
Process 11643 resumed (parent 19555 ready)
Process 19555 suspended

More stack traces to follow.
Comment 4 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2003-03-01 05:25:57 UTC
Created attachment 8850 [details]
Direct trace of the ccache call from the configure script

see also trace.11643 which is the trace of the forked process from this one.
Comment 5 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2003-03-01 05:29:11 UTC
Created attachment 8851 [details]
LARGE strace from forked process started by ccache

this file is 32mb when extracted. Judging by the compression alone, there is a
LOT of repition involved in the file.

briefly glancing at the content it seems that ccache is looping infinitely on
some calls.
Comment 6 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2003-03-01 05:34:25 UTC
For a temporary workaround, remove 'ccache' from FEATURES in make.global
Comment 7 Zach Welch (RETIRED) gentoo-dev 2003-03-01 13:24:06 UTC
Another report of this surfaced recently in bug 15100.  It is real.  My
instincts tell me that ccache enters an infinite chain of execs with itself.
I'll try to figure out a solution this weekend.
Comment 8 Zach Welch (RETIRED) gentoo-dev 2003-03-07 15:38:39 UTC
Have you tried clearing you /root/.ccache directory?  This seems to be the
present workaround that works and allows you to continue using ccache.

also, you might use ccache to set the maximum to something reasonable:

ccache -M 1G

seems to be fairly safe and prevents these lockups.
Comment 9 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2003-03-08 23:53:27 UTC
I've tried clearing out the entire ccache with 'ccache -C', as well as setting the max cache size to 1gb, without any success.
Comment 10 Zach Welch (RETIRED) gentoo-dev 2003-03-09 01:43:20 UTC
if you are running ccache to clear the cache be sure to try prefixing the
command like the following:

CCACHE_DIR=/root/.ccache ccache -C

or use the sure-fire approach:

rm -rf /root/.ccache
Comment 11 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2003-03-11 02:27:06 UTC
Zach: your new suggestions don't resolve it either.
I'm just about to upgrade the box to sys-devel/binutils-2.13.90.0.18-r1, sys-libs/glibc-2.3.2 and downgrade to sys-devel/gcc-3.2.2-r1.
Comment 12 Zach Welch (RETIRED) gentoo-dev 2003-03-19 22:37:51 UTC
your last comment says 'downgrade' to gcc-3.2.2-r1... what where you using?

Otherwise, have you made progress on this issue?  Any further information
that you might be able to provide?
Comment 13 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2003-03-20 00:33:19 UTC
was running gcc-3.2.2-r3 previously, then it got masked. The machine still has the problem.

The best details I can offer, is that when portage runs the configure script, it used this PATH spec (gained using printenv to a file during the configure)
PATH=/usr/lib/ccache/bin:/sbin:/usr/sbin:/usr/lib/portage/bin:/bin:/usr/bin:/usr/local/bin:/opt/bin:/usr/afsws/bin:/etc/afs/afsws:/usr/afs/bin:/usr/i686-pc-linux-gnu/gcc-bin/3.2:/opt/Acrobat5:/usr/X11R6/bin:/opt/blackdown-jre-1.4.1/bin:/usr/qt/3/bin:/var/qmail/bin

I had left the box alone for a while.
I'm trying a few more things now.
Comment 14 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2003-03-20 00:38:06 UTC
Found the eventual cause of the bug.
I had sys-devel/cc-config installed, and it had overwritten sys-devel/gcc-config.
Both of them contain /usr/bin/gcc...

I remerge gcc-config, and everything works now.

Should cc-config even exist?, see the output below:

pestilence root #  emerge -s cc-config
Searching...
[ Results for search key : cc-config ]
[ Applications found : 2 ]

*  sys-devel/cc-config
      Latest version available: 1.2.8
      Latest version installed: [ Not Installed ]
      Size of downloaded files: 0 kB
      Homepage:    http://www.gentoo.org/
      Description: Utility to change the gcc compiler being used.

*  sys-devel/gcc-config
      Latest version available: 1.3.1
      Latest version installed: 1.3.1
      Size of downloaded files: 0 kB
      Homepage:    http://www.gentoo.org/
      Description: Utility to change the gcc compiler being used.

Comment 15 Zach Welch (RETIRED) gentoo-dev 2003-03-20 00:51:35 UTC
Thanks for digging on this.  I'll look into killing off cc-config soon.