Re: [HACKERS] [bug fix] postgres.exe crashes with access violationon Windows while starting up - Mailing list pgsql-hackers

From Noah Misch
Subject Re: [HACKERS] [bug fix] postgres.exe crashes with access violationon Windows while starting up
Date
Msg-id 20171112223748.GA2941800@rfd.leadboat.com
Whole thread Raw
In response to Re: [HACKERS] [bug fix] postgres.exe crashes with access violation onWindows while starting up  (Michael Paquier <michael.paquier@gmail.com>)
Responses Re: [HACKERS] [bug fix] postgres.exe crashes with access violation onWindows while starting up  (Michael Paquier <michael.paquier@gmail.com>)
List pgsql-hackers
On Sat, Oct 28, 2017 at 03:43:02PM -0700, Michael Paquier wrote:
> couldn't we envisage to just use
> malloc? pgwin32_message_to_UTF16() is called in two places in elog.c,
> and there is a full control on the error code paths.

Switching to malloc is feasible, but it wouldn't enable PostgreSQL to handle
non-ASCII messages any earlier.  Messages should be ASCII-only until the
init_locale(LC_CTYPE) call initializes MessageEncoding.  (Before that call,
pgwin32_message_to_UTF16() assumes the message is UTF8-encoded.  I've expanded
the comments slightly.  We easily comply with that restriction today.)

On Fri, Nov 03, 2017 at 11:10:14AM +0000, Michael Paquier wrote:
> I am
> switching the patch as ready for committer, I definitely agree that
> you are taking the write approach here.

Committed both patches.


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

pgsql-hackers by date:

Previous
From: Thomas Munro
Date:
Subject: Re: [HACKERS] LDAPS
Next
From: Michael Paquier
Date:
Subject: Re: [HACKERS] [bug fix] postgres.exe crashes with access violation onWindows while starting up