Req #43525 [Asn->Csd]: [PATCH] zend_list functions should take ulong IDs

From: Date: Thu, 22 Jan 2015 12:06:36 +0000
Subject: Req #43525 [Asn->Csd]: [PATCH] zend_list functions should take ulong IDs
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-190145@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=43525&edit=1

 ID:                 43525
 Updated by:         ab@php.net
 Reported by:        mi+php at aldan dot algebra dot com
 Summary:            [PATCH] zend_list functions should take ulong IDs
-Status:             Assigned
+Status:             Closed
 Type:               Feature/Change Request
 Package:            Scripting Engine problem
 Operating System:   FreeBSD/amd64
 PHP Version:        5.2.5
 Assigned To:        ab
 Block user comment: N
 Private report:     N

 New Comment:

I was writing here https://www.mail-archive.com/internals@lists.php.net/msg72373.html
with a suggestion for master. Since no one has reacted,seems that the idea wasn't interesting.

In general - an integer can still identify a resource, whereby it's now only makes sense at the
places where an underlying library enforces it. Otherwise, the list api works with a pointer to the
resource structure, that makes an overflow impossible.

Thanks.


Previous Comments:
------------------------------------------------------------------------
[2014-12-28 23:51:24] kalle@php.net

Anatol, is this still an issue after the int64 branch merge?

------------------------------------------------------------------------
[2014-12-16 23:34:40] kalle@php.net

Please try using this snapshot:

  http://snaps.php.net/php-trunk-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/

Please try a PHP7 snapshot (master)

------------------------------------------------------------------------
[2008-01-29 15:00:34] mi+php at aldan dot algebra dot com

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.

------------------------------------------------------------------------
[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 https://bugs.php.net/bug.php?id=43525&edit=1


Thread (7 messages)

« previous php.bugs (#190145) next »