File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -169,23 +169,23 @@ void ddtrace_signals_first_rinit(void) {
169169 return ;
170170 }
171171
172- bool crashtracker_installed = false;
173- if (get_DD_INSTRUMENTATION_TELEMETRY_ENABLED () && get_DD_CRASHTRACKING_ENABLED ()) {
174- crashtracker_installed = true;
175- ddtrace_init_crashtracker ();
176- }
172+ bool install_crashtracker = get_DD_INSTRUMENTATION_TELEMETRY_ENABLED () && get_DD_CRASHTRACKING_ENABLED ();
177173
178- bool install_handler = get_DD_TRACE_HEALTH_METRICS_ENABLED ();
174+ bool install_backtrace_handler = get_DD_TRACE_HEALTH_METRICS_ENABLED ();
179175#if DDTRACE_HAVE_BACKTRACE
180- install_handler |= get_DD_LOG_BACKTRACE ();
176+ install_backtrace_handler |= get_DD_LOG_BACKTRACE ();
181177#endif
182178
179+ if (install_crashtracker ) {
180+ ddtrace_init_crashtracker ();
181+ }
182+
183183 /* Install a signal handler for SIGSEGV and run it on an alternate stack.
184184 * Using an alternate stack allows the handler to run even when the main
185185 * stack overflows.
186186 */
187- if (install_handler ) {
188- if (crashtracker_installed ) {
187+ if (install_backtrace_handler ) {
188+ if (install_crashtracker ) {
189189 LOG (WARN , "Settings 'datadog.log_backtrace' and 'datadog.crashtracking_enabled' are mutually exclusive. Cannot enable the backtrace." );
190190 return ;
191191 }
Original file line number Diff line number Diff line change 11--TEST--
2- Send crashtracker report when segmentation fault signal is raised and config enables it
2+ Don't send crashtracker report when segmentation fault signal is raised and config disables it
33--SKIPIF--
44<?php
55if (!extension_loaded ('posix ' )) die ('skip: posix extension required ' );
@@ -15,7 +15,7 @@ DD_AGENT_HOST=request-replayer
1515DD_TRACE_AGENT_PORT=80
1616DD_CRASHTRACKING_ENABLED=0
1717--INI--
18- datadog.trace.agent_test_session_token=tests/ext/crashtracker_segfault .phpt
18+ datadog.trace.agent_test_session_token=tests/ext/crashtracker_segfault_disabled .phpt
1919--FILE--
2020<?php
2121
You can’t perform that action at this time.
0 commit comments