Skip to content

array_shift on a large array captured by value in a closure frees a pointer malloc never returned at exit. #275

Closed

Description

@blacktrs

Summary

array_shift on a large array captured by value in a closure frees a pointer malloc never returned at exit.

Repro

<?php
$l = range(0, 2500);
$f = function () use ($l) {
    array_shift($l);
    return count($l);
};
echo $f(), "\n";

Expected (php)

2500

Actual (manticore 4172af1b, Darwin arm64)

2500
[exit code 134]

Tracking

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

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

    bugcrash

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions