Re: [BUG] Re-entering malloc problem when use --enable-nlsbuildpostgresql

From: 158306855 <anderson2013(at)qq(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-bugs <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: [BUG] Re-entering malloc problem when use --enable-nlsbuildpostgresql
Date: 2018-05-23 05:15:12
Message-ID: tencent_31D85ACEFC44E35C77680F58477027A56706@qq.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

> Can't we just reuse errmsg_internal etc?

Yes, the *_internal function can be reused. This is my modified patch.
Please take a look.

Zeng Wenjing

------------------ Original ------------------
From: "Andres Freund"<andres(at)anarazel(dot)de>;
Date: Wed, May 23, 2018 05:11 AM
To: "158306855"<anderson2013(at)qq(dot)com>;
Cc: "Tom Lane"<tgl(at)sss(dot)pgh(dot)pa(dot)us>; "pgsql-bugs"<pgsql-bugs(at)lists(dot)postgresql(dot)org>;
Subject: Re: [BUG] Re-entering malloc problem when use --enable-nlsbuildpostgresql

On 2018-05-21 10:49:53 +0800, 158306855 wrote:
> > It'd be fairly unproblematic to write an untranslated message out. There
> > we can make sure to either only use plain syscalls or use memory from
> > the preallocated context. I think it'd be ok to not to translate in
> > that situation.
>
>
> I wrote a patch to improve this problem.
>
> +extern int errmsg_no_translateit(const char *fmt,...) pg_attribute_printf(1, 2);
> +extern int errdetail_no_translateit(const char *fmt,...) pg_attribute_printf(1, 2);
> +extern int errhint_no_translateit(const char *fmt,...) pg_attribute_printf(1, 2);
> +
> /*
> * errcontext() is typically called in error context callback functions, not
> * within an ereport() invocation. The callback function can be in a different

Can't we just reuse errmsg_internal etc?

Greetings,

Andres Freund

Attachment Content-Type Size
ereport_message_not_translateit_in_quickdie_v2.patch application/octet-stream 2.4 KB

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message PG Bug reporting form 2018-05-23 07:50:28 BUG #15207: In crash recovery, SyncDataDirectory() will fall into recursion trap
Previous Message Kyotaro HORIGUCHI 2018-05-23 03:01:31 Re: postgres_fdw misbehaviour using "DELETE ... RETURNING *"