weixin_39627405
weixin_39627405
2020-12-04 11:42

Crash in asio

Hi,

I have no steps to reproduce the following crash, I think it is a race condition.

Maybe you could try to update asio?

Alex.


=================================================================
==1239==ERROR: AddressSanitizer: stack-use-after-scope on address 0x7fffdbeee6e0 at pc 0x5555567440ed bp 0x7fffdbeee6b0 sp 0x7fffdbeee6a0
READ of size 8 at 0x7fffdbeee6e0 thread T443
    #0 0x5555567440ec in void asio::detail::op_queue_access::next<:detail::scheduler_operation asio::detail::scheduler_operation>(asio::detail::scheduler_operation*&, asio::detail::scheduler_operation*) ../../../third-party/ableton-link/modules/asio-standalone/asio/include/asio/detail/op_queue.hpp:40
    #1 0x55555673cb2e in asio::detail::op_queue<:detail::scheduler_operation>::push(asio::detail::scheduler_operation*) ../../../third-party/ableton-link/modules/asio-standalone/asio/include/asio/detail/op_queue.hpp:106
    #2 0x5555567282b3 in asio::detail::epoll_reactor::descriptor_state::perform_io(unsigned int) ../../../third-party/ableton-link/modules/asio-standalone/asio/include/asio/detail/impl/epoll_reactor.ipp:670
    #3 0x55555672844c in asio::detail::epoll_reactor::descriptor_state::do_complete(void*, asio::detail::scheduler_operation*, std::error_code const&, unsigned long) ../../../third-party/ableton-link/modules/asio-standalone/asio/include/asio/detail/impl/epoll_reactor.ipp:693
    #4 0x555556722a56 in asio::detail::scheduler_operation::complete(void*, std::error_code const&, unsigned long) ../../../third-party/ableton-link/modules/asio-standalone/asio/include/asio/detail/scheduler_operation.hpp:39
    #5 0x55555672a3ea in asio::detail::scheduler::do_run_one(asio::detail::scoped_lock<:detail::posix_mutex>&, asio::detail::scheduler_thread_info&, std::error_code const&) ../../../third-party/ableton-link/modules/asio-standalone/asio/include/asio/detail/impl/scheduler.ipp:375
    #6 0x555556729662 in asio::detail::scheduler::run(std::error_code&) ../../../third-party/ableton-link/modules/asio-standalone/asio/include/asio/detail/impl/scheduler.ipp:146
    #7 0x55555672aece in asio::io_context::run() ../../../third-party/ableton-link/modules/asio-standalone/asio/include/asio/impl/io_context.ipp:59
    #8 0x5555567577f0 in ableton::platforms::asio::Context<:platforms::posix::scanipifaddrs ableton::util::nulllog>::Context<:link::controller long>, std::function<void>, ableton::platforms::linux::Clock<4>, ableton::platforms::asio::Context<:platforms::posix::scanipifaddrs ableton::util::nulllog> >::UdpSendExceptionHandler>(ableton::link::Controller<:function long>, std::function<void>, ableton::platforms::linux::Clock<4>, ableton::platforms::asio::Context<:platforms::posix::scanipifaddrs ableton::util::nulllog> >::UdpSendExceptionHandler)::{lambda(asio::io_context&, ableton::link::Controller<:function long>, std::function<void>, ableton::platforms::linux::Clock<4>, ableton::platforms::asio::Context<:platforms::posix::scanipifaddrs ableton::util::nulllog> >::UdpSendExceptionHandler)#1}::operator()(asio::io_context&, ableton::link::Controller<:function long>, std::function<void>, ableton::platforms::linux::Clock<4>, ableton::platforms::asio::Context<:platforms::posix::scanipifaddrs ableton::util::nulllog> >::UdpSendExceptionHandler) const ../../../third-party/ableton-link/include/ableton/platforms/asio/Context.hpp:65
    #9 0x555556762c4b in void std::__invoke_impl<void ableton::platforms::asio::context ableton::util::nulllog>::Context<:link::controller long>, std::function<void>, ableton::platforms::linux::Clock<4>, ableton::platforms::asio::Context<:platforms::posix::scanipifaddrs ableton::util::nulllog> >::UdpSendExceptionHandler>(ableton::link::Controller<:function long>, std::function<void>, ableton::platforms::linux::Clock<4>, ableton::platforms::asio::Context<:platforms::posix::scanipifaddrs ableton::util::nulllog> >::UdpSendExceptionHandler)::{lambda(asio::io_context&, ableton::link::Controller<:function long>, std::function<void>, ableton::platforms::linux::Clock<4>, ableton::platforms::asio::Context<:platforms::posix::scanipifaddrs ableton::util::nulllog> >::UdpSendExceptionHandler)#1}, asio::io_context&, ableton::link::Controller<:function long>, std::function<void>, ableton::platforms::linux::Clock<4>, ableton::platforms::asio::Context<:platforms::posix::scanipifaddrs ableton::util::nulllog> >::UdpSendExceptionHandler>(std::__invoke_other, ableton::platforms::asio::Context<:platforms::posix::scanipifaddrs ableton::util::nulllog>::Context<:link::controller long>, std::function<void>, ableton::platforms::linux::Clock<4>, ableton::platforms::asio::Context<:platforms::posix::scanipifaddrs ableton::util::nulllog> >::UdpSendExceptionHandler>(ableton::link::Controller<:function long>, std::function<void>, ableton::platforms::linux::Clock<4>, ableton::platforms::asio::Context<:platforms::posix::scanipifaddrs ableton::util::nulllog> >::UdpSendExceptionHandler)::{lambda(asio::io_context&, ableton::link::Controller<:function long>, std::function<void>, ableton::platforms::linux::Clock<4>, ableton::platforms::asio::Context<:platforms::posix::scanipifaddrs ableton::util::nulllog> >::UdpSendExceptionHandler)#1}&&, asio::io_context&, ableton::link::Controller<:function long>, std::function<void>, ableton::platforms::linux::Clock<4>, ableton::platforms::asio::Context<:platforms::posix::scanipifaddrs ableton::util::nulllog> >::UdpSendExceptionHandler&&) /usr/include/c++/7.1.1/bits/invoke.h:60
    #10 0x55555675e548 in std::__invoke_result<:platforms::asio::context ableton::util::nulllog>::Context<:link::controller long>, std::function<void>, ableton::platforms::linux::Clock<4>, ableton::platforms::asio::Context<:platforms::posix::scanipifaddrs ableton::util::nulllog> >::UdpSendExceptionHandler>(ableton::link::Controller<:function long>, std::function<void>, ableton::platforms::linux::Clock<4>, ableton::platforms::asio::Context<:platforms::posix::scanipifaddrs ableton::util::nulllog> >::UdpSendExceptionHandler)::{lambda(asio::io_context&, ableton::link::Controller<:function long>, std::function<void>, ableton::platforms::linux::Clock<4>, ableton::platforms::asio::Context<:platforms::posix::scanipifaddrs ableton::util::nulllog> >::UdpSendExceptionHandler)#1}, asio::io_context&, ableton::link::Controller<:function long>, std::function<void>, ableton::platforms::linux::Clock<4>, ableton::platforms::asio::Context<:platforms::posix::scanipifaddrs ableton::util::nulllog> >::UdpSendExceptionHandler>::type std::__invoke<:platforms::asio::context ableton::util::nulllog>::Context<:link::controller long>, std::function<void>, ableton::platforms::linux::Clock<4>, ableton::platforms::asio::Context<:platforms::posix::scanipifaddrs ableton::util::nulllog> >::UdpSendExceptionHandler>(ableton::link::Controller<:function long>, std::function<void>, ableton::platforms::linux::Clock<4>, ableton::platforms::asio::Context<:platforms::posix::scanipifaddrs ableton::util::nulllog> >::UdpSendExceptionHandler)::{lambda(asio::io_context&, ableton::link::Controller<:function long>, std::function<void>, ableton::platforms::linux::Clock<4>, ableton::platforms::asio::Context<:platforms::posix::scanipifaddrs ableton::util::nulllog> >::UdpSendExceptionHandler)#1}, asio::io_context&, ableton::link::Controller<:function long>, std::function<void>, ableton::platforms::linux::Clock<4>, ableton::platforms::asio::Context<:platforms::posix::scanipifaddrs ableton::util::nulllog> >::UdpSendExceptionHandler>(ableton::platforms::asio::Context<:platforms::posix::scanipifaddrs ableton::util::nulllog>::Context<:link::controller long>, std::function<void>, ableton::platforms::linux::Clock<4>, ableton::platforms::asio::Context<:platforms::posix::scanipifaddrs ableton::util::nulllog> >::UdpSendExceptionHandler>(ableton::link::Controller<:function long>, std::function<void>, ableton::platforms::linux::Clock<4>, ableton::platforms::asio::Context<:platforms::posix::scanipifaddrs ableton::util::nulllog> >::UdpSendExceptionHandler)::{lambda(asio::io_context&, ableton::link::Controller<:function long>, std::function<void>, ableton::platforms::linux::Clock<4>, ableton::platforms::asio::Context<:platforms::posix::scanipifaddrs ableton::util::nulllog> >::UdpSendExceptionHandler)#1}&&, (std::__invoke_result&&)...) /usr/include/c++/7.1.1/bits/invoke.h:95
    #11 0x5555567fd49c in decltype (__invoke((_S_declval<0ul>)(), (_S_declval<1ul>)(), (_S_declval<2ul>)())) std::thread::_Invoker<:tuple ableton::util::nulllog>::Context<:link::controller long>, std::function<void>, ableton::platforms::linux::Clock<4>, ableton::platforms::asio::Context<:platforms::posix::scanipifaddrs ableton::util::nulllog> >::UdpSendExceptionHandler>(ableton::link::Controller<:function long>, std::function<void>, ableton::platforms::linux::Clock<4>, ableton::platforms::asio::Context<:platforms::posix::scanipifaddrs ableton::util::nulllog> >::UdpSendExceptionHandler)::{lambda(asio::io_context&, ableton::link::Controller<:function long>, std::function<void>, ableton::platforms::linux::Clock<4>, ableton::platforms::asio::Context<:platforms::posix::scanipifaddrs ableton::util::nulllog> >::UdpSendExceptionHandler)#1}, asio::io_context&, ableton::link::Controller<:function long>, std::function<void>, ableton::platforms::linux::Clock<4>, ableton::platforms::asio::Context<:platforms::posix::scanipifaddrs ableton::util::nulllog> >::UdpSendExceptionHandler> >::_M_invoke<0ul, 1ul, 2ul>(std::_Index_tuple<0ul, 1ul, 2ul>) /usr/include/c++/7.1.1/thread:234
    #12 0x5555567fbf68 in std::thread::_Invoker<:tuple ableton::util::nulllog>::Context<:link::controller long>, std::function<void>, ableton::platforms::linux::Clock<4>, ableton::platforms::asio::Context<:platforms::posix::scanipifaddrs ableton::util::nulllog> >::UdpSendExceptionHandler>(ableton::link::Controller<:function long>, std::function<void>, ableton::platforms::linux::Clock<4>, ableton::platforms::asio::Context<:platforms::posix::scanipifaddrs ableton::util::nulllog> >::UdpSendExceptionHandler)::{lambda(asio::io_context&, ableton::link::Controller<:function long>, std::function<void>, ableton::platforms::linux::Clock<4>, ableton::platforms::asio::Context<:platforms::posix::scanipifaddrs ableton::util::nulllog> >::UdpSendExceptionHandler)#1}, asio::io_context&, ableton::link::Controller<:function long>, std::function<void>, ableton::platforms::linux::Clock<4>, ableton::platforms::asio::Context<:platforms::posix::scanipifaddrs ableton::util::nulllog> >::UdpSendExceptionHandler> >::operator()() /usr/include/c++/7.1.1/thread:243
    #13 0x5555567fafef in std::thread::_State_impl<:thread::_invoker ableton::util::nulllog>::Context<:link::controller long>, std::function<void>, ableton::platforms::linux::Clock<4>, ableton::platforms::asio::Context<:platforms::posix::scanipifaddrs ableton::util::nulllog> >::UdpSendExceptionHandler>(ableton::link::Controller<:function long>, std::function<void>, ableton::platforms::linux::Clock<4>, ableton::platforms::asio::Context<:platforms::posix::scanipifaddrs ableton::util::nulllog> >::UdpSendExceptionHandler)::{lambda(asio::io_context&, ableton::link::Controller<:function long>, std::function<void>, ableton::platforms::linux::Clock<4>, ableton::platforms::asio::Context<:platforms::posix::scanipifaddrs ableton::util::nulllog> >::UdpSendExceptionHandler)#1}, asio::io_context&, ableton::link::Controller<:function long>, std::function<void>, ableton::platforms::linux::Clock<4>, ableton::platforms::asio::Context<:platforms::posix::scanipifaddrs ableton::util::nulllog> >::UdpSendExceptionHandler> > >::_M_run() /usr/include/c++/7.1.1/thread:186
    #14 0x555558d1612e in execute_native_thread_routine (/home/abique/develop/bitwig/alex-future/target/bin/debug/BitwigAudioEngine+0x37c212e)
    #15 0x7ffff4760048 in start_thread (/usr/lib/libpthread.so.0+0x7048)
    #16 0x7ffff44a0f0e in clone (/usr/lib/libc.so.6+0xedf0e)

Address 0x7fffdbeee6e0 is located in stack of thread T443
SUMMARY: AddressSanitizer: stack-use-after-scope ../../../third-party/ableton-link/modules/asio-standalone/asio/include/asio/detail/op_queue.hpp:40 in void asio::detail::op_queue_access::next<:detail::scheduler_operation asio::detail::scheduler_operation>(asio::detail::scheduler_operation*&, asio::detail::scheduler_operation*)
Shadow bytes around the buggy address:
  0x10007b7d5c80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x10007b7d5c90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x10007b7d5ca0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x10007b7d5cb0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x10007b7d5cc0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x10007b7d5cd0: 00 00 00 00 00 00 00 00 00 00 00 00[f8]00 00 00
  0x10007b7d5ce0: 00 00 00 00 f1 f1 f1 f1 00 00 f2 f2 f2 f2 f2 f2
  0x10007b7d5cf0: 00 00 00 00 f3 f3 f3 f3 00 00 00 00 00 00 00 00
  0x10007b7d5d00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x10007b7d5d10: 00 00 00 00 00 00 00 00 00 00 00 00 f1 f1 f1 f1
  0x10007b7d5d20: 00 00 00 f2 f2 f2 f2 f2 00 00 00 f2 00 00 00 00
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
</:detail::scheduler_operation></:platforms::posix::scanipifaddrs></void></:function></:platforms::posix::scanipifaddrs></void></:function></:platforms::posix::scanipifaddrs></void></:function></:platforms::posix::scanipifaddrs></void></:link::controller></:thread::_invoker></:platforms::posix::scanipifaddrs></void></:function></:platforms::posix::scanipifaddrs></void></:function></:platforms::posix::scanipifaddrs></void></:function></:platforms::posix::scanipifaddrs></void></:link::controller></:tuple></:platforms::posix::scanipifaddrs></void></:function></:platforms::posix::scanipifaddrs></void></:function></:platforms::posix::scanipifaddrs></void></:function></:platforms::posix::scanipifaddrs></void></:link::controller></:tuple></:platforms::posix::scanipifaddrs></void></:function></:platforms::posix::scanipifaddrs></void></:function></:platforms::posix::scanipifaddrs></void></:link::controller></:platforms::posix::scanipifaddrs></:platforms::posix::scanipifaddrs></void></:function></:platforms::posix::scanipifaddrs></void></:function></:platforms::posix::scanipifaddrs></void></:function></:platforms::posix::scanipifaddrs></void></:link::controller></:platforms::asio::context></:platforms::posix::scanipifaddrs></void></:function></:platforms::posix::scanipifaddrs></void></:function></:platforms::posix::scanipifaddrs></void></:function></:platforms::posix::scanipifaddrs></void></:link::controller></:platforms::asio::context></:platforms::posix::scanipifaddrs></void></:function></:platforms::posix::scanipifaddrs></void></:function></:platforms::posix::scanipifaddrs></void></:function></:platforms::posix::scanipifaddrs></void></:link::controller></:platforms::posix::scanipifaddrs></:platforms::posix::scanipifaddrs></void></:function></:platforms::posix::scanipifaddrs></void></:function></:platforms::posix::scanipifaddrs></void></:function></:platforms::posix::scanipifaddrs></void></:link::controller></void></:platforms::posix::scanipifaddrs></void></:function></:platforms::posix::scanipifaddrs></void></:function></:platforms::posix::scanipifaddrs></void></:function></:platforms::posix::scanipifaddrs></void></:link::controller></:platforms::posix::scanipifaddrs></:detail::posix_mutex></:detail::scheduler_operation></:detail::scheduler_operation>

该提问来源于开源项目:Ableton/link

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答