#32954 [Opn-Fbk]: ifx_fetch_row() : SEGV if row has TEXT fields (PHP Apache Module only)

2005-09-02 Thread sniper
 ID:   32954
 Updated by:   [EMAIL PROTECTED]
 Reported By:  andreybl at matrix dot co dot il
-Status:   Open
+Status:   Feedback
 Bug Type: Informix related
 Operating System: Red Hat 3.0 ES
-PHP Version:  PHP 5.1.0-dev (cgi) (built: May 17 2005 15:15:13)
   (DEBUG)
+PHP Version:  5.1.0-dev (cgi) (built: May 17 2005 15:15:13) (DEBUG)
 New Comment:

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..



Previous Comments:


[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 :)



[2005-05-17 10:36:30] [EMAIL PROTECTED]

That does not matter. (1.3.33 is better though, IMO :)



[2005-05-17 10:29:54] andreybl at matrix dot co dot il

I see. Well. What Apache version do You want me to use: 1 or 2?



[2005-05-17 10:24:59] [EMAIL PROTECTED]

Yes, but we're focused on PHP 5 now. If you can check it happens with
PHP 5 too, there's much more interest in fixing it and backporting the
fix to PHP 4 too.




[2005-05-17 10:23:14] andreybl at matrix dot co dot il

Hi.
You propose me to check with the snapshot of the fifth (5)
version of PHP.
The problem, that I MUST use the fourth (4)



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=32954edit=1


#32954 [Opn-Fbk]: ifx_fetch_row() : SEGV if row has TEXT fields (PHP Apache Module only)

2005-05-17 Thread sniper
 ID:   32954
 Updated by:   [EMAIL PROTECTED]
 Reported By:  andreybl at matrix dot co dot il
-Status:   Open
+Status:   Feedback
 Bug Type: Informix related
 Operating System: Red Hat 3.0 ES
 PHP Version:  4.3.11
 New Comment:

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




Previous Comments:


[2005-05-05 12:29:55] andreybl at matrix dot co dot il

Description:

Apache version: 1.3.33
Informix server version: IDS 9.40.UC5
Informix SDK version: csdk_informix.2.90

'./configure' '--with-informix=/isoc/informix'
'--with-config-file-path=/isoc/apache/conf' '--enable-track-vars'
'--with-apache=/isoc/sources/apache' '--without-mysql' 

NOTE: 
The problem occurs in PHP Apache Module ONLY and NOT occurs in PHP
CGI.

Description:
Segmentation Fault in httpd when call to the 
ifx_fetch_row() while among the fields to be selected there is a field
of type TEXT containing NON-NULL data:

- In httpd log file (./apache/logs/error_log): 

[Thu May  5 12:02:10 2005] [notice] child pid 20754 exit signal
Segmentation fault (11)

- In browser: 

The page cannot be displayed

Seems my BUG is simillar to #8715, which was closed since there was No
feedback. So probably the problem in #8715 still persists too.

Please, take care of this report as soon as possible, since it is of
Critical severity for me. Actually this stops the whole project.

Thanks,
Andrey





Reproduce code:
---
$trace = fopen('/tmp/php_bug.txt', 'w+');

$conn_id = ifx_connect('DB', 'USER', 'PASS');
if (!$conn_id)
{
echo FAILED TO CONNECT; die();
}
fwrite($trace, after ifx_connect\n); fflush($trace);

$res_id  = ifx_query('SELECT * FROM registrars where regid = 5',
$conn_id);
if (!$res_id)
{
echo FAILED TO PREPARE; echo ifx_getsqlca(); die();
}
fwrite($trace, after ifx_query\n); fflush($trace);

$row = ifx_fetch_row($res_id);
fwrite($trace, after ifx_fetch_row: regid = {$row['regid']}\n);
fflush($trace);

ifx_free_result($res_id);
fwrite($trace, after ifx_free_result\n); fflush($trace);

ifx_close($conn_id);
fwrite($trace, after ifx_close\n); fflush($trace);

Expected result:

Hm. I expect the httpd not to crash.

