Skip to content

IR stack overflow #2

Description

@thomas-0816

cargo build --release

target/release/php-vm run --exec-format ir ackermann.php

thread 'php-vm-runtime' (804188) has overflowed its stack
fatal runtime error: stack overflow, aborting
Aborted
target/release/php-vm run --exec-format bytecode ackermann.php
509
php ackermann.php
509

ackermann.php

<?php

function ack(int $m, int $n): int {
    if ($m === 0) {
        return $n + 1;
    }
    if ($n === 0) {
        return ack($m - 1, 1);
    }
    return ack($m - 1, ack($m, $n - 1));
}

echo ack(3, 6);

compiled at git log -1

commit 5139f420549e533f4fca2512afa4b2b130f2f277
Date:   Thu Jul 9 08:04:45 2026 +0200
fix(vm): harden negative include cache

system:

Ubuntu 24.04.4 LTS

rustc --version --verbose
rustc 1.96.0 (ac68faa20 2026-05-25)
binary: rustc
commit-hash: ac68faa20c58cbccd01ee7208bf3b6e93a7d7f96
commit-date: 2026-05-25
host: x86_64-unknown-linux-gnu
release: 1.96.0
LLVM version: 22.1.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions