freetds AT lists.ibiblio.org
Subject: FreeTDS Development Group
List archive
Re: [PATCH] Solaris/Intel client, Sybase server: Unknown marker: 105!!
- From: Steve Willer <willer AT novator.com>
- To: TDS Development Group <freetds AT franklin.oit.unc.edu>
- Subject: Re: [PATCH] Solaris/Intel client, Sybase server: Unknown marker: 105!!
- Date: Wed, 22 Aug 2001 14:18:30 -0400 (EDT)
On Tue, 21 Aug 2001, Steve Willer wrote:
> If I run a "select * from sometable" query, and then fetch the rows one by
> one, at around 200 or 300 retrieved rows, the client starts to freak out.
>
> Here's a relevant excerpt:
>
> READING ROW 411:
> READING ROW 412:
> Out of memory during ridiculously large request at
> modules/VR/Kernel/Database.pm line 1282.
> Unknown marker: 44!!
> Unknown marker: 114!!
Okay. It cost me a day, but I've figured it out. This is what happens:
a) when reading the packet headers for a large-ish query result, at some
point down the line eventually the 8-byte packet header is divided up
over two tcp packets (at least when I run it here, with our config)
b) goodread(), in src/tds/read.c, assumes that read() returns all of the
data it asked for, and in this particular case gets 4 bytes instead of
8
c) tds_process_row(), two functions down the call stack, assumes that it
got all 8 header bytes, and therefore gets an invalid packet length
d) numbers are now bad, malloc is given bad sizes for allocation, and
somehow Perl 5.6.1 has overridden malloc
e) Perl (rudely) lops a bunch of functions off the top of the stack,
throwing FreeTDS into an out-of-phase situation it can never recover
from
f) stick a fork in it, it's done
The good news is it's a one-line fix.
The bad line, around line 95 in src/tds/read.c, in the goodread()
function says this:
got = READ(tds->s, buf, buflen);
it should say this:
while (got < buflen) {
got += READ(tds->s, buf + got, buflen - got);
}
If someone could fix this in the CVS copy, I would appreciate it.
-
Re: [PATCH] Solaris/Intel client, Sybase server: Unknown marker: 105!!,
Steve Willer, 08/22/2001
- <Possible follow-up(s)>
- Re: [PATCH] Solaris/Intel client, Sybase server: Unknown marker: 105!!, Brian Bruns, 08/22/2001
- Re: [PATCH] Solaris/Intel client, Sybase server: Unknown marker: 105!!, Craig Jackson, 08/22/2001
- Re: [PATCH] Solaris/Intel client, Sybase server: Unknown marker: 105!!, Steve Willer, 08/22/2001
- Re: [PATCH] Solaris/Intel client, Sybase server: Unknown marker: 105!!, Steve Willer, 08/23/2001
Archive powered by MHonArc 2.6.24.