-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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 segfaults when loading mimalloc with LD_PRELOAD #126200
Comments
@rustbot label -needs-triage +I-crash +regression-from-stable-to-stable |
Same issue over here.
|
I am also on Arch. I also see that you are both reporting output that contains mention of a directory called I'm trying to follow the directions in this repo. Unfortunately it seems like there's no sandboxing in sight, so I'm going to try to do this all in an
So I just deleted that package from the list. Then the setup instructions tell me to run Then I skip down to the "Compiling with GCC" section, and I try to paste in the
So I'm not sure what we can do with this issue. Can you provide a reproducer for this crash that others can run? |
my bash
|
|
Perhaps this is related? Something looks scuffed here
|
I don't have cmake problem (cmake version 3.29.5). here is my output
|
I'm sure you have the error, but I'd like to be able to induce it on my own so that I can minimize and/or debug the issue. I'm decently certain that there is something about your system state that is permitting you to run these commands. So, I'm up for shooting in the dark here but hopes are not high without the ability to reproduce your build setup. I see you're running via some |
Thank you very much! when I removed the Arch Linux upgraded mimalloc to 2.1.7-1 on June 8. I will try to downgrade it and let you know if the problem is also gone. |
Downgraded to mimalloc-2.1.2 (https://archive.archlinux.org/repos/2024/06/07/extra/os/x86_64/mimalloc-2.1.2-1-x86_64.pkg.tar.zst), kept Rust is not happy with mimalloc 2.1.7 in Arch Linux. Where should I report the bug, here, Arch Linux or mimalloc? |
gdb has a much more informative backtrace (as usual) than our segfault handler:
Our libLLVM.so is trying to deallocate memory with jemalloc, which was almost certainly allocated with mimalloc. I strongly suspect that on any system attempting to use LD_PRELOAD to override the allocator with anything will cause a similar explosion. |
rustc version seems entirely irrelevant; I can reproduce this on compilers at least back to 1.50 which is from 2021. I am surprised that the mimalloc version matters. This looks like plain old allocator confusion, but if that were the case the mimalloc version shouldn't matter, and it shouldn't really matter which alternative allocator is used. |
I think the only way jemalloc could deallocate this memory is when deallocation is performed by rustc (jemalloc is statically linked in rustc binary). If that is anywhere close to the truth, the fact mimalloc 2.1.2 (and possibly earlier) is a pure coincidence and such usage is basically impossible to support. Maybe @Kobzol who had an idea to use jemalloc with LLVM library (see #122047) has any idea? |
Possibly some allocations go to jemalloc directly, while some go through |
Running https://github.com/shinchiro/mpv-winbuild-cmake/blob/master/toolchain/rustup.cmake on newly installed Arch Linux
Before June 8th, the install would succeed.
After June 8th, I got
error: rustc interrupted by SIGSEGV
Meta
The problem also happens in the nightly version. When I found the problem in nightly, tried it on stable and got the same problem.
You can find the full log here:
https://raw.githubusercontent.com/CharlesMengCA/mpv-player-only/master/rustup-install-err.log
Hope someone can find the a solution for me. Thanks a lot!
Backtrace
The text was updated successfully, but these errors were encountered: