Skip to content

Fix GH-25760: pg_fetch_all_columns() crashes with JIT when the result for an empty set is modified - #25761

Closed
thunderer wants to merge 1 commit into
php:PHP-8.5from
thunderer:fix/pg-fetch-all-columns-refcount
Closed

thunderer wants to merge 1 commit into
php:PHP-8.5from
thunderer:fix/pg-fetch-all-columns-refcount

Conversation

@thunderer

Copy link
Copy Markdown
Contributor

Fixes GH-25760.

Since 8f6bc97, pg_fetch_all_columns() returns the shared immutable empty array for a result without rows. The stub still declared @refcount 1, so function JIT and tracing JIT modified that array in place and crashed.

This drops the annotation and regenerates the arginfo and optimizer info, as e43d3d1 did for array_column(). The test fails without the change.

…ult for an empty set is modified

Since 8f6bc97, pg_fetch_all_columns() returns the shared immutable empty
array for a result without rows. The stub still declared @refcount 1, which
lets function JIT and tracing JIT modify the result in place and crash. Drop
the annotation.
@devnexen devnexen closed this in 684612c Nov 25, 2026
@devnexen

Copy link
Copy Markdown
Member

Thanks !

@thunderer
thunderer deleted the fix/pg-fetch-all-columns-refcount branch November 25, 2026 23:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants