Skip to content

Commit

Permalink
Enable use_alt_stack setting for crashtracker
Browse files Browse the repository at this point in the history
I spent some time looking into `use_alt_stack` setting and I think
there's a bug in libdatadog and that setting doesn't seem to be doing
anything at this point.

Since the Ruby VM itself sets an altstack, this leaves us:

* In libdatadog 13.1, the crashtracker code always used the altstack
  (e.g. equivalent of `use_alt_stack` was hardcoded to `true`)
  => in libdatadog 13.1 we used the Ruby altstack
* In libdatadog 14.0, the crashtracker code chooses to use the altstack
  based on the value of `create_alt_stack` => libdatadog 14.0 we can't
  use the Ruby altstack

In preparation for `use_alt_stack` to get fixed in a future libdatadog
release, I'm changing it to true although, right now it's a no-op.

This means that in a future libdatadog release, we'll be back to where
we were in libdatadog 13.1: the crashtracker DOES NOT create its
own altstack, BUT WILL USE the existing Ruby altstack.
  • Loading branch information
ivoanjo committed Nov 6, 2024
1 parent 6c6a7ae commit ddbbbcb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ext/libdatadog_api/crashtracker.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ static VALUE _native_start_or_update_on_fork(int argc, VALUE *argv, DDTRACE_UNUS
// The Ruby crash handler also seems to get confused when this option is enabled and
// "Process.kill('SEGV', Process.pid)" gets run.
.create_alt_stack = false,
.use_alt_stack = false,
.use_alt_stack = true, // NOTE: This is a no-op in libdatadog 14.0; should be fixed in a future version
.endpoint = endpoint,
.resolve_frames = DDOG_CRASHT_STACKTRACE_COLLECTION_ENABLED_WITH_SYMBOLS_IN_RECEIVER,
.timeout_ms = FIX2INT(upload_timeout_seconds) * 1000,
Expand Down

0 comments on commit ddbbbcb

Please sign in to comment.