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

rustc segfault with jemalloc #9172

Closed
jedisct1 opened this issue Sep 13, 2013 · 6 comments
Closed

rustc segfault with jemalloc #9172

jedisct1 opened this issue Sep 13, 2013 · 6 comments
Labels
I-crash Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.

Comments

@jedisct1
Copy link
Contributor

rustc segfaults when using jemalloc (LD_PRELOAD=/usr/lib/libjemalloc.so). Not sure if this is a bug in jemalloc or if rustc is accessing unallocated memory.

x86_64-unknown-linux-gnu/stage1/bin/rustc -O --cfg stage1 --cfg rtopt -Z no-debug-borrows --target=x86_64-unknown-linux-gnu -D warnings --out-dir x86_64-unknown-linux-gnu/stage1/lib/rustc/x86_64-unknown-linux-gnu/lib /home/frank/src/rust/src/libstd/std.rs
+++ killed by SIGSEGV +++

Backtrace:

#0  0x00007ffff7bd0ae2 in ?? () from /usr/lib/libjemalloc.so
#1  0x00007ffff7bd1558 in ?? () from /usr/lib/libjemalloc.so
#2  0x00007ffff707c2ee in flate::deflate_bytes_internal::_6ace191abe458686::_0$x2e8$x2dpre ()
   from /home/frank/src/rust/x86_64-unknown-linux-gnu/stage1/bin/../lib/libextra-a7c050cfd46b2c9a-0.8-pre.so
#3  0x00007ffff707c462 in flate::deflate_bytes::_dd4c86de97c662c9::_0$x2e8$x2dpre ()
   from /home/frank/src/rust/x86_64-unknown-linux-gnu/stage1/bin/../lib/libextra-a7c050cfd46b2c9a-0.8-pre.so
#4  0x00007ffff5f4c7d8 in metadata::encoder::encode_metadata::_5e9470569ef0553a::_0$x2e8$x2dpre ()
   from /home/frank/src/rust/x86_64-unknown-linux-gnu/stage1/bin/../lib/librustc-d3cb8c2ccd84a7a7-0.8-pre.so
#5  0x00007ffff5f4abde in middle::trans::base::write_metadata::_3c7425b7f66f9212::_0$x2e8$x2dpre ()
   from /home/frank/src/rust/x86_64-unknown-linux-gnu/stage1/bin/../lib/librustc-d3cb8c2ccd84a7a7-0.8-pre.so
#6  0x00007ffff5f4df04 in middle::trans::base::trans_crate::_f3bb352d1de84a5::_0$x2e8$x2dpre ()
   from /home/frank/src/rust/x86_64-unknown-linux-gnu/stage1/bin/../lib/librustc-d3cb8c2ccd84a7a7-0.8-pre.so
#7  0x00007ffff645c918 in driver::driver::phase_4_translate_to_llvm::_ad5fa6cc5abb5f5a::_0$x2e8$x2dpre ()
   from /home/frank/src/rust/x86_64-unknown-linux-gnu/stage1/bin/../lib/librustc-d3cb8c2ccd84a7a7-0.8-pre.so
#8  0x00007ffff645d325 in driver::driver::compile_input::_1b306b4a530fa4d::_0$x2e8$x2dpre ()
   from /home/frank/src/rust/x86_64-unknown-linux-gnu/stage1/bin/../lib/librustc-d3cb8c2ccd84a7a7-0.8-pre.so
#9  0x00007ffff6489e09 in run_compiler::_686ff2cef217b1f::_0$x2e8$x2dpre ()
   from /home/frank/src/rust/x86_64-unknown-linux-gnu/stage1/bin/../lib/librustc-d3cb8c2ccd84a7a7-0.8-pre.so
#10 0x00007ffff649de4e in main_args::anon::expr_fn_96766 ()
   from /home/frank/src/rust/x86_64-unknown-linux-gnu/stage1/bin/../lib/librustc-d3cb8c2ccd84a7a7-0.8-pre.so
#11 0x00007ffff649bd9a in monitor::anon::expr_fn_96610 ()
   from /home/frank/src/rust/x86_64-unknown-linux-gnu/stage1/bin/../lib/librustc-d3cb8c2ccd84a7a7-0.8-pre.so
#12 0x00007ffff649927e in task::__extensions__::try_96079::anon::expr_fn_96279 ()
   from /home/frank/src/rust/x86_64-unknown-linux-gnu/stage1/bin/../lib/librustc-d3cb8c2ccd84a7a7-0.8-pre.so
#13 0x00007ffff753635c in task::spawn::spawn_raw::anon::expr_fn_22719 ()
   from /home/frank/src/rust/x86_64-unknown-linux-gnu/stage1/bin/../lib/libstd-6c65cf4b443341b1-0.8-pre.so
#14 0x00007ffff757ebde in rt::task::__extensions__::build_start_wrapper::anon::anon::expr_fn_30117 ()
   from /home/frank/src/rust/x86_64-unknown-linux-gnu/stage1/bin/../lib/libstd-6c65cf4b443341b1-0.8-pre.so
#15 0x00007ffff757da71 in rt::task::__extensions__::run::anon::expr_fn_30009 ()
   from /home/frank/src/rust/x86_64-unknown-linux-gnu/stage1/bin/../lib/libstd-6c65cf4b443341b1-0.8-pre.so
#16 0x00007ffff757eedd in rt::task::__extensions__::try_fn::_bdf5f0d7d89d6288::_0$x2e8$x2dpre ()
   from /home/frank/src/rust/x86_64-unknown-linux-gnu/stage1/bin/../lib/libstd-6c65cf4b443341b1-0.8-pre.so
#17 0x00007ffff5a98543 in rust_try (f=<optimized out>, fptr=<optimized out>, env=<optimized out>) at /home/frank/src/rust/src/rt/rust_builtin.cpp:523
#18 0x00007ffff757d924 in rt::task::__extensions__::meth_30007::try::_199ab8d6eb226980::_0$x2e8$x2dpre ()
   from /home/frank/src/rust/x86_64-unknown-linux-gnu/stage1/bin/../lib/libstd-6c65cf4b443341b1-0.8-pre.so
#19 0x00007ffff757d805 in rt::task::__extensions__::meth_30005::run::_199ab8d6eb226980::_0$x2e8$x2dpre ()
   from /home/frank/src/rust/x86_64-unknown-linux-gnu/stage1/bin/../lib/libstd-6c65cf4b443341b1-0.8-pre.so
#20 0x00007ffff757e8bc in rt::task::__extensions__::build_start_wrapper::anon::expr_fn_30101 ()
   from /home/frank/src/rust/x86_64-unknown-linux-gnu/stage1/bin/../lib/libstd-6c65cf4b443341b1-0.8-pre.so
---Type <return> to continue, or q <return> to quit---
#21 0x00007ffff75c6f19 in rt::context::__extensions__::task_start_wrapper::_d625afdc49afb93::_0$x2e8$x2dpre ()
   from /home/frank/src/rust/x86_64-unknown-linux-gnu/stage1/bin/../lib/libstd-6c65cf4b443341b1-0.8-pre.so
#22 0x0000000000000000 in ?? ()

Host is running Ubuntu Precise.

@thestinger
Copy link
Contributor

Rust already uses jemalloc. It's a vanilla 3.4.0 compiled into the runtime.

@thestinger
Copy link
Contributor

Are you testing with master or an old version of Rust?

@jedisct1
Copy link
Contributor Author

This is with master ( 7c8f503 )

@jedisct1
Copy link
Contributor Author

Ubuntu Precise ships with jemalloc 2.2.5. Maybe both just don't play well with each other. Not a big deal.

@thestinger
Copy link
Contributor

It could also be that statically linking jemalloc to the runtime prevents dynamically loading jemalloc or tcmalloc.

@alexcrichton
Copy link
Member

jemalloc was removed in #9933, so I'm going to close this. If we decide to re-integrate jemalloc, this has the possibility of becoming an issue, but thankfully github keeps archives of everything!

flip1995 pushed a commit to flip1995/rust that referenced this issue Jul 18, 2022
Rename rustcSource in contributing documentation

According to [rust-analyzer docs](https://rust-analyzer.github.io/manual.html#toolchain:~:text=rust%2Danalyzer.rustc.source), rustcSource has been renamed to rustc.source.

changelog: none
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I-crash Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.
Projects
None yet
Development

No branches or pull requests

3 participants