pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #7885: postmaster panic on startup does not release shared memory
4+ messages / 4 participants
[nested] [flat]

* BUG #7885: postmaster panic on startup does not release shared memory
@ 2013-02-15 18:33 david.thomas@enterprisedb.com
  2013-02-15 20:42 ` Re: BUG #7885: postmaster panic on startup does not release shared memory Bruce Momjian <bruce@momjian.us>
  0 siblings, 1 reply; 4+ messages in thread

From: david.thomas@enterprisedb.com @ 2013-02-15 18:33 UTC (permalink / raw)
  To: pgsql-bugs

The following bug has been logged on the website:

Bug reference:      7885
Logged by:          David Thomas
Email address:      david.thomas@enterprisedb.com
PostgreSQL version: 9.2.3
Operating system:   CentOS 6.3
Description:        

It seems that if the postmaster encounters a PANIC condition during startup,
it leaves it's allocated shared memory segments around:

-bash-4.1$ ipcs -a

------ Shared Memory Segments --------
key        shmid      owner      perms      bytes      nattch     status

------ Semaphore Arrays --------
key        semid      owner      perms      nsems

------ Message Queues --------
key        msqid      owner      perms      used-bytes   messages

-bash-4.1$ /usr/pgsql-9.2/bin/postmaster --single -D
/var/lib/pgsql/9.2/data/ test
PANIC:  could not locate a valid checkpoint record
Aborted
-bash-4.1$ ipcs -a

------ Shared Memory Segments --------
key        shmid      owner      perms      bytes      nattch     status
0x00000001 753664     postgres   600        41279488   0

------ Semaphore Arrays --------
key        semid      owner      perms      nsems
0x00000001 5439490    postgres   600        17
0x00000002 5472259    postgres   600        17
0x00000003 5505028    postgres   600        17
0x00000004 5537797    postgres   600        17
0x00000005 5570566    postgres   600        17
0x00000006 5603335    postgres   600        17
0x00000007 5636104    postgres   600        17

------ Message Queues --------
key        msqid      owner      perms      used-bytes   messages

Considering that it was able to allocate this memory before the panic
occurred, it should remove them before exiting.



-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: BUG #7885: postmaster panic on startup does not release shared memory
  2013-02-15 18:33 BUG #7885: postmaster panic on startup does not release shared memory david.thomas@enterprisedb.com
@ 2013-02-15 20:42 ` Bruce Momjian <bruce@momjian.us>
  2013-02-15 22:02   ` Re: BUG #7885: postmaster panic on startup does not release shared memory Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 4+ messages in thread

From: Bruce Momjian @ 2013-02-15 20:42 UTC (permalink / raw)
  To: david.thomas@enterprisedb.com; +Cc: pgsql-bugs


When we panic, we PANIC, meaning we don't jump around looking for
cleanup stuff, which might make things worse.  Postgres should never
panic, so it would be good if you found the cause of the panic.

Does restarting the server remove the old shared memory stuff?

---------------------------------------------------------------------------

On Fri, Feb 15, 2013 at 06:33:21PM +0000, david.thomas@enterprisedb.com wrote:
> The following bug has been logged on the website:
> 
> Bug reference:      7885
> Logged by:          David Thomas
> Email address:      david.thomas@enterprisedb.com
> PostgreSQL version: 9.2.3
> Operating system:   CentOS 6.3
> Description:        
> 
> It seems that if the postmaster encounters a PANIC condition during startup,
> it leaves it's allocated shared memory segments around:
> 
> -bash-4.1$ ipcs -a
> 
> ------ Shared Memory Segments --------
> key        shmid      owner      perms      bytes      nattch     status
> 
> ------ Semaphore Arrays --------
> key        semid      owner      perms      nsems
> 
> ------ Message Queues --------
> key        msqid      owner      perms      used-bytes   messages
> 
> -bash-4.1$ /usr/pgsql-9.2/bin/postmaster --single -D
> /var/lib/pgsql/9.2/data/ test
> PANIC:  could not locate a valid checkpoint record
> Aborted
> -bash-4.1$ ipcs -a
> 
> ------ Shared Memory Segments --------
> key        shmid      owner      perms      bytes      nattch     status
> 0x00000001 753664     postgres   600        41279488   0
> 
> ------ Semaphore Arrays --------
> key        semid      owner      perms      nsems
> 0x00000001 5439490    postgres   600        17
> 0x00000002 5472259    postgres   600        17
> 0x00000003 5505028    postgres   600        17
> 0x00000004 5537797    postgres   600        17
> 0x00000005 5570566    postgres   600        17
> 0x00000006 5603335    postgres   600        17
> 0x00000007 5636104    postgres   600        17
> 
> ------ Message Queues --------
> key        msqid      owner      perms      used-bytes   messages
> 
> Considering that it was able to allocate this memory before the panic
> occurred, it should remove them before exiting.
> 
> 
> 
> -- 
> Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-bugs

-- 
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + It's impossible for everything to be true. +


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: BUG #7885: postmaster panic on startup does not release shared memory
  2013-02-15 18:33 BUG #7885: postmaster panic on startup does not release shared memory david.thomas@enterprisedb.com
  2013-02-15 20:42 ` Re: BUG #7885: postmaster panic on startup does not release shared memory Bruce Momjian <bruce@momjian.us>
