Skip to content

bug: malloc_consolidate heap corruption with 1.17.0 on FrankenPHP #3729

@irhtml

Description

@irhtml

Bug report

After upgrading from dd-trace-php 1.16.0 to 1.17.0, we see glibc heap corruption in our FrankenPHP/Laravel Octane (long-running ZTS) production environment:

  malloc_consolidate(): unaligned fastbin chunk detected
  memory allocation of 3420891154821048684 bytes failed

The process crashes and requires a restart. Intermittent, affects ~20% of pods under production load.
We confirmed by comparing two Docker images identical in every way except dd-trace-php version:

Environment (identical between both images):

  • PHP 8.4.19 (ZTS, Zend Memory Manager disabled)
  • Debian 13 (trixie), x86_64
  • FrankenPHP/Caddy 2.11.2 (serversideup/php:8.4-frankenphp)
  • grpc ext 1.78.0
  • redis ext 6.3.0

Results:

  • dd-trace-php 1.16.0 - stable under production load
  • dd-trace-php 1.17.0 - heap corruption under load

Profiling config: allocation profiling enabled, timeline enabled, CPU time profiling enabled.

Pinning back to 1.16.0 resolved the issue immediately.

PHP version

PHP 8.4.19 (ZTS) built Mar 16 2026

Tracer or profiler version

1.17.0

Installed extensions

Installed extensions: Core, ctype, curl, datadog-profiling, date, ddappsec, ddtrace, dom, fileinfo, filter, grpc, hash, iconv, json, libxml, mbstring, mysqlnd, openssl, pcntl, pcre, PDO, pdo_mysql, pdo_pgsql, pdo_sqlite, Phar, posix, random, readline, redis, Reflection, session, SimpleXML, sodium, SPL, sqlite3, standard, tokenizer, xml, xmlreader, xmlwriter, Zend OPcache, zip, zlib

Output of phpinfo()

No response

Upgrading from

1.16.0

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions