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

Bug 778245

Summary: dev-lang/rust-1.50.0::gentoo failed (compile phase)
Product: Gentoo Linux Reporter: Austin Kilgore <kilgorephotoshop>
Component: Current packagesAssignee: Gentoo Linux bug wranglers <bug-wranglers>
Status: RESOLVED INVALID    
Severity: major CC: ionen
Priority: Normal    
Version: unspecified   
Hardware: AMD64   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: build.log and emerge --info
new build.log

Description Austin Kilgore 2021-03-25 20:32:31 UTC
Created attachment 693696 [details]
build.log and emerge --info

build.log and emerge --info attached

 * ERROR: dev-lang/rust-1.50.0::gentoo failed (compile phase):
 *   (no error message)
 * 
 * Call stack:
 *     ebuild.sh, line 125:  Called src_compile
 *   environment, line 3508:  Called die
 * The specific snippet of code:
 *       env $(cat "${S}"/config.env) RUST_BACKTRACE=1 "${EPYTHON}" ./x.py dist -vv --config="${S}"/config.toml -j$(makeopts_jobs) || die )
 * 
 * If you need support, post the output of `emerge --info '=dev-lang/rust-1.50.0::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=dev-lang/rust-1.50.0::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/dev-lang/rust-1.50.0/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/dev-lang/rust-1.50.0/temp/environment'.
 * Working directory: '/var/tmp/portage/dev-lang/rust-1.50.0/work/rustc-1.50.0-src'
 * S: '/var/tmp/portage/dev-lang/rust-1.50.0/work/rustc-1.50.0-src'
Comment 1 Ionen Wolkens gentoo-dev 2021-03-25 20:41:23 UTC
rustc exited with signal: 9

That implies something killed the process, most likely the kernel's OOM (Out-of-Memory) killer, so you likely ran out of RAM. Would be mentioned near the end of `dmesg`'s output.

I suggest to use lower MAKEOPTS -jN value (like halved to -j6) for this package, rustc can sometime use 2-3.5GB per thread and it adds up. Also ensure not using tmpfs for PORTAGE_TMPDIR).

(on side-note, preferably don't use tar for logs)
Comment 2 Georgy Yakovlev archtester gentoo-dev 2021-03-25 22:06:39 UTC
agreed.
try to get 2GB per thread for C++ and rust code.

so with 18GB it should be no more than -j9 and much much lower than that if you use TMPFS build dir.


if you don't use system-bootstrap and system-llvm, tmpfs will use approx 9GB to unpack and build it.
that leaves you with 9g to work with. assuming you need at least 1G for runtime, I would not set more than -j4 to build rust with 18G and tmpfs.
Comment 3 Austin Kilgore 2021-03-25 23:40:24 UTC
Created attachment 693792 [details]
new build.log
Comment 4 Austin Kilgore 2021-03-25 23:41:02 UTC
(In reply to Ionen Wolkens from comment #1)
> rustc exited with signal: 9
> 
> That implies something killed the process, most likely the kernel's OOM
> (Out-of-Memory) killer, so you likely ran out of RAM. Would be mentioned
> near the end of `dmesg`'s output.
> 
> I suggest to use lower MAKEOPTS -jN value (like halved to -j6) for this
> package, rustc can sometime use 2-3.5GB per thread and it adds up. Also
> ensure not using tmpfs for PORTAGE_TMPDIR).
> 
> (on side-note, preferably don't use tar for logs)

Ah okay, my bad I thought I had plenty free memory when building but maybe some was reserved.

I just did a clean reboot and re-emerged rust and it had 17.5GB of memory to build with and it still failed. I know you said to reduce my jobs but I wanted to be sure it was the memory because I've never had that problem in the past when I built it.

I've attached the new build.log, I checked it and didn't see any oom errors, but it could be that I just don't know what they look like (I was just skimming through/searching in vim).
Comment 5 Austin Kilgore 2021-03-25 23:42:58 UTC
(In reply to Georgy Yakovlev from comment #2)
> agreed.
> try to get 2GB per thread for C++ and rust code.
> 
> so with 18GB it should be no more than -j9 and much much lower than that if
> you use TMPFS build dir.
> 
> 
> if you don't use system-bootstrap and system-llvm, tmpfs will use approx 9GB
> to unpack and build it.
> that leaves you with 9g to work with. assuming you need at least 1G for
> runtime, I would not set more than -j4 to build rust with 18G and tmpfs.

I didn't account for my tmpfs... I'll reduce my jobs and try again. Sorry to be a bother. I really appreciate the feedback though!
Comment 6 Austin Kilgore 2021-03-26 05:32:57 UTC
It built when I set it to -j3.
Comment 7 Ionen Wolkens gentoo-dev 2021-03-26 11:51:39 UTC
Glad to hear it works.