Skip to content

SIGILL on old CPU #958

@antekone

Description

@antekone

I'm trying to use Cargo on a computer with an old CPU:

(1:664)$ cat /proc/cpuinfo
processor   : 0
vendor_id   : AuthenticAMD
cpu family  : 6
model       : 10
model name  : AMD Athlon(tm) XP 3200+
stepping    : 0
(...)
flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 mmx fxsr sse syscall mmxext 3dnowext 3dnow

This CPU is compatible with i686 architecture. When I'm trying to use Cargo (i.e. by using "cargo new --bin"), OR when trying to compile Cargo myself, I'm getting a crash:

(1:663)$ LC_ALL="C" make
"/usr/bin/rustc" -v
rustc 0.12.0-dev
target/snapshot/bin/cargo build --target i686-unknown-linux-gnu  
Makefile:77: recipe for target 'cargo-i686-unknown-linux-gnu' failed
make: *** [cargo-i686-unknown-linux-gnu] Illegal instruction (core dumped)

Here is some debug info, extracted from the coredump generated in the crash above:

Core was generated by `target/snapshot/bin/cargo build --target i686-unknown-linux-gnu'.
Program terminated with signal SIGILL, Illegal instruction.
#0  0xb759ed44 in stack_overflow::imp::signal_handler::term::h95cc93235a9133cb2Oa ()
(gdb) disassemble 
Dump of assembler code for function _ZN14stack_overflow3imp14signal_handler4term20h95cc93235a9133cb2OaE:
   0xb759ed00 <+0>: cmp    %gs:0x30,%esp
   0xb759ed07 <+7>: ja     0xb759ed19 <_ZN14stack_overflow3imp14signal_handler4term20h95cc93235a9133cb2OaE+25>
   0xb759ed09 <+9>: push   $0x0
   0xb759ed0e <+14>:    push   $0x1c
   0xb759ed13 <+19>:    call   0xb705a80c <__morestack>
   0xb759ed18 <+24>:    ret    
   0xb759ed19 <+25>:    push   %ebx
   0xb759ed1a <+26>:    push   %esi
   0xb759ed1b <+27>:    sub    $0x14,%esp
   0xb759ed1e <+30>:    mov    %ecx,%esi
   0xb759ed20 <+32>:    call   0xb759ed25 <_ZN14stack_overflow3imp14signal_handler4term20h95cc93235a9133cb2OaE+37>
   0xb759ed25 <+37>:    pop    %ebx
   0xb759ed26 <+38>:    add    $0x2220e3,%ebx
   0xb759ed2c <+44>:    mov    %esi,(%esp)
   0xb759ed2f <+47>:    movl   $0x0,0x4(%esp)
   0xb759ed37 <+55>:    call   0xb7001240 <signal@plt>
   0xb759ed3c <+60>:    mov    %esi,(%esp)
   0xb759ed3f <+63>:    call   0xb7001990 <raise@plt>
=> 0xb759ed44 <+68>:    ud2    
End of assembler dump.
(gdb) bt
#0  0xb759ed44 in stack_overflow::imp::signal_handler::term::h95cc93235a9133cb2Oa ()
#1  0xb759ecd5 in stack_overflow::imp::signal_handler::hed7998b12c57a9dcJOa ()
#2  <signal handler called>
#3  0xb735e02d in lh_insert ()
#4  0xb72f7f44 in int_err_set_item ()
#5  0xb72f8afe in ERR_load_ERR_strings ()
#6  0xb7350c68 in ERR_load_crypto_strings ()
#7  0xb73067a8 in SSL_load_error_strings ()
#8  0xb728f27a in init_ssl () at /home/rustbuild/src/rust-buildbot/slave/cargo-linux-32/build/.cargo/git/checkouts/git2-rs-cf258e7bcbaee34d/no-build-cmd/libgit2/build/libgit2/src/global.c:72
#9  init_once () at /home/rustbuild/src/rust-buildbot/slave/cargo-linux-32/build/.cargo/git/checkouts/git2-rs-cf258e7bcbaee34d/no-build-cmd/libgit2/build/libgit2/src/global.c:241
#10 init_once () at /home/rustbuild/src/rust-buildbot/slave/cargo-linux-32/build/.cargo/git/checkouts/git2-rs-cf258e7bcbaee34d/no-build-cmd/libgit2/build/libgit2/src/global.c:229
#11 0xb6f4673e in pthread_once () from /usr/lib/libpthread.so.0
#12 0xb728f447 in git_threads_init () at /home/rustbuild/src/rust-buildbot/slave/cargo-linux-32/build/.cargo/git/checkouts/git2-rs-cf258e7bcbaee34d/no-build-cmd/libgit2/build/libgit2/src/global.c:248
#13 0xb728f0a3 in init::closure.10156 ()
#14 0xb759d646 in one::Once::doit::h9e2f899a6ed191f1F7b ()
#15 0xb728c867 in repo::Repository::open::hdfc674d4138e412cIsf ()
#16 0xb71e4424 in sources::git::utils::GitRemote::db_at::h9596b2c826953124N9o ()
#17 0xb7064ce6 in sources::git::source::GitSource$LT$$x27a$C$$x20$x27b$GT$.Source::update::h4ea97016ef1ca3f2RSp ()
#18 0xb70b103a in core::registry::PackageRegistry$LT$$x27a$GT$::load::ha6cd4266d11b13edvug()
#19 0xb70bd349 in core::registry::PackageRegistry$LT$$x27a$GT$.Registry::query::he5fb17744c47eb94WBg ()
#20 0xb71da751 in core::resolver::activate::closure.27091 ()
#21 0xb71d965a in core::resolver::activate::h5098706157662105859 ()
#22 0xb70e1e32 in ops::resolve::resolve_with_previous::h64749ffa8746717dAao ()
#23 0xb70ded3f in ops::resolve::resolve_pkg::hae746acc4e161a6e88n ()
#24 0xb70d5dfa in ops::cargo_compile::compile_pkg::h5d89a256d8ef97aekgh ()
#25 0xb70d3a1f in ops::cargo_compile::compile::h47c8064cbc132422mbh ()
#26 0xb701b67e in call_main_without_stdin::h12692426207735314450 ()
#27 0xb700a592 in execute::hb805ce1b2bf062d7fda ()
#28 0xb70053f6 in call_main_without_stdin::h1306324012682129432 ()
#29 0xb7003502 in main::h0f7df40cd3e74b916ca ()
#30 0xb7494125 in start::closure.2821 ()
#31 0xb75a2554 in unwind::try::try_fn::hdb813388f395c605x0c ()
#32 0xb75a3543 in rust_try_inner ()
#33 0xb75a350c in rust_try ()
#34 0xb75a0baf in unwind::try::hcaa3d901d7810b5bmYc ()
#35 0xb75a0a69 in task::Task::run::h5d76bfe6ab305402u4b ()
#36 0xb7493f79 in start::h854aa1e34251dd912ma ()
#37 0xb7493ded in lang_start::hcae264f3f21854belma ()
#38 0xb70036a7 in main ()
(gdb) 

As a sidenote, the same executable file (cargo) on a different CPU (i7-4470k) works perfectly OK!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions