ID: 32954
Comment by: rait at krediidiinfo dot ee
Reported By: andreybl at matrix dot co dot il
Status: Assigned
Bug Type: Informix related
Operating System: Red Hat 3.0 ES
PHP Version: 5CVS, 4CVS, 6CVS (2005-09-04)
Assigned To: nobbie
New Comment:
My temporal workaround: I changed blob mode from memory to file mode.
(ifx_blobinfile_mode(0) -> ifx_blobinfile_mode(0))
Program, that generated a Segmentation fault:
<?php
$con = ifx_connect(DB, USER, PASS);
$sql = "SELECT id, data FROM news";
ifx_blobinfile_mode(0);
$res = ifx_query($sql, $con);
$row = ifx_fetch_row($res); // <-- "Segmentation fault"
echo ifx_get_blob($row['data']);
?>
And my workaround:
<?php
$con = ifx_connect(DB, USER, PASS);
$sql = "SELECT id, data FROM news";
ifx_blobinfile_mode(1); // <-- blob mode is changed.
$res = ifx_query($sql, $con);
$row = ifx_fetch_row($res);
echo file_get_contents(ifx_get_blob($row['data'])); // <-- data has
to be loaded from file.
?>
Previous Comments:
------------------------------------------------------------------------
[2005-11-09 15:18:08] rait at krediidiinfo dot ee
I encoutered same problem. ifx_fetch_row produces "Segmentation fault"
whenever I tried to fetch query result including TEXT type field with
non-NULL value. When the TEXT type field value was NULL then
segmentation fault didn't occure.
It gave segmentation fault in Apache and commmand line.
Informix server version: IDS 9.40.UC2
PHP version 5.0.5
Informix SDK version: csdk_informix.2.90.UC2
apache2-prefork-2.0.49-27.8 (SLES9)
------------------------------------------------------------------------
[2005-09-23 15:35:46] [EMAIL PROTECTED]
Assigned to the maintainer. Cornelius, if you get this mail, please
reply via email to me if you're actually maintaining this extension
anymore. (to [EMAIL PROTECTED])
------------------------------------------------------------------------
[2005-09-04 15:20:43] andreybl at matrix dot co dot il
Checked with the last snapshot, recomended:
PHP 5.1.0-dev (cli) (built: Sep 4 2005 16:11:34) (DEBUG)
Nothing changed from my last post of 17 May 2005.
------------------------------------------------------------------------
[2005-09-02 08:55:21] [EMAIL PROTECTED]
Please try using this CVS snapshot:
http://snaps.php.net/php5-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php5-win32-latest.zip
And don't invent your own PHP version strings. The version must start
with a NUMBER in this bug system..
------------------------------------------------------------------------
[2005-05-17 14:41:35] andreybl at matrix dot co dot il
Well, well.
I don know even what to do: cry :( or laugh :)
The good news is that the SEGV problem did not appear.
The bad news is that we still DO HAVE a problem with TEXT fields.
So. I have a table, called "registrars" with few rows. There is a field
in this table, called 'allowedips' and it is of type TEXT. It may have
NULL value. Here is a small test program run on PHP CGI (not Apache
module, but it does not matter):
$conn_id = ifx_connect(..............);
$res_id = ifx_query('SELECT * FROM registrars', $conn_id);
while ($row = ifx_fetch_row($res_id))
{
if (!empty($row['allowedips']))
echo ifx_get_blob($row['allowedips'])."\n";
}
ifx_free_result($res_id);
ifx_close($conn_id);
Instead of the values for the 'allowedips' field I see in the output
the following:
/tmp/blbGmDdPT
/tmp/blb214Nct
/tmp/blbQM8yM2
/tmp/blbuQGH1T
I ran this test several times. And as You can guess the /tmp directory
was full with blb****** emty files.
If in the beginning of the program I put:
ifx_textasvarchar(1);
then:
echo $row['allowedips';
will produce the same output and there will be same emty files.
BTW:
$rc = ifx_get_blob('blabla'); // 'blabla' is not a valid id
produces the Segmentation fault !!! that we all LOVE :)
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/32954
--
Edit this bug report at http://bugs.php.net/?id=32954&edit=1