Skip to content

php8.4beta4 JIT erronous results #15656

@tbali0524

Description

@tbali0524

Description

The following code:

// see `src/*.php` in the bug-report zip package (link below)
// These cli programs are reading from stdin and writing to stdout.
// see `./run.bat` to run them all with proper redirections (on Windows)

Resulted in this output:

// see `output-with-8.4beta4-JIT/*.txt` in the bug-report zip package (link below)

But I expected this output instead:

// see `output-with-8.4beta4-NO-JIT/*.txt` in the bug-report zip package (link below)

Notes

  • All files for bug reproduction (src, input text files, expected and wrong output text files) are attached or available
    in https://www.aviationfanatic.com/tmp/php84beta4-jit-bug.zip

  • Code WORKS fine with

    • php 8.3.11 with JIT enabled, on Windows 11,
    • php 8.3.11 with JIT disabled, on Windows 11,
    • php 8.4beta4 with JIT disabled, on Windows 11,
    • php 7.3 (no JIT ofc) on Linux (on CodingGame hosted runners)
  • Code FAILS (produces wrong, different output, despite having deterministic algorithms) with

    • 8.4beta4 with JIT enabled, on Windows 11
    • settings (full php.ini attached in bug-report zip):
      • opcache.enable_cli = 1
      • opcache.jit_buffer_size = 128M
      • opcache.jit = tracing
    • same problem appeared with 8.4alpha4 and 8.4beta3 (only with JIT enabled), but I did not report it that time.
  • Tested on Windows 11 only.

  • I am very sorry for not being able to provide helpful bug description, just the fact of output mismatch. I don't know the root cause, and don't even know if these are a single JIT bug or multiple unrelated issues.

  • These JIT bug(s) discovered by re-running my 800+ CodinGame (algorithmic puzzles) CLI solutions (90k+ loc) with 6k+ test cases. Only < ~1% of the test cases failed, these are provided in this bug report.

php84beta4-jit-bug.zip

PHP Version

PHP 8.4beta4

Operating System

Windows 11

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions