Skip to content

Conversation

@realFlowControl
Copy link
Member

Description

A crash report ...

0x55af66530fbf _zend_mm_alloc
0x7fe72dea8401 alloc_prof_orig_alloc (/go/src/github.com/DataDog/apm-reliability/dd-trace-php/profiling/src/allocation/allocation_le83.rs:379)
0x7fe72dea82de alloc_prof_malloc (/go/src/github.com/DataDog/apm-reliability/dd-trace-php/profiling/src/allocation/allocation_le83.rs:350)
0x55af6654bcc5 zend_register_constant
0x7fe72dea7635 execute_internal (/go/src/github.com/DataDog/apm-reliability/dd-trace-php/profiling/src/wall_time.rs:79)
0x55af665cd353 zend_execute
0x55af6655d2c8 zend_execute_scripts
0x55af664f79ae php_execute_script
0x7fe732896305 __libc_start_main
0x55af66248c61 _start

... indicated that _zend_mm_alloc was being called with an invalid heap pointer. This invalid pointer originated from the call to zend::zend_mm_get_heap() within alloc_prof_orig_alloc which is weird and can only mean that "something" changed the current heap via zend_mm_set_heap() after we installed our hooks in RINIT to something invalid, but I could not find any other extension that are known for these kind of things in the crash report.

So: In the end it is the right thing to call the heap that we registered with.

Reviewer checklist

  • Test coverage seems ok.
  • Appropriate labels assigned.

A crash report indicated that `_zend_mm_alloc` was being called with an invalid heap pointer
This invalid pointer originated from the call to `zend::zend_mm_get_heap()` within `alloc_prof_orig_alloc`.
@github-actions github-actions bot added profiling Relates to the Continuous Profiler tracing labels Dec 23, 2025
@codecov-commenter
Copy link

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 61.64%. Comparing base (0994638) to head (61be8bf).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3547      +/-   ##
==========================================
- Coverage   61.74%   61.64%   -0.11%     
==========================================
  Files         143      143              
  Lines       13045    13045              
  Branches     1704     1704              
==========================================
- Hits         8055     8041      -14     
- Misses       4228     4241      +13     
- Partials      762      763       +1     

see 3 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 0994638...61be8bf. 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.

@pr-commenter
Copy link

pr-commenter bot commented Dec 23, 2025

Benchmarks [ profiler ]

Benchmark execution time: 2025-12-23 16:11:10

Comparing candidate commit 61be8bf in PR branch florian/fix-allocs with baseline commit 0994638 in branch master.

Found 0 performance improvements and 4 performance regressions! Performance is the same for 24 metrics, 8 unstable metrics.

scenario:php-profiler-timeline-memory-control

  • 🟥 cpu_user_time [+38.401ms; +46.095ms] or [+6.367%; +7.642%]
  • 🟥 execution_time [+35.749ms; +43.575ms] or [+5.665%; +6.905%]

scenario:php-profiler-timeline-memory-with-profiler

  • 🟥 cpu_user_time [+22.816ms; +85.620ms] or [+2.006%; +7.529%]
  • 🟥 execution_time [+24.460ms; +43.177ms] or [+2.619%; +4.623%]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

profiling Relates to the Continuous Profiler tracing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants