php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #42266 BLOB functions do not work on 64bit systems
Submitted: 2007-08-10 15:40 UTC Modified: 2013-02-18 00:33 UTC
Votes:22
Avg. Score:4.7 ± 0.7
Reproduced:16 of 16 (100.0%)
Same Version:9 (56.2%)
Same OS:13 (81.2%)
From: karasek at ceskyserver dot cz Assigned: abies (profile)
Status: No Feedback Package: InterBase related
PHP Version: 5.2.4 OS: Linux 64-bit
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2007-08-10 15:40 UTC] karasek at ceskyserver dot cz
Description:
------------
When I compile PHP on our new installation of CentOS 5.0 (64-bit version) with Firebird 2.0, "InterBase: BLOB test" fails.

It's really critical issue for our company, because some of our applications stoped working...

When I tryed the same on CentOS 4.1 (32-bit version) with Firebird 1.5, the test passed.

In fact, I'm not sure, whether is the problem caused by the new version of Firebird, or by the 64-bit architecture (but my guess is the 64-bit).

I tryed to work with BLOBs using a desktop application - and verified, that BLOG support in Firebird 2.0 itself works (on the same server).

I have experienced the problem on PHP 5.2.3,  5.2.4RC1 and snapshot php5.2-200708101430

I think, that this is the same problem as Bug #42089, but the bug is now not open, and I don't know, how to open it again (I'm not the person, who originally reported it).

I'm ready to colaborate, so feel free to contact me, if you need further informations...

Regards
     Tony

Reproduce code:
---------------
make
make test


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-08-22 15:51 UTC] karasek at ceskyserver dot cz
Now I have done some tests and I'm sure, that the problem is related to the 64-bit platform - not to Firebird 2.0. I have tested 5.2.4RC2 on Kubuntu (32-bit) and the "InterBase: BLOB test" passed. Then, with the same version (5.2.4RC2) on CentOS (64-bit) "InterBase: BLOB test" failed. On both systems was installed the same version of Firebird...
 [2007-08-29 08:43 UTC] ale dot pas at tiscali dot it
Same problem here.

See my comment on Bug #42089
 [2007-09-05 12:52 UTC] karasek at ceskyserver dot cz
Hi,
I have some new informations. When I compile PHP on the 64-bit architecture, I get this warnings:

/home/phobos/sources/php-5.2.4/ext/interbase/ibase_blobs.c: In function '_php_ibase_free_blob':
/home/phobos/sources/php-5.2.4/ext/interbase/ibase_blobs.c:41: warning: comparison between pointer and integer
/home/phobos/sources/php-5.2.4/ext/interbase/ibase_blobs.c: In function 'zif_ibase_blob_create':
/home/phobos/sources/php-5.2.4/ext/interbase/ibase_blobs.c:223: warning: assignment makes integer from pointer without a cast
/home/phobos/sources/php-5.2.4/ext/interbase/ibase_blobs.c: In function 'zif_ibase_blob_open':
/home/phobos/sources/php-5.2.4/ext/interbase/ibase_blobs.c:267: warning: assignment makes integer from pointer without a cast
/home/phobos/sources/php-5.2.4/ext/interbase/ibase_blobs.c: In function '_php_ibase_blob_end':
/home/phobos/sources/php-5.2.4/ext/interbase/ibase_blobs.c:369: warning: assignment makes integer from pointer without a cast
/home/phobos/sources/php-5.2.4/ext/interbase/ibase_blobs.c:377: warning: assignment makes integer from pointer without a cast
/home/phobos/sources/php-5.2.4/ext/interbase/ibase_blobs.c: In function 'zif_ibase_blob_info':
/home/phobos/sources/php-5.2.4/ext/interbase/ibase_blobs.c:409: warning: initialization makes integer from pointer without a cast
/home/phobos/sources/php-5.2.4/ext/interbase/ibase_blobs.c: In function 'zif_ibase_blob_echo':
/home/phobos/sources/php-5.2.4/ext/interbase/ibase_blobs.c:485: warning: initialization makes integer from pointer without a cast
/home/phobos/sources/php-5.2.4/ext/interbase/ibase_blobs.c: In function 'zif_ibase_blob_import':
/home/phobos/sources/php-5.2.4/ext/interbase/ibase_blobs.c:546: warning: initialization makes integer from pointer without a cast

-- but I don't get them on 32-bit architecture.

I tryed to find out why. And this is the answer:

ibase.h: row 68:

#if defined(_LP64) || defined(__LP64__) || defined(__arch64__)
typedef unsigned int    FB_API_HANDLE;
#else
typedef void*           FB_API_HANDLE;
#endif

This means, that the type "FB_API_HANDLE" is pointer on 32-bit architecture, but it's not a pointer on 64-bit architecture. So, construction like:

FB_API_HANDLE what_ever = NULL;

Causes a warning on 64-bit architecture.

Note, that there are some "aliases":

typedef FB_API_HANDLE isc_att_handle;
typedef FB_API_HANDLE isc_blob_handle;
typedef FB_API_HANDLE isc_db_handle;
typedef FB_API_HANDLE isc_req_handle;
typedef FB_API_HANDLE isc_stmt_handle;
typedef FB_API_HANDLE isc_svc_handle;
typedef FB_API_HANDLE isc_tr_handle;

I belive, that this the "source of trouble".
 [2008-02-12 05:32 UTC] info at olemera dot com
Is the a new patch for the (64-bit
version) with Firebird 2.0 ? I get an integer Error.
Regards,
http://www.olemera.com/loans/home-loans/integer-home-loans/
[url=http://www.olemera.com/loans/home-loans/integer-home-loans/]Olemera[/url]
 [2008-05-15 09:35 UTC] ale dot pas at tiscali dot it
Ok, after 10 months this bug is sill open without a comment from a developer.

This clearly proves that PHP is definitely not ready for enterprise solutions.

It's a pity we choose PHP for almost all of our projects, do not make this error, choose Java, Python or Ruby you will find a better support there.
 [2008-05-15 09:42 UTC] pajoye@php.net
Let get it assigned. It will certainly help to bring some love here.

> It's a pity we choose PHP for almost all of our projects, do not make
> this error, choose Java, Python or Ruby you will find a better support
> there.

I doubt you will find better ibase support anywhere but InterBase directly. That's the main problem here, not PHP.
 [2008-05-16 06:39 UTC] ale dot pas at tiscali dot it
You're maybe right, but the bug appeared in 5.2.4 while 5.2.1. works fine, something has changed in PHP, not in firebird.
 [2008-05-16 07:19 UTC] pajoye@php.net
"You're maybe right, but the bug appeared in 5.2.4 while 5.2.1. works
fine, something has changed in PHP, not in firebird."

I meant support as in 2nd level support not for the quality of the driver :)

About the handle question, it is how they do it in firebird itself. A quick search in codesearch:

http://google.com/codesearch?q=lang%3Ac+typedef+FB_API_HANDLE&hl=en&btnG=Search+Code

So the problem is somewhere else, but I can't help as I don't use firebird. Let wait a bit more for the maintainers answer.

 [2008-08-06 17:31 UTC] hasul at etoscomp dot eu
Hi,
is this bug still open?

Because BLOB is working on my system (Centos 5.2 64bit). I used php 5.2.6 from Jason Litka repo (http://www.jasonlitka.com/yum-repository/)  and FirebirdSS-2.1.0.17798-0.amd64.rpm from official firebird site.
 [2008-09-08 14:24 UTC] andre at spiceware dot co dot za
I compiled PHP 5.2.6 from source tar ball for Linux this last weekend and also ended up with the BLOB error. This is still a problem.
 [2009-05-21 20:35 UTC] mkoeditz at gmx dot de
Well, i've just installed openSUSE 10.3 with php 25.2.9 and Firebird 2.1. 32 bit system. Same error. So I think there is no focus on the platform but the php version.

Regards
Martin
 [2009-06-08 10:10 UTC] lester at lsces dot co dot uk
I think we needs some proper feedback on this problem. There WAS a problem with some builds of PHP from 5.2.0 to 5.2.5 relating to how the blob ID was handled after some re-engineering of the core PHP code. This resulted in a problem which was clearly visible when running ADOdb, since it could not access the BLOB_ID. Since 5.2.6 that problem has been fixed, and I'm currently running both windows and linux x64 machineswithout the back to get around the problem. So as far as I am concerned this bug has been cleared. 

So where are people still seeing it and how can we recreate that view of the problem?
 [2009-07-23 09:30 UTC] andre at spiceware dot co dot za
I can confirm that php 5.2.1 was the last working version for BLOBS on 64 bit operating system as I have downloaded all the versions since then to check each one.

I have recently compiled 5.3.0 with no joy too!
 [2009-09-07 10:11 UTC] lester at lsces dot co dot uk
Currently I have PHP5.2.9 and 10 running without any blob id problem on a number of 64 bit distributions. And 5.3 running on Vista64 as well again without displaying this bug. So I think we need a lot more information from people who DO have this problem still ....
 [2011-09-12 09:50 UTC] mariuz@php.net
-Status: Assigned +Status: Feedback
 [2011-09-12 09:50 UTC] mariuz@php.net
Please try using this snapshot:

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

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


 [2013-02-18 00:33 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 06:01:30 2024 UTC