[php-src] PR #26022: ext/sysvshm: Use shm_list_ptr->id in shm_remove() failure warning
| From: | hohphu8 | Date: | Wed, 02 Dec 2026 03:13:03 +0000 |
| Subject: | [php-src] PR #26022: ext/sysvshm: Use shm_list_ptr->id in shm_remove() failure warning | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-41351@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/26022
Author: hohphu8
In
shm_remove() (ext/sysvshm/sysvshm.c), when
shmctl(shm_list_ptr->id, IPC_RMID, NULL) fails, the warning call reads
Z_LVAL_P(shm_id) on the SysvSharedMemory object parameter
(IS_OBJECT, parsed with "O"). Since zend_value.lval
shares the union with zend_value.obj, this prints the raw zend_object *
heap pointer address instead of the shared memory identifier (a leftover from the PHP 8.0
resource-to-object migration).
Pass shm_list_ptr->id (which is already a zend_long matching
ZEND_LONG_FMT) instead of Z_LVAL_P(shm_id). Checked
ext/sysvshm, ext/sysvmsg, and ext/sysvsem for similar
leftover Z_LVAL_P() calls on object arguments and confirmed this is the only
occurrence.
Added a regression test (ext/sysvshm/tests/shm_remove_already_removed.phpt, skipped on
Linux where repeated IPC_RMID succeeds while attached, exercised on BSD/macOS). Built
cleanly and verified ext/sysvshm/tests/ passes on PHP-8.4 (Debug + ZTS).