Skip to Content.
Sympa Menu

freetds - Re: FreeTDS .50 and PHP4 and FreeBSD

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Brian Bruns <camber AT ais.org>
  • To: TDS Development Group <freetds AT franklin.oit.unc.edu>
  • Subject: Re: FreeTDS .50 and PHP4 and FreeBSD
  • Date: Mon, 5 Mar 2001 23:41:15 -0500 (EST)



On Mon, 5 Mar 2001, Mike Davis wrote:

> I am having issues when I do a mssql_query() in PHP4. Some queries cause
> apache to SIGSEGV others work fine. No core dump is generated. Here is a
> ktrace output of the problem happening. I am assuming from this ktrace
> that a read() is failing and not being error checked properly. I would try
> FreeTDS .51 but I cannot get it to work as of yet.
>
> The server is MSSQL 7 and I compiled freetds with TDSVERSION=42.
>
> I searched the mail archive and there seems to be a history of odd
> segmentation faults.
>
> Anyone have a clue about this? If you can give me gdb commands to run I
> can and return the results to the list etc.

If you could run 'where' or 'bt' that would be very helpful

>
> 20734 httpd CALL write(0x7,0x822dc00,0x93)
> 20734 httpd GIO fd 7 wrote 147 bytes
> "\^A\^A\0\M^S\0\0\0\0INSERT INTO assets
> (item,customer,serial,price,mac,purchased)
> VALUES('13', '2', "1", '1', "1-1-1-1-1-1", "1/1/1")"
> 20734 httpd RET write 147/0x93
* here we are sending the query to the server...fine
> 20734 httpd CALL read(0x7,0xbfbfd428,0x8)
> 20734 httpd GIO fd 7 read 8 bytes
> "\^D\^A\0\^Q\0\0\0\0"
> 20734 httpd RET read 8
* read the 8 byte header from the response...good
> 20734 httpd CALL read(0x7,0x829a800,0x9)
> 20734 httpd GIO fd 7 read 9 bytes
> "\M-}\^P\0\M-C\0\^A\0\0\0"
> 20734 httpd RET read 9
* these 9 bytes should be a TDS_DONE_TOKEN with 8 byte payload...
> 20734 httpd CALL gettimeofday(0xbfbfd048,0)
> 20734 httpd RET gettimeofday 0
* get timeofday is called by tdsdump_log() called from
* tds_process_result_tokens(), it would be the 'marker is xx' message.

> 20734 httpd PSIG SIGSEGV caught handler=0x8156f0c mask=0x0 code=0x0

* And then we segfault...so, the chain of events that should follow the
* call to tdsdump_log:
*
* tds_process_end() unlikely to cause any problems unless tds socket is
* null
*
* tds_process_result_tokens then returns control to dblib with retcode
* TDS_NO_MORE_RESULTS
*
* It must crash somewhere between the return from tds_process...() and
* the end of dbresults_r because the next call in dbresults() is another
* call to tdsdump_log which would have shown up as a call to gettimeofday
*
* However there is not much there, and if everything is uncorrupted it
* shouldn't be able to crash here.
*
> 20734 httpd CALL chdir(0x81d8fc0)
> 20734 httpd NAMI "/usr/local/apache"
> 20734 httpd RET chdir 0
> 20734 httpd CALL sigaction(0xb,0xbfbfd338,0xbfbfd320)
> 20734 httpd RET sigaction 0
> 20734 httpd CALL getpid
> 20734 httpd RET getpid 20734/0x50fe
> 20734 httpd CALL kill(0x50fe,0xb)
> 20734 httpd RET kill 0
> 20734 httpd CALL sigreturn(0xbfbfd38c)
> 20734 httpd PSIG SIGSEGV SIG_DFL


>
> Thanks,
> Mike
>





Archive powered by MHonArc 2.6.24.

Top of Page