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

Commit30e99ef

Browse files
committed
Don't call pgwin32_message_to_UTF16() without CurrentMemoryContext.
PostgreSQL running as a Windows service crashed upon callingwrite_stderr() before MemoryContextInit(). This fix completes workstarted in5735efe. Messages thisearly contain only ASCII bytes; if we removed the CurrentMemoryContextrequirement, the ensuing conversions would have no effect. Back-patchto 9.3 (all supported versions).Takayuki Tsunakawa, reviewed by Michael Paquier.Discussion:https://postgr.es/m/0A3221C70F24FB45833433255569204D1F80CC73@G01JPEXMBYT05
1 parent4cd5d8a commit30e99ef

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1910,11 +1910,16 @@ write_eventlog(int level, const char *line, int len)
19101910
* Convert message to UTF16 text and write it with ReportEventW, but
19111911
* fall-back into ReportEventA if conversion failed.
19121912
*
1913+
* Since we palloc the structure required for conversion, also fall
1914+
* through to writing unconverted if we have not yet set up
1915+
* CurrentMemoryContext.
1916+
*
19131917
* Also verify that we are not on our way into error recursion trouble due
19141918
* to error messages thrown deep inside pgwin32_toUTF16().
19151919
*/
19161920
if (GetDatabaseEncoding()!=GetPlatformEncoding()&&
1917-
!in_error_recursion_trouble())
1921+
!in_error_recursion_trouble()&&
1922+
CurrentMemoryContext!=NULL)
19181923
{
19191924
utf16=pgwin32_toUTF16(line,len,NULL);
19201925
if (utf16)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp