Skip to Content.
Sympa Menu

freetds - Re: [PATCH] Solaris/Intel client, Sybase server: Unknown marker: 105!!

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: [PATCH] Solaris/Intel client, Sybase server: Unknown marker: 105!!
  • Date: Wed, 22 Aug 2001 15:40:33 -0400 (EDT)


Hi,

Thanks for the patch. I'm a bit preoccupied with a paying gig right now,
so not much work is going into FreeTDS at the moment (by me
anyway). Hopefully thing will shake loose in a few weeks.

Anyway, the patch is commited to CVS.

Cheers,

Brian

On Wed, 22 Aug 2001, Steve Willer wrote:

>
> 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.





Archive powered by MHonArc 2.6.24.

Top of Page