Segfault when building Rust programs

Steps to reproduce:

  1. clone the balena-rust-hello-world repository
  2. push it to a new application in balena cloud

Example of the error I get:

[main]     error: Could not compile `ansi_term`.
[main]     Caused by:
[main]       process didn't exit successfully: `rustc --crate-name ansi_term /root/.cargo/registry/src/github.com-1ecc6299db9ec823/ansi_term-0.11.0/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C metadata=13a492acd6e505a8 -C extra-filename=-13a492acd6e505a8 --out-dir /build/app/target/release/deps -L dependency=/build/app/target/release/deps --cap-lints allow` (signal: 11, SIGSEGV: invalid memory reference)

I tried pushing a blank rust project with no dependencies, but I get the same error. This is really holding back my development.

Thanks!

Hi there, we will have a look at why it fails. What device are you trying to run this on?

The reason it was failing was there were issues with the latest compiler version, and it is now fixed. Please try again and let us know if you still experience any issues. Cheers!

Indeed, pinning to the previous compiler version fixes the problem.

I’m wondering if it’s somehow balena-specific though, the rust issue tracker doesn’t have anything and surely this is not the only platform building rust on ARM.

@whm We suspect we face this issue posted on the official rust GitHub repo.
The PR that pinned the rust compiler in our hello-world project refers to this issue.

Great, I’m glad it’s being worked on.

Looks like it’s going to be a tough issue to track down.