From 29d3553cca2cfca3238e2d675a0cedca03528509 Mon Sep 17 00:00:00 2001 From: Misha Shneerson Date: Fri, 24 Jul 2015 11:57:21 -0700 Subject: [PATCH] Print type of singleton that is requested after destruction Summary: As titled Trying to troubleshoot shutdown problems in HHVM and I see: EventBase::runAfterDelay() callback threw St13runtime_error exception: Raw pointer to a singleton requested after its destruction. Would be much easier to troubleshoot if I know what is it being requested. Reviewed By: @chipturner Differential Revision: D2274497 --- folly/Singleton-inl.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/folly/Singleton-inl.h b/folly/Singleton-inl.h index 6bc43ad2..3848ab44 100644 --- a/folly/Singleton-inl.h +++ b/folly/Singleton-inl.h @@ -64,7 +64,9 @@ T* SingletonHolder::get() { if (instance_weak_.expired()) { throw std::runtime_error( - "Raw pointer to a singleton requested after its destruction."); + "Raw pointer to a singleton requested after its destruction." + " Singleton type is: " + + type_.name()); } return instance_ptr_; -- 2.34.1