randombit / botan

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

NetBSD 7.0 amd64 and crash in DSA_Signature_Operation::raw_sign #819

Closed noloader closed 6 years ago

noloader commented 7 years ago

Sorry about another report. This one is for NetBSD 7.0 amd64 under a Virtual Box VM. I've had trouble trying to update this system for months, so its mostly unpatched. GCC version is:

$ g++ --version
nb2 (20150115) 4.8.4

The library was built using the sed -i 's|-O3|-g3 -O2|g' Makefile trick (thanks for that, btw). Here's what it looks like under GDB.

$ export LD_LIBRARY_PATH=.
$ gdb ./botan-test
...

(gdb) r
Starting program: /home/jwalton/botan/botan-test 
...

Program received signal SIGSEGV, Segmentation fault.

(gdb) bt full
[Switching to LWP 1]
0x0000000000000000 in ?? ()
#0  0x0000000000000000 in ?? ()
No symbol table info available.
#1  0x00007f7ff6606b4a in pthread_once () from /usr/lib/libpthread.so.1
No symbol table info available.
#2  0x00000000004cf7c2 in __gthread_once (__func=<optimized out>, 
    __once=<optimized out>) at /usr/include/g++/bits/gthr-default.h:699
No locals.
#3  std::call_once<void (std::thread::*)(), std::reference_wrapper<std::thread> >(std::once_flag&, void (std::thread::*&&)(), std::reference_wrapper<std::thread>&&) (__once=..., 
    __f=__f@entry=<unknown type in /home/jwalton/botan/botan-test, CU 0x0, DIE 0x51659>) at /usr/include/g++/mutex:786
        __bound_functor = {
          _M_bound = {<std::_Tuple_impl<0ul, std::_Mem_fn<void (std::thread::*)()>, std::reference_wrapper<std::thread> >> = {<std::_Tuple_impl<1ul, std::reference_wrapper<std::thread> >> = {<std::_Tuple_impl<2ul>> = {<No data fields>}, <std::_Head_base<1ul, std::reference_wrapper<std::thread>, false>> = {
                  _M_head_impl = {<std::_Reference_wrapper_base<std::thread>> = {<std::_Reference_wrapper_base_impl<false, false, std::thread>> = {<std::_Weak_result_type<std::thread>> = {<std::_Weak_result_type_impl<std::thread>> = {<std::_Maybe_get_result_type<false, std::thread>> = {<No data fields>}, <No data fields>}, <No data fields>}, <No data fields>}, <No data fields>}, 
                    _M_data = 0x7f7ff711f440}}, <No data fields>}, <std::_Head_base<0ul, std::_Mem_fn<void (std::thread::*)()>, false>> = {
                _M_head_impl = {<std::_Maybe_unary_or_binary_function<void, std::thread*>> = {<std::unary_function<std::thread*, void>> = {<No data fields>}, <No data fields>}, 
                  __pmf = (void (std::thread::*)(std::thread * const)) 0x420880 <std::thread::join()@plt>}}, <No data fields>}, <No data fields>}}
        __e = <optimized out>
#4  0x00000000004cf807 in _M_join (this=<optimized out>)
    at /usr/include/g++/future:1481
No locals.
#5  std::__future_base::_Async_state_common::_M_run_deferred (
    this=<optimized out>) at /usr/include/g++/future:1479
No locals.
#6  0x00007f7ff778248c in wait (this=0x7f7ff711f398)
    at /usr/include/g++/future:325
        __lock = {_M_device = 0x7f7ff711f2b0, _M_owns = 0x77}
#7  _M_get_result (this=0x7f7fffffba30) at /usr/include/g++/future:596
No locals.
#8  get (this=0x7f7fffffba30) at /usr/include/g++/future:675
        __reset = {_M_fut = @0x7f7fffffba30}
#9  Botan::(anonymous namespace)::DSA_Signature_Operation::raw_sign (
    this=0x7f7ff7174090, msg=<optimized out>, msg_len=<optimized out>, rng=...)
    at src/lib/pubkey/dsa/dsa.cpp:124
        i = {
          m_reg = {<std::_Vector_base<unsigned long, Botan::secure_allocator<unsigned long> >> = {
              _M_impl = {<Botan::secure_allocator<unsigned long>> = {<No data fields>}, _M_start = 0x7f7ff7f675f0, _M_finish = 0x7f7ff7f67630, 
                _M_end_of_storage = 0x7f7ff7f67630}}, <No data fields>}, 
          m_signedness = Botan::BigInt::Positive}
        k = {
          m_reg = {<std::_Vector_base<unsigned long, Botan::secure_allocator<unsigned long> >> = {
              _M_impl = {<Botan::secure_allocator<unsigned long>> = {<No data fields>}, _M_start = 0x7f7ff7f67810, _M_finish = 0x7f7ff7f67850, 
                _M_end_of_storage = 0x7f7ff7f67850}}, <No data fields>}, 
          m_signedness = Botan::BigInt::Positive}
        future_r = {<std::__basic_future<Botan::BigInt>> = {<std::__future_base> = {<No data fields>}, 
            _M_state = {<std::__shared_ptr<std::__future_base::_State_base, (__gnu_cxx::_Lock_policy)2>> = {_M_ptr = 0x7f7ff711f398, _M_refcount = {
                  _M_pi = 0x7f7ff711f380}}, <No data fields>}}, <No data fields>}
        s = {
          m_reg = {<std::_Vector_base<unsigned long, Botan::secure_allocator<unsigned long> >> = {
              _M_impl = {<Botan::secure_allocator<unsigned long>> = {<No data fields>}, _M_start = 0x7f7ff7f67750, _M_finish = 0x7f7ff7f67790, 
                _M_end_of_storage = 0x7f7ff7f67790}}, <No data fields>}, 
          m_signedness = Botan::BigInt::Positive}
        __PRETTY_FUNCTION__ = "virtual Botan::secure_vector<unsigned char> Botan::{anonymous}::DSA_Signature_Operation::raw_sign(const __uint8_t*, std::size_t, Botan::RandomNumberGenerator&)"
        r = {
          m_reg = {<std::_Vector_base<unsigned long, Botan::secure_allocator<unsigned long> >> = {
              _M_impl = {<Botan::secure_allocator<unsigned long>> = {<No data fields>}, _M_start = 0xfe1ce226c73e69b, _M_finish = 0xda52a9a9a22272ed, 
                _M_end_of_storage = 0xf234b90f6679e208}}, <No data fields>}, 
          m_signedness = (unknown: 4152577142)}
#10 0x00007f7ff77b9f1d in Botan::PK_Ops::Signature_with_EMSA::sign (
    this=0x7f7ff7174090, rng=...) at src/lib/pubkey/pk_ops.cpp:102
        msg = {<std::_Vector_base<unsigned char, Botan::secure_allocator<unsigned char> >> = {
            _M_impl = {<Botan::secure_allocator<unsigned char>> = {<No data fields>}, 
              _M_start = 0x7f7ff7f674f0 "\277\340\300\004\240v\251\233}\275U\036\253\vA\374(5\247p\262\b\361u\205\220\020\260}\377\336\006\336*Z\277n\031)\217PJJ\264\313\267\363 H\216\376\202!\262~W\316>\357\260\001", 
              _M_finish = 0x7f7ff7f67510 "\336*Z\277n\031)\217PJJ\264\313\267\363 H\216\376\202!\262~W\316>\357\260\001", 
              _M_end_of_storage = 0x7f7ff7f67510 "\336*Z\277n\031)\217PJJ\264\313\267\363 H\216\376\202!\262~W\316>\357\260\001"}}, <No data fields>}
        padded = {<std::_Vector_base<unsigned char, Botan::secure_allocator<unsigned char> >> = {
            _M_impl = {<Botan::secure_allocator<unsigned char>> = {<No data fields>}, 
              _M_start = 0x7f7ff7f675d0 "\277\340\300\004\240v\251\233}\275U\036\253\vA\374(5\247p", _M_finish = 0x7f7ff7f675e4 "", 
              _M_end_of_storage = 0x7f7ff7f675e4 ""}}, <No data fields>}
#11 0x00007f7ff77beb91 in Botan::PK_Signer::signature (
    this=this@entry=0x7f7fffffbd70, rng=...) at src/lib/pubkey/pubkey.cpp:233
        sig = {<std::_Vector_base<unsigned char, std::allocator<unsigned char> >> = {
            _M_impl = {<std::allocator<unsigned char>> = {<__gnu_cxx::new_allocator<unsigned char>> = {<No data fields>}, <No data fields>}, 
              _M_start = 0x7f7ff7102e80 "r\301\177\231\222pU\356\220\211\324\064\a\261\246\020\b\177\205[\220CF\330\004\235[\260u\270\071\213", 
              _M_finish = 0x7f7fffffbe00 "(q\022\367\177\177", 
              _M_end_of_storage = 0x746960 <std::string::_Rep::_S_empty_rep_storage> ""}}, <No data fields>}
#12 0x00007f7ff779e719 in sign_message (rng=..., length=0x20, 
    in=0x7f7ff7102e80 "r\301\177\231\222pU\356\220\211\324\064\a\261\246\020\b\177\205[\220CF\330\004\235[\260u\270\071\213", this=0x7f7fffffbd70)
    at build/include/botan/pubkey.h:213
No locals.
#13 sign_message (rng=..., in=<synthetic pointer>, this=0x7f7fffffbd70)
    at build/include/botan/pubkey.h:224
No locals.
#14 Botan::KeyPair::signature_consistency_check (rng=..., private_key=..., 
    public_key=..., padding=...) at src/lib/pubkey/keypair/keypair.cpp:63
        signer = {m_op = {
            _M_t = {<std::_Tuple_impl<0ul, Botan::PK_Ops::Signature*, std::default_delete<Botan::PK_Ops::Signature> >> = {<std::_Tuple_impl<1ul, std::default_delete<Botan::PK_Ops::Signature> >> = {<std::_Tuple_impl<2ul>> = {<No data fields>}, <std::_Head_base<1ul, std::default_delete<Botan::PK_Ops::Signature>, true>> = {<std::default_delete<Botan::PK_Ops::Signature>> = {<No data fields>}, <No data fields>}, <No data fields>}, <std::_Head_base<0ul, Botan::PK_Ops::Signature*, false>> = {
                  _M_head_impl = 0x7f7ff7174090}, <No data fields>}, <No data fields>}}, m_sig_format = Botan::IEEE_1363, m_parts = 0x2, m_part_size = 0x14}
        verifier = {m_op = {
            _M_t = {<std::_Tuple_impl<0ul, Botan::PK_Ops::Verification*, std::default_delete<Botan::PK_Ops::Verification> >> = {<std::_Tuple_impl<1ul, std::default_delete<Botan::PK_Ops::Verification> >> = {<std::_Tuple_impl<2ul>> = {<No data fields>}, <std::_Head_base<1ul, std::default_delete<Botan::PK_Ops::Verification>, true>> = {<std::default_delete<Botan::PK_Ops::Verification>> = {<No data fields>}, <No data fields>}, <No data fields>}, <std::_Head_base<0ul, Botan::PK_Ops::Verification*, false>> = {
                  _M_head_impl = 0x7f7ff711f260}, <No data fields>}, <No data fields>}}, m_sig_format = Botan::IEEE_1363, m_parts = 0x2, m_part_size = 0x14}
        message = {<std::_Vector_base<unsigned char, std::allocator<unsigned char> >> = {
            _M_impl = {<std::allocator<unsigned char>> = {<__gnu_cxx::new_allocator<unsigned char>> = {<No data fields>}, <No data fields>}, 
              _M_start = 0x7f7ff7102e80 "r\301\177\231\222pU\356\220\211\324\064\a\261\246\020\b\177\205[\220CF\330\004\235[\260u\270\071\213", 
              _M_finish = <optimized out>, 
              _M_end_of_storage = <optimized out>}}, <No data fields>}
        signature = {<std::_Vector_base<unsigned char, std::allocator<unsigned char> >> = {
            _M_impl = {<std::allocator<unsigned char>> = {<__gnu_cxx::new_allocator<unsigned char>> = {<No data fields>}, <No data fields>}, _M_start = 0x0, 
              _M_finish = <optimized out>, 
              _M_end_of_storage = <optimized out>}}, <No data fields>}
#15 0x00007f7ff778012a in signature_consistency_check (padding=..., key=..., 
    rng=...) at build/include/botan/keypair.h:76
No locals.
#16 Botan::DSA_PrivateKey::check_key (this=0x7f7ff7106180, rng=..., 
    strong=strong@entry=0x1) at src/lib/pubkey/dsa/dsa.cpp:70
No locals.
#17 0x000000000046d780 in Botan_Tests::PK_Key_Generation_Test::run (
    this=0x7f7ff7103190) at src/tests/test_pubkey.cpp:417
        passphrase = {static npos = <optimized out>, 
          _M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>}, 
            _M_p = 0x746978 <std::string::_Rep::_S_empty_rep_storage+24> ""}}
        report_name = {static npos = <optimized out>, 
          _M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>}, 
            _M_p = 0x7f7ff7127158 "DSA dsa/jce/1024"}}
        result = {m_who = {static npos = <optimized out>, 
            _M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>}, 
              _M_p = 0x7f7ff710e6d8 "DSA dsa/jce/1024 keygen"}}, 
          m_started = 0x149758f0588428ef, m_ns_taken = 0x0, 
          m_tests_passed = 0x0, 
          m_fail_log = {<std::_Vector_base<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >> = {
              _M_impl = {<std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >> = {<__gnu_cxx::new_allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >> = {<No data fields>}, <No data fields>}, _M_start = 0x0, _M_finish = 0x0, 
                _M_end_of_storage = 0x0}}, <No data fields>}, 
          m_log = {<std::_Vector_base<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >> = {
              _M_impl = {<std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >> = {<__gnu_cxx::new_allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >> = {<No data fields>}, <No data fields>}, _M_start = 0x0, _M_finish = 0x0, 
                _M_end_of_storage = 0x0}}, <No data fields>}}
        key_p = {
          _M_t = {<std::_Tuple_impl<0ul, Botan::Private_Key*, std::default_delete<Botan::Private_Key> >> = {<std::_Tuple_impl<1ul, std::default_delete<Botan::Private_Key> >> = {<std::_Tuple_impl<2ul>> = {<No data fields>}, <std::_Head_base<1ul, std::default_delete<Botan::Private_Key>, true>> = {<std::default_delete<Botan::Private_Key>> = {<No data fields>}, <No data fields>}, <No data fields>}, <std::_Head_base<0ul, Botan::Private_Key*, false>> = {
                _M_head_impl = 0x7f7ff7106218}, <No data fields>}, <No data fields>}}
        __for_range = <unknown type in /home/jwalton/botan/botan-test, CU 0x8abb2d, DIE 0x8f1b5e>
        results = {<std::_Vector_base<Botan_Tests::Test::Result, std::allocator<Botan_Tests::Test::Result> >> = {
            _M_impl = {<std::allocator<Botan_Tests::Test::Result>> = {<__gnu_cxx::new_allocator<Botan_Tests::Test::Result>> = {<No data fields>}, <No data fields>}, _M_start = 0x0, _M_finish = 0x0, 
              _M_end_of_storage = 0x0}}, <No data fields>}
