RE: [PHP-DEV] Segfault with PHP 4.0.3pl1/FreeTDS 0.51(Sybase-ct) under Linux
| From: | Chris Newbill | Date: | Thu, 07 Dec 2000 20:50:23 +0000 |
| Subject: | RE: [PHP-DEV] Segfault with PHP 4.0.3pl1/FreeTDS 0.51(Sybase-ct) under Linux | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-40493@lists.php.net to get a copy of this message | ||
The backtrace....
#0 0x4007c663 in _ct_bind_data (cmd=0x81cfe08) at ct.c:488
#1 0x4007c432 in ct_fetch (cmd=0x81cfe08, type=5, offset=5, option=5,
rows_read=0x0) at ct.c:429
#2 0x80da0ca in php_sybase_fetch_result_set (sybase_ptr=0x81a3ddc) at
php_sybase_ct.c:927
#3 0x80da8ef in php_if_sybase_query (ht=2, return_value=0x81ce874,
this_ptr=0x0, return_value_used=1)
at php_sybase_ct.c:1098
#4 0x812f8b3 in execute (op_array=0x81ce7ac) at ./zend_execute.c:1519
#5 0x80f9562 in zend_execute_scripts (type=8, file_count=3) at zend.c:717
#6 0x806183c in php_execute_script (primary_file=0xbffff9f0) at main.c:1200
#7 0x805f6f0 in main (argc=2, argv=0xbffffaa4) at cgi_main.c:715
#8 0x40189665 in __libc_start_main (main=0x805ee7c <main>, argc=2,
ubp_av=0xbffffaa4,
init=0x805d130 <_init>, fini=0x81395ac <_fini>, rtld_fini=0x4000dca4
<_dl_fini>, stack_end=0xbffffa9c)
at ../sysdeps/generic/libc-start.c:111
Chris
-----Original Message-----
From: Chris Newbill [mailto:cnewbill@onewest.net]
Sent: Thursday, December 07, 2000 11:45 AM
To: php-dev@lists.php.net
Cc: chiahh@yahoo.com
Subject: [PHP-DEV] Segfault with PHP 4.0.3pl1/FreeTDS 0.51(Sybase-ct)
under Linux
If you received a copy of this it is because you have a similar problem
posted on bugs.php.net and I am curious if you have resolved the issue.
Whose issue it, whether it be PHP, Apache, or FreeTDS I don't know.
The following query works properly using FreeTDS 0.51 and the one below it
does not(it cause apache to segfault). BOTH queries however both work when
using ODBC(--with-esoob).
I have tried recompiling all three parties; FreeTDS, php4.0.3pl1, and
apache 1.3.14-ssl. I have also tried switching between TDS versions 4.2,
5.0, and 7.0, which doesn't really seem to make any change. The server I am
attempting to chat with is a MS SQL Server version 7.0. It does not have
any service packs, I realize that this may be a problem or the problem
itself, but I am curious as to why it would not cause a segfault with the
other queries I am doing. I have also removed GD support, etc.
select
radiusdat.username,radiusdat.callstart,radiusdat.callend,radiusdat.sessid,
radiusdat.radid,radiusdat.termid,radsvr.hostname,termserv.termname,
datediff(ss,radiusdat.callstart,radiusdat.callend) as c from
radiusdat,radsvr,termserv where radiusdat.username='cnewbill' and radsvr.id
= radiusdat.radid and termserv.id = radiusdat.termid and radiusdat.callstart
>= '2000-11-01' and radiusdat.callend <= '2000-12-01' ORDER BY
radiusdat.callstart
select
iheader.invoice,iheader.customer,customer.guarantor,iheader.shipname,
iheader.total,iheader.paid,iheader.date,customer.id,customer.name,customer.u
sername,
customer.email,customer.nextstmt,customer.laststmt from iheader,customer
where iheader.customer = customer.id and customer.username = 'cnewbill'
and customer.active = 'Y' order by iheader.date
/* The usual info */
'./configure' '--with-ftp' '--with-mysql=/usr/local/'
'--with-sybase-ct=/usr/local/freetds/' '--with-gd' '--with-jpeg-dir'
'--with-png-dir' '--with-esoob' '--with-apache=../apache_1.3.14'
Linux support.onewest.net 2.2.16-21 #1 Wed Aug 9 11:45:35 EDT 2000 i686
unknown
SYBASE=/usr/local/freetds
LD_LIBRARY_PATH=...:/usr/local/freetds
CODE SNIPPET to reproduce crash
<?
$conn = mssql_connect("XXXXXXXX" , "XXXXXXX" , "XXXXXXXX" );
print "ConnectID: $conn<br>\n";
$query = " select
iheader.invoice,iheader.customer,customer.guarantor,iheader.shipname,";
$query .=
"iheader.total,iheader.paid,iheader.date,customer.id,customer.name,customer.
username,";
$query .= "customer.email,customer.nextstmt,customer.laststmt from
iheader,customer ";
$query .= "where iheader.customer = customer.id and customer.username =
'cnewbill' and ";
$query .= "customer.active = 'Y' order by iheader.date"; // DOESNT WORK
PERIOD
$query = "select * from iheader where iheader.customer=25813"; // DOESNT
WORK PERIOD
$query = "select * from customer where id=25813"; // WORKS
print "Query $query.<BR><BR>";
print "I...can...make...";
$res = mssql_query("$query",$conn);
print "it! Yeah, I made it.";
mssql_close($conn);
?>
/* No more info */
Current PHP bugs that sound familiar to problem
http://bugs.php.net/bugs.php?id=7084
Any pointers etc would be helpful.
Chris Newbill
Programmer/Analyst
OneWest.net Inc.,
406-449-8056