Oops, mailed it to myself instead of the list!

It's been a long day...


------------- Begin Forwarded Message -------------

Date: Thu, 1 Jun 2000 23:31:01 +0100 (BST)
From: Keith Parks <emkxp01@mtcc.demon.co.uk>
Subject: Re: [HACKERS] Problems with recent CVS versions and Solaris.
To: emkxp01@mtcc.demon.co.uk
MIME-Version: 1.0

I've managed to get a backtrace, attached, thanks to Ross J. Reedstrom's
excellent example from the archives, also attached.

I'm not sure whether the stack frame shown is corrupt, it seems to just
loop over and over again. (I got fed up after 400+ frames)

The final few frames show us asking for more memory, the point at
which things seem to go out of control.

#0  0xef5d33b8 in _brk_unlocked ()
#1  0xef5ce2f8 in _sbrk_unlocked ()
#2  0xef5ce26c in sbrk ()
#3  0xef585bb0 in _morecore ()
#4  0xef58549c in _malloc_unlocked ()
#5  0xef5852b4 in malloc ()
#6  0x139198 in AllocSetAlloc (set=0x1bea10, size=4032) at aset.c:285
#7  0x139ea8 in GlobalMemoryAlloc (this=0x1bea08, size=4008) at mcxt.c:419
#8  0x1399ec in MemoryContextAlloc (context=0x1bea08, size=4008) at mcxt.c:224
#9  0x12c700 in InitSysCache (relname=0x180f40 "pg_proc", 
    iname=0x180f08 "pg_proc_oid_index", id=18, nkeys=1, key=0x19a2f0, 
    iScanfuncP=0x6e1c8 <ProcedureOidIndexScan>) at catcache.c:705
#10 0x1312d8 in SearchSysCacheTuple (cacheId=18, key1=184, key2=0, key3=0, 
    key4=0) at syscache.c:509

Is this any help?

I'm no expert in gdb, but I can follow instructions. ;-)

Thanks,
Keith.


Keith Parks <emkxp01@mtcc.demon.co.uk>
> 
> Hi all,
> 
> I regularly do a "cvs update" and compile and test PostgreSQL.
> 
> Recently, since about 1 week, I've had a nasty problem.
> 
> Doing an "initdb" seems to suck up all available memory and almost
> kills the system, before dying itself with a SEGV.
> 
> The problem postgress process is:-
> 
>   /usr/local/pgsql/bin/postgres -boot -x -C -F -D/usr/local/pgsql/data -d 
> template1
>   
> The system becomes VERY unresponsive when this postgres process
> starts running, so difficult to attach to with gdb. 
> 
> I'm stuck for a clue as to how to debug this.
> 
> Is anyone else seeing this problem recently?
> 
> Is it just a Solaris problem?
> (Solaris 2.6 on SPARCstation 5)
> 
> Is it just me? :-(
> 
> Help,
> 
> Keith.
> 

------------- End Forwarded Message -------------
Thu, 1 Jun 2000 23:32:13 +0100 (BST)
Keith Parks <emkxp01@mtcc.demon.co.uk>
Re: Problems with recent CVS versions and Solaris.
Keith Parks <emkxp01@mtcc.demon.co.uk> writes:
> I've managed to get a backtrace, attached, thanks to Ross J. Reedstrom's
> excellent example from the archives, also attached.

> I'm not sure whether the stack frame shown is corrupt, it seems to just
> loop over and over again. (I got fed up after 400+ frames)

What we've got here is the syscache trying to set up for a search of
cache 18, which I believe is the pg_proc-indexed-on-OID cache.
For that it needs the OID comparison function, "oideq" (OID 184).
It's asking the funcmgr for oideq ... and funcmgr is turning around
and asking the syscache for the pg_proc entry with OID 184.  Ooops.

I thought there was an interlock in there to report a useful message if
a syscache got called recursively like this.  Have to look at why it's
not working.  However, I guess your real problem is that the funcmgr is
failing to find proc OID 184 in its own table of built-in functions.
The reason this isn't a recursion under normal circumstances is that the
comparison functions the syscaches need are all supposed to be hardwired
into fmgr.

My bet is that there is something snafu'd in your generation of
fmgrtab.c from pg_proc.h via Gen_fmgrtab.sh, such that your table of
builtin functions is either empty or corrupt.

Before wasting any additional time on it I'd recommend a make distclean,
cvs update, configure and rebuild from scratch to see if the problem
persists.  I changed the Gen_fmgrtab.sh setup last week as part of the
first round of fmgr checkins, and I wouldn't be surprised to find that
you've just gotten burnt by out-of-sync files or some such (eg, a local
file that needs to be rebuilt but is timestamped a bit newer than the
cvs-supplied files it depends on).

If you still see the problem with a virgin build, take a look at
src/backend/utils/Gen_fmgrtab.sh and its output
src/backend/utils/fmgrtab.c to see if you can figure out what's
wrong.  Could be that I introduced some kind of portability problem
into Gen_fmgrtab.sh ...

			regards, tom lane

Thu, 01 Jun 2000 19:22:21 -0400
Tom Lane <tgl@sss.pgh.pa.us>
Re: Problems with recent CVS versions and Solaris. 