Skip to content

An error raised inside a builtin (intdiv) has no frame for the builtin in getTrace(). #81

Closed

Description

@blacktrs

Summary

An error raised inside a builtin (intdiv) has no frame for the builtin in getTrace().

Repro

<?php
function v() { return intdiv(1, 0); }
try { v(); } catch (Throwable $e) { foreach ($e->getTrace() as $fr) { echo $fr['function'], "\n"; } }

Expected (php)

intdiv
v

Actual (manticore 3bea722c, Darwin arm64)

v

Tracking

Known-bug repro: tests/aot/repro/wrong/trace_builtin_leaf_frame_missing.php — bash tests/aot/xfail.sh -k trace_builtin_leaf_frame_missing 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
    wrong-answer
    on Oct 5, 2026
  2. added
    area:runtime
    on Oct 13, 2026
  3. blacktrs commented on Oct 13, 2026

    @blacktrs
    ContributorAuthor

    Partial (branch fix/batch-b). emitThrowIf now takes an optional leaf name that pushes a builtin frame; wired only for intdiv and str_repeat. Every other raising builtin still has no leaf frame in getTrace(). Follow-up: wire the remaining throwing builtins (sweep emitThrowIf call sites). If the commit auto-closes this issue, reopen it.

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

    area:runtimebugwrong-answer

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions