Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix exception profiling in Generator->throw() #2682

Merged
merged 1 commit into from
May 31, 2024

Conversation

bwoebi
Copy link
Collaborator

@bwoebi bwoebi commented May 31, 2024

The prev_execute_frame of fake frame of the generator is not fixed up when throwing. Only when executing afterwards.

SCP-456

@bwoebi bwoebi requested review from a team as code owners May 31, 2024 08:39
@pr-commenter
Copy link

pr-commenter bot commented May 31, 2024

Benchmarks

Benchmark execution time: 2024-05-31 09:49:24

Comparing candidate commit b981d5c in PR branch bob/fix-exception-generator with baseline commit b1438ba in branch master.

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

scenario:HookBench/benchWithoutHook-opcache

  • 🟩 mem_peak [-212.596KB; -64.524KB] or [-10.006%; -3.037%]

scenario:MessagePackSerializationBench/benchMessagePackSerialization

  • 🟩 execution_time [-7.991µs; -5.069µs] or [-5.270%; -3.343%]

scenario:MessagePackSerializationBench/benchMessagePackSerialization-opcache

  • 🟩 execution_time [-5.664µs; -3.596µs] or [-3.790%; -2.406%]

scenario:PDOBench/benchPDOBaseline

  • 🟥 execution_time [+13.946µs; +14.762µs] or [+7.962%; +8.428%]

scenario:PDOBench/benchPDOBaseline-opcache

  • 🟥 execution_time [+17.510µs; +18.582µs] or [+10.093%; +10.711%]

scenario:PDOBench/benchPDOOverhead

  • 🟥 execution_time [+12.533µs; +16.573µs] or [+4.617%; +6.106%]

@codecov-commenter
Copy link

codecov-commenter commented May 31, 2024

Codecov Report

Attention: Patch coverage is 54.54545% with 5 lines in your changes are missing coverage. Please review.

Project coverage is 76.08%. Comparing base (b1438ba) to head (b981d5c).

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #2682      +/-   ##
============================================
- Coverage     79.36%   76.08%   -3.28%     
  Complexity     2223     2223              
============================================
  Files           200      226      +26     
  Lines         22322    26347    +4025     
  Branches          0      988     +988     
============================================
+ Hits          17715    20046    +2331     
- Misses         4607     5775    +1168     
- Partials          0      526     +526     
Flag Coverage Δ
appsec-extension 69.13% <ø> (?)
tracer-extension 78.65% <54.54%> (-0.03%) ⬇️
tracer-php 75.46% <ø> (-4.88%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
ext/handlers_api.c 64.28% <54.54%> (-35.72%) ⬇️

... and 39 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b1438ba...b981d5c. Read the comment docs.

@bwoebi bwoebi force-pushed the bob/fix-exception-generator branch 3 times, most recently from 7e21253 to b3abc96 Compare May 31, 2024 09:04
Signed-off-by: Bob Weinand <bob.weinand@datadoghq.com>
@bwoebi bwoebi force-pushed the bob/fix-exception-generator branch from b3abc96 to b981d5c Compare May 31, 2024 09:21
@morrisonlevi
Copy link
Collaborator

As discussed in Slack, Bob was able to find a reproducer for this crash in pure PHP (our extension isn't needed) and opened an upstream issue: Crash when stack walking in destructor of yielded from values during Generator->throw()

@morrisonlevi morrisonlevi added 🐛 bug Something isn't working cat:app-crash profiling Relates to the Continuous Profiler labels May 31, 2024
@morrisonlevi morrisonlevi added this to the 1.0.0 milestone May 31, 2024
Copy link
Member

@realFlowControl realFlowControl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome work 🎉

@bwoebi bwoebi merged commit 92560fa into master May 31, 2024
636 of 639 checks passed
@bwoebi bwoebi deleted the bob/fix-exception-generator branch May 31, 2024 13:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working cat:app-crash profiling Relates to the Continuous Profiler
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants