Skip site navigation (1) Skip section navigation (2)

pgsql: Clear error_context_stack and debug_query_string at the beginning

From: tgl(at)postgresql(dot)org (Tom Lane)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Clear error_context_stack and debug_query_string at the beginning
Date: 2010-03-20 00:58:14
Message-ID: 20100320005814.E36C17541D0@cvs.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-committers
Log Message:
-----------
Clear error_context_stack and debug_query_string at the beginning of proc_exit,
so that we won't try to attach any context printouts to messages that get
emitted while exiting.  Per report from Dennis Koegel, the context functions
won't necessarily work after we've started shutting down the backend, and it
seems possible that debug_query_string could be pointing at freed storage
as well.  The context information doesn't seem particularly relevant to
such messages anyway, so there's little lost by suppressing it.

Back-patch to all supported branches.  I can only demonstrate a crash with
log_disconnections messages back to 8.1, but the risk seems real in 8.0 and
before anyway.

Tags:
----
REL8_4_STABLE

Modified Files:
--------------
    pgsql/src/backend/storage/ipc:
        ipc.c (r1.105 -> r1.105.2.1)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/storage/ipc/ipc.c?r1=1.105&r2=1.105.2.1)

pgsql-committers by date

Next:From: Tom LaneDate: 2010-03-20 00:58:21
Subject: pgsql: Clear error_context_stack and debug_query_string at the beginning
Previous:From: Tom LaneDate: 2010-03-20 00:58:09
Subject: pgsql: Clear error_context_stack and debug_query_string at the beginning

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group