Skip to content

Zend/COW invariant violation around $_FILES in debug-assertion builds#21160

Closed
geeknik wants to merge 1 commit intophp:masterfrom
geeknik:master
Closed

Zend/COW invariant violation around $_FILES in debug-assertion builds#21160
geeknik wants to merge 1 commit intophp:masterfrom
geeknik:master

Conversation

@geeknik
Copy link

@geeknik geeknik commented Feb 7, 2026

rfc1867_post_handler() registers file metadata into &PG(http_globals)[TRACK_VARS_FILES] (i.e. $_FILES). See main/rfc1867.c:1153.

$_FILES is created as an auto-global and inserted into EG(symbol_table) in php_auto_globals_create_files() (main/php_variables.c). That means the underlying HashTable ends up with refcount > 1.

When php_register_variable_*() tries to write into that shared HashTable, Zend asserts in Zend/zend_hash.c:912 unless the table is marked HT_ALLOW_COW_VIOLATION (same mechanism already used for $_SERVER).

@geeknik geeknik requested a review from bukka as a code owner February 7, 2026 18:42
@geeknik geeknik closed this Feb 7, 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