Thread: Debugging

Debugging

From
"Ian Harding"
Date:
Is there any way to debug a procedural language shared library when you can't createlang?

I get this...
L-897V601: {1} createlang pltcl template1
DEBUG:  InitPostgres
DEBUG:  StartTransactionCommand
DEBUG:  PortalRun
DEBUG:  CommitTransactionCommand
DEBUG:  StartTransactionCommand
DEBUG:  PortalRun
DEBUG:  CommitTransactionCommand
DEBUG:  StartTransactionCommand
DEBUG:  ProcessUtility
createlang: language installation failed: server closed the connection unexpectedly
        This probably means the server terminated abnormally
        before or while processing the request.
L-897V601: {2}

and in the log...

DEBUG:  00000: ProcessUtility
LOCATION:  PortalRunUtility, pquery.c:741
STATEMENT:  CREATE FUNCTION "pltcl_call_handler" () RETURNS language_handler AS
'$libdir/pltcl' LANGUAGE C;
        CREATE TRUSTED LANGUAGE "pltcl" HANDLER "pltcl_call_handler";

DEBUG:  00000: reaping dead processes
LOCATION:  reaper, postmaster.c:1819
DEBUG:  00000: child process (PID 2365) was terminated by signal 6
LOCATION:  LogChildExit, postmaster.c:2087
LOG:  00000: server process (PID 2365) was terminated by signal 6
LOCATION:  LogChildExit, postmaster.c:2087
LOG:  00000: terminating any other active server processes
LOCATION:  CleanupProc, postmaster.c:2008
LOG:  00000: all server processes terminated; reinitializing
LOCATION:  reaper, postmaster.c:1920
DEBUG:  00000: shmem_exit(0)
LOCATION:  shmem_exit, ipc.c:126
DEBUG:  00000: invoking IpcMemoryCreate(size=7798784)
LOCATION:  CreateSharedMemoryAndSemaphores, ipci.c:73
LOG:  00000: database system was interrupted at 2004-09-02 07:01:17 PDT
LOCATION:  StartupXLOG, xlog.c:2610

None of which is helping me any.

All its friends seem to be there...

L-897V601: {7} ldd pltcl.so
pltcl.so:
         -ltcl84.1 => /usr/pkg/lib/libtcl84.so.1
         -lpthread.0 => /usr/lib/libpthread.so.0
         -lm.0 => /usr/lib/libm387.so.0
         -lm.0 => /usr/lib/libm.so.0
         -lc.12 => /usr/lib/libc.so.12

Any advice will be appreciated.

Ian

Re: Debugging

From
Tom Lane
Date:
"Ian Harding" <iharding@tpchd.org> writes:
> Is there any way to debug a procedural language shared library when you can't createlang?

Hmm.  I would bet on this being an abort() inside the dynamic linker.
It's annoying that it doesn't say anything beforehand :-( ... you are
capturing postmaster stdout/stderr here, right, not anything more
filtered such as syslog output?

You might possibly be able to learn something by getting a stack trace
from the core dump that this should be generating.  (If you don't see
one then you need to fool with your ulimit settings.)

What PG version is this exactly, and on what platform?

            regards, tom lane