Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

current nightly gets OOM'd upon building Diesel example application #68591

Closed
ejmg opened this issue Jan 28, 2020 · 3 comments
Closed

current nightly gets OOM'd upon building Diesel example application #68591

ejmg opened this issue Jan 28, 2020 · 3 comments

Comments

@ejmg
Copy link

ejmg commented Jan 28, 2020

Hi there!

I've discovered what I believe to be a a bug in the currently build for nightly that results in the build process getting OOM'd on my machine. In under ~20 seconds, I can observe Rust take all available RAM (15gb of 16) before it begins to fill up swap as well (8gb). By the 40 second mark, my desktop is largely frozen and the process gets kill around 60 seconds in or so.

I haven't timed these builds but can if specific numbers are needed.

The specific project being built is the first version of the Diesel demo app found on it's landing page. Upon switching the contents of my rust-toolchain file to stable, the project builds and executes as expected. Here's a link to my code. The only thing you'll need to change is the toolchain file to nightly. Like I said, this will OOM on Linux so be warned.

System stats:

  • my current version of rustc: rustc 1.42.0-nightly (8a79d08fa 2020-01-27)
  • my version of linux: x86_64 Linux 5.4.13-arch1-1
  • OS: Arch Linux

As an aside, the demo app uses Diesel 1.0.0, but I also went ahead and tested it against the most recent released version of 1.4.3 to the same results on nightly.

Update: Here's the output of dmesg for one of the failed attempts to build on nightly:

[240198.230402] oom-kill:constraint=CONSTRAINT_NONE,nodemask=(null),cpuset=/,mems_allowed=0,global_oom,task_memcg=/user.slice/user-1000.slice/session-1.scope,task=cargo,pid=188300,uid=1000
[240198.230413] Out of memory: Killed process 188300 (cargo) total-vm:34595572kB, anon-rss:14876996kB, file-rss:0kB, shmem-rss:0kB, UID:1000 pgtables:36180kB oom_score_adj:0
[240198.980499] oom_reaper: reaped process 188300 (cargo), now anon-rss:0kB, file-rss:0kB, shmem-rss:0kB

So maybe this is more an issue with Cargo?

@tesuji
Copy link
Contributor

tesuji commented Jan 28, 2020

Yes, this should be fixed in next nightly.

@wfraser
Copy link

wfraser commented Jan 28, 2020

Looks like it's specifically fixed by e1a837c, which pulls in a bugfix in Cargo: rust-lang/cargo@dc6d219

@ejmg you can try building in release mode to unblock yourself; that worked for me where debug didn't for some reason.

@ejmg
Copy link
Author

ejmg commented Jan 28, 2020

Yeah, I can report that building with the release flag works around the issue. Thanks!

Will e1a837c fix it such that --release won't be necessary on the next nightly that gets shipped?

Anyway, thanks for the response and sorry for the false alarm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants