Skip to content

Conversation

@bwoebi
Copy link
Collaborator

@bwoebi bwoebi commented Jan 21, 2026

They don't check EG(vm_interrupt) by design, so we manually handle this.

@bwoebi bwoebi force-pushed the bob/prof-flf-test branch from 1976c3c to 222e3a4 Compare January 21, 2026 17:19
@datadog-datadog-prod-us1
Copy link

datadog-datadog-prod-us1 bot commented Jan 21, 2026

⚠️ Tests

Fix all issues with Cursor

⚠️ Warnings

❄️ 1 New flaky test detected

ext/gd/tests/bug77272.phpt (Bug #77272 (imagescale() may return image resource on failure)) from php.ext.gd.tests (Datadog) (Fix with Cursor)
002-  in %s on line %d
003- bool(false)
001+ Killed
002+ 
003+ Termsig=9

🧪 1024 Tests failed

    testSearchPhpBinaries from integration.DDTrace\Tests\Integration\PHPInstallerTest (Fix with Cursor)

    testSimplePushAndProcess from laravel-58-test.DDTrace\Tests\Integrations\Laravel\V5_8\QueueTest (Fix with Cursor)

testSimplePushAndProcess from laravel-8x-test.DDTrace\Tests\Integrations\Laravel\V8_x\QueueTest (Datadog) (Fix with Cursor)
DDTrace\Tests\Integrations\Laravel\V8_x\QueueTest::testSimplePushAndProcess
Test code or tested code printed unexpected output: spanLinksTraceId: 6973525c000000004d5565ab599608c4
tid: 6973525c00000000
hexProcessTraceId: 4d5565ab599608c4
hexProcessSpanId: ead63bed90829e17
processTraceId: 5572471900557674692
processSpanId: 16921778541408984599
View all
This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 2f81b3a | Docs | Datadog PR Page | Was this helpful? Give us feedback!

@codecov-commenter
Copy link

codecov-commenter commented Jan 21, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 62.00%. Comparing base (4df27be) to head (2f81b3a).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3595      +/-   ##
==========================================
- Coverage   62.01%   62.00%   -0.02%     
==========================================
  Files         140      140              
  Lines       13312    13312              
  Branches     1762     1762              
==========================================
- Hits         8256     8254       -2     
- Misses       4267     4270       +3     
+ Partials      789      788       -1     

see 1 file 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 4df27be...2f81b3a. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Collaborator

@morrisonlevi morrisonlevi left a comment

Choose a reason for hiding this comment

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

I assume this can run afoul of permissions somehow, since we're making executable code at runtime? I'm not well versed here, and yes, if the JIT is enabled you'd have to have that capability anyway, but I'm trying to understand implications of this WIP.

@pr-commenter
Copy link

pr-commenter bot commented Jan 21, 2026

Benchmarks [ profiler ]

Benchmark execution time: 2026-01-23 10:57:23

Comparing candidate commit 2f81b3a in PR branch bob/prof-flf-test with baseline commit 4df27be in branch master.

Found 0 performance improvements and 2 performance regressions! Performance is the same for 27 metrics, 7 unstable metrics.

scenario:php-profiler-timeline-memory-control

  • 🟥 cpu_user_time [+27.300ms; +40.564ms] or [+4.460%; +6.627%]
  • 🟥 execution_time [+33.796ms; +38.388ms] or [+5.296%; +6.016%]

Signed-off-by: Bob Weinand <bob.weinand@datadoghq.com>
@bwoebi bwoebi force-pushed the bob/prof-flf-test branch from 222e3a4 to 0eb96ee Compare January 21, 2026 17:52
Signed-off-by: Bob Weinand <bob.weinand@datadoghq.com>
@bwoebi bwoebi force-pushed the bob/prof-flf-test branch from dc825a7 to c6bdefc Compare January 21, 2026 18:06
@bwoebi
Copy link
Collaborator Author

bwoebi commented Jan 21, 2026

@morrisonlevi dynasmrt takes care of setting RX permissions after compiling the code. As long as you're not running this under a hardened runtime (like app store apps or android (?)), there's no fundamental problem. Also I currently call assembler.finalize().unwrap() (which takes care of settign RX) - proper usage should just handle the potential error here and abort.

@bwoebi bwoebi force-pushed the bob/prof-flf-test branch from 95f422a to 7471599 Compare January 21, 2026 18:17
Signed-off-by: Bob Weinand <bob.weinand@datadoghq.com>
@bwoebi bwoebi force-pushed the bob/prof-flf-test branch from 7471599 to 4358ab8 Compare January 21, 2026 18:24
dynasm!(assembler
; mov rax, QWORD original as i64
; call rax
; mov rax, QWORD interrupt_addr as i64
Copy link
Contributor

Choose a reason for hiding this comment

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

I assume original is not returning anything, because you're writing over RAX.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Correct

#[cfg(target_arch = "aarch64")]
dynasm!(assembler
; mov x16, original as u64
; blr x16
Copy link
Contributor

Choose a reason for hiding this comment

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

this overwrites x30/lr, aren't you gonna lose the original return location of the handler? so when br x16 returns, it goes back to calling interrupt_addr

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ah, right. call on x86_64 pushes %eip to the stack, but blr doesn't.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed up, is it correct now?

Signed-off-by: Bob Weinand <bob.weinand@datadoghq.com>
);
#[cfg(target_arch = "x86_64")]
dynasm!(assembler
; mov rax, QWORD *orig as i64
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you also need a sub rsp, 8 to align the stack to 16 bytes and satisfy the abi requirements

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Right, compilers often handle that by just pushing rbp anyway. Will do.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I need to actually push and pop to restore rsp too, for the final jump.

@bwoebi bwoebi force-pushed the bob/prof-flf-test branch from a3c79dc to 078acef Compare January 21, 2026 19:34
Signed-off-by: Bob Weinand <bob.weinand@datadoghq.com>
@bwoebi bwoebi force-pushed the bob/prof-flf-test branch 2 times, most recently from e4930fe to 2604b22 Compare January 21, 2026 19:35
Signed-off-by: Bob Weinand <bob.weinand@datadoghq.com>
@bwoebi bwoebi force-pushed the bob/prof-flf-test branch from 2604b22 to 6307860 Compare January 21, 2026 19:38
Signed-off-by: Bob Weinand <bob.weinand@datadoghq.com>
@bwoebi bwoebi force-pushed the bob/prof-flf-test branch from a246940 to bcebfb0 Compare January 21, 2026 20:37
Signed-off-by: Bob Weinand <bob.weinand@datadoghq.com>
Signed-off-by: Bob Weinand <bob.weinand@datadoghq.com>
Signed-off-by: Bob Weinand <bob.weinand@datadoghq.com>
@bwoebi bwoebi force-pushed the bob/prof-flf-test branch from b0995bc to d9d3f43 Compare January 22, 2026 13:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants