Rustc SIGILL during cargo build

For some reason, I encountered rustc SIGILL ((signal: 4, SIGILL: illegal instruction) many times in GitHub Action runs, and cannot reproduce locally.

Rust version: 1.56.1

It's a debug build for one of my own library package (private crate). I don't have the stack backtrace and cannot find much info about it online.

Are there known issues with rustc hitting SIGILL? Is there some way to produce more info from rustc when this happens?


Are you using any -C options to choose the target cpu? It could really be encountering instructions that the CI computers don't understand, if they're older.

The other time SIGILL comes up is with the ud2 instruction, which is a reserved "undefined" instruction that LLVM uses to trap some undefined behavior. But if it's working locally, this seems less likely.

I'm not using -C options. The command I used is:

cargo build --color=always

Btw, is it possible to ask cargo or rustc to log what exact illegal instruction it was?

SIGILL is handled by the OS. Perhaps syslog will have more info?

Otherwise you'd need to run the rustc process under a debugger to catch the signal. Adding --verbose will make cargo print rustc invocations, which you could try copying and running via debugger.

I didn't have the syslog as it was in GitHub Action runs. I was wondering if it's related to rust-cache I used in GitHub Action. After I disabled the cache, the SIGILL is gone, for now. But I don't have real evidence that's the reason.

( I used to see SIGILL in cargo test and later changed the ordering of the cache action and rust toolchain action, which seemed helped.)

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.