Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 441034 - dev-libs/boost-1.49-r2 fails to build with MAKEOPTS higher than -j64 (like -j65)
Summary: dev-libs/boost-1.49-r2 fails to build with MAKEOPTS higher than -j64 (like -j65)
Status: RESOLVED DUPLICATE of bug 498134
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: C++ Team [disbanded]
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-11-03 03:03 UTC by Rick Farina (Zero_Chaos)
Modified: 2014-06-19 08:35 UTC (History)
2 users (show)

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


Attachments
Patch for boost-build (boost-build-maxjobs.patch,786 bytes, patch)
2012-11-03 03:41 UTC, Mike Gilbert
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Rick Farina (Zero_Chaos) gentoo-dev 2012-11-03 03:03:15 UTC
* b2-1_49 -j65 -q -d+2 gentoorelease --user-config=user-config.jam  --disable-icu boost.locale.icu=off pch=off --boost-build=/usr/share/boost-build-1_49 --prefix="/var/tmp/portage/dev-libs/boost-1.49.0-r2/image/usr" --layout=versioned threading=single,multi link=shared runtime-link=shared --python-buildid=2.7

Building the Boost C++ Libraries.


/var/tmp/portage/dev-libs/boost-1.49.0-r2/temp/environment: line 5127: 26842 Segmentation fault      ${BJAM} ${NUMJOBS} -q -d+2 gentoorelease --user-config=user-config.jam ${OPTIONS} threading=single,multi ${LINK_OPTS} runtime-link=shared $(use python && echo --python-buildid=${PYTHON_ABI})
 * ERROR: dev-libs/boost-1.49.0-r2 failed (compile phase):
 *   Building of Boost libraries failed
 * 
 * Call stack:
 *     ebuild.sh, line   93:  Called src_compile
 *   environment, line 5166:  Called python_execute_function 'building'
 *   environment, line 3348:  Called building
 *   environment, line 5131:  Called die
 * The specific snippet of code:
 *           ${BJAM} ${NUMJOBS} -q -d+2 gentoorelease --user-config=user-config.jam ${OPTIONS} threading=single,multi ${LINK_OPTS} runtime-link=shared $(use python && echo --python-buildid=${PYTHON_ABI}) || die "Building of Boost libraries failed";
 * 
 * If you need support, post the output of `emerge --info '=dev-libs/boost-1.49.0-r2'`,
 * the complete build log and the output of `emerge -pqv '=dev-libs/boost-1.49.0-r2'`.
 * The complete build log is located at '/var/tmp/portage/dev-libs/boost-1.49.0-r2/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/dev-libs/boost-1.49.0-r2/temp/environment'.
 * Working directory: '/var/tmp/portage/dev-libs/boost-1.49.0-r2/work/boost_1_49_0'
 * S: '/var/tmp/portage/dev-libs/boost-1.49.0-r2/work/boost_1_49_0'
Comment 1 Rick Farina (Zero_Chaos) gentoo-dev 2012-11-03 03:05:44 UTC
building with MAKEOPTS="-j" seems to hack down to -j1:

 * b2-1_49 -j1 -q -d+2 gentoorelease --user-config=user-config.jam  --disable-icu boost.locale.icu=off pch=off --boost-build=/usr/share/boost-build-1_49 --prefix="/var/tmp/portage/dev-libs/boost-1.49.0-r2/image/usr" --layout=versioned threading=single,multi link=shared runtime-link=shared --python-buildid=2.7


Something is rotten here. Looks like I'm limited to -j64 if I want to build boost...
Comment 2 Mike Gilbert gentoo-dev 2012-11-03 03:12:17 UTC
Found this nifty line in boost_1_49_0/tools/build/v2engine/jam.h.

#define MAXJOBS  64    /* silently enforced -j limit */

Sounds like this is not being enforced so well.
Comment 3 Rick Farina (Zero_Chaos) gentoo-dev 2012-11-03 03:27:32 UTC
(In reply to comment #2)
> Found this nifty line in boost_1_49_0/tools/build/v2engine/jam.h.
> 
> #define MAXJOBS  64    /* silently enforced -j limit */
> 
> Sounds like this is not being enforced so well.

An acceptable fix for this would be to actually silently enforce the -j limit instead of segfaulting.  I can live with boost only building with -j64
Comment 4 Rick Farina (Zero_Chaos) gentoo-dev 2012-11-03 03:34:10 UTC
boost-1.51 is slightly more hilarious. my hardened kernel kills it as a buffer overflow

 * Building of dev-libs/boost-1.51.0-r1 with CPython 2.7...
 * Using the following command to build:
 * b2-1_51 -j96 -q -d+2 gentoorelease --user-config=user-config.jam  --disable-icu boost.locale.icu=off pch=off --boost-build=/usr/share/boost-build-1_51 --prefix="/var/tmp/portage/dev-libs/boost-1.51.0-r1/image/usr" --layout=versioned threading=single,multi link=shared --python-buildid=2.7

Building the Boost C++ Libraries.


*** buffer overflow detected ***: b2-1_51 - terminated
b2-1_51: buffer overflow attack in function <unknown> - terminated
Report to http://bugs.gentoo.org/
/var/tmp/portage/dev-libs/boost-1.51.0-r1/temp/environment: line 5221: 28032 Killed                  ${BJAM} ${NUMJOBS} -q -d+2 gentoorelease --user-config=user-config.jam ${OPTIONS} threading=single,multi ${LINK_OPTS} $(use python && echo --python-buildid=${PYTHON_ABI})


and just to round out the figures, 1.46.1-r1 segfaults like 1.49:

 * Using the following command to build: 
 * bjam-1_46 -j96 -q -d+2 gentoorelease --disable-icu pch=off --user-config="/var/tmp/portage/dev-libs/boost-1.46.1-r1/work/boost_1_46_1/user-config.jam" --boost-build=/usr/share/boost-build-1_46 --prefix="/var/tmp/portage/dev-libs/boost-1.46.1-r1/image//usr" --layout=versioned threading=single,multi link=shared runtime-link=shared

Building the Boost C++ Libraries.


/var/tmp/portage/dev-libs/boost-1.46.1-r1/temp/environment: line 5314:  1560 Segmentation fault      ${BJAM} ${NUMJOBS} -q -d+2 gentoorelease ${OPTIONS} threading=single,multi ${LINK_OPTS} runtime-link=shared
Comment 5 Mike Gilbert gentoo-dev 2012-11-03 03:41:00 UTC
Created attachment 328178 [details, diff]
Patch for boost-build

Can you give this patch for boost-build a try? It resolves the segfault here.

Of course, I also run out of memory pretty quickly on my 8 GB system... :(
Comment 6 Mike Gilbert gentoo-dev 2012-11-03 04:12:40 UTC
Reported upstream.
Comment 7 Rick Farina (Zero_Chaos) gentoo-dev 2012-11-03 04:21:57 UTC
(In reply to comment #1)
> building with MAKEOPTS="-j" seems to hack down to -j1:
> 
>  * b2-1_49 -j1 -q -d+2 gentoorelease --user-config=user-config.jam 
> --disable-icu boost.locale.icu=off pch=off
> --boost-build=/usr/share/boost-build-1_49
> --prefix="/var/tmp/portage/dev-libs/boost-1.49.0-r2/image/usr"
> --layout=versioned threading=single,multi link=shared runtime-link=shared
> --python-buildid=2.7
> 
> 
> Something is rotten here. Looks like I'm limited to -j64 if I want to build
> boost...

We can ignore this safely, it is fixed(ish) in 1.51.  The patch in comment 5 fixes the crashes for me so it is a good stopgap but it seems in 1.51 that upstream mapped -j to -j999 so it looks like -j64 isn't really a limit anymore.
Comment 8 Rick Farina (Zero_Chaos) gentoo-dev 2012-11-03 04:53:44 UTC
The MAKEOPTS="-j" issue in the stable ebuild *could* be fixed like this:

diff -u -r1.3 boost-1.49.0-r2.ebuild
--- boost-1.49.0-r2.ebuild	2 Nov 2012 11:55:46 -0000	1.3
+++ boost-1.49.0-r2.ebuild	3 Nov 2012 04:52:04 -0000
@@ -7,7 +7,7 @@
 SUPPORT_PYTHON_ABIS="1"
 RESTRICT_PYTHON_ABIS="*-jython *-pypy-*"
 
-inherit flag-o-matic multilib python toolchain-funcs versionator
+inherit flag-o-matic multilib multiprocessing python toolchain-funcs versionator
 
 MY_P=${PN}_$(replace_all_version_separators _)
 
@@ -124,17 +124,10 @@
 }
 
 src_compile() {
-	local jobs
-	jobs=$( echo " ${MAKEOPTS} " | \
-		sed -e 's/ --jobs[= ]/ -j /g' \
-			-e 's/ -j \([1-9][0-9]*\)/ -j\1/g' \
-			-e 's/ -j\>/ -j1/g' | \
-			( while read -d ' ' j; do if [[ "${j#-j}" = "$j" ]]; then continue; fi; jobs="${j#-j}"; done; echo ${jobs} ) )
-	if [[ "${jobs}" != "" ]]; then NUMJOBS="-j"${jobs}; fi
-
 	export BOOST_ROOT="${S}"
 	PYTHON_DIRS=""
 	MPI_PYTHON_MODULE=""
+	NUMJOBS="-j$(makeopts_jobs)"
 
 	building() {
 		create_user-config.jam


However, fixing it is suicidal without the boost-build patch from comment #5 as it would cause -j to mean -j999 which would segfault or overflow instead of how it is now with -j1 and just really slow building.
Comment 9 Diego Elio Pettenò (RETIRED) gentoo-dev 2012-11-11 05:47:07 UTC

*** This bug has been marked as a duplicate of bug 427306 ***
Comment 10 Sergey Popov gentoo-dev 2014-06-19 08:35:21 UTC

*** This bug has been marked as a duplicate of bug 498134 ***