Very intermittent segmentation fault with boost::multiprecision
::value&&(!boost::multiprecision::detail::is_restricted_conversion<boost::multiprecision::detail::canonical<double, boost::multiprecision::backends::cpp_dec_float<50u, int, void> >::type, boost::multiprecision::backends::cpp_dec_float<50u, int, void> >::value), void>::type*) (this=0x7fc440fe2f40, v=@0x7fc440fe1d60: 2.9500000000000002) at /usr/include/boost/multiprecision/number.hpp:64 #4 0x0000000000447332 in ib_trading_engine::tickPrice (this=0x1dd0650, tickerId=1002, field=BID, price=2.9500000000000002, attribs=...) at ../src/ib_trading_engine.cpp:700 #5 0x000000000049c5c4 in EDecoder::processTickPriceMsg (this=0x1dd30c0,
Team, Trying to get to the root of a very intermittent seg fault in my program. Here's the snipped (not able to reproduce) as the section of code is part of a callback and I'm not sure how to reproduce it. Here's the tickPrice method and the trace from gdb is below that ... any thoughts? TJ void ib_trading_engine::tickPrice(TickerId tickerId, TickType field, double price, const TickAttrib& attribs) { this -> current_time(); ticksnapshot_complete_ = false; last_tick spy_call_trade; last_tick spy_put_trade; last_tick qqq_call_trade; last_tick qqq_put_trade; spy_call_trade.contract(spy_call_contract_); spy_call_trade.datetime(local_time_); spy_call_trade.symbol(spy_call_symbol_); spy_put_trade.contract(spy_put_contract_); spy_put_trade.datetime(local_time_); spy_put_trade.symbol(spy_put_symbol_); qqq_call_trade.contract(qqq_call_contract_); qqq_call_trade.datetime(local_time_); qqq_call_trade.symbol(qqq_call_symbol_); qqq_put_trade.contract(qqq_put_contract_); qqq_put_trade.datetime(local_time_); qqq_put_trade.symbol(qqq_put_symbol_); try { if (tickerId == 1001 && field == TickType::LAST) { spy_strike_ = (unsigned int)std::trunc(price); ticksnapshot_complete_ = true; last_spy_price_ = bmp::cpp_dec_float_50(price); } else if (tickerId == 1002) { switch (field) { case TickType::BID: last_call_bid_ = bmp::cpp_dec_float_50(price); break; case TickType::ASK: last_call_ask_ = bmp::cpp_dec_float_50(price); break; case TickType::LAST: spy_call_trade.last(bmp::cpp_dec_float_50(price)); trade_queue_.push(spy_call_trade); break; default: break; } } else if (tickerId == 1003) { switch (field) { case TickType::BID: last_put_bid_ = bmp::cpp_dec_float_50(price); break; case TickType::ASK: last_put_ask_= bmp::cpp_dec_float_50(price); break; case TickType::LAST: spy_put_trade.last(bmp::cpp_dec_float_50(price)); trade_queue_.push(spy_put_trade); break; default: break; } } else if (field == TickType::LAST && tickerId == 2001) { qqq_strike_ = (unsigned int)std::trunc(price); ticksnapshot_complete_ = true; last_qqq_price_ = bmp::cpp_dec_float_50(price); } else if (tickerId == 2002) { switch (field) { case TickType::BID: last_call_bid_ = bmp::cpp_dec_float_50(price); break; case TickType::ASK: last_call_ask_ = bmp::cpp_dec_float_50(price); break; case TickType::LAST: qqq_call_trade.last(bmp::cpp_dec_float_50(price)); trade_queue_.push(qqq_call_trade); break; default: break; } } else if (tickerId == 2003) { switch (field) { case TickType::BID: last_put_bid_ = bmp::cpp_dec_float_50(price); break; case TickType::ASK: last_put_ask_= bmp::cpp_dec_float_50(price); break; case TickType::LAST: qqq_put_trade.last(bmp::cpp_dec_float_50(price)); trade_queue_.push(qqq_put_trade); break; default: break; } } } catch (const std::exception& exception) { std::cerr << "ib_trading_engine::tickPrice() exception: " << exception.what() << "\n"; } } Core was generated by `./atm_call_paper_2.1'. Program terminated with signal SIGSEGV, Segmentation fault. #0 0x00000000004221fd in boost::multiprecision::backends::cpp_dec_float<50u, int, void>::pow2 (p=30) at /usr/include/boost/multiprecision/cpp_dec_float.hpp:2936 2936 cpp_dec_float<Digits10, ExponentType, Allocator> t; [Current thread is 1 (Thread 0x7fc4418027c0 (LWP 20245))] (gdb) bt #0 0x00000000004221fd in boost::multiprecision::backends::cpp_dec_float<50u, int, void>::pow2 (p=30) at /usr/include/boost/multiprecision/cpp_dec_float.hpp:2936 #1 0x00000000004157ba in boost::multiprecision::backends::cpp_dec_float<50u, int, void>::operator=<double> (this=0x7fc440fe2f40, a=2.9500000000000002) at /usr/include/boost/multiprecision/cpp_dec_float.hpp:2290 #2 0x0000000000411c17 in boost::multiprecision::backends::cpp_dec_float<50u, int, void>::cpp_dec_float<double>(double, std::enable_if<std::is_floating_point<double>::value&&(!std::is_same<double, __float128>::value), void>::type*) (this=0x7fc440fe2f40, val=2.9500000000000002) at /usr/include/boost/multiprecision/cpp_dec_float.hpp:249 #3 0x000000000040fcb6 in boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<50u, int, void>, (boost::multiprecision::expression_template_option)1>::number<double>(double const&, std::enable_if<std::is_convertible<boost::multiprecision::detail::canonical<double, boost::multiprecision::backends::cpp_dec_float<50u, int, void> >::type, boost::multiprecision::backends::cpp_dec_float<50u, int, void> ptr=0x7fc43c0077a6 "00%", endPtr=0x7fc43c0077a6 "00%") at ../src/client/EDecoder.cpp:65 #6 0x00000000004a7ea6 in EDecoder::parseAndProcessMsg (this=0x1dd30c0, beginPtr=@0x7fc440fe33e8: 0x7fc43c007790 "1", endPtr=0x7fc43c0077a6 "00%") at ../src/client/EDecoder.cpp:2247 #7 0x00000000004bee93 in EReader::processMsgs (this=0x1dd30b0) at ../src/client/EReader.cpp:282 #8 0x0000000000444630 in ib_trading_engine::process_messages (this=0x1dd0650) at ../src/ib_trading_engine.cpp:405 #9 0x000000000044465f in ib_trading_engine::current_time (this=0x1dd0650) at ../src/ib_trading_engine.cpp:410 #10 0x0000000000447086 in ib_trading_engine::tickPrice (this=0x1dd0650, tickerId=1002, field=BID, price=2.96, attribs=...) at ../src/ib_trading_engine.cpp:666
On Feb 10, 2022, at 10:22 AM, tjisana (泰志) via Boost-users <boost-users@lists.boost.org> wrote:
Team,
Trying to get to the root of a very intermittent seg fault in my program. Here's the snipped (not able to reproduce) as the section of code is part of a callback and I'm not sure how to reproduce it. Here's the tickPrice method and the trace from gdb is below that ... any thoughts?
What happens when you run the program under AddressSanitizer? — Marshall
Marshall, I'm not sure exactly how to do that (admittedly). I'm looking that up now. T. On Thu, Feb 10, 2022 at 11:58 AM Marshall Clow via Boost-users < boost-users@lists.boost.org> wrote:
On Feb 10, 2022, at 10:22 AM, tjisana (泰志) via Boost-users < boost-users@lists.boost.org> wrote:
Team,
Trying to get to the root of a very intermittent seg fault in my
program. Here's the snipped (not able to reproduce) as the section of code is part of a callback and I'm not sure how to reproduce it. Here's the tickPrice method and the trace from gdb is below that ... any thoughts?
What happens when you run the program under AddressSanitizer?
— Marshall
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org https://lists.boost.org/mailman/listinfo.cgi/boost-users
Okay, rebuild the binary with AddressSanitizer. Since I need to run the program during market hours, I'll do so first thing tomorrow - will let you know how it goes. Cheers, TJ On Thu, Feb 10, 2022 at 2:01 PM tjisana (泰志) <tjisana.lewis@gmail.com> wrote:
Marshall,
I'm not sure exactly how to do that (admittedly). I'm looking that up now.
T.
On Thu, Feb 10, 2022 at 11:58 AM Marshall Clow via Boost-users < boost-users@lists.boost.org> wrote:
On Feb 10, 2022, at 10:22 AM, tjisana (泰志) via Boost-users < boost-users@lists.boost.org> wrote:
Team,
Trying to get to the root of a very intermittent seg fault in my
program. Here's the snipped (not able to reproduce) as the section of code is part of a callback and I'm not sure how to reproduce it. Here's the tickPrice method and the trace from gdb is below that ... any thoughts?
What happens when you run the program under AddressSanitizer?
— Marshall
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org https://lists.boost.org/mailman/listinfo.cgi/boost-users
On 10/02/2022 22:07, tjisana (泰志) via Boost-users wrote:
Okay, rebuild the binary with AddressSanitizer. Since I need to run the program during market hours, I'll do so first thing tomorrow - will let you know how it goes.
Given that the fault is intermittent, and the offending line in the backtrace is innocuous, I would hazard a guess at stack overflow. BTW, just to say, cpp_dec_float does not do correct bankers rounding, and so may not be a good choice for critical financial programs. Best, John. -- This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus
I was thinking of revisiting cpp_dec_float for that reason too - thanks for noting that. Here's the result with address sanitizer ... ================================================================= ==15679==ERROR: AddressSanitizer: heap-use-after-free on address 0x60600000ea48 at pc 0x0000004228c3 bp 0x7f2e041f16a0 sp 0x7f2e041f1698 READ of size 40 at 0x60600000ea48 thread T0 #0 0x4228c2 in boost::multiprecision::backends::cpp_dec_float<50u, int, void>::cpp_dec_float(boost::multiprecision::backends::cpp_dec_float<50u, int, void> const&) /usr/include/boost/multiprecision/cpp_dec_float.hpp:210 #1 0x427592 in boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<50u, int, void>, (boost::multiprecision::expression_template_option)1>::number(boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<50u, int, void>, (boost::multiprecision::expression_template_option)1> const&) /usr/include/boost/multiprecision/number.hpp:47 #2 0x4168ae in transform<__gnu_cxx::__normal_iterator<boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<50>
*, std::vector<boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<50>
, std::back_insert_iterator<std::vector<boost::multiprecision::number<boost::multiprecision::backends::cpp_dec_float<50> , higher_high::calculate(const positions_map&, const last_tick&)::<lambda(boost::multiprecision::cpp_dec_float_50)> > /usr/include/c++/11/bits/stl_algo.h:4296 #3 0x410ca3 in higher_high::calculate(std::unordered_map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, trade_position, std::hash<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::equal_to<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, trade_position> > > const&, last_tick const&) ../src/higher_high.cpp:197 #4 0x4aca5d in operator() ../src/ib_trading_engine.cpp:228 #5 0x4c11d1 in operator() /usr/include/boost/coroutine2/detail/push_control_block_cc.ipp:90 #6 0x4c27e5 in __invoke_impl<boost::context::fiber, boost::coroutines2::detail::push_coroutine<last_tick>::control_block::control_block<boost::context::basic_fixedsize_stack<boost::context::stack_traits>, ib_trading_engine::run()::<lambda(boost::coroutines2::coroutine<last_tick>::pull_type&)> (boost::context::preallocated, boost::context::basic_fixedsize_stack<boost::context::stack_traits>&&, ib_trading_engine::run()::<lambda(boost::coroutines2::coroutine<last_tick>::pull_type&)>&&)::<lambda(boost::context::fiber&&)>&, boost::context::fiber> /usr/include/c++/11/bits/invoke.h:61 #7 0x4c25d0 in __invoke<boost::coroutines2::detail::push_coroutine<last_tick>::control_block::control_block<boost::context::basic_fixedsize_stack<boost::context::stack_traits>, ib_trading_engine::run()::<lambda(boost::coroutines2::coroutine<last_tick>::pull_type&)> (boost::context::preallocated, boost::context::basic_fixedsize_stack<boost::context::stack_traits>&&, ib_trading_engine::run()::<lambda(boost::coroutines2::coroutine<last_tick>::pull_type&)>&&)::<lambda(boost::context::fiber&&)>&, boost::context::fiber> /usr/include/c++/11/bits/invoke.h:97 #8 0x4c2537 in invoke<boost::coroutines2::detail::push_coroutine<last_tick>::control_block::control_block<boost::context::basic_fixedsize_stack<boost::context::stack_traits>, ib_trading_engine::run()::<lambda(boost::coroutines2::coroutine<last_tick>::pull_type&)> (boost::context::preallocated, boost::context::basic_fixedsize_stack<boost::context::stack_traits>&&, ib_trading_engine::run()::<lambda(boost::coroutines2::coroutine<last_tick>::pull_type&)>&&)::<lambda(boost::context::fiber&&)>&, boost::context::fiber> /usr/include/c++/11/functional:98 #9 0x4c2297 in run /usr/include/boost/context/fiber_fcontext.hpp:140 #10 0x4c2043 in fiber_entry<boost::context::detail::fiber_record<boost::context::fiber, boost::context::basic_fixedsize_stack<boost::context::stack_traits>, boost::coroutines2::detail::push_coroutine<last_tick>::control_block::control_block<boost::context::basic_fixedsize_stack<boost::context::stack_traits>, ib_trading_engine::run()::<lambda(boost::coroutines2::coroutine<last_tick>::pull_type&)> (boost::context::preallocated, boost::context::basic_fixedsize_stack<boost::context::stack_traits>&&, ib_trading_engine::run()::<lambda(boost::coroutines2::coroutine<last_tick>::pull_type&)>&&)::<lambda(boost::context::fiber&&)> /usr/include/boost/context/fiber_fcontext.hpp:80 #11 0x7f2e0740118e in make_fcontext (/lib64/libboost_context.so.1.78.0+0x118e)
0x60600000ea58 is located 0 bytes to the right of 56-byte region [0x60600000ea20,0x60600000ea58) freed by thread T0 here: #0 0x7f2e074b8dc7 in operator delete(void*, unsigned long) (/lib64/libasan.so.6+0xb3dc7) previously allocated by thread T0 here: #0 0x7f2e074b7f47 in operator new(unsigned long) (/lib64/libasan.so.6+0xb2f47) SUMMARY: AddressSanitizer: heap-use-after-free /usr/include/boost/multiprecision/cpp_dec_float.hpp:210 in boost::multiprecision::backends::cpp_dec_float<50u, int, void>::cpp_dec_float(boost::multiprecision::backends::cpp_dec_float<50u, int, void> const&) Shadow bytes around the buggy address: 0x0c0c7fff9cf0: fd fd fd fd fd fd fd fa fa fa fa fa fd fd fd fd 0x0c0c7fff9d00: fd fd fd fa fa fa fa fa fd fd fd fd fd fd fd fa 0x0c0c7fff9d10: fa fa fa fa fd fd fd fd fd fd fd fa fa fa fa fa 0x0c0c7fff9d20: fd fd fd fd fd fd fd fa fa fa fa fa fd fd fd fd 0x0c0c7fff9d30: fd fd fd fa fa fa fa fa fd fd fd fd fd fd fd fa =>0x0c0c7fff9d40: fa fa fa fa fd fd fd fd fd[fd]fd fa fa fa fa fa 0x0c0c7fff9d50: 00 00 00 00 00 00 00 fa fa fa fa fa fa fa fa fa 0x0c0c7fff9d60: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c0c7fff9d70: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c0c7fff9d80: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c0c7fff9d90: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa Shadow byte legend (one shadow byte represents 8 application bytes): Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 Heap left redzone: fa Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack after return: f5 Stack use after scope: f8 Global redzone: f9 Global init order: f6 Poisoned by user: f7 Container overflow: fc Array cookie: ac Intra object redzone: bb ASan internal: fe Left alloca redzone: ca Right alloca redzone: cb Shadow gap: cc ==15679==ABORTING On Fri, Feb 11, 2022 at 2:06 AM John Maddock via Boost-users < boost-users@lists.boost.org> wrote:
On 10/02/2022 22:07, tjisana (泰志) via Boost-users wrote:
Okay, rebuild the binary with AddressSanitizer. Since I need to run the program during market hours, I'll do so first thing tomorrow - will let you know how it goes.
Given that the fault is intermittent, and the offending line in the backtrace is innocuous, I would hazard a guess at stack overflow.
BTW, just to say, cpp_dec_float does not do correct bankers rounding, and so may not be a good choice for critical financial programs.
Best, John.
-- This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org https://lists.boost.org/mailman/listinfo.cgi/boost-users
Hi, tjisana wrote:
Trying to get to the root of a very intermittent seg fault in my program.
This reminds me of the issue that I found while reviewing Boost.Multiprecision back in 2012: https://lists.boost.org/Archives/boost/2012/06/193862.php I did track that down and it was fixed, but in the process of investigating I got a poor impression of the implementation of the library and I felt that other similar issues were probably present. In my review, I said that I would not be confident using Boost.Multiprecision without verifying its answers against another implementation. Of course that's a decade ago and things may have changed - or not. Regards, Phil.
So, thanks to Marshall for clueing me in on address sanitizer. Realized that I failed to do bounds checking on a segment of code and solved the read problem. With that fixed I'm getting stack overflow due, it seems, to the heavy recursion in my code (and using cpp_dec_). I swapped out cpp_dec_ for double and the problem has gone away. Will figure out my banker's rounding while I'm at it. Here's the AddressSanitizer trace for completeness (below) - maybe there's another issue afoot? TJ 09:46:38.996500 | SPY 220211C00447000 | root: 0.000 | open: 0.000 | high: 2.120 | low: 0.000 | close: 1.680 | bid: 1.680 | ask: 1.690 | 1.414 | 0.009 | 0.306 | 09:47:03.456158 | SPY 220211C00447000 | order: MKT | qty: 31.000 | action: BUY | exchg: SMART AddressSanitizer:DEADLYSIGNAL ================================================================= ==19612==ERROR: AddressSanitizer: stack-overflow on address 0x7f22fd7d5718 (pc 0x7f2300abe437 bp 0x7f22fd7d6360 sp 0x7f22fd7d5700 T0) #0 0x7f2300abe437 (/lib64/libasan.so.6+0xb9437) #1 0x7f2300a418fb in __interceptor_memcpy (/lib64/libasan.so.6+0x3c8fb) #2 0x7f2300927ba7 in std::basic_streambuf<char, std::char_traits<char>
::xsputn(char const*, long) (/lib64/libstdc++.so.6+0x147ba7) #3 0x7f23009197d6 in std::ostream::write(char const*, long) (/lib64/libstdc++.so.6+0x1397d6) #4 0x588c8a in EClientSocket::prepareBufferImpl(std::ostream&) const ../src/client/EClientSocket.cpp:217 #5 0x588d7f in EClientSocket::prepareBuffer(std::ostream&) const ../src/client/EClientSocket.cpp:225 #6 0x5548dc in EClient::reqCurrentTime() ../src/client/EClient.cpp:1234 #7 0x4afda3 in ib_trading_engine::current_time() ../src/ib_trading_engine.cpp:409 #8 0x4b6dd5 in ib_trading_engine::tickPrice(long, TickType, double, TickAttrib const&) ../src/ib_trading_engine.cpp:666 #9 0x58b8f7 in EDecoder::processTickPriceMsg(char const*, char const*) ../src/client/EDecoder.cpp:65 #10 0x5a50c7 in EDecoder::parseAndProcessMsg(char const*&, char const*) ../src/client/EDecoder.cpp:2247 #11 0x5d1f59 in EReader::processMsgs() ../src/client/EReader.cpp:282 #12 0x4afd59 in ib_trading_engine::process_messages() ../src/ib_trading_engine.cpp:405 #13 0x4afdaf in ib_trading_engine::current_time() ../src/ib_trading_engine.cpp:410 #14 0x4b6dd5 in ib_trading_engine::tickPrice(long, TickType, double, TickAttrib const&) ../src/ib_trading_engine.cpp:666 #15 0x58b8f7 in EDecoder::processTickPriceMsg(char const*, char const*) ../src/client/EDecoder.cpp:65 #16 0x5a50c7 in EDecoder::parseAndProcessMsg(char const*&, char const*) ../src/client/EDecoder.cpp:2247 #17 0x5d1f59 in EReader::processMsgs() ../src/client/EReader.cpp:282 #18 0x4afd59 in ib_trading_engine::process_messages() ../src/ib_trading_engine.cpp:405 #19 0x4afdaf in ib_trading_engine::current_time() ../src/ib_trading_engine.cpp:410 #20 0x4b6dd5 in ib_trading_engine::tickPrice(long, TickType, double, TickAttrib const&) ../src/ib_trading_engine.cpp:666 #21 0x58b8f7 in EDecoder::processTickPriceMsg(char const*, char const*) ../src/client/EDecoder.cpp:65 #22 0x5a50c7 in EDecoder::parseAndProcessMsg(char const*&, char const*) ../src/client/EDecoder.cpp:2247 #23 0x5d1f59 in EReader::processMsgs() ../src/client/EReader.cpp:282 #24 0x4afd59 in ib_trading_engine::process_messages() ../src/ib_trading_engine.cpp:405 #25 0x4afdaf in ib_trading_engine::current_time() ../src/ib_trading_engine.cpp:410 #26 0x4b6dd5 in ib_trading_engine::tickPrice(long, TickType, double, TickAttrib const&) ../src/ib_trading_engine.cpp:666 #27 0x58b8f7 in EDecoder::processTickPriceMsg(char const*, char const*) ../src/client/EDecoder.cpp:65 #28 0x5a50c7 in EDecoder::parseAndProcessMsg(char const*&, char const*) ../src/client/EDecoder.cpp:2247 #29 0x5d1f59 in EReader::processMsgs() ../src/client/EReader.cpp:282 #30 0x4afd59 in ib_trading_engine::process_messages() ../src/ib_trading_engine.cpp:405 #31 0x4afdaf in ib_trading_engine::current_time() ../src/ib_trading_engine.cpp:410 #32 0x4b6dd5 in ib_trading_engine::tickPrice(long, TickType, double, TickAttrib const&) ../src/ib_trading_engine.cpp:666 #33 0x58b8f7 in EDecoder::processTickPriceMsg(char const*, char const*) ../src/client/EDecoder.cpp:65 #34 0x5a50c7 in EDecoder::parseAndProcessMsg(char const*&, char const*) ../src/client/EDecoder.cpp:2247 #35 0x5d1f59 in EReader::processMsgs() ../src/client/EReader.cpp:282 #36 0x4afd59 in ib_trading_engine::process_messages() ../src/ib_trading_engine.cpp:405 #37 0x4afdaf in ib_trading_engine::current_time() ../src/ib_trading_engine.cpp:410 #38 0x4b6dd5 in ib_trading_engine::tickPrice(long, TickType, double, TickAttrib const&) ../src/ib_trading_engine.cpp:666 #39 0x58b8f7 in EDecoder::processTickPriceMsg(char const*, char const*) ../src/client/EDecoder.cpp:65 #40 0x5a50c7 in EDecoder::parseAndProcessMsg(char const*&, char const*) ../src/client/EDecoder.cpp:2247 #41 0x5d1f59 in EReader::processMsgs() ../src/client/EReader.cpp:282 #42 0x4afd59 in ib_trading_engine::process_messages() ../src/ib_trading_engine.cpp:405 #43 0x4afdaf in ib_trading_engine::current_time() ../src/ib_trading_engine.cpp:410 #44 0x4b6dd5 in ib_trading_engine::tickPrice(long, TickType, double, TickAttrib const&) ../src/ib_trading_engine.cpp:666 #45 0x58b8f7 in EDecoder::processTickPriceMsg(char const*, char const*) ../src/client/EDecoder.cpp:65 #46 0x5a50c7 in EDecoder::parseAndProcessMsg(char const*&, char const*) ../src/client/EDecoder.cpp:2247 #47 0x5d1f59 in EReader::processMsgs() ../src/client/EReader.cpp:282 #48 0x4afd59 in ib_trading_engine::process_messages() ../src/ib_trading_engine.cpp:405 #49 0x4afdaf in ib_trading_engine::current_time() ../src/ib_trading_engine.cpp:410 #50 0x4b6dd5 in ib_trading_engine::tickPrice(long, TickType, double, TickAttrib const&) ../src/ib_trading_engine.cpp:666 #51 0x58b8f7 in EDecoder::processTickPriceMsg(char const*, char const*) ../src/client/EDecoder.cpp:65 #52 0x5a50c7 in EDecoder::parseAndProcessMsg(char const*&, char const*) ../src/client/EDecoder.cpp:2247 #53 0x5d1f59 in EReader::processMsgs() ../src/client/EReader.cpp:282 #54 0x4afd59 in ib_trading_engine::process_messages() ../src/ib_trading_engine.cpp:405 #55 0x4afdaf in ib_trading_engine::current_time() ../src/ib_trading_engine.cpp:410 #56 0x4b6dd5 in ib_trading_engine::tickPrice(long, TickType, double, TickAttrib const&) ../src/ib_trading_engine.cpp:666 #57 0x58b8f7 in EDecoder::processTickPriceMsg(char const*, char const*) ../src/client/EDecoder.cpp:65 #58 0x5a50c7 in EDecoder::parseAndProcessMsg(char const*&, char const*) ../src/client/EDecoder.cpp:2247 #59 0x5d1f59 in EReader::processMsgs() ../src/client/EReader.cpp:282 #60 0x4afd59 in ib_trading_engine::process_messages() ../src/ib_trading_engine.cpp:405 #61 0x4afdaf in ib_trading_engine::current_time() ../src/ib_trading_engine.cpp:410 #62 0x4b6dd5 in ib_trading_engine::tickPrice(long, TickType, double, TickAttrib const&) ../src/ib_trading_engine.cpp:666 #63 0x58b8f7 in EDecoder::processTickPriceMsg(char const*, char const*) ../src/client/EDecoder.cpp:65 #64 0x5a50c7 in EDecoder::parseAndProcessMsg(char const*&, char const*) ../src/client/EDecoder.cpp:2247 #65 0x5d1f59 in EReader::processMsgs() ../src/client/EReader.cpp:282 #66 0x4afd59 in ib_trading_engine::process_messages() ../src/ib_trading_engine.cpp:405 #67 0x4afdaf in ib_trading_engine::current_time() ../src/ib_trading_engine.cpp:410 #68 0x4b6dd5 in ib_trading_engine::tickPrice(long, TickType, double, TickAttrib const&) ../src/ib_trading_engine.cpp:666 #69 0x58b8f7 in EDecoder::processTickPriceMsg(char const*, char const*) ../src/client/EDecoder.cpp:65 #70 0x5a50c7 in EDecoder::parseAndProcessMsg(char const*&, char const*) ../src/client/EDecoder.cpp:2247 #71 0x5d1f59 in EReader::processMsgs() ../src/client/EReader.cpp:282 #72 0x4afd59 in ib_trading_engine::process_messages() ../src/ib_trading_engine.cpp:405 #73 0x4afdaf in ib_trading_engine::current_time() ../src/ib_trading_engine.cpp:410 #74 0x4b6dd5 in ib_trading_engine::tickPrice(long, TickType, double, TickAttrib const&) ../src/ib_trading_engine.cpp:666 #75 0x58b8f7 in EDecoder::processTickPriceMsg(char const*, char const*) ../src/client/EDecoder.cpp:65 #76 0x5a50c7 in EDecoder::parseAndProcessMsg(char const*&, char const*) ../src/client/EDecoder.cpp:2247 #77 0x5d1f59 in EReader::processMsgs() ../src/client/EReader.cpp:282 #78 0x4afd59 in ib_trading_engine::process_messages() ../src/ib_trading_engine.cpp:405 #79 0x4afdaf in ib_trading_engine::current_time() ../src/ib_trading_engine.cpp:410 #80 0x4b6dd5 in ib_trading_engine::tickPrice(long, TickType, double, TickAttrib const&) ../src/ib_trading_engine.cpp:666 #81 0x58b8f7 in EDecoder::processTickPriceMsg(char const*, char const*) ../src/client/EDecoder.cpp:65 #82 0x5a50c7 in EDecoder::parseAndProcessMsg(char const*&, char const*) ../src/client/EDecoder.cpp:2247 #83 0x5d1f59 in EReader::processMsgs() ../src/client/EReader.cpp:282 #84 0x4afd59 in ib_trading_engine::process_messages() ../src/ib_trading_engine.cpp:405 #85 0x4afdaf in ib_trading_engine::current_time() ../src/ib_trading_engine.cpp:410 #86 0x4b6dd5 in ib_trading_engine::tickPrice(long, TickType, double, TickAttrib const&) ../src/ib_trading_engine.cpp:666 #87 0x58b8f7 in EDecoder::processTickPriceMsg(char const*, char const*) ../src/client/EDecoder.cpp:65 #88 0x5a50c7 in EDecoder::parseAndProcessMsg(char const*&, char const*) ../src/client/EDecoder.cpp:2247 #89 0x5d1f59 in EReader::processMsgs() ../src/client/EReader.cpp:282 #90 0x4afd59 in ib_trading_engine::process_messages() ../src/ib_trading_engine.cpp:405 #91 0x4afdaf in ib_trading_engine::current_time() ../src/ib_trading_engine.cpp:410 #92 0x4b6dd5 in ib_trading_engine::tickPrice(long, TickType, double, TickAttrib const&) ../src/ib_trading_engine.cpp:666 #93 0x58b8f7 in EDecoder::processTickPriceMsg(char const*, char const*) ../src/client/EDecoder.cpp:65 #94 0x5a50c7 in EDecoder::parseAndProcessMsg(char const*&, char const*) ../src/client/EDecoder.cpp:2247 #95 0x5d1f59 in EReader::processMsgs() ../src/client/EReader.cpp:282 #96 0x4afd59 in ib_trading_engine::process_messages() ../src/ib_trading_engine.cpp:405 #97 0x4afdaf in ib_trading_engine::current_time() ../src/ib_trading_engine.cpp:410 #98 0x4b6dd5 in ib_trading_engine::tickPrice(long, TickType, double, TickAttrib const&) ../src/ib_trading_engine.cpp:666 #99 0x58b8f7 in EDecoder::processTickPriceMsg(char const*, char const*) ../src/client/EDecoder.cpp:65 #100 0x5a50c7 in EDecoder::parseAndProcessMsg(char const*&, char const*) ../src/client/EDecoder.cpp:2247 #101 0x5d1f59 in EReader::processMsgs() ../src/client/EReader.cpp:282 #102 0x4afd59 in ib_trading_engine::process_messages() ../src/ib_trading_engine.cpp:405 #103 0x4ad671 in operator() ../src/ib_trading_engine.cpp:261 #104 0x4c1219 in operator() /usr/include/boost/coroutine2/detail/push_control_block_cc.ipp:90 #105 0x4c282d in __invoke_impl<boost::context::fiber, boost::coroutines2::detail::push_coroutine<last_tick>::control_block::control_block<boost::context::basic_fixedsize_stack<boost::context::stack_traits>, ib_trading_engine::run()::<lambda(boost::coroutines2::coroutine<last_tick>::pull_type&)> (boost::context::preallocated, boost::context::basic_fixedsize_stack<boost::context::stack_traits>&&, ib_trading_engine::run()::<lambda(boost::coroutines2::coroutine<last_tick>::pull_type&)>&&)::<lambda(boost::context::fiber&&)>&, boost::context::fiber> /usr/include/c++/11/bits/invoke.h:61 #106 0x4c2618 in __invoke<boost::coroutines2::detail::push_coroutine<last_tick>::control_block::control_block<boost::context::basic_fixedsize_stack<boost::context::stack_traits>, ib_trading_engine::run()::<lambda(boost::coroutines2::coroutine<last_tick>::pull_type&)> (boost::context::preallocated, boost::context::basic_fixedsize_stack<boost::context::stack_traits>&&, ib_trading_engine::run()::<lambda(boost::coroutines2::coroutine<last_tick>::pull_type&)>&&)::<lambda(boost::context::fiber&&)>&, boost::context::fiber> /usr/include/c++/11/bits/invoke.h:97 #107 0x4c257f in invoke<boost::coroutines2::detail::push_coroutine<last_tick>::control_block::control_block<boost::context::basic_fixedsize_stack<boost::context::stack_traits>, ib_trading_engine::run()::<lambda(boost::coroutines2::coroutine<last_tick>::pull_type&)> (boost::context::preallocated, boost::context::basic_fixedsize_stack<boost::context::stack_traits>&&, ib_trading_engine::run()::<lambda(boost::coroutines2::coroutine<last_tick>::pull_type&)>&&)::<lambda(boost::context::fiber&&)>&, boost::context::fiber> /usr/include/c++/11/functional:98 #108 0x4c22df in run /usr/include/boost/context/fiber_fcontext.hpp:140 #109 0x4c208b in fiber_entry<boost::context::detail::fiber_record<boost::context::fiber, boost::context::basic_fixedsize_stack<boost::context::stack_traits>, boost::coroutines2::detail::push_coroutine<last_tick>::control_block::control_block<boost::context::basic_fixedsize_stack<boost::context::stack_traits>, ib_trading_engine::run()::<lambda(boost::coroutines2::coroutine<last_tick>::pull_type&)> (boost::context::preallocated, boost::context::basic_fixedsize_stack<boost::context::stack_traits>&&, ib_trading_engine::run()::<lambda(boost::coroutines2::coroutine<last_tick>::pull_type&)>&&)::<lambda(boost::context::fiber&&)>
/usr/include/boost/context/fiber_fcontext.hpp:80 #110 0x7f2300a0118e in make_fcontext (/lib64/libboost_context.so.1.78.0+0x118e)
SUMMARY: AddressSanitizer: stack-overflow (/lib64/libasan.so.6+0xb9437) ==19612==ABORTING On Fri, Feb 11, 2022 at 9:41 AM Phil Endecott via Boost-users < boost-users@lists.boost.org> wrote:
Hi,
tjisana wrote:
Trying to get to the root of a very intermittent seg fault in my program.
This reminds me of the issue that I found while reviewing Boost.Multiprecision back in 2012:
https://lists.boost.org/Archives/boost/2012/06/193862.php
I did track that down and it was fixed, but in the process of investigating I got a poor impression of the implementation of the library and I felt that other similar issues were probably present. In my review, I said that I would not be confident using Boost.Multiprecision without verifying its answers against another implementation. Of course that's a decade ago and things may have changed - or not.
Regards, Phil.
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org https://lists.boost.org/mailman/listinfo.cgi/boost-users
participants (4)
-
John Maddock
-
Marshall Clow
-
Phil Endecott
-
tjisana (泰志)