Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
rustc fails with memory corruption when --disable-jemalloc is used #16071
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)!