Actual result:
--
Here is the backtrace:
Program received signal SIGSEGV, Segmentation fault.
0xb7359e6f in _int_free () from /lib/tls/libc.so.6
(gdb) bt
#0  0xb7359e6f in _int_free () from /lib/tls/libc.so.6
#1  0xb7358e68 in free () from /lib/tls/libc.so.6
#2  0xb7583c3c in ifx_free_sqldata () from
/isoc/informix/lib/esql/libifsql.so
#3  0xb7583a80 in sqli_desc_dealloc () from
/isoc/informix/lib/esql/libifsql.so
#4  0x080b4a14 in zif_ifx_free_result ()
#5  0x080abca6 in execute ()
#6  0x0809fa5b in zend_execute_scripts ()
#7  0x0808193b in php_execute_script ()
#8  0x080aee8e in apache_php_module_main ()
#9  0x0807a772 in ap_get_server_built ()
#10 0x0807a7dc in ap_get_server_built ()
#11 0x0812e6d3 in ap_invoke_handler ()
#12 0x0814356f in ap_some_auth_required ()
#13 0x081435ce in ap_process_request ()
#14 0x0813a731 in ap_child_terminate ()
#15 0x0813a8d1 in ap_child_terminate ()
#16 0x0813aa37 in ap_child_terminate ()
#17 0x0813b0ee in ap_child_terminate ()
#18 0x0813b90c in main ()
(gdb) qui

In the test program above I fetch only one row. If the TEXT field in
the row has NULL value everything's OK and the output in the
php_bug.txt file (see the programm) is the following:

after ifx_connect
after ifx_query
after ifx_fetch_row: regid = 3
after ifx_free_result
after ifx_close

i.e. all the functions returned ok.

If the TEXT field in the row has non-NULL data, then the SEGV occurs
and the output in the php_bug.txt test file is:
after ifx_connect
after ifx_query
after ifx_fetch_row: regid = 11

i.e. ifx_free_result did not return.

NOTE: if the TEXT-type field is not in the list of the filds to be
selected, then everything is OK.






-- 
Edit this bug report at http://bugs.php.net/?id=32954edit=1


#32954 [Opn-Fbk]: ifx_fetch_row() : SEGV if row has TEXT fields (PHP Apache Module only)

2005-05-17 Thread sniper
 ID:   32954
 Updated by:   [EMAIL PROTECTED]
 Reported By:  andreybl at matrix dot co dot il
-Status:   Open
+Status:   Feedback
 Bug Type: Informix related
 Operating System: Red Hat 3.0 ES
 PHP Version:  4.3.11
 New Comment:

Yes, but we're focused on PHP 5 now. If you can check it happens with
PHP 5 too, there's much more interest in fixing it and backporting the
fix to PHP 4 too.



Previous Comments:


[2005-05-17 10:23:14] andreybl at matrix dot co dot il

Hi.
You propose me to check with the snapshot of the fifth (5)
version of PHP.
The problem, that I MUST use the fourth (4)



[2005-05-17 09:07:23] [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





[2005-05-05 12:29:55] andreybl at matrix dot co dot il

Description:

Apache version: 1.3.33
Informix server version: IDS 9.40.UC5
Informix SDK version: csdk_informix.2.90

'./configure' '--with-informix=/isoc/informix'
'--with-config-file-path=/isoc/apache/conf' '--enable-track-vars'
'--with-apache=/isoc/sources/apache' '--without-mysql' 

NOTE: 
The problem occurs in PHP Apache Module ONLY and NOT occurs in PHP
CGI.

Description:
Segmentation Fault in httpd when call to the 
ifx_fetch_row() while among the fields to be selected there is a field
of type TEXT containing NON-NULL data:

- In httpd log file (./apache/logs/error_log): 

[Thu May  5 12:02:10 2005] [notice] child pid 20754 exit signal
Segmentation fault (11)

- In browser: 

The page cannot be displayed

Seems my BUG is simillar to #8715, which was closed since there was No
feedback. So probably the problem in #8715 still persists too.

Please, take care of this report as soon as possible, since it is of
Critical severity for me. Actually this stops the whole project.

Thanks,
Andrey





Reproduce code:
---
$trace = fopen('/tmp/php_bug.txt', 'w+');

$conn_id = ifx_connect('DB', 'USER', 'PASS');
if (!$conn_id)
{
echo FAILED TO CONNECT; die();
}
fwrite($trace, after ifx_connect\n); fflush($trace);

$res_id  = ifx_query('SELECT * FROM registrars where regid = 5',
$conn_id);
if (!$res_id)
{
echo FAILED TO PREPARE; echo ifx_getsqlca(); die();
}
fwrite($trace, after ifx_query\n); fflush($trace);

$row = ifx_fetch_row($res_id);
fwrite($trace, after ifx_fetch_row: regid = {$row['regid']}\n);
fflush($trace);

ifx_free_result($res_id);
fwrite($trace, after ifx_free_result\n); fflush($trace);

ifx_close($conn_id);
fwrite($trace, after ifx_close\n); fflush($trace);

Expected result:

Hm. I expect the httpd not to crash.

Actual result:
--
Here is the backtrace:
Program received signal SIGSEGV, Segmentation fault.
0xb7359e6f in _int_free () from /lib/tls/libc.so.6
(gdb) bt
#0  0xb7359e6f in _int_free () from /lib/tls/libc.so.6
#1  0xb7358e68 in free () from /lib/tls/libc.so.6
#2  0xb7583c3c in ifx_free_sqldata () from
/isoc/informix/lib/esql/libifsql.so
#3  0xb7583a80 in sqli_desc_dealloc () from
/isoc/informix/lib/esql/libifsql.so
#4  0x080b4a14 in zif_ifx_free_result ()
#5  0x080abca6 in execute ()
#6  0x0809fa5b in zend_execute_scripts ()
#7  0x0808193b in php_execute_script ()
#8  0x080aee8e in apache_php_module_main ()
#9  0x0807a772 in ap_get_server_built ()
#10 0x0807a7dc in ap_get_server_built ()
#11 0x0812e6d3 in ap_invoke_handler ()
#12 0x0814356f in ap_some_auth_required ()
#13 0x081435ce in ap_process_request ()
#14 0x0813a731 in ap_child_terminate ()
#15 0x0813a8d1 in ap_child_terminate ()
#16 0x0813aa37 in ap_child_terminate ()
#17 0x0813b0ee in ap_child_terminate ()
#18 0x0813b90c in main ()
(gdb) qui

In the test program above I fetch only one row. If the TEXT field in
the row has NULL value everything's OK and the output in the
php_bug.txt file (see the programm) is the following:

after ifx_connect
after ifx_query
after ifx_fetch_row: regid = 3
after ifx_free_result
after ifx_close

i.e. all the functions returned ok.

If the TEXT field in the row has non-NULL data, then the SEGV occurs
and the output in the php_bug.txt test file is:
after ifx_connect
after ifx_query
after ifx_fetch_row: regid = 11

i.e. ifx_free_result did not return.

NOTE: if the TEXT-type field is not in the list of the filds to be
selected, then everything is OK.






-- 
Edit this bug report at http://bugs.php.net/?id=32954edit=1


#32954 [Opn-Fbk]: ifx_fetch_row() : SEGV if row has TEXT fields (PHP Apache Module only)

2005-05-17 Thread sniper
 ID:   32954
 Updated by:   [EMAIL PROTECTED]
 Reported By:  andreybl at matrix dot co dot il
-Status:   Open
+Status:   Feedback
 Bug Type: Informix related
 Operating System: Red Hat 3.0 ES
 PHP Version:  4.3.11
 New Comment:

That does not matter. (1.3.33 is better though, IMO :)


Previous Comments:


[2005-05-17 10:29:54] andreybl at matrix dot co dot il

I see. Well. What Apache version do You want me to use: 1 or 2?



[2005-05-17 10:24:59] [EMAIL PROTECTED]

Yes, but we're focused on PHP 5 now. If you can check it happens with
PHP 5 too, there's much more interest in fixing it and backporting the
fix to PHP 4 too.




[2005-05-17 10:23:14] andreybl at matrix dot co dot il

Hi.
You propose me to check with the snapshot of the fifth (5)
version of PHP.
The problem, that I MUST use the fourth (4)



[2005-05-17 09:07:23] [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





[2005-05-05 12:29:55] andreybl at matrix dot co dot il

Description:

Apache version: 1.3.33
Informix server version: IDS 9.40.UC5
Informix SDK version: csdk_informix.2.90

'./configure' '--with-informix=/isoc/informix'
'--with-config-file-path=/isoc/apache/conf' '--enable-track-vars'
'--with-apache=/isoc/sources/apache' '--without-mysql' 

NOTE: 
The problem occurs in PHP Apache Module ONLY and NOT occurs in PHP
CGI.

Description:
Segmentation Fault in httpd when call to the 
ifx_fetch_row() while among the fields to be selected there is a field
of type TEXT containing NON-NULL data:

- In httpd log file (./apache/logs/error_log): 

[Thu May  5 12:02:10 2005] [notice] child pid 20754 exit signal
Segmentation fault (11)

- In browser: 

The page cannot be displayed

Seems my BUG is simillar to #8715, which was closed since there was No
feedback. So probably the problem in #8715 still persists too.

Please, take care of this report as soon as possible, since it is of
Critical severity for me. Actually this stops the whole project.

Thanks,
Andrey





Reproduce code:
---
$trace = fopen('/tmp/php_bug.txt', 'w+');

$conn_id = ifx_connect('DB', 'USER', 'PASS');
if (!$conn_id)
{
echo FAILED TO CONNECT; die();
}
fwrite($trace, after ifx_connect\n); fflush($trace);

$res_id  = ifx_query('SELECT * FROM registrars where regid = 5',
$conn_id);
if (!$res_id)
{
echo FAILED TO PREPARE; echo ifx_getsqlca(); die();
}
fwrite($trace, after ifx_query\n); fflush($trace);

$row = ifx_fetch_row($res_id);
fwrite($trace, after ifx_fetch_row: regid = {$row['regid']}\n);
fflush($trace);

ifx_free_result($res_id);
fwrite($trace, after ifx_free_result\n); fflush($trace);

ifx_close($conn_id);
fwrite($trace, after ifx_close\n); fflush($trace);

Expected result:

Hm. I expect the httpd not to crash.

Actual result:
--
Here is the backtrace:
Program received signal SIGSEGV, Segmentation fault.
0xb7359e6f in _int_free () from /lib/tls/libc.so.6
(gdb) bt
#0  0xb7359e6f in _int_free () from /lib/tls/libc.so.6
#1  0xb7358e68 in free () from /lib/tls/libc.so.6
#2  0xb7583c3c in ifx_free_sqldata () from
/isoc/informix/lib/esql/libifsql.so
#3  0xb7583a80 in sqli_desc_dealloc () from
/isoc/informix/lib/esql/libifsql.so
#4  0x080b4a14 in zif_ifx_free_result ()
#5  0x080abca6 in execute ()
#6  0x0809fa5b in zend_execute_scripts ()
#7  0x0808193b in php_execute_script ()
#8  0x080aee8e in apache_php_module_main ()
#9  0x0807a772 in ap_get_server_built ()
#10 0x0807a7dc in ap_get_server_built ()
#11 0x0812e6d3 in ap_invoke_handler ()
#12 0x0814356f in ap_some_auth_required ()
#13 0x081435ce in ap_process_request ()
#14 0x0813a731 in ap_child_terminate ()
#15 0x0813a8d1 in ap_child_terminate ()
#16 0x0813aa37 in ap_child_terminate ()
#17 0x0813b0ee in ap_child_terminate ()
#18 0x0813b90c in main ()
(gdb) qui

In the test program above I fetch only one row. If the TEXT field in
the row has NULL value everything's OK and the output in the
php_bug.txt file (see the programm) is the following:

after ifx_connect
after ifx_query
after ifx_fetch_row: regid = 3
after ifx_free_result
after ifx_close

i.e. all the functions returned ok.

If the TEXT field in the row has non-NULL data, then the SEGV occurs
and the output in the php_bug.txt test file is:
after ifx_connect
after ifx_query
after ifx_fetch_row: regid = 11

i.e. ifx_free_result did not return.

NOTE: if the TEXT-type field is not in the list of the filds to be
selected, then everything is OK.