Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita0dab33

Browse files
committed
Fix elog.c to avoid infinite recursion (leading to backend crash) when
log_min_error_statement is active and there is some problem in logging thecurrent query string; for example, that it's too long to include in the logmessage without running out of memory. This problem has existed since thelog_min_error_statement feature was introduced. No doubt the reason itwasn't detected long ago is that 8.2 is the first release that defaultslog_min_error_statement to less than PANIC level.Per report from Bill Moran.
1 parentddb93ca commita0dab33

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

‎src/backend/utils/error/elog.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
*
4343
*
4444
* IDENTIFICATION
45-
* $PostgreSQL: pgsql/src/backend/utils/error/elog.c,v 1.189 2007/07/19 21:58:12 tgl Exp $
45+
* $PostgreSQL: pgsql/src/backend/utils/error/elog.c,v 1.190 2007/07/21 22:12:04 tgl Exp $
4646
*
4747
*-------------------------------------------------------------------------
4848
*/
@@ -240,10 +240,15 @@ errstart(int elevel, const char *filename, int lineno,
240240

241241
/*
242242
* If we recurse more than once, the problem might be something broken
243-
* in a context traceback routine.Abandon them too.
243+
* in a context traceback routine. Abandon them too. We also
244+
* abandon attempting to print the error statement (which, if long,
245+
* could itself be the source of the recursive failure).
244246
*/
245247
if (recursion_depth>2)
248+
{
246249
error_context_stack=NULL;
250+
debug_query_string=NULL;
251+
}
247252
}
248253
if (++errordata_stack_depth >=ERRORDATA_STACK_SIZE)
249254
{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp