Re: PQtrace doesn't work

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Daniel Verite <daniel(at)manitou-mail(dot)org>, pgsql-general(at)postgresql(dot)org
Subject: Re: PQtrace doesn't work
Date: 2005-09-25 03:10:31
Message-ID: 200509250310.j8P3AVi05265@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Tom Lane wrote:
> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > Daniel Verite wrote:
> >> So it looks like the problem would be DLL-related?
>
> > Is there a problem with a DLL writing to a file descriptor opened by
> > application code? I would think not, but perhaps.
>
> Hmm .... malloc/free are broken in exactly that way in Windows DLLs,
> maybe stdio has the same kind of issue? I'd think this would be pretty
> well known if true, though.

Ah, I have found the cause of the crash, and added documentation about
the cause:

On Win32, if the <application>libpq</> and the application are
compiled with different flags, this function call will crash the
application because the internal representation of the <literal>FILE</>
pointers differ.

While such a mismatch is a problem on all platforms, it is more common
on Win32 where the FILE structure changes for debug, for example.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tony Caduto 2005-09-25 03:16:21 Re: Extraordinarily slow!!
Previous Message Sterpu Victor 2005-09-25 00:46:38 createdb problem