Re: [bug fix] postgres.exe crashes with access violation on Windows while starting up

From: Noah Misch <noah(at)leadboat(dot)com>
To: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
Cc: "Tsunakawa, Takayuki" <tsunakawa(dot)takay(at)jp(dot)fujitsu(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [bug fix] postgres.exe crashes with access violation on Windows while starting up
Date: 2017-11-12 22:37:48
Message-ID: 20171112223748.GA2941800@rfd.leadboat.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2017-11-12 23:06:28 Re: [bug fix] postgres.exe crashes with access violation on Windows while starting up
Previous Message Thomas Munro 2017-11-12 21:25:07 Re: LDAPS