StackOverflow in the Symbolizer Due to Singleton on Threads Where Singletons Aren't Allowed |
|||
Issue descriptionCaught when writing https://codereview.chromium.org/2213933003/. Looks like on OS_LINUX (and I repro'ed locally in both Debug/Release), the AssertSingletonAllowed call in TaskSchedulerTaskTrackerTest.SingletonAllowed for CONTINUE_ON_SHUTDOWN [1] crashes instead of hitting the DCHECK. More weird things: 1) Replacing the checks and enforcement to use IOAllowed instead (https://codereview.chromium.org/2215193003) passes... but IOAllowed and SingletonAllowed use the exact same logic...?! 2) The crash is very mysterious... to debug I removed EXPECT_DCHECK_DEATH (let the statement run free of gtest wrappers to catch full output), it indeed crashes without logging NOTREACHED(), and if adding a LOG(ERROR) right before the NOTREACHED() in AssertSingletonAllowed(), the log message spams the console for *many* repeated lines before the crash (but without the NOTREACHED() the log only appears once as expected...)?! And these are all static calls using TLS so even if there were somehow other callers not owned by TaskTracker in the scope of this unittest, it shouldn't matter..?! Disabling that death test on Linux for now as I'm utterly clueless... [1] ContinueOnShutdown/TaskSchedulerTaskTrackerTest.SingletonAllowed/0
,
Aug 5 2016
Note: if we can't figure it out we could at least re-enable as an EXPECT_DEATH instead of EXPECT_DCHECK_DEATH on OS_LINUX... but I'd like use to dig to the bottom of that one.
,
Aug 5 2016
Definitely a stack overflow. Ironically, we die trying to output the stack. The symbolizer references a singleton, which isn't allowed on this thread. That assert fails and triggers another output request to the symbolizer. Rinse and repeat. #17 in base::ThreadRestrictions::AssertSingletonAllowed () at ../../base/threading/thread_restrictions.cc:57 #18 in base::Singleton<base::debug::SandboxSymbolizeHelper, base::DefaultSingletonTraits<base::debug::SandboxSymbolizeHelper>, base::debug::SandboxSymbolizeHelper>::get () at ../../base/memory/singleton.h:234 #19 in base::debug::SandboxSymbolizeHelper::GetInstance () at ../../base/debug/stack_trace_posix.cc:464 #20 in base::debug::SandboxSymbolizeHelper::OpenObjectFileContainingPc () at ../../base/debug/stack_trace_posix.cc:536 #21 in google::SymbolizeAndDemangle () at ../../base/third_party/symbolize/symbolize.cc:762 #22 in google::Symbolize () at ../../base/third_party/symbolize/symbolize.cc:849 #23 in base::debug::() at ../../base/debug/stack_trace_posix.cc:169 #24 in base::debug::StackTrace::OutputToStream () at ../../base/debug/stack_trace_posix.cc:742 #25 in logging::LogMessage::~LogMessage () at ../../base/logging.cc:534 #26 in base::ThreadRestrictions::AssertSingletonAllowed () at ../../base/threading/thread_restrictions.cc:57 #27 in base::Singleton<base::debug::SandboxSymbolizeHelper, base::DefaultSingletonTraits<base::debug::SandboxSymbolizeHelper>, base::debug::SandboxSymbolizeHelper>::get () at ../../base/memory/singleton.h:234 #28 in base::debug::SandboxSymbolizeHelper::GetInstance () at ../../base/debug/stack_trace_posix.cc:464 #29 in base::debug::SandboxSymbolizeHelper::OpenObjectFileContainingPc () at ../../base/debug/stack_trace_posix.cc:536 #30 in google::SymbolizeAndDemangle () at ../../base/third_party/symbolize/symbolize.cc:762 #31 in google::Symbolize () at ../../base/third_party/symbolize/symbolize.cc:849 #32 in base::debug::() at ../../base/debug/stack_trace_posix.cc:169 #33 in base::debug::StackTrace::OutputToStream () at ../../base/debug/stack_trace_posix.cc:742 #34 in logging::LogMessage::~LogMessage () at ../../base/logging.cc:534 #35 in base::ThreadRestrictions::AssertSingletonAllowed () at ../../base/threading/thread_restrictions.cc:57 #36 in base::Singleton<base::debug::SandboxSymbolizeHelper, base::DefaultSingletonTraits<base::debug::SandboxSymbolizeHelper>, base::debug::SandboxSymbolizeHelper>::get () at ../../base/memory/singleton.h:234 #37 in base::debug::SandboxSymbolizeHelper::GetInstance () at ../../base/debug/stack_trace_posix.cc:464 #38 in base::debug::SandboxSymbolizeHelper::OpenObjectFileContainingPc () at ../../base/debug/stack_trace_posix.cc:536 #39 in google::SymbolizeAndDemangle () at ../../base/third_party/symbolize/symbolize.cc:762 #40 in google::Symbolize () at ../../base/third_party/symbolize/symbolize.cc:849 #41 in base::debug::() at ../../base/debug/stack_trace_posix.cc:169 #42 in base::debug::StackTrace::OutputToStream () at ../../base/debug/stack_trace_posix.cc:742 #43 in logging::LogMessage::~LogMessage () at ../../base/logging.cc:534 #44 in base::ThreadRestrictions::AssertSingletonAllowed () at ../../base/threading/thread_restrictions.cc:57 [...] #19313 in base::ThreadRestrictions::AssertSingletonAllowed () at ../../base/threading/thread_restrictions.cc:57 #19314 in base::Singleton<base::debug::SandboxSymbolizeHelper, base::DefaultSingletonTraits<base::debug::SandboxSymbolizeHelper>, base::debug::SandboxSymbolizeHelper>::get () at ../../base/memory/singleton.h:234 #19315 in base::debug::SandboxSymbolizeHelper::GetInstance () at ../../base/debug/stack_trace_posix.cc:464 #19316 in base::debug::SandboxSymbolizeHelper::OpenObjectFileContainingPc () at ../../base/debug/stack_trace_posix.cc:536 #19317 in google::SymbolizeAndDemangle () at ../../base/third_party/symbolize/symbolize.cc:762 #19318 in google::Symbolize () at ../../base/third_party/symbolize/symbolize.cc:849 #19319 in base::debug::() at ../../base/debug/stack_trace_posix.cc:169 #19320 in base::debug::StackTrace::OutputToStream () at ../../base/debug/stack_trace_posix.cc:742 #19321 in logging::LogMessage::~LogMessage () at ../../base/logging.cc:534 #19322 in base::ThreadRestrictions::AssertSingletonAllowed () at ../../base/threading/thread_restrictions.cc:57 #19323 in base::internal::FunctorTraits<void () at ../../base/bind_internal.h:164 #19324 in base::internal::InvokeHelper<false, void>::MakeItSo<void () at ../../base/bind_internal.h:283 #19325 in base::internal::Invoker<base::internal::BindState<void () at ../../base/bind_internal.h:346 #19326 in base::internal::Invoker<base::internal::BindState<void () at ../../base/bind_internal.h:324 #19327 in base::Callback<void () at ../../base/callback.h:389 #19328 in base::debug::TaskAnnotator::RunTask () at ../../base/debug/task_annotator.cc:51 #19329 in base::internal::TaskTracker::RunNextTaskInSequence () at ../../base/task_scheduler/task_tracker.cc:220 #19330 in base::internal::TaskSchedulerTaskTrackerTest_SingletonAllowed_Test::TestBody () at ../../base/task_scheduler/task_tracker_unittest.cc:385 #19331 in testing::internal::HandleSehExceptionsInMethodIfSupported<testing::Test, void> () at ../../testing/gtest/src/gtest.cc:2402 #19332 in testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void> () at ../../testing/gtest/src/gtest.cc:2455
,
Aug 9 2016
,
Aug 9 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/63f454db7093f1f578fc04632c5f5423eba14cd3 commit 63f454db7093f1f578fc04632c5f5423eba14cd3 Author: robliao <robliao@chromium.org> Date: Tue Aug 09 20:17:47 2016 Make the SandboxSymbolizeHelper Singleton Leaky and Enable Impacted Test If the SandboxSymbolizeHelper Singleton is obtained on a non-joinable thread, that singleton itself will assert and attempt to symbolize the current stack, resulting in another request to get the SandboxSymbolizeHelper Singleton, ultimately resulting in a stack overflow. Since the symbolizer is expected to last the entire process, it can be leaky. TaskSchedulerTaskTrackerTest SingletonAllowed Tests on POSIX can be run after this fix, so it's enabled here as well. BUG= 634552 Review-Url: https://codereview.chromium.org/2221063004 Cr-Commit-Position: refs/heads/master@{#410792} [modify] https://crrev.com/63f454db7093f1f578fc04632c5f5423eba14cd3/base/debug/stack_trace_posix.cc [modify] https://crrev.com/63f454db7093f1f578fc04632c5f5423eba14cd3/base/task_scheduler/task_tracker_unittest.cc
,
Aug 10 2016
|
|||
►
Sign in to add a comment |
|||
Comment 1 by bugdroid1@chromium.org
, Aug 5 2016