Skip to content

VM: fatals can still exit 255 with no output — the compliance harness spawns with error_reporting=0 and two catch sites swallow CompileError/LogicException (test/BaseTest.php, bin/vm.php, src/cli_driver.php) #36208

Description

@PurHur

Category

Foundation: · loud failures · child of #36188

Problem

Reproduced on master 4eed6a2785: test/BaseTest.php:164-166 spawns every compliance case with -d display_errors=0 -d error_reporting=0; an OOM under those flags yields empty stdout, empty stderr, exit 255. With -d error_reporting=1 -d log_errors=1 the same OOM prints PHP Fatal error: Allowed memory size … exhausted on stderr and stdout stays clean. This is the "silent exit 255" class from #15906/#36148, and it also hides real fatals in nightly runs.

VM-originated fatals are fine (ErrorReporter::writeCliErrorOutput, lib/VM/ErrorReporter.php:756-767 always writes STDERR), but two driver paths are not: bin/vm.php:52-55 and src/cli_driver.php:373-379 — catch (\CompileError) { exit(255); } with no output, and catch (\LogicException) { echo …; exit(255); } which writes to stdout without a PHP Fatal error: prefix. lib/Block.php:1779 ("Could not resolve argument") and lib/VM/Variable.php:1774 ("Unsupported type copy") throw exactly those.

PHP implementation target

  • test/BaseTest.php: -d error_reporting=1 -d log_errors=1 -d display_errors=stderr (expected-output comparison is on stdout; stderr is captured separately).
  • bin/vm.php / src/cli_driver.php: every catch writes PHP Fatal error: <class>: <message> in <file>:<line> to stderr and exits 255; add a unit test that runs the two throw sites through the driver and asserts stderr is non-empty.
  • script/bench.php and differential-sweep.sh: same flags for the VM side.

Done when

  • The OOM repro prints the fatal on stderr under the harness flags; VMTest.failing name-set unchanged
  • No exit(255) in bin/ or src/ without a preceding stderr write (grep-gated in check-generated-docs.sh or a unit test)

Activity

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:vmVirtual machinebugSomething isn't workingimplementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claimphase-0:FoundationPhase 0 – foundation & DevEx

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions