Program received signal SIGSEGV, Segmentation fault.
CryptoPP::Rijndael::Base::UncheckedSetKey (this=0x4b2c888,
userKey=0x4b2c650 "u\033悡\b\t)'爯\251\341\aJ饅V颲\373\251+\t9紃\266\025鴥+\235\r\001\255\272\r\272 ", keylen=32)
at rijndael.cpp:231
231 __m128i temp = _mm_loadu_si128((__m128i *)(void *)(userKey+keylen-16));
(gdb) bt
#0 CryptoPP::Rijndael::Base::UncheckedSetKey (this=0x4b2c888,
userKey=0x4b2c650 "u\033悡\b\t)'爯\251\341\aJ饅V颲\373\251+\t9紃\266\025+\235\r\001\255\272\r\272 ", keylen=32)
at rijndael.cpp:231
#1 0x00428300 in CryptoPP::RandomPool::GenerateIntoBufferedTransformation (this=0x4b2c618, target=..., channel="", size=20)
at randpool.cpp:40
#2 0x00420c0b in CryptoPP::RandomNumberGenerator::GenerateBlock (this=0x4b2c618,
output=0x4b26c81 "瓠\272\r瓠\272\r瓠\272\r瓠\272\r\272\r\332\071^kK\r2U`\030\330\a\t", size=20) at cryptlib.cpp:339
#3 0x00448669 in CryptoPP::OAEP_Base::Pad (this=<optimized out>, rng=...,
input=0x4b25ae8 "ABA369F7D2B28A9098A0A26FEB7DC9656326909417\253\253\253\253\253\253\253\253", inputLength=42,
oaepBlock=0x4b26c81 "\272\r\272\r\272\r\272\r\272\r\332\071^kK\r2U`\030\330\a\t",
oaepBlockLen=<optimized out>, parameters=...) at oaep.cpp:47
#4 0x0042ff55 in CryptoPP::TF_EncryptorBase::Encrypt (this=<optimized out>, rng=...,
plaintext=0x4b25ae8 "ABA369F7D2B28A9098A0A26FEB7DC9656326909417\253\253\253\253\253\253\253\253",
plaintextLength=42,
ciphertext=0x4b25f20 "\r瓠\272\r瓠\272\r瓠\272\r瓠\272\r瓠\272\r瓠\272\r瓠\272\r瓠\272\r瓠\272\r瓠\272\r瓠\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\272\r\253\253\253\253", <incomplete sequence \253>, parameters=...) at pubkey.cpp:164
#5 0x004d631c in CryptoPP::PK_DefaultEncryptionFilter::Put2 (this=0x4b27fe8, inString=0x0, length=0, messageEnd=-1, blocking=true)
at cryptlib.cpp:801
#6 0x004d27df in CryptoPP::BufferedTransformation::MessageEnd (this=0x4b27fe8, propagation=-1, blocking=true)
at ../../../contrib/cryptopp/cryptopp/cryptlib.h:1437
#7 0x004c811c in CryptoPP::SimpleProxyFilter::LastPut (this=0x4b2ca30, inString=0x0, length=0)
at ../../../contrib/cryptopp/cryptopp/filters.h:905
#8 0x0042615e in CryptoPP::FilterWithBufferedInput::PutMaybeModifiable (this=0x4b2ca30, inString=<optimized out>, length=0,
messageEnd=-1, blocking=true, modifiable=false) at filters.cpp:437
#9 0x004d47cd in CryptoPP::FilterWithBufferedInput::Put2 (this=0x4b2ca30, inString=0x0, length=0, messageEnd=-1, blocking=true)
at ../../../contrib/cryptopp/cryptopp/filters.h:339
#10 0x004204f7 in CryptoPP::BufferedTransformation::ChannelPut2 (this=<optimized out>, channel="", begin=0x0, length=0,
messageEnd=-1, blocking=true) at cryptlib.cpp:470
---Type <return> to continue, or q <return> to quit---
#11 0x00420ea2 in ChannelMessageEnd (blocking=true, propagation=<optimized out>, channel="", this=0x4b2ca30) at cryptlib.h:1908
#12 CryptoPP::BufferedTransformation::TransferMessagesTo2 (this=0x606ef64, target=..., messageCount=@0x606edb8: 0, channel="",
blocking=true) at cryptlib.cpp:627
#13 0x0042102a in CryptoPP::BufferedTransformation::TransferAllTo2 (this=0x606ef64, target=..., channel="", blocking=true)
at cryptlib.cpp:668
#14 0x004bd44d in CryptoPP::SourceTemplate<CryptoPP::StringStore>::PumpAll2 (this=0x606ef4c, blocking=true)
at ../../../contrib/cryptopp/cryptopp/filters.h:1222
#15 0x004e3283 in CryptoPP::Source::PumpAll (this=0x606ef4c) at ../../../contrib/cryptopp/cryptopp/filters.h:1166
#16 0x004e3256 in CryptoPP::Source::SourceInitialize (this=0x606ef4c, pumpAll=true, parameters=...)
at ../../../contrib/cryptopp/cryptopp/filters.h:1199
#17 0x004b8a72 in CryptoPP::StringSource::StringSource (this=0x606ef4c,
string=0x4b2c4b4 "ABA369F7D2B28A9098A0A26FEB7DC9656326909417", length=42, pumpAll=true, attachment=0x4b2ca30)
at ../../../contrib/cryptopp/cryptopp/filters.h:1252
#18 0x0041ddec in crypto::Rsa::encrypt (this=0x4b2c4f8, dest=std::vector of length 0, capacity 0,
src=0x4b2c4b4 "ABA369F7D2B28A9098A0A26FEB7DC9656326909417", src_len=42) at rsa_crypto.cpp:135
#19 0x0041e5a4 in crypto::Encryptor::encrypt (this=0x606f050, dest=std::vector of length 0, capacity 0,
src=0x4b2c4b4 "ABA369F7D2B28A9098A0A26FEB7DC9656326909417", src_len=42) at encryptor.cpp:27
#20 0x0040dbff in lproxy::local::session::pack_exchange (this=0x4b25bfc, keysize=@0x606f1ea: 1024,
public_key="30819D300D06092A864886F70D010101050003818B00308187028181009B7CA78876C3CAA5879C1761730E7D8139A63662DC9E7752DF369BDBB28A168EF61F884709FCE3C71D9582984CB57ED6D36060E556C52433ECDFA1C766CDCF6BABCF40B3BE15D0"...) at session_local.cpp:575
#21 0x004079ad in lproxy::local::session::right_read_handler (this=0x4b25bfc, error=..., bytes_transferred=326,
lss_reply=std::shared_ptr (count 3, weak 0) 0x4b272c4, __data_right_rest=std::shared_ptr (count 7, weak 0) 0x4b25034,
__write_data=std::shared_ptr (count 7, weak 0) 0x4b25034) at session_local.cpp:253
#22 0x004edaf1 in boost::_mfi::mf5<void, lproxy::local::session, boost::system::error_code const&, unsigned int, std::shared_ptr<lproxy::local::reply>, std::shared_ptr<std::basic_string<unsigned char, std::char_traits<unsigned char>, std::allocator<unsigned char> > >, std::shared_ptr<std::basic_string<unsigned char, std::char_traits<unsigned char>, std::allocator<unsigned char> > > >::call<std::shared_ptr<lproxy::local::session>, boost::system::error_code const, unsigned int, std::shared_ptr<lproxy::local::reply>, std::shared_ptr<std::basic_string<unsigned char, std::char_traits<unsigned char>, std::allocator<unsigned char> > >, std::shared_ptr<std::basic_string<unsigned char, std::char_traits<unsigned char>, std::allocator<unsigned char> > > > (this=0x606fad4,
---Type <return> to continue, or q <return> to quit---
u=std::shared_ptr (count 1, weak 1) 0x4b25bfc, b1=..., b2=@0x606f9ac: 326, b3=std::shared_ptr (count 3, weak 0) 0x4b272c4,
b4=std::shared_ptr (count 7, weak 0) 0x4b25034, b5=std::shared_ptr (count 7, weak 0) 0x4b25034)
at ../../../contrib/boost/boost_1_57_0/boost/bind/mem_fn_template.hpp:610
#23 0x004edb92 in boost::_mfi::mf5<void, lproxy::local::session, boost::system::error_code const&, unsigned int, std::shared_ptr<lproxy::local::reply>, std::shared_ptr<std::basic_string<unsigned char, std::char_traits<unsigned char>, std::allocator<unsigned char> > >, std::shared_ptr<std::basic_string<unsigned char, std::char_traits<unsigned char>, std::allocator<unsigned char> > > >::operator()<std::shared_ptr<lproxy::local::session> > (this=0x606fad4, u=std::shared_ptr (count 1, weak 1) 0x4b25bfc, a1=..., a2=326,
a3=std::shared_ptr (count 3, weak 0) 0x4b272c4, a4=std::shared_ptr (count 7, weak 0) 0x4b25034,
a5=std::shared_ptr (count 7, weak 0) 0x4b25034) at ../../../contrib/boost/boost_1_57_0/boost/bind/mem_fn_template.hpp:625
#24 0x0048bead in boost::_bi::list6<boost::_bi::value<std::shared_ptr<lproxy::local::session> >, boost::arg<1>, boost::arg<2>, boost::_bi::value<std::shared_ptr<lproxy::local::reply> >, boost::_bi::value<std::shared_ptr<std::basic_string<unsigned char, std::char_traits<unsigned char>, std::allocator<unsigned char> > > >, boost::_bi::value<std::shared_ptr<std::basic_string<unsigned char, std::char_traits<unsigned char>, std::allocator<unsigned char> > > > >::operator()<boost::_mfi::mf5<void, lproxy::local::session, boost::system::error_code const&, unsigned int, std::shared_ptr<lproxy::local::reply>, std::shared_ptr<std::basic_string<unsigned char, std::char_traits<unsigned char>, std::allocator<unsigned char> > >, std::shared_ptr<std::basic_string<unsigned char, std::char_traits<unsigned char>, std::allocator<unsigned char> > > >, boost::_bi::list2<boost::system::error_code const&, unsigned int const&> > (
this=0x606fadc, f=..., a=...) at ../../../contrib/boost/boost_1_57_0/boost/bind/bind.hpp:596
#25 0x0048cc38 in boost::_bi::bind_t<void, boost::_mfi::mf5<void, lproxy::local::session, boost::system::error_code const&, unsigned int, std::shared_ptr<lproxy::local::reply>, std::shared_ptr<std::basic_string<unsigned char, std::char_traits<unsigned char>, std::allocator<unsigned char> > >, std::shared_ptr<std::basic_string<unsigned char, std::char_traits<unsigned char>, std::allocator<unsigned char> > > >, boost::_bi::list6<boost::_bi::value<std::shared_ptr<lproxy::local::session> >, boost::arg<1>, boost::arg<2>, boost::_bi::value<std::shared_ptr<lproxy::local::reply> >, boost::_bi::value<std::shared_ptr<std::basic_string<unsigned char, std::char_traits<unsigned char>, std::allocator<unsigned char> > > >, boost::_bi::value<std::shared_ptr<std::basic_string<unsigned char, std::char_traits<unsigned char>, std::allocator<unsigned char> > > > > >::operator()<boost::system::error_code, unsigned int> (this=0x606fad4,
a1=..., a2=@0x606fb04: 326) at ../../../contrib/boost/boost_1_57_0/boost/bind/bind_template.hpp:102
#26 0x004a0122 in boost::asio::detail::binder2<boost::_bi::bind_t<void, boost::_mfi::mf5<void, lproxy::local::session, boost::system::error_code const&, unsigned int, std::shared_ptr<lproxy::local::reply>, std::shared_ptr<std::basic_string<unsigned char, std::char_traits<unsigned char>, std::allocator<unsigned char> > >, std::shared_ptr<std::basic_string<unsigned char, std::char_traits<unsigned char>, std::allocator<unsigned char> > > >, boost::_bi::list6<boost::_bi::value<std::shared_ptr<lproxy::local::session> >, boost::arg<---Type <return> to continue, or q <return> to quit---
1>, boost::arg<2>, boost::_bi::value<std::shared_ptr<lproxy::local::reply> >, boost::_bi::value<std::shared_ptr<std::basic_string<unsigned char, std::char_traits<unsigned char>, std::allocator<unsigned char> > > >, boost::_bi::value<std::shared_ptr<std::basic_string<unsigned char, std::char_traits<unsigned char>, std::allocator<unsigned char> > > > > >, boost::system::error_code, unsigned int>::operator() (this=0x606fad4) at ../../../contrib/boost/boost_1_57_0/boost/asio/detail/bind_handler.hpp:127
#27 0x0048fbae in boost::asio::asio_handler_invoke<boost::asio::detail::binder2<boost::_bi::bind_t<void, boost::_mfi::mf5<void, lproxy::local::session, boost::system::error_code const&, unsigned int, std::shared_ptr<lproxy::local::reply>, std::shared_ptr<std::basic_string<unsigned char, std::char_traits<unsigned char>, std::allocator<unsigned char> > >, std::shared_ptr<std::basic_string<unsigned char, std::char_traits<unsigned char>, std::allocator<unsigned char> > > >, boost::_bi::list6<boost::_bi::value<std::shared_ptr<lproxy::local::session> >, boost::arg<1>, boost::arg<2>, boost::_bi::value<std::shared_ptr<lproxy::local::reply> >, boost::_bi::value<std::shared_ptr<std::basic_string<unsigned char, std::char_traits<unsigned char>, std::allocator<unsigned char> > > >, boost::_bi::value<std::shared_ptr<std::basic_string<unsigned char, std::char_traits<unsigned char>, std::allocator<unsigned char> > > > > >, boost::system::error_code, unsigned int> > (function=...) at ../../../contrib/boost/boost_1_57_0/boost/asio/handler_invoke_hook.hpp:69
#28 0x0047be48 in boost_asio_handler_invoke_helpers::invoke<boost::asio::detail::binder2<boost::_bi::bind_t<void, boost::_mfi::mf5<void, lproxy::local::session, boost::system::error_code const&, unsigned int, std::shared_ptr<lproxy::local::reply>, std::shared_ptr<std::basic_string<unsigned char, std::char_traits<unsigned char>, std::allocator<unsigned char> > >, std::shared_ptr<std::basic_string<unsigned char, std::char_traits<unsigned char>, std::allocator<unsigned char> > > >, boost::_bi::list6<boost::_bi::value<std::shared_ptr<lproxy::local::session> >, boost::arg<1>, boost::arg<2>, boost::_bi::value<std::shared_ptr<lproxy::local::reply> >, boost::_bi::value<std::shared_ptr<std::basic_string<unsigned char, std::char_traits<unsigned char>, std::allocator<unsigned char> > > >, boost::_bi::value<std::shared_ptr<std::basic_string<unsigned char, std::char_traits<unsigned char>, std::allocator<unsigned char> > > > > >, boost::system::error_code, unsigned int>, boost::_bi::bind_t<void, boost::_mfi::mf5<void, lproxy::local::session, boost::system::error_code const&, unsigned int, std::shared_ptr<lproxy::local::reply>, std::shared_ptr<std::basic_string<unsigned char, std::char_traits<unsigned char>, std::allocator<unsigned char> > >, std::shared_ptr<std::basic_string<unsigned char, std::char_traits<unsigned char>, std::allocator<unsigned char> > > >, boost::_bi::list6<boost::_bi::value<std::shared_ptr<lproxy::local::session> >, boost::arg<1>, boost::arg<2>, boost::_bi::value<std::shared_ptr<lproxy::local::reply> >, boost::_bi::value<std::shared_ptr<std::basic_string<unsigned char, std::char_traits<unsigned char>, std::allocator<unsigned char> > > >, boost::_bi::value<std::shared_ptr<std::basic_string<unsigned char, std::char_traits<unsigned char>, std::allocator<unsigned char> > > > > > > (function=..., context=...)
at ../../../contrib/boost/boost_1_57_0/boost/asio/detail/handler_invoke_helpers.hpp:37
#29 0x0049b5e0 in boost::asio::detail::win_iocp_socket_recv_op<boost::array<boost::asio::mutable_buffer, 5u>, boost::_bi::bind_t<void, boost::_mfi::mf5<void, lproxy::local::session, boost::system::error_code const&, unsigned int, std::shared_ptr<lproxy::local::reply---Type <return> to continue, or q <return> to quit---
>, std::shared_ptr<std::basic_string<unsigned char, std::char_traits<unsigned char>, std::allocator<unsigned char> > >, std::shared_ptr<std::basic_string<unsigned char, std::char_traits<unsigned char>, std::allocator<unsigned char> > > >, boost::_bi::list6<boost::_bi::value<std::shared_ptr<lproxy::local::session> >, boost::arg<1>, boost::arg<2>, boost::_bi::value<std::shared_ptr<lproxy::local::reply> >, boost::_bi::value<std::shared_ptr<std::basic_string<unsigned char, std::char_traits<unsigned char>, std::allocator<unsigned char> > > >, boost::_bi::value<std::shared_ptr<std::basic_string<unsigned char, std::char_traits<unsigned char>, std::allocator<unsigned char> > > > > > >::do_complete (owner=0x4b25b78, base=0x4b26e58, result_ec=..., bytes_transferred=326)
at ../../../contrib/boost/boost_1_57_0/boost/asio/detail/win_iocp_socket_recv_op.hpp:97
#30 0x00498ea4 in boost::asio::detail::win_iocp_operation::complete (this=0x4b26e58, owner=..., ec=..., bytes_transferred=326)
at ../../../contrib/boost/boost_1_57_0/boost/asio/detail/win_iocp_operation.hpp:46
#31 0x0049a0e1 in boost::asio::detail::win_iocp_io_service::do_one (this=0x4b25b78, block=true, ec=...)
at ../../../contrib/boost/boost_1_57_0/boost/asio/detail/impl/win_iocp_io_service.ipp:405
#32 0x00499afc in boost::asio::detail::win_iocp_io_service::run (this=0x4b25b78, ec=...)
at ../../../contrib/boost/boost_1_57_0/boost/asio/detail/impl/win_iocp_io_service.ipp:164
#33 0x0048e29e in boost::asio::io_service::run (
this=0x559558 <lproxy::lss_server<lproxy::local::session>::io_service_right()::io_service>)
at ../../../contrib/boost/boost_1_57_0/boost/asio/impl/io_service.ipp:59
#34 0x004b0ba2 in lproxy::lss_server<lproxy::local::session>::handle_thread_right (io_service=...)
at ../../../src/core/lss/lss_server.h:109
#35 0x0051db02 in std::_Bind_simple<void (*(std::reference_wrapper<boost::asio::io_service>))(boost::asio::io_service&)>::_M_invoke<0u>(std::_Index_tuple<0u>) (this=0x4b25a80) at D:/Qt/QtDev/Tools/mingw492_32/i686-w64-mingw32/include/c++/functional:1700
#36 0x0051db82 in std::_Bind_simple<void (*(std::reference_wrapper<boost::asio::io_service>))(boost::asio::io_service&)>::operator()() (this=0x4b25a80) at D:/Qt/QtDev/Tools/mingw492_32/i686-w64-mingw32/include/c++/functional:1688
#37 0x0052b5ee in std::thread::_Impl<std::_Bind_simple<void (*(std::reference_wrapper<boost::asio::io_service>))(boost::asio::io_service&)> >::_M_run() (this=0x4b25a74) at D:/Qt/QtDev/Tools/mingw492_32/i686-w64-mingw32/include/c++/thread:115
#38 0x6fcb8c4f in libstdc++-6!execute_native_thread_routine () from D:\Qt\QtDev\5.5\mingw492_32\bin\libstdc++-6.dll
#39 0x64944f11 in pthread_create_wrapper () from D:\Qt\QtDev\Tools\mingw492_32\opt\bin\libwinpthread-1.dll
#40 0x749771e6 in msvcrt!_beginthreadex () from C:\WINDOWS\SYSTEM32\msvcrt.dll
#41 0x749772b1 in msvcrt!_endthreadex () from C:\WINDOWS\SYSTEM32\msvcrt.dll
#42 0x747f38f4 in KERNEL32!BaseThreadInitThunk () from C:\WINDOWS\SYSTEM32\kernel32.dll
#43 0x775f5de3 in ntdll!RtlUnicodeStringToInteger () from C:\WINDOWS\SYSTEM32\ntdll.dll
#44 0x04b26560 in ?? ()
#45 0x775f5dae in ntdll!RtlUnicodeStringToInteger () from C:\WINDOWS\SYSTEM32\ntdll.dll
#46 0xffffffff in ?? ()
#47 0x7761b7ea in ntdll!RtlCaptureContext () from C:\WINDOWS\SYSTEM32\ntdll.dll
#48 0x00000000 in ?? ()
但是在 test 用例中同样的的代码就没问题: