Re: _penalty gist method invoked with one key NULL - Mailing list pgsql-hackers

From Tom Lane
Subject Re: _penalty gist method invoked with one key NULL
Date
Msg-id 24328.1130449464@sss.pgh.pa.us
Whole thread Raw
In response to _penalty gist method invoked with one key NULL  (Grzegorz Piotr Jaskiewicz <gj@pointblue.com.pl>)
Responses Re: _penalty gist method invoked with one key NULL
Re: _penalty gist method invoked with one key NULL
List pgsql-hackers
Grzegorz Piotr Jaskiewicz <gj@pointblue.com.pl> writes:
> can I just run postgres, in non forking mode, on gdb?

Just start a normal session and then attach to the backend process with
gdb in a separate window.  There's no reason to fool with a standalone
backend for 99.99% of debugging problems.  With a regular session, you
can use psql to input the SQL commands, which is MUCH friendlier than a
standalone backend, and you can run additional sessions in case you'd
like to examine the state of the database while you've got your debug
backend pinned down someplace.

I tend to use the attached script so that I don't even need to manually
discover the PID to attach to, assuming there's only one backend running
(else it shows me all the plausible candidates to attach to).

Dunno about the gist-specific issue, Oleg or Teodor will have to answer
that.
        regards, tom lane

#!/bin/sh

# Usage: gdblive

# tee /dev/tty is for user to see the set of procs considered
PROCS=`ps auxww | \   grep postgres: | \   grep -v -e 'grep postgres:' -e 'postgres: stats' -e 'postgres: writer' -e
'postgres:archiver' -e 'postgres: logger' | \   tee /dev/tty | \   awk '{print $2}'`
 

if [ `echo "$PROCS" | wc -w` -eq 1 ]
then   exec gdb $PGINSTROOT/bin/postgres -silent "$PROCS"
else   exec gdb $PGINSTROOT/bin/postgres -silent
fi


pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: ERROR: invalid memory alloc request size
Next
From: gj
Date:
Subject: Re: _penalty gist method invoked with one key NULL