Skip to content

A variadic closure forwarding to $this->{$m}(...$args), installed as the exception handler, crashes (SIGBUS) when an exception is uncaught. #575

Closed

Description

@blacktrs

Summary

A variadic closure forwarding to $this->{$m}(...$args), installed as the exception handler, crashes (SIGBUS) when an exception is uncaught.

Repro

<?php
class H
{
    public function handle(Throwable $e): void { echo "handled: ", $e->getMessage(), "\n"; }
    public function forwardsTo(string $m)
    {
        return fn (...$arguments) => $this->{$m}(...$arguments);
    }
}
$h = new H();
set_exception_handler($h->forwardsTo('handle'));
throw new RuntimeException('boom');

Expected (php)

handled: boom

Actual (manticore 0b88f1ca, Darwin arm64)


[exit code 138 — SIGBUS]
/Users/taras/var/projects/manticore-laravel/tools/lib/limit.sh: line 35: 28164 Bus error: 10           "$TIMEOUT_KIND" -k 2 "$secs" "$@"

Tracking

Known-bug repro: tests/aot/repro/crash/uncaught_variadic_handler_dynamic_spread.php — bash tests/aot/xfail.sh -k uncaught_variadic_handler_dynamic_spread 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
    crash
    on Nov 6, 2026
  2. added a commit that references this issue on Nov 11, 2026
    c662631
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