DataDog / dd-trace-php

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

Ensure DDTRACE_G(active_stack) is always NULL when the root span is being pushed #2701

Closed bwoebi closed 3 months ago

bwoebi commented 3 months ago

I have zero idea how this happened, given that I'm unable to reproduce it, but a core dump indicated that the memory it pointed to was from the previous request. While this is not a very proper fix (as this should not be possible in the first place), it mitigates the effects.

So, better a mitigation than a crash... :-)

codecov-commenter commented 3 months ago

Codecov Report

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

Project coverage is 77.96%. Comparing base (c5f2dcb) to head (4157bd2). Report is 1 commits behind head on master.

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/DataDog/dd-trace-php/pull/2701/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/2701?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DataDog) ```diff @@ Coverage Diff @@ ## master #2701 +/- ## ========================================= Coverage 77.96% 77.96% Complexity 2212 2212 ========================================= Files 227 227 Lines 26551 26552 +1 Branches 988 988 ========================================= + Hits 20701 20702 +1 Misses 5324 5324 Partials 526 526 ``` | [Flag](https://app.codecov.io/gh/DataDog/dd-trace-php/pull/2701/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/2701/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DataDog) | `69.13% <ø> (ø)` | | | [tracer-extension](https://app.codecov.io/gh/DataDog/dd-trace-php/pull/2701/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DataDog) | `78.86% <100.00%> (+<0.01%)` | :arrow_up: | | [tracer-php](https://app.codecov.io/gh/DataDog/dd-trace-php/pull/2701/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DataDog) | `80.52% <ø> (ø)` | | 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. | [Files](https://app.codecov.io/gh/DataDog/dd-trace-php/pull/2701?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DataDog) | Coverage Δ | | |---|---|---| | [ext/ddtrace.c](https://app.codecov.io/gh/DataDog/dd-trace-php/pull/2701?src=pr&el=tree&filepath=ext%2Fddtrace.c&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DataDog#diff-ZXh0L2RkdHJhY2UuYw==) | `74.38% <100.00%> (+0.01%)` | :arrow_up: | ------ [Continue to review full report in Codecov by Sentry](https://app.codecov.io/gh/DataDog/dd-trace-php/pull/2701?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/2701?dropdown=coverage&src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DataDog). Last update [c5f2dcb...4157bd2](https://app.codecov.io/gh/DataDog/dd-trace-php/pull/2701?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 3 months ago

Benchmarks

Benchmark execution time: 2024-06-10 11:28:42

Comparing candidate commit 4157bd27b36b8d8284017781bd00ee988e63ffa4 in PR branch bob/safety-stack with baseline commit c5f2dcb3faec360227837310221040ce6208e082 in branch master.

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

scenario:LaravelBench/benchLaravelOverhead

scenario:PDOBench/benchPDOBaseline

scenario:PDOBench/benchPDOOverhead

scenario:PDOBench/benchPDOOverheadWithDBM