Skip to content

Possible miscompilation of alacritty with -C target-cpu=native #48464

Closed

Description

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:

thread 'main' panicked at 'capacity overflow', libcore/option.rs:917:5
stack backtrace:
   0:     0x55912e09fd73 - std::sys::unix::backtrace::tracing::imp::unwind_backtrace::h5be622d6bae271e4
                               at libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1:     0x55912e09e76d - std::panicking::default_hook::{{closure}}::h3dad42fd5277700a
                               at libstd/sys_common/backtrace.rs:71
                               at libstd/sys_common/backtrace.rs:59
                               at libstd/panicking.rs:380
   2:     0x55912e09d176 - std::panicking::rust_panic_with_hook::h17668d919cb963a0
                               at libstd/panicking.rs:396
                               at libstd/panicking.rs:576
   3:     0x55912e09cc02 - std::panicking::begin_panic::hc486239aa11674a1
                               at libstd/panicking.rs:537
   4:     0x55912e09cb79 - std::panicking::begin_panic_fmt::h2d2bb54c3df78ea1
                               at libstd/panicking.rs:521
   5:     0x55912e0b998a - core::panicking::panic_fmt::hee07a740495be6a3
                               at libstd/panicking.rs:497
   6:     0x55912e0c02a8 - core::option::expect_failed::h8c28a7270985f5ac
                               at libcore/option.rs:917
   7:     0x55912dec0e24 - <std::collections::hash::table::RawTable<K, V>>::new::h9be5b206095a0292
                               at /checkout/src/libcore/option.rs:302
                               at /checkout/src/libstd/collections/hash/table.rs:776
                               at /checkout/src/libstd/collections/hash/table.rs:816
   8:     0x55912deb825a - <std::collections::hash::map::HashMap<K, V, S>>::resize::hfcf2613f008e9ae5
                               at /checkout/src/libstd/collections/hash/map.rs:777
   9:     0x55912deb7fec - <std::collections::hash::map::HashMap<K, V, S>>::entry::h5422f5e504c51b41
                               at /checkout/src/libcore/cmp.rs:0
  10:     0x55912dea653b - alacritty::renderer::QuadRenderer::with_loader::hf63d8fc8d3d62172
                               at src/renderer/mod.rs:282
                               at src/renderer/mod.rs:214
                               at src/renderer/mod.rs:200
                               at src/display.rs:227
                               at src/renderer/mod.rs:686
  11:     0x55912ded5f4b - alacritty::display::Display::new::h18ace9deaccdd433
                               at src/display.rs:226
                               at src/display.rs:153
  12:     0x55912de09755 - alacritty::main::h023b5d1d018376be
                               at src/main.rs:104
                               at src/main.rs:62
  13:     0x55912e0f49f5 - std::rt::lang_start::{{closure}}::h924495c33c565557
                               at /checkout/src/libstd/rt.rs:74
  14:     0x55912de14f82 - main
  15:     0x7f30e925e010 - __libc_start_main
  16:     0x55912ddfaa39 - _start
  17:                0x0 - <unknown>

Further information:

  • Works fine with stable.
  • The last working nightly is nightly-2018-02-10, as provided by rustup.
  • It is broken only on one of my computers and only when I compile it with -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):

$ rustc --version --verbose
rustc 1.25.0-nightly (27a046e93 2018-02-18)
binary: rustc
commit-hash: 27a046e9338fb0455c33b13e8fe28da78212dedc
commit-date: 2018-02-18
host: x86_64-unknown-linux-gnu
release: 1.25.0-nightly
LLVM version: 6.0

I believe my /proc/cpuinfo is also relevant (it's some low-power celeron).

processor	: 3
vendor_id	: GenuineIntel
cpu family	: 6
model		: 55
model name	: Intel(R) Celeron(R) CPU  N2940  @ 1.83GHz
stepping	: 8
microcode	: 0x829
cpu MHz		: 499.609
cache size	: 1024 KB
physical id	: 0
siblings	: 4
core id		: 3
cpu cores	: 4
apicid		: 6
initial apicid	: 6
fpu		: yes
fpu_exception	: yes
cpuid level	: 11
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology tsc_reliable nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 movbe popcnt tsc_deadline_timer rdrand lahf_lm 3dnowprefetch epb pti tpr_shadow vnmi flexpriority ept vpid tsc_adjust smep erms dtherm ida arat
bugs		: cpu_meltdown spectre_v1 spectre_v2
bogomips	: 3666.91
clflush size	: 64
cache_alignment	: 64
address sizes	: 36 bits physical, 48 bits virtual
power management:

Is there any other way I could narrow it down further, or anything more I could try?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions