Re: Error I don't understand, losing synch with server

From: Scott Ribe <scott_ribe(at)killerbytes(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Error I don't understand, losing synch with server
Date: 2006-03-16 20:57:30
Message-ID: C03F1F4A.44091%scott_ribe@killerbytes.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> This means either that libpq got a corrupt message from the server, or
> that libpq itself contains a bug in message parsing. Given that no one
> else has reported similar problems, the idea that your app is somehow
> clobbering the libpq message buffer (and thus corrupting the message "in
> transit") has to be taken seriously.

Gee. My code corrupting memory. Like that's never happened before ;-) I just
had to ask though since I'm not seeing other signs right now.

> You mention pooling so I suppose this is a multi-threaded application
> ... are you being careful not to let any two threads try to use the same
> libpq PGconn at the same time? libpq itself does not contain any
> locking that would make that safe, you need to provide the locking
> yourself.

I have a queue of pgconns. When a thread needs one it pops it off the queue,
and when it's done it pushes the pgconn back on, wrapped by a
stack-allocated class whose constructor and destructor take care of
acquiring and releasing the pgconn. The queue is a Mac OS thing, not my
code, so it's not a problem with sharing them, unfortunately. So I'll have
to keep looking for memory-munging bugs.

--
Scott Ribe
scott_ribe(at)killerbytes(dot)com
http://www.killerbytes.com/
(303) 722-0567 voice

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Alvaro Herrera 2006-03-16 21:11:21 Re: [GENERAL] Concurrencia
Previous Message CSN 2006-03-16 20:49:21 Disabling persistent connections?