|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2001-05-15 10:25 UTC] ville dot alkkiomaki at sonera dot com
Following script causes Bus error with php 4.0.5 & Solid 3.x (and at least 4.0.3 & 4.0.1pl2). It crashes identically as a standalone cgi binary and as a apache module.
<?php
error_reporting(255);
if($hdbc=odbc_connect("tcp localhost 1313","login", "password")) {
if($hstmt=odbc_prepare($hdbc, "SELECT * FROM FX_USER WHERE LOGIN=?")) {
if(odbc_execute($hstmt,array("user"))) {
print("OK -- query completed with success\n");
}
}
odbc_commit($hdbc);
odbc_close($hdbc);
} else print("Connect to database failed.\n");
?>
Where odbc_prepare causes Bus error and gdb gives following backtrace when configured with "--with-solid --enable-debug".
#0 0xef6c7bb4 in ssa_stmt_getstmtintegerproperty ()
from /usr/lib/libsocssx35.so
#1 0xef6c4070 in SSAGetIntegerProperty () from /usr/lib/libsocssx35.so
#2 0xef6aabb4 in SQLNumParams_nomutex () from /usr/lib/libsocssx35.so
#3 0xef6aac74 in SQLNumParams () from /usr/lib/libsocssx35.so
#4 0x32bc8 in php_if_odbc_prepare (ht=2, return_value=0x1d1080, this_ptr=0x0,
return_value_used=1) at php_odbc.c:812
#5 0x14acd8 in execute ()
#6 0xef07c in zend_execute_scripts (type=8, file_count=3) at zend.c:743
#7 0x27880 in php_execute_script (primary_file=0xeffffbc8) at main.c:1209
#8 0x24424 in main (argc=2, argv=0xeffffc6c) at cgi_main.c:730
Above script works fine with php 3.0.18RC1 & Solid 3.0 SDK. Older php3 releases had problems to compile with Solid 3.x, but if I recall right php version 3.0.1* had also similar problems. (required little hacking to compile)
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 23:00:01 2025 UTC |
Got little further, now commit is causing segmentation faults.. :) However changing line 2423 from ext/odbc/php_odbc.c from: #ifndef HAVE_DBMAKER if ((*pv_onoff)) { #else if (pv_onoff && (*pv_onoff)) { #endif to: #if !defined(HAVE_DBMAKER) && !defined(HAVE_SOLID) && !defined(HAVE_SOLID_30) &&!defined(HAVE_SOLID_35) if ((*pv_onoff)) { #else if (pv_onoff && (*pv_onoff)) { #endif ..seems to fix problems this time...actually the change in the source (which I thought made it into 4.0.5) was: from: #ifndef HAVE_DBMAKER if ((*pv_onoff)) { #else if (pv_onoff && (*pv_onoff)) { #endif to: if (pv_onoff && (*pv_onoff)) { the SQLSMALLINT and the SWORD are defined to be the same in Solid 3.5 (both are short ints).