Assertion failure on reload of GUC_SUPERUSER_ONLY parms

From: Simon Riggs <simon(at)2ndQuadrant(dot)com>
To: pgsql-bugs <pgsql-bugs(at)postgresql(dot)org>
Cc: "gabriele(dot)bartolini" <gabriele(dot)bartolini(at)2ndquadrant(dot)it>
Subject: Assertion failure on reload of GUC_SUPERUSER_ONLY parms
Date: 2009-10-03 14:41:18
Message-ID: 1254580878.4691.73.camel@ebony.2ndQuadrant
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


TRAP: BadState("!(((bool) ((CurrentUserId) != ((Oid) 0))))", File:
"miscinit.c", Line: 295)

Gabriele Bartolini originally reported this to me as a bug in Hot
Standby, though I have now been able to reproduce in CVS head. We were
just unlucky enough to hit it while doing thorough HS testing.

backtrace
#0 0x00002b7beafd2b45 in raise () from /lib64/libc.so.6
#1 0x00002b7beafd40e0 in abort () from /lib64/libc.so.6
#2 0x00000000006c016d in ExceptionalCondition (
conditionName=<value optimized out>, errorType=<value optimized
out>,
fileName=<value optimized out>, lineNumber=<value optimized out>)
at assert.c:57
#3 0x00000000006ccf4d in GetUserId () at miscinit.c:295
#4 0x00000000006db1b9 in superuser () at superuser.c:48
#5 0x00000000006d5a2b in GetConfigOption (name=0xb2b6e8 "log_filename")
at guc.c:5226
#6 0x00000000006d8a2c in ProcessConfigFile (context=PGC_SIGHUP)
at guc-file.l:319
#7 0x00000000005e49e2 in SIGHUP_handler (
postgres_signal_arg=<value optimized out>) at postmaster.c:2062
#8 <signal handler called>
#9 0x00002b7beb060bc3 in select () from /lib64/libc.so.6
#10 0x00000000005e1bf7 in ServerLoop () at postmaster.c:1360
#11 0x00000000005e2b14 in PostmasterMain (argc=3, argv=0xb246a0)
at postmaster.c:1065

It turns out that when you modify a GUC_SUPERUSER_ONLY parameter, such
as log_filename, in postgresql.conf and then reload you will get the
assertion failure.

It looks to me like the correct fix would be to use
GetUserIdAndContext() instead, though I would suggest inventing
GetUserIdIfAny() which would skip the assertion test for use in
superuser().

--
Simon Riggs www.2ndQuadrant.com

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2009-10-03 15:54:21 Re: Assertion failure on reload of GUC_SUPERUSER_ONLY parms
Previous Message Robert Haas 2009-10-03 01:03:36 [SPAM?]Re: BUG #5089: not supported plpsql