Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uninitialized string offset -1 at Psalm/Internal/Fork/PsalmRestarter.php:90 #9396

Closed
oddnoc opened this issue Feb 25, 2023 · 8 comments
Closed

Comments

@oddnoc
Copy link

oddnoc commented Feb 25, 2023

psalm 5.7.6 crashes when psalm is invoked on the command line. This did not happen in 5.7.5 or earlier.

@psalm-github-bot
Copy link

Hey @oddnoc, can you reproduce the issue on https://psalm.dev ?

@oddnoc
Copy link
Author

oddnoc commented Feb 25, 2023

It happens before any code is analyzed, so I'm not sure how to test it on psalm.dev.

Here is the entire transcript, with long disk path redacted:

Warning: "findUnusedBaselineEntry" will be defaulted to "true" in Psalm 6. You should explicitly enable or disable this setting.
Warning: "findUnusedCode" will be defaulted to "true" in Psalm 6. You should explicitly enable or disable this setting.
Uncaught RuntimeException: PHP Error: Uninitialized string offset -1 in [siteroot]/vendor/vimeo/psalm/src/Psalm/Internal/Fork/PsalmRestarter.php:90 for command with CLI args "./vendor/bin/psalm" in [siteroot]/vendor/vimeo/psalm/src/Psalm/Internal/ErrorHandler.php:75
Stack trace:
#0 [siteroot]/vendor/vimeo/psalm/src/Psalm/Internal/Fork/PsalmRestarter.php(90): Psalm\Internal\ErrorHandler::Psalm\Internal\{closure}(2, 'Uninitialized s...', '/Volumes/Sensit...', 90)
#1 [siteroot]/vendor/vimeo/psalm/src/Psalm/Internal/Fork/PsalmRestarter.php(75): Psalm\Internal\Fork\PsalmRestarter::toBytes('')
#2 [siteroot]/vendor/composer/xdebug-handler/src/XdebugHandler.php(143): Psalm\Internal\Fork\PsalmRestarter->requiresRestart(true)
#3 [siteroot]/vendor/vimeo/psalm/src/Psalm/Internal/Cli/Psalm.php(914): Composer\XdebugHandler\XdebugHandler->check()
#4 [siteroot]/vendor/vimeo/psalm/src/Psalm/Internal/Cli/Psalm.php(267): Psalm\Internal\Cli\Psalm::restart(Array, 7, Object(Psalm\Progress\DefaultProgress))
#5 [siteroot]/vendor/vimeo/psalm/psalm(9): Psalm\Internal\Cli\Psalm::run(Array)
#6 [siteroot]/vendor/bin/psalm(120): include('/Volumes/Sensit...')
#7 {main}
(Psalm 5.7.6@ae4ec68e00e4880e3f00b1edd2da891236d749ab crashed due to an uncaught Throwable)

@weirdan
Copy link
Collaborator

weirdan commented Feb 25, 2023

@oddnoc can you run the following:

php -r 'var_dump(ini_get("opcache.jit_buffer_size"));'

and report the output here?

@weirdan
Copy link
Collaborator

weirdan commented Feb 25, 2023

Anyway, I think #9397 should solve this.

@oddnoc
Copy link
Author

oddnoc commented Feb 25, 2023

php -r 'var_dump(ini_get("opcache.jit_buffer_size"));'                                                              [8.0.28]
Command line code:1:
bool(false)

PHP is v8.0.28

@weirdan
Copy link
Collaborator

weirdan commented Feb 25, 2023

It should be fixed in 5.7.7, released moments ago.

image

@aboyton
Copy link
Contributor

aboyton commented Mar 10, 2023

Thanks for the fix. I can't seem to see 5.7.7 in https://packagist.org/packages/psalm/phar but I can for https://packagist.org/packages/vimeo/psalm. Any chance you can release a .phar version as well?

@weirdan
Copy link
Collaborator

weirdan commented Mar 10, 2023

Due to how psalm/phar releases are published, fixing missing 5.7.7 would be tricky. I released 5.8.0, which also includes this fix - it's already available through all distribution channels.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants