Re: [HACKERS] [sqlsmith] stuck spinlock in pg_stat_get_wal_receiverafter OOM - Mailing list pgsql-hackers

From Thomas Munro
Subject Re: [HACKERS] [sqlsmith] stuck spinlock in pg_stat_get_wal_receiverafter OOM
Date
Msg-id CAEepm=0W-JWedyTqfyT7eUeZ3yiU9jpUSPC_dJhbY90mbNmWkA@mail.gmail.com
Whole thread Raw
In response to [HACKERS] [sqlsmith] stuck spinlock in pg_stat_get_wal_receiver after OOM  (Andreas Seltenreich <seltenreich@gmx.de>)
List pgsql-hackers
On Tue, Oct 3, 2017 at 9:56 AM, Andreas Seltenreich <seltenreich@gmx.de> wrote:
> low-memory testing with REL_10_STABLE at 1f19550a87 produced the
> following PANIC:
>
>     stuck spinlock detected at pg_stat_get_wal_receiver, walreceiver.c:1397
>
> I was about to wrap the pstrdup()s with a PG_TRY block, but I can't find
> a spinlock being released in a PG_CATCH block anywhere, so maybe that's
> a bad idea?

No comment on what might be holding the spinlock there, but perhaps
the spinlock-protected code should strncpy into stack-local buffers
instead of calling pstrdup()?  The buffers could be statically sized
with NAMEDATALEN and MAXCONNINFO.

-- 
Thomas Munro
http://www.enterprisedb.com


-- 
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: Andreas Seltenreich
Date:
Subject: [HACKERS] [sqlsmith] stuck spinlock in pg_stat_get_wal_receiver after OOM
Next
From: Andres Freund
Date:
Subject: Re: [HACKERS] [sqlsmith] stuck spinlock in pg_stat_get_wal_receiverafter OOM