Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 652200

Summary: dev-qt/qtwebengine:5 doesn't respect MAKEOPTS=-j1
Product: Gentoo Linux Reporter: Toralf Förster <toralf>
Component: Current packagesAssignee: Qt Bug Alias <qt>
Status: RESOLVED WORKSFORME    
Severity: normal CC: adasss, cruzki123, mail, pacho, sam
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on: 630834    
Bug Blocks: 654178    
Attachments: 27.20180402-012705
load.23.20190117-142310

Description Toralf Förster gentoo-dev 2018-04-02 10:37:02 UTC
pls see attached pstree - at least ninja ignores it, although the tinderbox set this:

MAKEOPTS="-j 1"
NINJAFLAGS="-j 1"
EGO_BUILD_FLAGS="-p 1"
GOMAXPROCS="1"
GO19CONCURRENTCOMPILATION=0
RUSTFLAGS="-C codegen-units=1"
RUST_TEST_THREADS=1
RUST_TEST_TASKS=1
Comment 1 Toralf Förster gentoo-dev 2018-04-02 10:37:26 UTC
Created attachment 526316 [details]
27.20180402-012705

pstree
Comment 2 Arfrever Frehtes Taifersar Arahesis 2018-04-03 03:45:22 UTC
Patch #1 from patchset in bug #630834 should fix this problem.

Your attachment shows that src/3rdparty/chromium/tools/gn/bootstrap/bootstrap.py was run and exactly this file is changed by sed in the aforementioned patch.
Comment 3 Andreas Sturmlechner gentoo-dev 2018-09-15 13:35:30 UTC
*** Bug 666270 has been marked as a duplicate of this bug. ***
Comment 4 Toralf Förster gentoo-dev 2019-01-17 18:47:43 UTC
Created attachment 561864 [details]
load.23.20190117-142310

this is from qt-webengine-5.11.3, where 13 c++ processes are spawned
Comment 5 Davide Pesavento gentoo-dev 2019-04-18 16:09:32 UTC
*** Bug 683776 has been marked as a duplicate of this bug. ***
Comment 6 Nathan Shearer 2019-04-18 16:33:08 UTC
I have encountered this bug on a 4-core system with only 1GB of ram (and 8 GB of swap). At times there were 6 instances of cc1plus, and the system was swapping so hard I could barely open top or even kill the compilation.

This seems to be an issue with the way ninja is allocating resources on the build system for maximum performance: https://github.com/ninja-build/ninja/issues/1441

Is there a way, any way, to force ninja to stop fork bombing my computer? Even if it is forced to run in a throttled sandbox of some kind?
Comment 7 Toralf Förster gentoo-dev 2019-04-18 17:30:39 UTC
FWIW these settings here seems not to be enough but might be a starting point:

https://github.com/toralf/tinderbox/blob/master/bin/setup_img.sh#L422
Comment 8 Alessandro Barbieri 2021-05-05 18:40:00 UTC
Any plan on fixing this? I don't even know how to workaround it
Comment 9 Nathan Shearer 2021-05-05 21:33:49 UTC
Perhaps inside the portage sandbox a wrapper script can be used that does in fact respect the environment MAKEOPTS -j variable.

It would just postpone launching the actual process until the existing ones have returned, preventing the forkbomb.
Comment 10 Chiitoo gentoo-dev 2021-06-24 10:30:59 UTC
Quick testing with 'dev-qt/qtwebengine-5.15.2_p20210521' suggests that the '-j' option is being respected.

Some things I did:

- Set MAKEOPTS="-j 1" in 'make.conf'.
- Start build while watching CPU cores being used, 'pstree -l', and 'pstree -al' for about 10 minutes.

- Set NINJAFLAGS="-j 100" on the command-line for emerge.
- Start build while watching CPU cores being used, 'pstree -l', and 'pstree -al' for about 10 minutes.

Closing now since there seems to be nothing for us to do here.

Please do re-open in case this can still be re-produced somehow.

Thanks!
Comment 11 Robert Booth 2022-05-18 06:16:38 UTC
The "-j" in my MAKEOPTS is not being respected for a build of dev-qt/qtwebengine-5.15.3_p20220406. Despite using MAKEOPTS="-j 1", the build uses all CPU cores.

I've tried setting NINJAJOBS and NINJAFLAGS on the command line for emerge, but there is no change.

I'll be happy to provide any other information if necessary.
Comment 12 Robert Booth 2022-05-18 07:07:50 UTC
Apologies, I see that the CPU usage settles down after an initial spike. Please disregard my previous message.