Re: memory corruption bug - Mailing list pgsql-bugs

From Tom Lane
Subject Re: memory corruption bug
Date
Msg-id 14454.1081192613@sss.pgh.pa.us
Whole thread Raw
In response to memory corruption bug  (Alan Stange <stange@rentec.com>)
List pgsql-bugs
Alan Stange <stange@rentec.com> writes:
> There's memory corruption occuring causing the malloc routines to
> SIGBUS.
> ...
> Sadly, we have no reproducible test case right now.

Without a test case there's not much we can do :-(.  The backtrace you
show is during client query collection, which is a quite well-tested
code path and hardly likely to contain such errors, so I would venture
that the memory clobber occurred previously.  Meaning that this trace
gives no useful data about where it is.

Some versions of Solaris are known to contain a broken vsnprintf()
library routine that can result in memory clobbers.  I don't recall
which versions exactly, but I think it was only in 64-bit builds;
is yours 64-bit?  Anyway you might try undef'ing HAVE_VSNPRINTF and
HAVE_SNPRINTF in src/include/pg_config.h after configure (to force
use of our own emulations of those routines) to see if that helps.
Also try scanning the pgsql-bugs archives for other mentions of Solaris
to see if there are other such issues ...

> Typically one would use a tool like purify, bcheck, etc., to find the
> offending code.

Without being able to duplicate the crash, it's unlikely anyone else
could find the problem.  We haven't heard similar reports, so this is
either a platform-specific issue or a consequence of some corner case
that you are exercising and other people aren't.  Either way, the most
likely way to learn something from Purify is for you to run it ...

            regards, tom lane

pgsql-bugs by date:

Previous
From: "Enke, Michael"
Date:
Subject: Re: BUG #1110: psql -h localhost consults the nameservice
Next
From: Lamar Owen
Date:
Subject: Re: Problem starting postgresql !!