-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Possible miscompilation of alacritty with -C target-cpu=native #48464
Comments
For the record, if you run |
Hmm. It says amdfam10, which seems wrong, considering this CPU is intel (and I could see why that would produce strange crashes). How does it detect the CPU? Does it rely on some library present in the OS, or is everything bundled within the tarball downloaded by rustc? (I ask because I have an unusual setup ‒ this is gentoo and the packages for the computer are compiled on a different computer, so some library in the OS could in theory provide the info from the time it was compiled, not where it runs, but it sounds unlikely). |
Just to add, the 2018-02-10 version guesses silvermont. |
Just curious, if you run |
Host CPU detection is done by LLVM here. |
@vorner are you sure you looked at the
and not
amdfam10 is definitely not something that should be detected for intel. |
@nagisa Yes, I'm sure (and just double-checked).
The fact the amdfam10 is first in the list is suspicious, though (something initialized to 0 and not set later on, maybe). I fully agree this should not be detected on intel. (As for the dmesg and illegal instruction, I'll report back in ~30 minutes ‒ I have to get back to the broken state and the processor is slow). |
@matthiaskrgr No illegal instruction dmesg, only well-behaved panic. But I think it is possible there exists an instruction opcode that means one thing on the amdfam10 processor and something completely different on the intel one. |
I'd have expected a Perhaps the panic can be turned into an abort, get a core dump, and then look at the disassembly of the frames in the backtrace. In particular, what Or, can skip that and try to figure out why cpu detection is off in the first place. @vorner, you said that this nightly version works fine if you manually select silvermont? |
It works fine if I pass no RUSTFLAGS (eg. compile generic code). I'm compiling with explicit silvermont now, but I'd expect that to work too. |
@vorner, does it always fail with |
If I explicitly select silvermont, it also works correctly. With native, it always fails and the function names and line numbers in the backtrace are the same. The addresses on the left differ, probably due to some kind of address space randomization. |
I believe it is the choice of wrong processor during the compilation. But I still went with the
I'm attaching the core file and corresponding binary, if you want to look into it. |
Hello
I admit it is a bit hard to say where exactly the problem lies, but I think something in rustc might be to blame here. I first reported it to alacritty directly, but the more info I gather I think it might be here: alacritty/alacritty#1122.
In short, on one of my computers, alacritty crashes with this panic on start:
Further information:
-C target-cpu=native
.If I had to guess, I'd say it has something to do with switch to llvm 6.
Current nightly version info (still broken):
I believe my
/proc/cpuinfo
is also relevant (it's some low-power celeron).Is there any other way I could narrow it down further, or anything more I could try?
The text was updated successfully, but these errors were encountered: