patch: prevent user from setting wal_buffers over 2GB bytes - Mailing list pgsql-hackers

From Josh Berkus
Subject patch: prevent user from setting wal_buffers over 2GB bytes
Date
Msg-id 55BACC94.6040207@agliodbs.com
Whole thread Raw
Responses Re: patch: prevent user from setting wal_buffers over 2GB bytes
List pgsql-hackers
Hackers,

In guc.c, the maximum for wal_buffers is INT_MAX.  However, wal_buffers
is actually measured in 8KB buffers, not in bytes.  This means that
users are able to set wal_buffers > 2GB.  When the database is started,
this can cause a core dump if the WAL offset is > 2GB.

Attached patch fixes this issue by lowering the maximum for wal_buffers:

josh@Radegast:~/pg94a$ bin/pg_ctl -D data start
server starting
josh@Radegast:~/pg94a$ LOG:  393216 is outside the valid range for
parameter "wal_buffers" (-1 .. 262143)
FATAL:  configuration file "/home/josh/pg94a/data/postgresql.conf"
contains errors

Thanks to Andrew Gierth for diagnosing this issue.

--
Josh Berkus
PostgreSQL Experts Inc.
http://pgexperts.com

Attachment

pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: creating extension including dependencies
Next
From: Michael Paquier
Date:
Subject: Re: Doubt about AccessExclusiveLock in ALTER TABLE .. SET ( .. );