diff options
author | Tor Brede Vekterli <vekterli@yahooinc.com> | 2022-06-01 13:09:14 +0000 |
---|---|---|
committer | Tor Brede Vekterli <vekterli@yahooinc.com> | 2022-06-01 13:09:14 +0000 |
commit | 5efb33111dc1b225996535a124e84f95ef3059ec (patch) | |
tree | 3badaf26e396d5237de7e02326c261ffc9b10c14 /vespalib | |
parent | 3de3834cd05b2f70147ef74794602b435130c42c (diff) |
Really, really, really don't inline the backtrace-test function
Diffstat (limited to 'vespalib')
-rw-r--r-- | vespalib/src/tests/signalhandler/my_shared_library.cpp | 1 | ||||
-rw-r--r-- | vespalib/src/vespa/vespalib/util/signalhandler.cpp | 2 |
2 files changed, 2 insertions, 1 deletions
diff --git a/vespalib/src/tests/signalhandler/my_shared_library.cpp b/vespalib/src/tests/signalhandler/my_shared_library.cpp index 5663f6c4ba0..4b7593d863c 100644 --- a/vespalib/src/tests/signalhandler/my_shared_library.cpp +++ b/vespalib/src/tests/signalhandler/my_shared_library.cpp @@ -12,6 +12,7 @@ void my_cool_function(std::latch& arrival_latch, std::latch& departure_latch) { arrival_latch.arrive_and_wait(); // Twiddle thumbs in departure latch until main test thread has dumped our stack departure_latch.arrive_and_wait(); + asm(""); // Dear GCC; really, really don't inline this function. It's clobberin' time! } vespalib::string my_totally_tubular_and_groovy_function() { diff --git a/vespalib/src/vespa/vespalib/util/signalhandler.cpp b/vespalib/src/vespa/vespalib/util/signalhandler.cpp index fe74267d4be..b00fe1718c9 100644 --- a/vespalib/src/vespa/vespalib/util/signalhandler.cpp +++ b/vespalib/src/vespa/vespalib/util/signalhandler.cpp @@ -190,7 +190,7 @@ SignalHandler::get_cross_thread_stack_trace(pthread_t thread_id) } // This will only work with pthreads, but then again, so will Vespa. if (thread_id == pthread_self()) { - return vespalib::getStackTrace(3); // Skip getStackTrace() internals + this function's frame. + return vespalib::getStackTrace(1); // Skip this function's frame. } static std::mutex stack_dump_caller_mutex; |