From: schulmat at cms dot hu-berlin dot de
Operating system: Solaris 9/10
PHP version: 5.2.5
PHP Bug Type: Sybase-ct (ctlib) related
Bug description: Incurred fault #6 - if returned textfield ist empty
Description:
------------
The problem can reproduced on Solaris 9 and Solaris 10.
If I compile php with
./configure \
--prefix=/usr/local/wwwbin/php-5.2.5 \
--with-apxs2=/usr/local/wwwbin/apache/bin/apxs \ (Apache 2.2.6)
--with-sybase-ct=/opt/csw (freetds-version 0.64 from blastwave)
and perform this simple query:
select DC_Rights from Resource R where R.Resource_ID = 123;
(DC_Rights type text, Resource_ID = 123 exists, should return "(empty) not
NULL, works via tsql)
i get "Incurred fault #6".
Reproduce code:
---------------
<?php
require("DBConnection.cls.php"); // database connection
$db=new DBConnection(); // new object
$test = "set textsize 262144";
echo $test."<br />";
//$db->submitQuery($test); flush();
$query = "select DC_Rights from Resource R where R.Resource_ID = 122"; //
expected Result: NULL
flush();
$res_id = $db->submitQuery($query); // works!
$query = "select DC_Rights from Resource R where R.Resource_ID = 123"; //
expected Result: ""
flush();
$res_id = $db->submitQuery($query); // doesn't work. Apache: Segmentation
fault (11)
echo "done!";
flush();
exit();
?>
Expected result:
----------------
set textsize 262144
select DC_Rights from Resource R where R.Resource_ID = 122
select DC_Rights from Resource R where R.Resource_ID = 123
done!
Actual result:
--------------
Output:
Warning: sybase_connect() [function.sybase-connect]: Sybase: Server
message: Changed client character set setting to 'iso_1'. (severity 10,
procedure N/A) in /usr/local/htdocs/DBConnection.cls.php on line 7
Warning: sybase_connect() [function.sybase-connect]: Sybase: Server
message: Changed database context to 'metadb'. (severity 10, procedure N/A)
in /usr/local/htdocs/DBConnection.cls.php on line 7
Warning: sybase_select_db() [function.sybase-select-db]: Sybase: Server
message: Changed database context to 'metadb'. (severity 10, procedure N/A)
in /usr/local/htdocs/DBConnection.cls.php on line 10
set textsize 262144
select DC_Rights from Resource R where R.Resource_ID = 27397
select DC_Rights from Resource R where R.Resource_ID = 20676
truss output php-cli:
time() = 1197455005
pollsys(0xFFBFE900, 1, 0x00000000, 0x00000000) = 1
read(4, "FD\0\0\002\0\0\0\0", 9) = 9
time() = 1197455005
time() = 1197455005
sigaction(SIGPIPE, 0xFFBFEBA0, 0xFFBFEC40) = 0
pollsys(0xFFBFEBE8, 1, 0x00000000, 0x00000000) = 1
write(4, "0F01\018\0\0\0\0 !\0\0\0".., 24) = 24
sigaction(SIGPIPE, 0xFFBFEBA0, 0xFFBFEC40) = 0
time() = 1197455005
pollsys(0xFFBFEA08, 1, 0x00000000, 0x00000000) = 1
read(4, "0401\0 r\0\0\0\0", 8) = 8
time() = 1197455005
time() = 1197455005
pollsys(0xFFBFEA08, 1, 0x00000000, 0x00000000) = 1
read(4, "E3\00F0106 m e t a d b06".., 106) = 106
time() = 1197455005
write(1, "\n W a r n i n g : s y".., 177) = 177
Warning: sybase_select_db(): Sybase: Server message: Changed database
context to 'metadb'.
(severity 10, procedure N/A) in /usr/local/htdocs/DBConnection.cls.php on
line 10
write(1, " s e l e c t D C _ R i".., 64) = 64
time() = 1197453664
sigaction(SIGPIPE, 0xFFBFEBA0, 0xFFBFEC40) = 0
pollsys(0xFFBFEBE8, 1, 0x00000000, 0x00000000) = 1
write(4, "0F01\0 J\0\0\0\0 !\0\0\0".., 74) = 74
sigaction(SIGPIPE, 0xFFBFEBA0, 0xFFBFEC40) = 0
time() = 1197453664
pollsys(0xFFBFEA08, 1, 0x00000000, 0x00000000) = 1
read(4, "0401\0 ;\0\0\0\0", 8) = 8
time() = 1197453664
time() = 1197453664
pollsys(0xFFBFEA08, 1, 0x00000000, 0x00000000) = 1
read(4, "EE\0 !\001\t D C _ R i g".., 51) = 51
time() = 1197453664
write(1, " s e l e c t D C _ R i".., 64) = 64
time() = 1197453664
sigaction(SIGPIPE, 0xFFBFEBA0, 0xFFBFEC40) = 0
pollsys(0xFFBFEBE8, 1, 0x00000000, 0x00000000) = 1
write(4, "0F01\0 J\0\0\0\0 !\0\0\0".., 74) = 74
sigaction(SIGPIPE, 0xFFBFEBA0, 0xFFBFEC40) = 0
time() = 1197453664
pollsys(0xFFBFEA08, 1, 0x00000000, 0x00000000) = 1
read(4, "0401\0 W\0\0\0\0", 8) = 8
time() = 1197453664
time() = 1197453664
pollsys(0xFFBFEA08, 1, 0x00000000, 0x00000000) = 1
read(4, "EE\0 !\001\t D C _ R i g".., 79) = 79
time() = 1197453664
Incurred fault #6, FLTBOUNDS %pc = 0xFEC40E48
siginfo: SIGSEGV SEGV_MAPERR addr=0x004DE000
Received signal #11, SIGSEGV [default]
siginfo: SIGSEGV SEGV_MAPERR addr=0x004DE000
--
Edit bug report at http://bugs.php.net/?id=43578&edit=1
--
Try a CVS snapshot (PHP 4.4):
http://bugs.php.net/fix.php?id=43578&r=trysnapshot44
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=43578&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=43578&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=43578&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=43578&r=fixedcvs
Fixed in release:
http://bugs.php.net/fix.php?id=43578&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=43578&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=43578&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=43578&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=43578&r=support
Expected behavior: http://bugs.php.net/fix.php?id=43578&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=43578&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=43578&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=43578&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=43578&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=43578&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=43578&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=43578&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=43578&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=43578&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=43578&r=mysqlcfg