#18 0x0000000000495b7d in Botan_Tests::Test::run_test (test_name=..., 
    fail_if_missing=fail_if_missing@entry=0x0) at src/tests/tests.cpp:459
        test_results = {<std::_Vector_base<Botan_Tests::Test::Result, std::allocator<Botan_Tests::Test::Result> >> = {
            _M_impl = {<std::allocator<Botan_Tests::Test::Result>> = {<__gnu_cxx::new_allocator<Botan_Tests::Test::Result>> = {<No data fields>}, <No data fields>}, _M_start = 0x0, _M_finish = 0x0, 
              _M_end_of_storage = 0x0}}, <No data fields>}
        test = <optimized out>
        results = {<std::_Vector_base<Botan_Tests::Test::Result, std::allocator<Botan_Tests::Test::Result> >> = {
            _M_impl = {<std::allocator<Botan_Tests::Test::Result>> = {<__gnu_cxx::new_allocator<Botan_Tests::Test::Result>> = {<No data fields>}, <No data fields>}, _M_start = 0x0, _M_finish = 0x0, 
              _M_end_of_storage = 0x0}}, <No data fields>}
#19 0x0000000000424044 in run_tests (threads=<optimized out>, out=..., 
    tests_to_run=..., this=0x7f7ff711f140) at src/tests/main.cpp:237
        results = {<std::_Vector_base<Botan_Tests::Test::Result, std::allocator<Botan_Tests::Test::Result> >> = {
            _M_impl = {<std::allocator<Botan_Tests::Test::Result>> = {<__gnu_cxx::new_allocator<Botan_Tests::Test::Result>> = {<No data fields>}, <No data fields>}, _M_start = 0x0, _M_finish = 0x0, 
              _M_end_of_storage = 0x0}}, <No data fields>}
        __for_range = @0x7f7fffffc6d0: {<std::_Vector_base<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >> = {
            _M_impl = {<std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >> = {<__gnu_cxx::new_allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >> = {<No data fields>}, <No data fields>}, _M_start = 0x7f7ff7129400, _M_finish = 0x7f7ff7129748, 
              _M_end_of_storage = 0x7f7ff7129748}}, <No data fields>}
        tests_ran = 0x269de
        tests_failed = 0x0
        start_time = 0x149758edf5a49aed
        total_ns = <optimized out>
#20 (anonymous namespace)::Test_Runner::go (this=<optimized out>)
    at src/tests/main.cpp:184
        run_long_tests = <optimized out>
        rng = {
          _M_t = {<std::_Tuple_impl<0ul, Botan::RandomNumberGenerator*, std::default_delete<Botan::RandomNumberGenerator> >> = {<std::_Tuple_impl<1ul, std::default_delete<Botan::RandomNumberGenerator> >> = {<std::_Tuple_impl<2ul>> = {<No data fields>}, <std::_Head_base<1ul, std::default_delete<Botan::RandomNumberGenerator>, true>> = {<std::default_delete<Botan::RandomNumberGenerator>> = {<No data fields>}, <No data fields>}, <No data fields>}, <std::_Head_base<0ul, Botan::RandomNumberGenerator*, false>> = {
                _M_head_impl = 0x7f7ff710e1c0}, <No data fields>}, <No data fields>}}
        sha512 = {
          _M_t = {<std::_Tuple_impl<0ul, Botan::HashFunction*, std::default_delete<Botan::HashFunction> >> = {<std::_Tuple_impl<1ul, std::default_delete<Botan::HashFunction> >> = {<std::_Tuple_impl<2ul>> = {<No data fields>}, <std::_Head_base<1ul, std::default_delete<Botan::HashFunction>, true>> = {<std::default_delete<Botan::HashFunction>> = {<No data fields>}, <No data fields>}, <No data fields>}, <std::_Head_base<0ul, Botan::HashFunction*, false>> = {
                _M_head_impl = 0x7f7ff7141080}, <No data fields>}, <No data fields>}}
        drbg = {
          _M_t = {<std::_Tuple_impl<0ul, Botan::HMAC_DRBG*, std::default_delete<Botan::HMAC_DRBG> >> = {<std::_Tuple_impl<1ul, std::default_delete<Botan::HMAC_DRBG> >> = {<std::_Tuple_impl<2ul>> = {<No data fields>}, <std::_Head_base<1ul, std::default_delete<Botan::HMAC_DRBG>, true>> = {<std::default_delete<Botan::HMAC_DRBG>> = {<No data fields>}, <No data fields>}, <No data fields>}, <std::_Head_base<0ul, Botan::HMAC_DRBG*, false>> = {_M_head_impl = 
    0x0}, <No data fields>}, <No data fields>}}
        drbg_seed = {static npos = <optimized out>, 
          _M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>}, 
            _M_p = 0x746978 <std::string::_Rep::_S_empty_rep_storage+24> ""}}
        log_success = <optimized out>
        run_online_tests = <optimized out>
        data_dir = {static npos = <optimized out>, 
          _M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>}, 
            _M_p = 0x7f7ff711cfb8 "src/tests/data"}}
        req = {<std::_Vector_base<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >> = {
            _M_impl = {<std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >> = {<__gnu_cxx::new_allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >> = {<No data fields>}, <No data fields>}, _M_start = 0x7f7ff7129400, _M_finish = 0x7f7ff7129748, 
              _M_end_of_storage = 0x7f7ff7129748}}, <No data fields>}
        seed = {<std::_Vector_base<unsigned char, std::allocator<unsigned char> >> = {
            _M_impl = {<std::allocator<unsigned char>> = {<__gnu_cxx::new_allocator<unsigned char>> = {<No data fields>}, <No data fields>}, 
              _M_start = 0x7f7ff710e180 "\246\006\021\266\256\030%\333\v\336\247\"\331*\f|\313\245ZE<\275\216\213\227\347\066\237E\364\262Q*\026,\a x\222\225\253\353\327\251\335/l}6\006\340\217\331\036\325\373\240\311LRv\035\310\060\220\264P", _M_finish = 0x7f7ff710e1c0 "\220\264P", 
              _M_end_of_storage = 0x7f7ff710e1c0 "\220\264P"}}, <No data fields>}
        pkcs11_lib = {static npos = <optimized out>, 
          _M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>}, 
            _M_p = 0x746978 <std::string::_Rep::_S_empty_rep_storage+24> ""}}
#21 0x00000000004d285f in Botan_CLI::Command::run (this=0x7f7ff711f140, 
    params=...) at src/tests/../cli/cli.h:229
        args = {<std::_Vector_base<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >> = {
            _M_impl = {<std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >> = {<__gnu_cxx::new_allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >> = {<No data fields>}, <No data fields>}, _M_start = 0x0, _M_finish = 0x0, 
              _M_end_of_storage = 0x0}}, <No data fields>}
        seen_stdin_flag = <optimized out>
        arg_i = <optimized out>
#22 0x00000000004c6edd in main (argc=<optimized out>, argv=<optimized out>)
    at src/tests/main.cpp:333
        cmd = {
          _M_t = {<std::_Tuple_impl<0ul, Botan_CLI::Command*, std::default_delete<Botan_CLI::Command> >> = {<std::_Tuple_impl<1ul, std::default_delete<Botan_CLI::Command> >> = {<std::_Tuple_impl<2ul>> = {<No data fields>}, <std::_Head_base<1ul, std::default_delete<Botan_CLI::Command>, true>> = {<std::default_delete<Botan_CLI::Command>> = {<No data fields>}, <No data fields>}, <No data fields>}, <std::_Head_base<0ul, Botan_CLI::Command*, false>> = {
                _M_head_impl = 0x7f7ff711f140}, <No data fields>}, <No data fields>}}
        args = {<std::_Vector_base<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >> = {
            _M_impl = {<std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >> = {<__gnu_cxx::new_allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >> = {<No data fields>}, <No data fields>}, _M_start = 0x0, _M_finish = 0x0, 
              _M_end_of_storage = 0x0}}, <No data fields>}
A debugging session is active.

    Inferior 1 [LWP 0] will be killed.

Quit anyway? (y or n) 

And:

