<p dir="auto">A Show implementation could use the string representation.</p>
<p dir="auto">If I build rust with <tt>--disable-jemalloc</tt>, 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)!</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="# 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"><pre class="notranslate"><code class="notranslate"># 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
</code></pre></div>
<p dir="auto">results in:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="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 ***"><pre class="notranslate"><code class="notranslate">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 ***
</code></pre></div>