[BUG] Re-entering malloc problem when use --enable-nls build postgresql

From: 158306855 <anderson2013(at)qq(dot)com>
To: pgsql-bugs <pgsql-bugs(at)postgresql(dot)org>, pgsql-bugs <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: [BUG] Re-entering malloc problem when use --enable-nls build postgresql
Date: 2018-05-08 01:59:11
Message-ID: tencent_34F9D9C6F16EAA9EB10ED2CE6CCF88B5B407@qq.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

HI pg team:

I found that compiling postgresql with enable-nls may be introduce a problem

1. When build postgresql with enable-nls (Native Language Support), postgresql use dgettext function to translate Language.
2. The quickdie use dgettext translate message ; dgettext use malloc (in __dcigettext function)
3. When use pg_ctl -m fast to shutdown postgresql, pg backend process use function quickdie to shutdown database.
4. Before receive quickdie signal, if backend process in malloc function and already have lock that will lead to process deadlock.
5. This is the deadlock process stack:

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2018-05-08 05:32:33 Re: [BUG] Re-entering malloc problem when use --enable-nls build postgresql
Previous Message Andres Freund 2018-05-06 19:57:12 Re: BUG #15187: When use huge page, there may be a lot of hanged connections with status startup or authentication