@ 2013-02-15 22:02   ` Tom Lane <tgl@sss.pgh.pa.us>
  2013-02-15 23:07     ` Re: BUG #7885: postmaster panic on startup does not release shared memory David Thomas <david.thomas@enterprisedb.com>
  0 siblings, 1 reply; 4+ messages in thread

From: Tom Lane @ 2013-02-15 22:02 UTC (permalink / raw)
  To: Bruce Momjian <bruce@momjian.us>; +Cc: david.thomas@enterprisedb.com; pgsql-bugs

Bruce Momjian <bruce@momjian.us> writes:
> When we panic, we PANIC, meaning we don't jump around looking for
> cleanup stuff, which might make things worse.

I think also there was some thought that we should intentionally leave
the shmem segment around for debugging purposes.

In any case, I believe the behavior complained of here is specific to
--single mode, which is surely not a production scenario, thus even
less reason to be concerned about it.  (If a postmaster child panics,
the postmaster will still shut down normally and thus release the
shmem segment.)

			regards, tom lane


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: BUG #7885: postmaster panic on startup does not release shared memory
  2013-02-15 18:33 BUG #7885: postmaster panic on startup does not release shared memory david.thomas@enterprisedb.com
  2013-02-15 20:42 ` Re: BUG #7885: postmaster panic on startup does not release shared memory Bruce Momjian <bruce@momjian.us>
  2013-02-15 22:02   ` Re: BUG #7885: postmaster panic on startup does not release shared memory Tom Lane <tgl@sss.pgh.pa.us>
@ 2013-02-15 23:07     ` David Thomas <david.thomas@enterprisedb.com>
  0 siblings, 0 replies; 4+ messages in thread

From: David Thomas @ 2013-02-15 23:07 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Bruce Momjian <bruce@momjian.us>; pgsql-bugs

On Fri, Feb 15, 2013 at 05:02:46PM -0500, Tom Lane wrote:
> Bruce Momjian <bruce@momjian.us> writes:
> > When we panic, we PANIC, meaning we don't jump around looking for
> > cleanup stuff, which might make things worse.
> 
> I think also there was some thought that we should intentionally leave
> the shmem segment around for debugging purposes.
> 
> In any case, I believe the behavior complained of here is specific to
> --single mode, which is surely not a production scenario, thus even
> less reason to be concerned about it.  (If a postmaster child panics,
> the postmaster will still shut down normally and thus release the
> shmem segment.)
> 
Yup, if I attempt to start the cluster normally, it cleans up after
itself, so this is specific to --single mode.

-- 
David Thomas
System Engineer
EnterpriseDB - The Enterprise PostgreSQL Company


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2013-02-15 23:07 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2013-02-15 18:33 BUG #7885: postmaster panic on startup does not release shared memory david.thomas@enterprisedb.com
2013-02-15 20:42 ` Bruce Momjian <bruce@momjian.us>
2013-02-15 22:02   ` Tom Lane <tgl@sss.pgh.pa.us>
2013-02-15 23:07     ` David Thomas <david.thomas@enterprisedb.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox