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

Commit7fad5ff

Browse files
committed
That's just the lovely way windows handles a "segfault". Gotta be really
interesting for MS to catch all those dumps...Anyway. Oops. Seems I ran my regression tests with the old psql, andjust managed to update the backend, when I tested that patch. Turns outthere are codepaths where we'd access the Critical Section before it wasinitialized. Attached patch breaks the initializeation off to a separatepart and adds that one to a much earlier position in the program.Magnus Hagander
1 parent9c3d654 commit7fad5ff

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

‎src/bin/psql/common.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Copyright (c) 2000-2004, PostgreSQL Global Development Group
55
*
6-
* $PostgreSQL: pgsql/src/bin/psql/common.c,v 1.93 2004/10/30 23:10:50tgl Exp $
6+
* $PostgreSQL: pgsql/src/bin/psql/common.c,v 1.94 2004/11/01 19:21:50momjian Exp $
77
*/
88
#include"postgres_fe.h"
99
#include"common.h"
@@ -307,9 +307,14 @@ consoleHandler(DWORD dwCtrlType)
307307
}
308308

309309
void
310-
setup_cancel_handler(void)
310+
setup_win32_locks(void)
311311
{
312312
InitializeCriticalSection(&cancelConnLock);
313+
}
314+
315+
void
316+
setup_cancel_handler(void)
317+
{
313318
SetConsoleCtrlHandler(consoleHandler, TRUE);
314319
}
315320

‎src/bin/psql/common.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Copyright (c) 2000-2004, PostgreSQL Global Development Group
55
*
6-
* $PostgreSQL: pgsql/src/bin/psql/common.h,v 1.40 2004/10/30 23:10:50tgl Exp $
6+
* $PostgreSQL: pgsql/src/bin/psql/common.h,v 1.41 2004/11/01 19:21:50momjian Exp $
77
*/
88
#ifndefCOMMON_H
99
#defineCOMMON_H
@@ -49,6 +49,7 @@ extern void ResetCancelConn(void);
4949
#ifndefWIN32
5050
externvoidhandle_sigint(SIGNAL_ARGS);
5151
#else
52+
externvoidsetup_win32_locks(void);
5253
externvoidsetup_cancel_handler(void);
5354
#endif
5455

‎src/bin/psql/startup.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Copyright (c) 2000-2004, PostgreSQL Global Development Group
55
*
6-
* $PostgreSQL: pgsql/src/bin/psql/startup.c,v 1.104 2004/10/16 03:10:16 momjian Exp $
6+
* $PostgreSQL: pgsql/src/bin/psql/startup.c,v 1.105 2004/11/01 19:21:50 momjian Exp $
77
*/
88
#include"postgres_fe.h"
99

@@ -121,6 +121,7 @@ main(int argc, char *argv[])
121121

122122
#ifdefWIN32
123123
setvbuf(stderr,NULL,_IONBF,0);
124+
setup_win32_locks();
124125
#endif
125126
pset.cur_cmd_source=stdin;
126127
pset.cur_cmd_interactive= false;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp