]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Clear error_context_stack and debug_query_string at the beginning of proc_exit,
authorTom Lane <tgl@sss.pgh.pa.us>
Sat, 20 Mar 2010 00:58:14 +0000 (00:58 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Sat, 20 Mar 2010 00:58:14 +0000 (00:58 +0000)
commite679564e90fec35d16bcee992b5192f721a8f2d9
tree3f291c4f7a1c5beab0561d690ba6dcfd69eaa028
parentf870ab0190dd3e09ee4e81aeee03046580cf89f5
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.
src/backend/storage/ipc/ipc.c