#43525 [Opn]: zend_list functions should take ulong IDs
| From: | mi+php at aldan dot algebra dot com | Date: | Tue, 29 Jan 2008 15:00:34 +0000 |
| Subject: | #43525 [Opn]: zend_list functions should take ulong IDs | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-121734@lists.php.net to get a copy of this message | ||
ID: 43525
User updated by: mi+php at aldan dot algebra dot com
Reported By: mi+php at aldan dot algebra dot com
Status: Open
Bug Type: PostgreSQL related
Operating System: FreeBSD/amd64
PHP Version: 5.2.5
New Comment:
The original problem may, indeed, be a problem with PostgreSQL
back-end, but the dropping of bits by the list-API is gratuitous. There
is no need for it to truncate to int, because internally it stores ulong
values anyway...
It may make sense to keep the 5_2 branch binary-compatible (even though
the compatibility would only be broken on 64-bit platforms), but going
forward the API should change...
Come to think of it, I am not sure, the ABI would break even on 64-bit
platforms, as you'd be widening (rather than narrowing) the acceptable
values.
Previous Comments:
------------------------------------------------------------------------
[2008-01-29 10:13:33] dmitry@php.net
The fact that ext/pgsql uses ZE API in wrong way, doesn't mean that we
should fix the API. It is especially impossible in PHP_5_2 branch,
because it'll break binary compatibility.
I would suggest fix the bug in ext/pgsql by using other data
structures.
------------------------------------------------------------------------
[2007-12-07 05:13:38] mi+php at aldan dot algebra dot com
Description:
------------
The "id" variable in the zend_list family of functions should be ulong
(or uintptr_t, as pointers are often stored there). It already is ulong
in the underlying "workhorse" function zend_hash_index_find.
At least one spot -- in in pgsql.c -- makes an id from a pointer, which
leads to nasty occasional errors and httpd-/crashes/ on 64-bit
platforms.
Please, find the patch on
http://virtual-estates.com/~mi/port-stuff/patch-zend_list
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=43525&edit=1