Skip to Content.
Sympa Menu

freetds - Re: apache php module crashing when accessing freet ds libraries

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Chris <ccortner AT cvol.net>
  • To: TDS Development Group <freetds AT franklin.oit.unc.edu>
  • Subject: Re: apache php module crashing when accessing freet ds libraries
  • Date: 14 Nov 2002 16:18:55 -0600


I only have a little bit of experience with gdb none with using it to
debug libraries. If you tell me what I need to do I'll do it, if
anything for the educational value. Otherwise I'm going home for the
night and I'll have to send you a backtrace sometime tommorow.

Thanks for all the help so far.

Chris

On Thu, 2002-11-14 at 16:06, Lowden, James K wrote:
> > From: Chris [mailto:ccortner AT cvol.net]
> > Sent: November 14, 2002 3:57 PM
> >
> > I'm using the latest snapshot of freetds. Here is the output of the
> > configuration log. Also I set TDSDUMP="" to get a log from the apache
> > module.
>
> No magic. :( Here's what I see:
>
> > 2002-11-14 14:32:40.106372 option = 'tds version' value = '7.0'.
> Hmm. Well, guess #1 was no good. (That log is from the apache module
> version, right?) I thought you said you weren't getting anything from the
> server under apache.
>
> > pid: 26520:2002-11-14 14:32:40.205138 inside dbconvert() srctype = 108
> > desttype = 47
>
> converting numeric to char
>
> > pid: 26520:2002-11-14 14:32:40.205254 inside dbconvert() calling
> > tds_convert
> > pid: 26520:2002-11-14 14:32:40.205415 inside dbconvert() outputting 8
> > bytes character data destlen = -1
>
> conversion yielded an 8 byte null-terminated string.
>
> > pid: 26520:2002-11-14 14:32:40.205530 dbdatlen() type = 111
> > pid: 26520:2002-11-14 14:32:40.205624 leaving dbdatlen() returning 0
>
> found a null (or empty) datetime
>
> > pid: 26520:2002-11-14 14:32:40.205724 dbdatlen() type = 38
> > pid: 26520:2002-11-14 14:32:40.205820 leaving dbdatlen() returning 0
>
> found a null (or empty) char
>
> Fade to black.
>
> Sure looks like a failure in the upper layers, although that could be
> because we lied about something to it.
>
> My next step would be to try to see a backtrace. Can you get a core dump or
> is it possible to run the whole thing inside the debugger, so you can get
> control when the segfault happens?
>
> I can't think of any reason FreeTDS would care whether it's called from
> PHP's CLI or from its Apache module. If there's no environmental
> difference, I'd say either the latter is making an existing problem more
> obvious, or has a problem of its own.
>
> I looked over the code, and didn't find any glaring error. Besides, your
> CLI log shows nothing but repeated calls to dbdatlen and stuff to fetch
> rows. No reason for that sort of thing to go awry in midflight. OTOH, a
> lot of this has been changing lately, and new bugs are written every day.
>
> Memo to file: It would be nice if the raw TDS stream could be written to
> file and reprocessed in a test harness. The existing TDSDUMP format has
> elements of a data log and a trace. Can the stream be reconstructed from
> it?
>
> I'm a bit stuck, Chris. It may well be that the problem lies in something
> FreeTDS is doing, but it's sure not obvious where or how. The bt will
> certainly make things clearer.
>
> --jkl
>
>
> > 2002-11-14 14:32:40.101919 Attempting to read conf files.
> > 2002-11-14 14:32:40.102182 ...$FREETDSCONF not set. Trying $HOME.
> > 2002-11-14 14:32:40.102538 Found conf file
> > '/usr/local/freetds/etc/freetds.conf' (default). Reading section
> > '0-ecpc-2'.
> > 2002-11-14 14:32:40.102619 Looking for section global.
> > 2002-11-14 14:32:40.102737 ... Found section global.
> > 2002-11-14 14:32:40.102779 Got a match.
> > 2002-11-14 14:32:40.102814 option = 'tds version' value = '4.2'.
> > 2002-11-14 14:32:40.102863 option = 'initial block size'
> > value = '512'.
> > 2002-11-14 14:32:40.102903 option = 'swap broken dates' value = 'no'.
> > 2002-11-14 14:32:40.102935 no is a 'no/off/false'.
> > 2002-11-14 14:32:40.102969 option = 'swap broken money' value = 'no'.
> > 2002-11-14 14:32:40.102999 no is a 'no/off/false'.
> > 2002-11-14 14:32:40.103032 option = 'try server login' value = 'no'.
> > 2002-11-14 14:32:40.103062 no is a 'no/off/false'.
> > 2002-11-14 14:32:40.103094 option = 'try domain login' value = 'yes'.
> > 2002-11-14 14:32:40.103124 yes is a 'yes/on/true'.
> > 2002-11-14 14:32:40.103156 option = 'nt domain' value = 'ECPC2000'.
> > 2002-11-14 14:32:40.103195 option = 'cross domain login' value = 'no'.
> > 2002-11-14 14:32:40.103226 no is a 'no/off/false'.
> > 2002-11-14 14:32:40.103262 option = 'dump file' value =
> > '/usr/local/freetds/freetds.log'.
> > 2002-11-14 14:32:40.103299 option = 'debug level' value = '10'.
> > 2002-11-14 14:32:40.103375 option = 'text size' value = '64512'.
> > 2002-11-14 14:32:40.103413 ... Found section 0-ecpc-2.
> > 2002-11-14 14:32:40.103463 ... Found section jdbc.
> > 2002-11-14 14:32:40.103527 Looking for section 0-ecpc-2.
> > 2002-11-14 14:32:40.103598 ... Found section global.
> > 2002-11-14 14:32:40.103690 ... Found section 0-ecpc-2.
> > 2002-11-14 14:32:40.103720 Got a match.
> > 2002-11-14 14:32:40.103750 option = 'host' value = '192.58.100.17'.
> > 2002-11-14 14:32:40.103781 Found host entry 192.58.100.17.
> > 2002-11-14 14:32:40.106133 IP addr is 192.58.100.17.
> > 2002-11-14 14:32:40.106328 option = 'port' value = '1433'.
> > 2002-11-14 14:32:40.106372 option = 'tds version' value = '7.0'.
> > 2002-11-14 14:32:40.106410 option = 'dump file append' value = 'yes'.
> > 2002-11-14 14:32:40.106443 yes is a 'yes/on/true'.
> > pid: 26520:2002-11-14 14:32:40.106489 ... Found section jdbc.
> > pid: 26520:2002-11-14 14:32:40.106556 ...Success.
> > pid: 26520:2002-11-14 14:32:40.106666 Setting 'dump_file' to
> > '/tmp/freetds.log.26520' from $TDSDUMP.
> >
> > Also here are tails of the logs from:
> >
> > The cli version of php which worked
> >
> > pid: 26697:2002-11-14 14:38:15.956176 inside
> > tds_willconvert() 108 47 1
> > pid: 26697:2002-11-14 14:38:15.956325 dbdatlen() type = 108
> > pid: 26697:2002-11-14 14:38:15.956460 leaving dbdatlen() returning 35
> > pid: 26697:2002-11-14 14:38:15.956607 inside dbconvert() srctype = 108
> > desttype = 47
> > pid: 26697:2002-11-14 14:38:15.956754 inside dbconvert() calling
> > tds_convert
> > pid: 26697:2002-11-14 14:38:15.957030 inside dbconvert() outputting 8
> > bytes character data destlen = -1
> > pid: 26697:2002-11-14 14:38:15.957216 dbdatlen() type = 111
> > pid: 26697:2002-11-14 14:38:15.957356 leaving dbdatlen() returning 0
> > pid: 26697:2002-11-14 14:38:15.957501 dbdatlen() type = 38
> > pid: 26697:2002-11-14 14:38:15.957638 leaving dbdatlen() returning 0
> > pid: 26697:2002-11-14 14:38:15.957778 dbdatlen() type = 111
> > pid: 26697:2002-11-14 14:38:15.957916 leaving dbdatlen() returning 8
> > pid: 26697:2002-11-14 14:38:15.958057 inside tds_willconvert()
> > pid: 26697:2002-11-14 14:38:15.958216 inside tds_willconvert() 61 47 1
> > pid: 26697:2002-11-14 14:38:15.958365 dbdatlen() type = 111
> > pid: 26697:2002-11-14 14:38:15.958500 leaving dbdatlen() returning 8
> > pid: 26697:2002-11-14 14:38:15.958644 inside dbconvert() srctype = 61
> > desttype = 47
> > pid: 26697:2002-11-14 14:38:15.958819 inside dbconvert() calling
> > tds_convert
> > pid: 26697:2002-11-14 14:38:15.959000 inside dbconvert() outputting 19
> > bytes character data destlen = -1
> > pid: 26697:2002-11-14 14:38:15.959170 dbdatlen() type = 38
> > pid: 26697:2002-11-14 14:38:15.959305 leaving dbdatlen() returning 0
> > pid: 26697:2002-11-14 14:38:15.959449 dbdatlen() type = 39
> > pid: 26697:2002-11-14 14:38:15.959585 leaving dbdatlen() returning 0
> > pid: 26697:2002-11-14 14:38:15.959727 dbdatlen() type = 39
> > pid: 26697:2002-11-14 14:38:15.959860 leaving dbdatlen() returning 0
> > pid: 26697:2002-11-14 14:38:15.960002 dbdatlen() type = 39
> > pid: 26697:2002-11-14 14:38:15.960132 leaving dbdatlen() returning 0
> > pid: 26697:2002-11-14 14:38:15.960272 inside dbnextrow()
> > pid: 26697:2002-11-14 14:38:15.960410 processing row tokens.
> > marker is
> > fd
> > pid: 26697:2002-11-14 14:38:15.960561 inside tds_process_end()
> > more_results = 0, was_cancelled = 0
> > pid: 26697:2002-11-14 14:38:15.960721 leaving dbnextrow() returning -2
> >
> >
> > and a tail from the module version run
> >
> > pid: 26520:2002-11-14 14:32:40.204776 inside
> > tds_willconvert() 108 47 1
> > pid: 26520:2002-11-14 14:32:40.204913 dbdatlen() type = 108
> > pid: 26520:2002-11-14 14:32:40.205026 leaving dbdatlen() returning 35
> > pid: 26520:2002-11-14 14:32:40.205138 inside dbconvert() srctype = 108
> > desttype = 47
> > pid: 26520:2002-11-14 14:32:40.205254 inside dbconvert() calling
> > tds_convert
> > pid: 26520:2002-11-14 14:32:40.205415 inside dbconvert() outputting 8
> > bytes character data destlen = -1
> > pid: 26520:2002-11-14 14:32:40.205530 dbdatlen() type = 111
> > pid: 26520:2002-11-14 14:32:40.205624 leaving dbdatlen() returning 0
> > pid: 26520:2002-11-14 14:32:40.205724 dbdatlen() type = 38
> > pid: 26520:2002-11-14 14:32:40.205820 leaving dbdatlen() returning 0
> > ----no entries after the previous line =----
>
>
> The information contained in this transmission may contain privileged and
> confidential information and is intended only for the use of the person(s)
> named above. If you are not the intended recipient, or an employee or agent
> responsible for delivering this message to the intended recipient, any
> review, dissemination, distribution or duplication of this communication is
> strictly prohibited. If you are not the intended recipient, please contact
> the sender immediately by reply e-mail and destroy all copies of the
> original message. Please note that we do not accept account orders and/or
> instructions by e-mail, and therefore will not be responsible for carrying
> out such orders and/or instructions.
>
>
>
> ---
> You are currently subscribed to freetds as: [ccortner AT cvol.net]
> To unsubscribe, forward this message to $subst('Email.Unsub')
> ---
> [This E-mail scanned for viruses by Declude Virus]
>
>
>


---
[This E-mail scanned for viruses by Declude Virus]





Archive powered by MHonArc 2.6.24.

Top of Page