Re: [sqlsmith] stuck spinlock in pg_stat_get_wal_receiver after OOM
Thomas Munro <thomas.munro@enterprisedb.com>
From: Thomas Munro <thomas.munro@enterprisedb.com>
To: Andreas Seltenreich <seltenreich@gmx.de>
Cc: Pg Hackers <pgsql-hackers@postgresql.org>
Date: 2017-10-02T21:05:16Z
Lists: 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
Commits
-
Fix race condition with unprotected use of a latch pointer variable.
- 2451de7e9e72 10.1 landed
- 45f9d08684d9 11.0 landed
-
Fix coding rules violations in walreceiver.c
- c9c37e335e3a 9.2.24 landed
- b24f15f86de4 9.3.20 landed
- ad40d5f74585 10.1 landed
- 89e434b59caf 11.0 landed
- 86076395ef81 9.6.6 landed
- 6b2daef96d43 9.4.15 landed
- 182abe31387c 9.5.10 landed
-
Use latch instead of select() in walreceiver
- 597a87ccc9a6 10.0 cited