IronCoreLabs / ironoxide

Rust SDK for IronCore Privacy Platform
https://docs.rs/ironoxide
GNU Affero General Public License v3.0
10 stars 3 forks source link

SEGV in cross test that use QEMU #136

Open cjyar opened 4 years ago

cjyar commented 4 years ago
Fiddle:ironoxide chris$ cross test --no-default-features --features "blocking beta tls-vendored-openssl" --target armv7-linux-androideabi
...
test crypto::aes::tests::test_parallel_encrypt ... libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0x813ceed4 in tid 82 (qemu-arm)
libc: Unable to open connection to debuggerd: Connection refused
qemu: uncaught target signal 11 (Segmentation fault) - core dumped
error: test failed, to rerun pass '--lib'

Caused by:
  process didn't exit successfully: `qemu-arm /target/armv7-linux-androideabi/debug/deps/ironoxide-c38a6b0d31c7f14c` (signal: 11, SIGSEGV: invalid memory reference)

This does not happen every time; it failed 8/10 times on my machine.

cjyar commented 4 years ago

I got this on aarch64-linux-android, which seems even more concerning:

test crypto::aes::tests::test_parallel_encrypt ... libc: Fatal signal 11 (SIGSEGV), code 0, fault addr 0x0 in tid 21 ()
libc: Fatal signal 4 (SIGILL), code 2, fault addr 0x4004227030 in tid 23 (qemu-aarch64)
libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0x4802102498 in tid 22 (qemu-aarch64)
libclibc: Unable to open connection to debuggerd: Connection refused
: Unable to open connection to debuggerd: Connection refused
libc: Unable to open connection to debuggerd: Connection refused
qemu: uncaught target signal 4 (Illegal instruction) - core dumped
error: test failed, to rerun pass '--lib'

Caused by:
  process didn't exit successfully: `qemu-aarch64 /target/aarch64-linux-android/debug/deps/ironoxide-c26b43cb4deb804d` (signal: 4, SIGILL: illegal instruction)
clintfred commented 4 years ago

Reading the cross docs:

Also, testing is very slow. cross test runs units tests sequentially because QEMU gets upset when you spawn multiple threads. This means that, if one of your unit tests spawns threads, then it's more likely to fail or, worst, never terminate.

So that's probably the issue as the test in question is using std::thread::spawn which is maybe a bad idea anyway....