DataDog / dd-trace-php

Datadog PHP Clients
https://docs.datadoghq.com/tracing/setup/php
Other
501 stars 155 forks source link

Fix use-after-free in exception replay #2947

Closed bwoebi closed 1 week ago

bwoebi commented 1 week ago

Depending on where the exception originates, a span may have been part of it and be freed during serialization. Immediately send to avoid dangling pointers.

codecov-commenter commented 1 week ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 72.21%. Comparing base (e2b0a15) to head (495a98d).

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/DataDog/dd-trace-php/pull/2947/graphs/tree.svg?width=650&height=150&src=pr&token=eXio8H7vwF&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DataDog)](https://app.codecov.io/gh/DataDog/dd-trace-php/pull/2947?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DataDog) ```diff @@ Coverage Diff @@ ## master #2947 +/- ## ============================================ - Coverage 73.62% 72.21% -1.42% Complexity 2529 2529 ============================================ Files 109 136 +27 Lines 10410 14452 +4042 Branches 0 991 +991 ============================================ + Hits 7664 10436 +2772 - Misses 2746 3472 +726 - Partials 0 544 +544 ``` | [Flag](https://app.codecov.io/gh/DataDog/dd-trace-php/pull/2947/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DataDog) | Coverage Δ | | |---|---|---| | [appsec-extension](https://app.codecov.io/gh/DataDog/dd-trace-php/pull/2947/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DataDog) | `68.57% <ø> (?)` | | | [tracer-php](https://app.codecov.io/gh/DataDog/dd-trace-php/pull/2947/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DataDog) | `73.62% <ø> (ø)` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DataDog#carryforward-flags-in-the-pull-request-comment) to find out more. [see 27 files with indirect coverage changes](https://app.codecov.io/gh/DataDog/dd-trace-php/pull/2947/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DataDog) ------ [Continue to review full report in Codecov by Sentry](https://app.codecov.io/gh/DataDog/dd-trace-php/pull/2947?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DataDog). > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DataDog) > `Δ = absolute (impact)`, `ø = not affected`, `? = missing data` > Powered by [Codecov](https://app.codecov.io/gh/DataDog/dd-trace-php/pull/2947?dropdown=coverage&src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DataDog). Last update [e2b0a15...495a98d](https://app.codecov.io/gh/DataDog/dd-trace-php/pull/2947?dropdown=coverage&src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DataDog). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DataDog).
pr-commenter[bot] commented 1 week ago

Benchmarks [ tracer ]

Benchmark execution time: 2024-11-13 13:46:56

Comparing candidate commit 495a98d70f15b96a7d9651e33261ca9e56a596a7 in PR branch bob/exception-debugger-uaf with baseline commit e2b0a15abbf03bc042f4fdd732e36fde8cdf0fd3 in branch master.

Found 1 performance improvements and 0 performance regressions! Performance is the same for 177 metrics, 0 unstable metrics.

scenario:TraceSerializationBench/benchSerializeTrace