randombit / botan

Cryptography Toolkit
https://botan.randombit.net
BSD 2-Clause "Simplified" License
2.59k stars 567 forks source link

"Segmentation fault" in botan-test(.exe) #1437

Closed DevSidious closed 6 years ago

DevSidious commented 6 years ago

Tested on Ubuntu 17 (x86_64), Ubuntu 16 (AArch64) and Ubuntu 16 (armv7l)

x509_unit:
Segmentation fault

Tested on Windows 10 (x86_64).

x509_unit:
-> crash

Tested on macOS Sierra (x86_64)

x509_unit:
Segmentation fault: 11
randombit commented 6 years ago

Well it is consistent at least...

Which revision is this, also what are the params for configure.py?

randombit commented 6 years ago

I can't replicate this, nor does it show up in CI, so we'll need some hints. If you can grab a backtrace that would probably help a lot.

DevSidious commented 6 years ago

Well it is consistent at least...

This is actually good news. :)

I can't replicate this, nor does it show up in CI, so we'll need some hints.

I suspect it's my customized module selection that triggers this behavior. Here's output from the arm32 machine, which should be representative since I'm using the same configure.py parameters everywhere.

git branch
  anch
* master
INFO: ./configure.py invoked with options "--minimized-build --enable-modules=x509,ecdsa,rsa,emsa_pkcs1,sha2_64,aes --disable-shared-library --debug-mode --amalgamation --single-amalgamation-file --prefix=/opt/dev/botan/dbg"
INFO: Guessing target OS is linux (use --os to set)
INFO: Guessing to use compiler gcc (use --cc or CXX to set)
INFO: Guessing target processor is a arm32 (use --cpu to set)
INFO: Auto-detected compiler version 5.4
INFO: Target is gcc:5.4-linux-arm32
INFO: Skipping (incompatible CPU): aes_ni aes_ssse3 chacha_sse2 clmul clmul_ssse3 idea_sse2 rdrand_rng rdseed sha1_sse2 sha1_x86 sha2_32_x86 shacal2_x86 threefish_avx2
INFO: Skipping (incompatible OS): darwin_secrandom getentropy win32_stats
INFO: Skipping (incompatible compiler): aes_armv8 pmull sha1_armv8 sha2_32_armv8
INFO: Skipping (not requested): adler32 aead aont aria auto_rng bcrypt blake2 blowfish camellia cascade cast cbc cbc_mac ccm cecpq1 certstor_sql certstor_sqlite3 cfb chacha chacha20poly1305 chacha_rng checksum cmac codec_filt comb4p compression crc24 crc32 cryptobox ctr curve25519 des dev_random dh dl_algo dl_group dlies dsa dyn_load eax ecdh ecgdsa ecies eckcdsa ed25519 elgamal eme_oaep eme_pkcs1 eme_raw emsa_raw emsa_x931 fd_unix ffi filters fpe_fe1 gcm gmac gost_28147 gost_3410 gost_3411 hkdf hmac hmac_drbg hotp http_util idea iso9796 kasumi kdf1 kdf1_iso18033 kdf2 keccak lion locking_allocator mce mceies md4 md5 misty1 mode_pad modes newhope nist_keywrap noekeon noekeon_simd ocb ofb par_hash passhash9 pbes2 pbkdf pbkdf1 pbkdf2 pgp_s2k pkcs11 poly1305 poly_dbl prf_tls prf_x942 proc_walk psk_db rc4 rdrand rfc3394 rfc6979 rmd160 salsa20 seed serpent serpent_simd sessions_sql sessions_sqlite3 sha3 shacal2 shacal2_simd shake shake_cipher simd siphash siv skein sm2 sm3 sm4 socket sp800_108 sp800_56a sp800_56c srp6 stateful_rng stream streebog system_rng thread_utils threefish tiger tls tls_cbc tss twofish whirlpool x919_mac xmss xtea xts
INFO: Skipping (requires external dependency): bearssl boost bzip2 lzma openssl sqlite3 tpm zlib
INFO: Loading modules: aes asn1 base base64 bigint block cpuid ec_gfp ec_group ecc_key ecdsa emsa1 emsa_pkcs1 emsa_pssr entropy hash hash_id hex kdf keypair mac mdx_hash mgf1 mp numbertheory pem pk_pad pubkey rng rsa sha1 sha2_32 sha2_64 utils x509
INFO: Using symlink to link files into build dir (use --link-method to change)
INFO: Writing amalgamation header to botan_all.h
INFO: Writing amalgamation header to botan_all_internal.h
INFO: Writing amalgamation source to botan_all.cpp
INFO: Botan 2.5.0 (revision git:439d2ead033142365f092c7882bad31e4257ed09) (unreleased undated) build setup is complete

If you still can't replicate, I will attach a core dump. Just let me know.

randombit commented 6 years ago

Thanks - was a bug I introduced last week that caused a crash if any of DH, ECDH or ElGamal was disabled. Should have been caught by CI but was not because the configurations that disabled ElGamal also skipped testing X.509. I just changed that, so it's more likely such bugs are caught early in the future.

DevSidious commented 6 years ago

Thanks. All good now:

Tests complete ran 83320 tests in 65.74 sec all tests ok