[BUG] Re-entering malloc problem when use --enable-nls build postgresql - Mailing list pgsql-bugs

From 158306855
Subject [BUG] Re-entering malloc problem when use --enable-nls build postgresql
Date
Msg-id tencent_34F9D9C6F16EAA9EB10ED2CE6CCF88B5B407@qq.com
Whole thread Raw
Responses Re: [BUG] Re-entering malloc problem when use --enable-nls build postgresql  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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:

Attachment

pgsql-bugs by date:

Previous
From: Andres Freund
Date:
Subject: Re: BUG #15187: When use huge page, there may be a lot of hangedconnections with status startup or authentication
Next
From: Tom Lane
Date:
Subject: Re: [BUG] Re-entering malloc problem when use --enable-nls build postgresql