Testing Botan 2.0.0 (unreleased, revision git:45c986c2d4af6db2c882405e1fb472fb459f73bc, distribution unspecified)
Starting tests rng:HMAC_DRBG with seed '1497598AD959F48F'
AES-128 ran 10422 tests in 46.69 msec all ok
AES-192 ran 12150 tests in 50.68 msec all ok
AES-256 ran 13878 tests in 57.52 msec all ok
Blowfish ran 540 tests in 8.87 msec all ok
CAST-128 ran 369 tests in 1.54 msec all ok
CAST-256 ran 117 tests in 0.58 msec all ok
Camellia-128 ran 54 tests in 0.26 msec all ok
Camellia-192 ran 27 tests in 0.10 msec all ok
Camellia-256 ran 45 tests in 0.17 msec all ok
Cascade(Serpent,AES-256) ran 18 tests in 0.11 msec all ok
Cascade(Serpent,CAST-128) ran 9 tests in 0.10 msec all ok
Cascade(Serpent,Twofish) ran 27 tests in 0.27 msec all ok
DES ran 2898 tests in 11.88 msec all ok
DESX ran 81 tests in 0.35 msec all ok
GOST-28147-89(R3411_94_TestParam) ran 162 tests in 1.09 msec all ok
GOST-28147-89(R3411_CryptoPro) ran 90 tests in 0.59 msec all ok
IDEA ran 9756 tests in 55.18 msec all ok
KASUMI ran 27 tests in 0.11 msec all ok
Lion(SHA-160,RC4,64) ran 9 tests in 0.16 msec all ok
MISTY1 ran 279 tests in 1.14 msec all ok
Noekeon ran 36 tests in 0.19 msec all ok
SEED ran 36 tests in 0.14 msec all ok
Serpent ran 18828 tests in 79.59 msec all ok
Threefish-512 ran 36 tests in 0.23 msec all ok
TripleDES ran 522 tests in 2.32 msec all ok
Twofish ran 9963 tests in 49.31 msec all ok
XTEA ran 612 tests in 2.55 msec all ok
CTR-BE(AES-128) ran 20 tests in 0.22 msec all ok
CTR-BE(AES-192) ran 5 tests in 0.03 msec all ok
CTR-BE(AES-256) ran 5 tests in 0.03 msec all ok
CTR-BE(DES) ran 65 tests in 0.37 msec all ok
CTR-BE(Noekeon) ran 640 tests in 3.58 msec all ok
CTR-BE(Serpent) ran 555 tests in 3.67 msec all ok
CTR-BE(TripleDES) ran 745 tests in 6.03 msec all ok
CTR-BE(XTEA) ran 285 tests in 1.69 msec all ok
ChaCha(12) ran 20 tests in 0.12 msec all ok
ChaCha(20) ran 740 tests in 4.55 msec all ok
ChaCha(8) ran 190 tests in 1.09 msec all ok
MARK-4 ran 25 tests in 0.21 msec all ok
OFB(AES-128) ran 5 tests in 0.03 msec all ok
OFB(AES-192) ran 5 tests in 0.03 msec all ok
OFB(AES-256) ran 5 tests in 0.03 msec all ok
OFB(DES) ran 20 tests in 0.11 msec all ok
RC4 ran 345 tests in 3.20 msec all ok
SHAKE-128 ran 5630 tests in 33.16 msec all ok
Salsa20 ran 35 tests in 0.18 msec all ok
Adler32 ran 215 tests in 0.28 msec all ok
Blake2b(224) ran 2046 tests in 5.34 msec all ok
Blake2b(256) ran 2046 tests in 4.57 msec all ok
Blake2b(384) ran 2046 tests in 4.63 msec all ok
Blake2b(512) ran 2150 tests in 5.23 msec all ok
CRC24 ran 229 tests in 0.32 msec all ok
CRC32 ran 215 tests in 0.27 msec all ok
Comb4P(MD4,MD5) ran 8 tests in 0.05 msec all ok
Comb4P(SHA-160,RIPEMD-160) ran 8 tests in 0.04 msec all ok
GOST-R-34.11-94 ran 79 tests in 0.69 msec all ok
Keccak-1600(224) ran 2142 tests in 6.41 msec all ok
Keccak-1600(256) ran 2142 tests in 6.44 msec all ok
Keccak-1600(384) ran 2142 tests in 7.11 msec all ok
Keccak-1600(512) ran 2142 tests in 8.03 msec all ok
MD4 ran 596 tests in 0.76 msec all ok
MD5 ran 604 tests in 0.79 msec all ok
Parallel(MD5,SHA-160) ran 12 tests in 0.07 msec all ok
Parallel(SHA-256,SHA-512) ran 6 tests in 0.04 msec all ok
RIPEMD-160 ran 605 tests in 0.84 msec all ok
SHA-160 ran 1212 tests in 1.74 msec all ok
SHA-224 ran 14 tests in 0.02 msec all ok
SHA-256 ran 2094 tests in 2.68 msec all ok
SHA-3(224) ran 806 tests in 2.48 msec all ok
SHA-3(256) ran 806 tests in 2.49 msec all ok
SHA-3(384) ran 806 tests in 2.51 msec all ok
SHA-3(512) ran 806 tests in 4.20 msec all ok
SHA-384 ran 54 tests in 0.08 msec all ok
SHA-512 ran 54 tests in 0.08 msec all ok
SHA-512-256 ran 7 tests in 0.01 msec all ok
SHAKE-128(1120) ran 8 tests in 0.03 msec all ok
SHAKE-128(128) ran 24 tests in 0.17 msec all ok
SHAKE-256(2000) ran 8 tests in 0.04 msec all ok
SHAKE-256(256) ran 23 tests in 0.11 msec all ok
Skein-512(224) ran 2046 tests in 6.64 msec all ok
Skein-512(256) ran 2046 tests in 6.75 msec all ok
Skein-512(384) ran 2046 tests in 11.64 msec all ok
Skein-512(512) ran 2142 tests in 6.79 msec all ok
Tiger(16,3) ran 15 tests in 0.08 msec all ok
Tiger(16,4) ran 8 tests in 0.02 msec all ok
Tiger(20,3) ran 15 tests in 0.06 msec all ok
Tiger(20,4) ran 8 tests in 0.02 msec all ok
Tiger(24,3) ran 71 tests in 0.17 msec all ok
Tiger(24,4) ran 8 tests in 0.02 msec all ok
Whirlpool ran 62 tests in 0.13 msec all ok
CBC-MAC(AES-128) ran 378 tests in 1.40 msec all ok
CBC-MAC(DES) ran 258 tests in 1.11 msec all ok
CMAC(AES-128) ran 176 tests in 0.79 msec all ok
CMAC(AES-192) ran 46 tests in 0.13 msec all ok
CMAC(AES-256) ran 54 tests in 0.00 msec all ok
CMAC(Blowfish) ran 8 tests in 0.26 msec all ok
CMAC(Threefish-512) ran 8 tests in 0.04 msec all ok
GMAC(AES-128) ran 54 tests in 0.27 msec all ok
GMAC(AES-192) ran 30 tests in 0.14 msec all ok
GMAC(AES-256) ran 30 tests in 0.14 msec all ok
HMAC(MD5) ran 32 tests in 0.18 msec all ok
HMAC(RIPEMD-160) ran 32 tests in 0.14 msec all ok
HMAC(SHA-160) ran 48 tests in 0.20 msec all ok
HMAC(SHA-256) ran 40 tests in 0.19 msec all ok
Poly1305 ran 618 tests in 1.91 msec all ok
SipHash(2,4) ran 8 tests in 0.03 msec all ok
X9.19-MAC ran 48 tests in 0.27 msec all ok
AES-128/CBC/CTS ran 30 tests in 0.79 msec all ok
AES-128/CBC/NoPadding ran 5 tests in 0.14 msec all ok
AES-128/CFB ran 9 tests in 0.12 msec all ok
AES-128/CFB(8) ran 9 tests in 0.15 msec all ok
AES-128/XTS ran 337 tests in 7.48 msec all ok
AES-192/CBC/NoPadding ran 5 tests in 0.15 msec all ok
AES-192/CFB ran 9 tests in 0.12 msec all ok
AES-192/CFB(8) ran 9 tests in 0.13 msec all ok
AES-256/CBC/NoPadding ran 5 tests in 0.16 msec all ok
AES-256/CFB ran 9 tests in 0.12 msec all ok
AES-256/CFB(8) ran 9 tests in 0.13 msec all ok
AES-256/XTS ran 229 tests in 5.47 msec all ok
CTR-BE(AES-128) ran 9 tests in 0.09 msec all ok
CTR-BE(DES) ran 9 tests in 0.10 msec all ok
DES/CBC/CTS ran 246 tests in 5.55 msec all ok
DES/CBC/NoPadding ran 5 tests in 0.19 msec all ok
DES/CBC/OneAndZeros ran 175 tests in 4.95 msec all ok
DES/CBC/PKCS7 ran 165 tests in 4.15 msec all ok
DES/CFB ran 148 tests in 3.24 msec all ok
DES/CFB(16) ran 54 tests in 1.63 msec all ok
DES/CFB(32) ran 63 tests in 1.86 msec all ok
DES/CFB(8) ran 90 tests in 2.17 msec all ok
Noekeon/CBC/PKCS7 ran 866 tests in 17.85 msec all ok
Serpent/XTS ran 1218 tests in 37.36 msec all ok
TripleDES/XTS ran 1020 tests in 19.02 msec all ok
Twofish/XTS ran 1900 tests in 39.37 msec all ok
PBKDF1(SHA-160) ran 10 tests in 5.23 msec all ok
PBKDF2(CMAC(Blowfish)) ran 2 tests in 0.06 msec all ok
PBKDF2(HMAC(SHA-160)) ran 20 tests in 34.12 msec all ok
PBKDF2(HMAC(SHA-256)) ran 2 tests in 32.76 msec all ok
PBKDF2(HMAC(SHA-384)) ran 2 tests in 21.39 msec all ok
PBKDF2(HMAC(SHA-512)) ran 2 tests in 20.28 msec all ok
HMAC_DRBG(SHA-1) ran 240 tests in 7.71 msec all ok
HMAC_DRBG(SHA-224) ran 240 tests in 14.34 msec all ok
HMAC_DRBG(SHA-256) ran 240 tests in 14.19 msec all ok
HMAC_DRBG(SHA-384) ran 240 tests in 17.96 msec all ok
HMAC_DRBG(SHA-512) ran 240 tests in 17.51 msec all ok
HMAC_DRBG(SHA-512-256) ran 240 tests in 17.73 msec all ok
Util load/store ran 229 tests all ok
Util round_down ran 6 tests in 0.02 msec all ok
Util round_up ran 11 tests in 8.05 msec all ok
AES-128/CCM(10,2) ran 11 tests in 0.27 msec all ok
AES-128/CCM(16,2) ran 22 tests in 0.51 msec all ok
AES-128/CCM(16,3) ran 11 tests in 0.25 msec all ok
AES-128/CCM(8,2) ran 33 tests in 0.88 msec all ok
AES-128/EAX ran 1550 tests in 25.11 msec all ok
AES-128/EAX(8) ran 24 tests in 0.52 msec all ok
AES-128/GCM ran 780 tests in 14.35 msec all ok
AES-128/GCM(8) ran 92 tests in 2.03 msec all ok
AES-128/OCB ran 287 tests in 6.30 msec all ok
AES-128/OCB(12) ran 11 tests in 0.27 msec all ok
AES-128/SIV ran 21 tests in 0.47 msec all ok
AES-192/EAX ran 75 tests in 1.37 msec all ok
AES-192/GCM ran 364 tests in 7.01 msec all ok
AES-256/EAX ran 97 tests in 1.69 msec all ok
AES-256/GCM ran 364 tests in 6.48 msec all ok
Blowfish/EAX ran 278 tests in 10.96 msec all ok
ChaCha20Poly1305 ran 95 tests in 1.82 msec all ok
DES/EAX ran 278 tests in 4.40 msec all ok
Threefish-512/EAX ran 17 tests in 0.34 msec all ok
TripleDES/EAX ran 278 tests in 5.29 msec all ok
Twofish/EAX ran 550 tests in 10.24 msec all ok
AutoSeeded_RNG ran 13 tests all ok
Base64 ran 64 tests in 0.12 msec all ok
ESP ran 15 tests in 0.02 msec all ok
NoPadding ran 10 tests in 0.03 msec all ok
OneAndZeros ran 13 tests in 0.02 msec all ok
PKCS7 ran 12 tests in 0.02 msec all ok
X9.23 ran 13 tests in 0.02 msec all ok
bcrypt ran 24 tests in 1.27 sec all ok
BigInt IO operators ran 8 tests all ok
BigInt encoding functions ran 1 tests all ok
BigInt prime generation ran 151 tests all ok
BigInt size functions ran 72 tests all ok
BigInt::random_integer ran 15010 tests in 100.16 msec all ok
BigInt Addition ran 292 tests in 86.64 msec all ok
BigInt Divide ran 72 tests in 6.95 msec all ok
BigInt InvMod ran 305 tests in 66.97 msec all ok
BigInt Test NonPrime ran 107 tests in 108.25 msec all ok
BigInt Test Prime ran 17 tests in 10.61 msec all ok
BigInt Lshift ran 100 tests in 45.69 msec all ok
BigInt Mod ran 171 tests in 11.28 msec all ok
BigInt Multiply ran 416 tests in 403.18 msec all ok
BigInt Powmod ran 209 tests in 317.53 msec all ok
BigInt Ressol ran 22 tests in 10.12 msec all ok
BigInt Rshift ran 102 tests in 13.23 msec all ok
BigInt Square ran 42 tests in 12.48 msec all ok
BigInt Subtraction ran 126 tests in 36.38 msec all ok
Charset ran 9 tests in 0.03 msec all ok
Charset negative tests ran 5 tests all ok
cryptobox ran 1 tests all ok
Curve25519 keygen ran 21 tests in 82.08 msec all ok
Curve25519 roundtrip ran 10 tests all ok
Curve25519 scalarmult ran 18 tests in 1.62 msec all ok
DH invalid keys ran 7 tests in 390.86 msec all ok
DH negative tests ran 2 tests all ok
Diffie-Hellman/KDF2(SHA-1) Valid key agreement ran 4 tests in 2.63 msec all ok
Diffie-Hellman/Raw Valid key agreement ran 36 tests in 206.16 msec all ok
DH modp/ietf/1024 keygen ran 21 tests in 332.29 msec all ok
DH modp/ietf/2048 keygen ran 21 tests in 1.93 sec all ok
DL_Group encoding ran 8 tests all ok
DL_Group generate ran 14 tests in 832.84 msec all ok
DL_Group named ran 38 tests in 107.93 msec all ok
DLIES AES-256/CBC ran 84 tests in 753.67 msec all ok
DLIES AES-256/GCM ran 16 tests in 145.08 msec all ok
DLIES XOR ran 44 tests in 391.75 msec all ok
DLIES XOR ran 12 tests all ok
<core dump>
randombit commented 7 years ago

Sorry about another report.

LOL thanks for testing, seriously it's very helpful.

It looks like std::async is broken here. I've seen some crashes like this before on other systems, when threads are broken or disabled for whatever reason. Maybe a problem on NetBSD generally, maybe just on your setup, or maybe some interaction between NetBSD threads and some bug in Botan. In any case I'm sure debugging it will be tons of fun. I will try to get a VM installed and replicate the problem.

Right now there is no way to disable use of std::async but still also provide thread safety through std::mutex. I need to fix that. In the short term you can try disabling thread support completely and seeing if the tests make it through otherwise. You can do that by editing src/build-data/os/netbsd.txt and removing "threads" from target_features block. I've been meaning to also add configure.py toggles for these feature flags, another todo...

Too late to handle this one for 2.0.0, but worth fixing if possible and with a bit of setup I should be able to replicate.

randombit commented 6 years ago

At this point a working std::async is required for path validation to work, so I don't think it is possible to support this system. Closing.