Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-49078

Suppress ThreadSanitizer: signal-unsafe call inside of a signal

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.7.0
    • Affects Version/s: None
    • Component/s: None
    • Fully Compatible
    • ALL
    • Dev Platform 2020-07-13, Dev Platform 2020-07-27
    • 0

      The printStackTrace function allocates memory and is called as part of signal handlers. ThreadSanitizer warns about any calls to malloc/free and new/delete as part of signal handling. These memory allocation calls are expected and the warning should be suppressed in etc/tsan.suppressions.

      Here is my proposed list from ad-hoc testing. The allocations are from many places: boost::log, RamLog, the backtrace code, BSONObj, json escaping, etc.

      signal:boost::log::v2s_mt_posix::aux::stateless_allocator<unsigned char>::allocate
      signal:boost::log::v2s_mt_posix::aux::stateless_allocator<unsigned char>::deallocate
      signal:boost::log::v2s_mt_posix::aux::stateless_allocator<char>::allocate
      signal:boost::log::v2s_mt_posix::aux::stateless_allocator<char>::deallocate
      signal:__gnu_cxx::new_allocator<boost::shared_ptr<boost::log::v2s_mt_posix::sinks::sink> >::allocate
      signal:__gnu_cxx::new_allocator<boost::shared_ptr<boost::log::v2s_mt_posix::sinks::sink> >::deallocate
      signal:mongo::mongoMalloc
      signal:mongo::intrusive_ptr_release
      signal:std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_assign
      signal:__gnu_cxx::new_allocator<boost::shared_ptr<boost::log::v2s_mt_posix::sinks::sink> >::deallocate
      signal:std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_mutate
      signal:mongo::mongoRealloc
      signal:__gnu_cxx::new_allocator<unsigned long>::allocate
      signal:__gnu_cxx::new_allocator<unsigned long>::deallocate
      signal:__gnu_cxx::new_allocator<mongo::BSONElement>::allocate
      signal:__gnu_cxx::new_allocator<mongo::BSONElement>::deallocate
      signal:__gnu_cxx::new_allocator<char>::allocate
      signal:__gnu_cxx::new_allocator<char>::deallocate
      signal:mongo::logv2::(anonymous namespace)::JSONValueExtractor::storeUnquoted
      signal:mongo::StackTraceAddressMetadata::BaseAndName::~BaseAndName
      signal:mongo::stack_trace_detail::(anonymous namespace)::printStackTraceImpl
      

            Assignee:
            andrew.morrow@mongodb.com Andrew Morrow (Inactive)
            Reporter:
            mark.benvenuto@mongodb.com Mark Benvenuto
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: