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

rustc fails with memory corruption when --disable-jemalloc is used #16071

Closed
mneumann opened this Issue Jul 29, 2014 · 5 comments

Comments

Projects
None yet
3 participants
@mneumann
Copy link
Contributor

mneumann commented Jul 29, 2014

If I build rust with --disable-jemalloc, I am getting a strange memory issue somewhere in stage1 (see below for how to reproduce it on Linux). I also reproduced the same issue during porting rust to DragonflyBSD (which I initially built w/o jemalloc). There I noticed for some input files that it wants to mmap an anonymous region of size 0x800_000_000 or 0x1000_000_000, probably due to a mal-formed malloc call (just a wild guess). And then more or less stalls the system, probably trying to zero that region and swapping to disk. Changing a single letter in the file subject for compilation makes rustc behave well again. With jemalloc, these issues are not existent (both on Dragonfly and Linux)!

# uname -a
Linux linux-vbox 3.11.0-12-generic #19-Ubuntu SMP Wed Oct 9 16:20:46 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
# ./configure --disable-jemalloc
# make

results in:

cp: x86_64-unknown-linux-gnu/stage1/lib/librustc_llvm
cp: x86_64-unknown-linux-gnu/stage1/lib/librustc_back
cp: x86_64-unknown-linux-gnu/stage1/lib/librustc
cp: x86_64-unknown-linux-gnu/stage1/lib/libnative
cp: x86_64-unknown-linux-gnu/stage1/bin/rustc
cp: x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib/libmorestack.a
cp: x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler-rt.a
rustc: x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore
*** Error in `x86_64-unknown-linux-gnu/stage1/bin/rustc': free(): invalid next size (fast): 0x00002b032802af30 ***
*** Error in `x86_64-unknown-linux-gnu/stage1/bin/rustc': malloc(): memory corruption: 0x00002b032802af60 ***
@alexcrichton

This comment has been minimized.

Copy link
Member

alexcrichton commented Jul 29, 2014

if you run valgrind, does it turn up anything suspicious?

@mneumann

This comment has been minimized.

Copy link
Contributor Author

mneumann commented Jul 29, 2014

hm, is it only me seeing this failure? I thought it is somehow reproducable everywhere :). I haven't tried valgrind yet.

@alexcrichton

This comment has been minimized.

Copy link
Member

alexcrichton commented Jul 29, 2014

Ah I was just hoping you still had a build lying around, I hadn't personally tried it out just yet, but I shall do so now!

@thestinger

This comment has been minimized.

Copy link
Contributor

thestinger commented Sep 5, 2014

@mneumann: Is this still an issue with master?

@thestinger

This comment has been minimized.

Copy link
Contributor

thestinger commented Sep 12, 2014

AFAIK this has been fixed. I can't duplicate it on Linux or Windows.

@thestinger thestinger closed this Sep 12, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment