Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ASAN is stuck when I run my code. #1819

Open
wddpfx opened this issue Nov 18, 2024 · 0 comments
Open

ASAN is stuck when I run my code. #1819

wddpfx opened this issue Nov 18, 2024 · 0 comments

Comments

@wddpfx
Copy link

wddpfx commented Nov 18, 2024

Here is the part of backtrace,And the GCC version is 9.3

[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/aarch64-linux-gnu/libthread_db.so.1".
0x0000ffff8044f044 in ?? () from /lib/aarch64-linux-gnu/libc.so.6
(gdb) bt
#0  0x0000ffff8044f044 in ?? () from /lib/aarch64-linux-gnu/libc.so.6
#1  0x0000ffff80644b70 in __asan_handle_no_return () at ../../../../src/libsanitizer/asan/asan_rtl.cc:569
#2  0x0000ffff805876c4 in __interceptor___cxa_throw (a=0xffff78e2d380, b=0xffff6f89e2a8 <typeinfo for std::system_error>, c=0xffff6f792ba0 <std::system_error::~system_error()>)
    at ../../../../src/libsanitizer/asan/asan_interceptors.cc:328
#3  0x0000ffff68aee940 in void asio::detail::throw_exception<std::system_error>(std::system_error const&) ()
   from /zeekr_plt/platform/ros/galactic/install/lib/libfastrtps.so.2.11
#4  0x0000ffff68d033c0 in asio::detail::do_throw_error(std::error_code const&, char const*) [clone .isra.0] ()
   from /zeekr_plt/platform/ros/galactic/install/lib/libfastrtps.so.2.11
#5  0x0000ffff68d07050 in eprosima::fastdds::rtps::UDPv4Transport::OpenAndBindInputSocket(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned short, bool) () from /zeekr_plt/platform/ros/galactic/install/lib/libfastrtps.so.2.11
#6  0x0000ffff68d1c16c in eprosima::fastdds::rtps::UDPTransportInterface::CreateInputChannelResource(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, eprosima::fastrtps::rtps::Locator_t const&, bool, unsigned int, eprosima::fastdds::rtps::TransportReceiverInterface*) ()
   from /zeekr_plt/platform/ros/galactic/install/lib/libfastrtps.so.2.11
#7  0x0000ffff68d20c40 in eprosima::fastdds::rtps::UDPTransportInterface::OpenAndBindInputSockets(eprosima::fastrtps::rtps::Locator_t const&, eprosima::fastdds::rtps::TransportReceiverInterface*, bool, unsigned int) () from /zeekr_plt/platform/ros/galactic/install/lib/libfastrtps.so.2.11

Asan does report nothing, And the process cannot continue, It seems to stuck at function PoisonShadow(bottom, top - bottom, 0);

void NOINLINE __asan_handle_no_return() {
  if (asan_init_is_running)
    return;

  int local_stack;
  AsanThread *curr_thread = GetCurrentThread();
  uptr PageSize = GetPageSizeCached();
  uptr top, bottom;
  if (curr_thread) {
    top = curr_thread->stack_top();
    bottom = ((uptr)&local_stack - PageSize) & ~(PageSize - 1);
  } else if (SANITIZER_RTEMS) {
    // Give up On RTEMS.
    return;
  } else {
    CHECK(!SANITIZER_FUCHSIA);
    // If we haven't seen this thread, try asking the OS for stack bounds.
    uptr tls_addr, tls_size, stack_size;
    GetThreadStackAndTls(/*main=*/false, &bottom, &stack_size, &tls_addr,
                         &tls_size);
    top = bottom + stack_size;
  }
  static const uptr kMaxExpectedCleanupSize = 64 << 20;  // 64M
  if (top - bottom > kMaxExpectedCleanupSize) {
    static bool reported_warning = false;
    if (reported_warning)
      return;
    reported_warning = true;
    Report("WARNING: ASan is ignoring requested __asan_handle_no_return: "
           "stack top: %p; bottom %p; size: %p (%zd)\n"
           "False positive error reports may follow\n"
           "For details see "
           "https://github.com/google/sanitizers/issues/189\n",
           top, bottom, top - bottom, top - bottom);
    return;
  }
  PoisonShadow(bottom, top - bottom, 0);
  if (curr_thread && curr_thread->has_fake_stack())
    curr_thread->fake_stack()->HandleNoReturn();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant