Skip to content

A local aliased with =& is dropped from ownership tracking and its string leaks. #395

Closed

Description

@blacktrs

Summary

A local aliased with =& is dropped from ownership tracking and its string leaks.

Repro

<?php
function t(int $i): int { $y = "s" . $i . str_repeat("x", 40); $z = &$y; $z = $z . "!"; return strlen($y); }
t(1);
$b = memory_get_usage();
for ($i = 0; $i < 50000; $i++) { t($i); }
echo (memory_get_usage() - $b) < 500000 ? "flat" : "leak", "\n";

Expected (php)

flat

Actual (manticore 96d0daa4, Darwin arm64)

leak

Tracking

Known-bug repro: tests/aot/repro/leak/ref_alias_local_string_leaks.php — bash tests/aot/xfail.sh -k ref_alias_local_string_leaks 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 Oct 23, 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