Skip to content

A spread into a variadic function that throws leaks the pack built for the call. #647

Closed

Description

@blacktrs

Summary

A spread into a variadic function that throws leaks the pack built for the call.

Repro

<?php
function boom(int ...$xs): int { throw new RuntimeException('n=' . count($xs)); }
$ints = range(1, 64);
$m0 = memory_get_usage();
for ($i = 0; $i < 200000; $i++) {
    try { boom(...$ints); } catch (RuntimeException $e) {}
}
$d = memory_get_peak_usage() - $m0;
echo $d < 20000000 ? "flat" : "LEAK " . $d, "\n";

Expected (php)

flat

Actual (manticore adaf6ee1, Darwin arm64)

LEAK 132005888

Tracking

Known-bug repro: tests/aot/repro/leak/spread_into_variadic_throw.php — bash tests/aot/xfail.sh -k spread_into_variadic_throw reports XFAIL while this is open and XPASS once it is fixed; then move the repro into tests/aot/cases/ and close this issue.

Activity

  1. added
    bug
    leak
    on Nov 11, 2026
  2. added a commit that references this issue on Nov 11, 2026
    b451934
  3. added 2 commits that reference this issue on Nov 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugleak

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions