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

Commitf6a3b87

Browse files
committed
Reset CurrentMemoryContext to TopMemoryContext at the beginning of error
cleanup, ie, as soon as we have caught the longjmp. This ensures thatcurrent context will be a valid context throughout error cleanup. Beforeit was possible that current context was pointing at a context that wouldget deleted during cleanup, leaving any subsequent pallocs in deeptrouble. I was able to provoke an Assert failure when compiled withasserts + -DCLOBBER_FREED_MEMORY, if I did something that would causean error to be reported by the backend large-object code, because indeedthat code operates in a context that gets deleted partway through xactabort --- and CurrentMemoryContext was still pointing at it! Boo hiss.
1 parente0095c6 commitf6a3b87

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

‎src/backend/tcop/postgres.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.153 2000/04/28 05:07:34 tgl Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.154 2000/04/30 21:29:23 tgl Exp $
1212
*
1313
* NOTES
1414
* this is the "main" module of the postgres backend and
@@ -127,7 +127,6 @@ boolExitAfterAbort = false;
127127
externintNBuffers;
128128

129129
staticboolEchoQuery= false;/* default don't echo */
130-
time_ttim;
131130
charpg_pathname[MAXPGPATH];
132131
FILE*StatFp=NULL;
133132

@@ -1453,7 +1452,7 @@ PostgresMain(int argc, char *argv[], int real_argc, char *real_argv[])
14531452
if (!IsUnderPostmaster)
14541453
{
14551454
puts("\nPOSTGRES backend interactive interface ");
1456-
puts("$Revision: 1.153 $ $Date: 2000/04/28 05:07:34 $\n");
1455+
puts("$Revision: 1.154 $ $Date: 2000/04/30 21:29:23 $\n");
14571456
}
14581457

14591458
/*
@@ -1473,7 +1472,8 @@ PostgresMain(int argc, char *argv[], int real_argc, char *real_argv[])
14731472

14741473
if (sigsetjmp(Warn_restart,1)!=0)
14751474
{
1476-
time(&tim);
1475+
/* Make sure we are in a valid memory context */
1476+
MemoryContextSwitchTo(TopMemoryContext);
14771477

14781478
if (Verbose)
14791479
TPRINTF(TRACE_VERBOSE,"AbortCurrentTransaction");

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp