Skip to content

Distinguish intentional JIT disable from unexpected failure in status message#11681

Open
alies-dev wants to merge 1 commit intovimeo:6.xfrom
alies-dev:fix-misleading-jit-off-message
Open

Distinguish intentional JIT disable from unexpected failure in status message#11681
alies-dev wants to merge 1 commit intovimeo:6.xfrom
alies-dev:fix-misleading-jit-off-message

Conversation

@alies-dev
Copy link
Contributor

@alies-dev alies-dev commented Feb 25, 2026

Summary

When opcache is loaded but JIT is off, Psalm currently displays:

JIT acceleration: OFF (an error occurred while enabling JIT)
Please report this to https://github.com/vimeo/psalm with your OS and PHP configuration!

This is misleading when JIT was intentionally disabled (e.g. via -d opcache.jit=disable to work around PHP JIT segfaults during taint analysis).

This PR checks ini_get('opcache.jit') to distinguish between intentional disabling and unexpected failure:

  • Intentionally disabled (off, disable, 0, etc.) → "JIT acceleration: OFF (opcache.jit is disabled)"
  • Failed unexpectedly → keeps the current error message + "Please report this"

Context

We hit JIT segfaults (exit code 139) running --taint-analysis on a large Laravel codebase (~3400 files). The workaround is PSALM_ALLOW_XDEBUG=1 + -d opcache.jit=disable, but the alarming error message causes confusion.

Limitations

This is a minimal DX fix for the misleading message only. It does not address the underlying issue that PsalmRestarter force-enables JIT regardless of user intent.

The proper solution would be making JIT opt-in rather than forced — @theodorejb's approach in #11613 is the right direction for that. The benchmarks in #11589 consistently show JIT hurting performance across platforms, and it also causes stability issues (segfaults) during taint analysis. I'd love to see that work land.

Fixes messaging issue from #11589

When opcache is loaded but JIT is off, Psalm displays a misleading
"an error occurred while enabling JIT" message even when JIT was
intentionally disabled (e.g. via -d opcache.jit=disable to work
around PHP JIT segfaults during taint analysis).

This change checks ini_get('opcache.jit') to distinguish between
intentional disabling and unexpected failure, showing a clean
informational message in the former case.
@alies-dev alies-dev changed the title Improve JIT status message when JIT is intentionally disabled Distinguish intentional JIT disable from unexpected failure in status message Feb 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant