php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #8715 ifx_get_blob ifx_fetch_row and NULLS
Submitted: 2001-01-15 11:23 UTC Modified: 2001-11-14 06:42 UTC
From: djl at inkshop dot org Assigned:
Status: Closed Package: Informix related
PHP Version: 4.0.4 OS: Tru64 Unix 5.0
Private report: No CVE-ID: None
 [2001-01-15 11:23 UTC] djl at inkshop dot org
If a table exists within Informix with a TEXT field (have
not tested BYTE fields) that has NULL data and that field is
selected, the ifx_fetch_row() call after the ifx_get_blob()
call causes a segmentation fault in Apache. If only one row
is retrieved, there the segmentaion fault does not occur. If
the first row HAS data in the TEXT field (ie IS NOT NULL)
then the segmentation fault does not occur. The segmentation
fault occurs in the second call to ifx_fetch_row() (assuming
ifx_get_blob is called on every row). This bug has been
around for a while (including in PHP 3.0). At one point I
sent the contents of ifx.c to the Informix folks, but since
ifx.c cannot be compiled and ran alone (it needs the rest of
PHP to function) they refused to use it as a sample. And I
don't know enough C to generate an example of my own. I am
uncertain if the problems lies within PHP's ifx.c or if it
is in the client side Informix libraries. I have seen this
problem with several version of the libraries including
those distributed with ODS 7.23.FC4 and those from the
latest SDK. My current ESQL/C version is: INFORMIX-ESQL
Version 9.30.FC1 (output from esql -V).

If you find the bug is in Informix Client libraries, and not
in PHP code... if you can give me a NON-PHP C code sample
reproducing this bug, I can properly report it to Informix
(we have a site wide support license here). Please email me
at djl@inkshop.org for more information.

Although it is rather difficult for me to perform a gdb
backtrace (as I would have to first build and install gdb
and then isolate the Apache process on a non-production
machines) I can do so if it will help get the bug fixed.
Just let me know.

As a workaround, currently, when I generate my blob to
insert or update I use this syntax:

$blobid = ifx_create_blob(1, 0, trim($data) . " ");

That space on the end ensures the field IS NOT NULL and
therefore stops the segmentation fault from ocurring.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-10-23 11:33 UTC] sniper@php.net
Does this happen with latest CVS snapshot from http://snaps.php.net/ ?

 [2001-11-14 06:42 UTC] sander@php.net
No feedback. Closing.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Dec 02 20:01:32 2024 UTC