Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 408375 - =sys-process/at-3.1.13-r1 parallel make problem
Summary: =sys-process/at-3.1.13-r1 parallel make problem
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Cron Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 407947
  Show dependency tree
 
Reported: 2012-03-15 16:38 UTC by Dan Dexter
Modified: 2012-03-20 09:15 UTC (History)
1 user (show)

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


Attachments
build.log (build.log,10.67 KB, text/plain)
2012-03-15 16:39 UTC, Dan Dexter
Details
build2.log (build2.log,10.15 KB, text/plain)
2012-03-15 16:39 UTC, Dan Dexter
Details
at-3.1.13-Makefile.in-parallel-make-yacc-fix.patch (at-3.1.13-Makefile.in-parallel-make-yacc-fix.patch,407 bytes, text/plain)
2012-03-15 19:45 UTC, Dan Dexter
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dan Dexter 2012-03-15 16:38:22 UTC
=sys-process/at-3.1.13-r1 fails to build sometimes. On a machine with not a whole lot running, it was _very_ difficult to reproduce. However, peg'ing each processor greatly increased the chances of getting the compile error.

Reproducible: Sometimes

Steps to Reproduce:
1. Peg _each_ processor with 'cat /dev/zero >/dev/null'
2. emerge =sys-process/at-3.1.13-r1 (note: May take a lot of attempts).
3. Build fails with different errors each time.
Actual Results:  
Fails to compile on occasion.

Expected Results:  
Compiles successfully each time.

Portage 2.1.10.44 (default/linux/x86/10.0, gcc-4.5.3, glibc-2.13-r4, 3.2.1-gentoo-r2 i686)
=================================================================
System uname: Linux-3.2.1-gentoo-r2-i686-Intel-R-_Core-TM-_i3_CPU_M_370_@_2.40GHz-with-gentoo-2.0.3
Timestamp of tree: Wed, 14 Mar 2012 23:30:01 +0000
distcc 3.1 i686-pc-linux-gnu [disabled]
app-shells/bash:          4.2_p20
dev-java/java-config:     2.1.11-r3
dev-lang/python:          2.7.2-r3, 3.2.2
dev-util/cmake:           2.8.6-r4
dev-util/pkgconfig:       0.26
sys-apps/baselayout:      2.0.3
sys-apps/openrc:          0.9.8.4
sys-apps/sandbox:         2.5
sys-devel/autoconf:       2.68
sys-devel/automake:       1.11.1
sys-devel/binutils:       2.21.1-r1
sys-devel/gcc:            4.5.3-r2
sys-devel/gcc-config:     1.5-r2
sys-devel/libtool:        2.4-r1
sys-devel/make:           3.82-r1
sys-kernel/linux-headers: 3.1 (virtual/os-headers)
sys-libs/glibc:           2.13-r4
Repositories: gentoo sunrise x-portage
ACCEPT_KEYWORDS="x86"
ACCEPT_LICENSE="* -@EULA PUEL AdobeFlash-10.3"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=core2 -mtune=generic -msse4.2 -pipe --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=256"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.3/ext-active/ /etc/php/cgi-php5.3/ext-active/ /etc/php/cli-php5.3/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -march=core2 -mtune=generic -msse4.2 -pipe --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=256"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests binpkg-logs distlocks ebuild-locks fixlafiles news parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FFLAGS=""
GENTOO_MIRRORS="http://mirror.datapipe.net/gentoo"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="en"
MAKEOPTS="-j5"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/var/lib/layman/sunrise /usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X a52 aac aalib accessibility acl acpi alsa apache2 ares arts bash-completion berkdb branding bzip2 cairo cdparanoia cli cpudetection cracklib crypt ctype cups curl cxx dbus directfb dri dts dv dvb dvd dvdr dvdread encode exif extensions fbcon ffmpeg flac fontconfig fortran gd gdbm gif git gpm gtk hal iconv icu id3 imlib ipv6 ithreads java jpeg jpeg2k kqemu lame libcaca libmpeg2 lm_sensors lua mad matroska mbrola mjpeg mmx modules mp2 mp3 mp4 mpeg mudflap musepack mysql mysqli mysqlnd ncurses nls nptl nptlonly ogg openal opengl openmp oss pam pcap pcre pdo perl php png ppds pppd python quicktime rar readline remote samba session spell sse sse2 ssl ssse3 subversion suid svg svga sysfs syslog tcl tcpd theora threads tiff tordns truetype um unicode urandom usb v4l v4l2 vaapi vorbis wavpack wifi win32codecs x264 x86 xcb xcomposite xml xorg xv xvid zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan stage tables krita karbon braindump" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="intel" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Dan Dexter 2012-03-15 16:39:11 UTC
Created attachment 305529 [details]
build.log
Comment 2 Dan Dexter 2012-03-15 16:39:34 UTC
Created attachment 305531 [details]
build2.log
Comment 3 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2012-03-15 17:08:04 UTC
Darn it! I'm not really a makefile expert so I doubt I can fix this myself.
Patches are welcome :)
Comment 4 Dan Dexter 2012-03-15 19:45:18 UTC
Created attachment 305545 [details]
at-3.1.13-Makefile.in-parallel-make-yacc-fix.patch

Attached a patch to fix the issue in Makefile.in.

Two instances of bison were running concurrently, both outputting to the same two files: y.tab.c and y.tab.h. To fix the issue, the patch makes an intermediate target that both files depend on. As part of this targets command, it creates an empty file with the target name so that the target is not ran again.
Comment 5 Dan Dexter 2012-03-15 23:41:03 UTC
It looks like there was already a patch submitted in bug 294351 Comment #6 for this issue and appears to be a better implementation.

The patch I proposed followed the method outlined in a paper titled "Design and Implementation of Parallel Make" by Erik H. Baalbergen, specifically section 5.2.2. However, this paper is rather dated and sf's patch is mentioned in the much more authoritive 'info make', so I'm more inclined to think his patch is the better choice.

Either way, i've thoroughly tested both patches and can vouch for their effectiveness.
Comment 6 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2012-03-16 16:53:58 UTC
+  16 Mar 2012; Lars Wendler <polynomial-c@gentoo.org> at-3.1.13-r1.ebuild,
+  +files/at-3.1.13-parallel-make-fix.patch:
+  Fixed parallel make issue (bug #408375).
+
I've taken the patch from bug 294351 Comment #6
Please give at-3.1.13-r1 another try and report back if this problem is fixed now.
Comment 7 Dan Dexter 2012-03-17 14:32:17 UTC
Verified that the problem is fixed with at-3.1.13-parallel-make-fix.patch.

I kicked off a script to compile it 50 times overnight; none of them had an error.
Comment 8 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2012-03-20 09:15:55 UTC
Thanks for testing.