Re: PQtrace doesn't work - Mailing list pgsql-general

From Bruce Momjian
Subject Re: PQtrace doesn't work
Date
Msg-id 200509250310.j8P3AVi05265@candle.pha.pa.us
Whole thread Raw
In response to Re: PQtrace doesn't work  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
Tom Lane wrote:
> Bruce Momjian <pgman@candle.pha.pa.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@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

pgsql-general by date:

Previous
From: Tony Caduto
Date:
Subject: Re: Extraordinarily slow!!
Next
From: Tony Caduto
Date:
Subject: Re: Extraordinarily slow!!