Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

prevent explosions when stopping while paused

Breakpoint 1, CpuProfiler::DisableHandler (this=0x7fa1ce890ce0) at src/profiler.cc:271
271   RAW_CHECK(prof_handler_token_ != NULL, "SIGPROF handler is not registered");
Current language:  auto; currently c++

Program received signal SIGABRT, Aborted.
0x00007fa1d7df9ed5 in raise () from /lib/libc.so.6
(gdb) where
 #0  0x00007fa1d7df9ed5 in raise () from /lib/libc.so.6
 #1  0x00007fa1d7dfb3f3 in abort () from /lib/libc.so.6
 #2  0x00007fa1ce685634 in CpuProfiler::DisableHandler (this=0x7fa1ce890ce0) at src/profiler.cc:271
 #3  0x00007fa1ce6859b0 in CpuProfiler::Stop (this=0x7fa1ce890ce0) at src/profiler.cc:209
 #4  0x00007fa1ce685a2a in ~CpuProfiler (this=0x7fa1ce890ce0) at src/profiler.cc:196
 #5  0x00007fa1d7dfc9cd in exit () from /lib/libc.so.6
 #6  0x0000000000425310 in ruby_stop (ex=<value optimized out>) at eval.c:1689
 #7  0x000000000042dcd1 in ruby_run () at eval.c:1710
 #8  0x0000000000412063 in main (argc=9, argv=0x7fff08f9b6e8, envp=<value optimized out>) at main.c:48
  • Loading branch information...
commit f39c7c90a4c44ffc68576c3eb58a5f7f778d02bc 1 parent 06099e7
@tmm1 authored
Showing with 16 additions and 0 deletions.
  1. +16 −0 patches/perftools-pause.patch
View
16 patches/perftools-pause.patch
@@ -40,3 +40,19 @@ index 2f1af06..7c404c3 100644
extern "C" PERFTOOLS_DLL_DECL void ProfilerGetCurrentState(
ProfilerState* state) {
CpuProfiler::instance_.GetCurrentState(state);
+diff --git a/src/profiler.cc b/src/profiler.cc
+index 7c404c3..735a885 100644
+--- a/src/profiler.cc
++++ b/src/profiler.cc
+@@ -268,8 +268,9 @@ void CpuProfiler::EnableHandler() {
+ }
+
+ void CpuProfiler::DisableHandler() {
+- RAW_CHECK(prof_handler_token_ != NULL, "SIGPROF handler is not registered");
+- ProfileHandlerUnregisterCallback(prof_handler_token_);
++ //RAW_CHECK(prof_handler_token_ != NULL, "SIGPROF handler is not registered");
++ if (prof_handler_token_ != NULL)
++ ProfileHandlerUnregisterCallback(prof_handler_token_);
+ prof_handler_token_ = NULL;
+ }
+
Please sign in to comment.
Something went wrong with that request. Please try again.