Obtaining a backtrace (was Re: [HACKERS] GEQO optimizer)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Oleg Bartunov <oleg(at)sai(dot)msu(dot)su>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Obtaining a backtrace (was Re: [HACKERS] GEQO optimizer)
Date: 1999-05-17 15:52:12
Message-ID: 9639.926956332@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Oleg Bartunov <oleg(at)sai(dot)msu(dot)su> writes:
>> Can you provide a backtrace?

> Will try to reproduce crash,. How do I can debug psql ?

There should be a core file left in the database subdirectory, eg

/usr/local/pgsql/data/base/DB/core

where DB represents the name of the database you used.

As the postgres user, do this (with appropriate pathname changes of course)

gdb /usr/local/pgsql/bin/postgres /usr/local/pgsql/data/base/DB/core

and when you get the (gdb) prompt, enter "bt" for backtrace. You should
get a few dozen lines of printout, more or less like this:

(gdb) bt
#0 AllocSetAlloc (set=0x40254600, size=1076446936) at aset.c:267
#1 0x169314 in PortalHeapMemoryAlloc (this=0x40254600, size=36)
at portalmem.c:264
#2 0x168bb4 in MemoryContextAlloc (context=0x4007d940, size=36) at mcxt.c:230
#3 0xe4d88 in newNode (size=36, tag=T_Resdom) at nodes.c:41
#4 0xea92c in makeResdom (resno=17920, restype=23, restypmod=-1, resname=0x0,
reskey=0, reskeyop=0, resjunk=0) at makefuncs.c:102
#5 0x101448 in create_tl_element (var=0x402402e0, resdomno=36) at tlist.c:135
#6 0xf689c in new_join_tlist (tlist=0x40254600, first_resdomno=36)
at joinrels.c:286
...

The "q" command will get you out of gdb after you've copied and pasted
this info.

BTW, if you did not build the backend with "-g" included in CFLAGS, you
will get a much less complete backtrace ... but it may still tell us
something of use.

regards, tom lane

Browse pgsql-hackers by date

  From Date Subject
Next Message Vince Vielhaber 1999-05-17 16:00:34 Re: [HACKERS] 6.5 cvs: problem with includes in src/interfaces/l
Previous Message Oleg Bartunov 1999-05-17 15:38:14 Re: [HACKERS] GEQO optimizer (was Re: Backend message type 0x44 arrived while idle)