Re: [ADMIN] Running Postgres on a HP-Ux 10.10 System - Mailing list pgsql-admin

From jwieck@debis.com (Jan Wieck)
Subject Re: [ADMIN] Running Postgres on a HP-Ux 10.10 System
Date
Msg-id m105VkH-000EBQC@orion.SAPserv.Hamburg.dsh.de
Whole thread Raw
In response to [ADMIN] Running Postgres on a HP-Ux 10.10 System  ("Reiner Nippes" <nippes@ums-ulm.de>)
List pgsql-admin
> #0  0xc00a9098 in memset ()
> (gdb) backtrace
> #0  0xc00a9098 in memset ()
> #1  0x15d0e8 in PostgresMain (argc=-534762622, argv=0x203cb000,
>     real_argc=-534763790, real_argv=0x203cb000) at postgres.c:1582
> #2  0xe0202530 in ?? ()
> Cannot access memory at address 0x203cafe8.
>
> (gdb) frame 1
> #1  0x15d0e8 in PostgresMain (argc=-534762622, argv=0x203cb000,
>     real_argc=-534763790, real_argv=0x203cb000) at postgres.c:1582
> 1582                    MemSet(parser_input, 0, MAX_PARSE_BUFFER);
> (gdb) list
> 1577
> 1578                    /* ----------------
> 1579                     *       (3) read a command.
> 1580                     * ----------------
> 1581                     */
> 1582                    MemSet(parser_input, 0, MAX_PARSE_BUFFER);
> 1583
> 1584                    firstchar = ReadCommand(parser_input);
> 1585
> 1586                    QueryCancel = false;    /* forget any earlier CANCEL sig
> nal */
> (gdb)

    Bingo!

    MemSet()  is  a  macro  in src/include/c.h which in this case
    calls the real memset() library  function  (area  to  set  is
    greater than 64 bytes).

    parser_input    is   a   dynamic   char   array   inside   of
    PostgresMain(), so it's part  of  the  innermost  stackframe.
    This  looks  to  me  like the execution of longjmp() from the
    elog() corrupted the stackframe of PostgresMain() instead  of
    restoring it as it should have done.

    There  are  different  kinds  of  jumps used depending on the
    installation.   One  is  setjmp()/longjmp()  the   other   is
    sigsetjmp()/siglongjmp(). If I recall correct, sigsetjmp() is
    #defined to setjmp() if it isn't available.

    So folks, low level HP/UX 10.10 know how required!


Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#======================================== jwieck@debis.com (Jan Wieck) #

pgsql-admin by date:

Previous
From: Nico De Ranter
Date:
Subject: [postgresql] problems compiling 6.4.2 on Solaris 2.6 :-(
Next
From: Jan Kim
Date:
Subject: Re: [ADMIN] [postgresql] problems compiling 6.4.2 on Solaris 2.6 :-(