Port Bug Report: Backend dies when run at high debug level - Mailing list pgsql-ports

From Unprivileged user
Subject Port Bug Report: Backend dies when run at high debug level
Date
Msg-id 199905281611.MAA95585@hub.org
Whole thread Raw
Responses Re: [PORTS] Port Bug Report: Backend dies when run at high debug level
List pgsql-ports
============================================================================
                        POSTGRESQL BUG REPORT TEMPLATE
============================================================================


Your name               : Michael Reed
Your email address      : reed@itd.nrl.navy.mil

Category                : runtime: back-end
Severity                : serious

Summary: Backend dies when run at high debug level

System Configuration
--------------------
  Operating System   : Solaris 2.6

  PostgreSQL version : 6.4.2

  Compiler used      : gcc 2.8.1

Hardware:
---------
SunOS sun0 5.6 Generic_105181-12 sun4u sparc SUNW,Ultra-4
Sun Ultra 450 (2x300Mhz, 512MB).  Also verified on Sun Ultra 2 (2x167Mhz, 256MB)


Versions of other tools:
------------------------
gmake 3.75, bison 1.25, flex 2.5.4

--------------------------------------------------------------------------

Problem Description:
--------------------
Backend server dies unexpectedly when running at high debug level.
Problem not seen with no debug level specified.


--------------------------------------------------------------------------

Test Case:
----------
Run server at debug '10' on any solaris 2.6 platform (verified on
multiple machine types).


--------------------------------------------------------------------------

Solution:
---------
Traced it to a SEGV in postgresql-6.4.2/src/backend/nodes/outfuncs.c
in the function _outResdom (line 671).  The node->resname pointer was
NULL leading to an explosion of the sprintf statement (kinda hard to
do a sprintf of a string with a null pointer as the argument :-) Quick
hack to fix is:

        sprintf(buf, "\"%s\"", node->resname ? node->resname : ""); /* fix for
SELECT col AS

instead of:

        sprintf(buf, "\"%s\"", node->resname); /* fix for SELECT col AS

Why/how we are actually getting a NULL pointer in that field I didn't
track down (since this hack fixed the problem).

Tried to email this report to the mailing list, but it bounced.

--------------------------------------------------------------------------


pgsql-ports by date:

Previous
From: Unprivileged user
Date:
Subject: Port Bug Report:
Next
From: Bruce Momjian
Date:
Subject: Re: [PORTS] Port Bug Report: Backend dies when run at high debug level