Thread: Postgres 9.2.8 crash sporadically on Windows
Hi, Postgres server (9.2.8) crash on Windows sporadically Usually it happens after machine reboot that we do, once in a day After ~4 minutes it crashes with this error in the log: 2014-04-06 08:08:01.069 GMTLOG: server process (PID 5304) exited with exit= code 0 2014-04-06 08:08:01.069 GMTLOG: terminating any other active server proces= ses 2014-04-06 08:08:01.833 GMTLOG: all server processes terminated; reinitial= izing 2014-04-06 08:08:11.183 GMTFATAL: pre-existing shared memory block is stil= l in use 2014-04-06 08:08:11.183 GMTHINT: Check if there are any old server process= es still running, and terminate them. This is production, Please help! Yuval Sofer BMC Software CTM&D Business Unit DBA Team 972-52-4286-282 yuval_sofer@bmc.com<mailto:yuval_sofer@bmc.com>
Hello, On 2014-04-07 09:49:09 -0500, Sofer, Yuval wrote: > Postgres server (9.2.8) crash on Windows sporadically > > Usually it happens after machine reboot that we do, once in a day > > After ~4 minutes it crashes with this error in the log: > > 2014-04-06 08:08:01.069 GMTLOG: server process (PID 5304) exited with exit code 0 > 2014-04-06 08:08:01.069 GMTLOG: terminating any other active server processes > 2014-04-06 08:08:01.833 GMTLOG: all server processes terminated; reinitializing > 2014-04-06 08:08:11.183 GMTFATAL: pre-existing shared memory block is still in use > 2014-04-06 08:08:11.183 GMTHINT: Check if there are any old server processes still running, and terminate them. > > This is production, Please help! This is unfortunately not giving us many details to work with... Are you using any self written functions? Any extensions? What's the last query executed before the crash? Greetings, Andres Freund -- Andres Freund http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services
Andres Freund <andres@2ndquadrant.com> writes: > On 2014-04-07 09:49:09 -0500, Sofer, Yuval wrote: >> Postgres server (9.2.8) crash on Windows sporadically >> 2014-04-06 08:08:01.069 GMTLOG: server process (PID 5304) exited with exit code 0 >> 2014-04-06 08:08:01.069 GMTLOG: terminating any other active server processes >> 2014-04-06 08:08:01.833 GMTLOG: all server processes terminated; reinitializing >> 2014-04-06 08:08:11.183 GMTFATAL: pre-existing shared memory block is still in use >> 2014-04-06 08:08:11.183 GMTHINT: Check if there are any old server processes still running, and terminate them. >> >> This is production, Please help! > This is unfortunately not giving us many details to work with... The "exit code 0" bit reminds me of this: http://www.postgresql.org/message-id/21027.1393546453@sss.pgh.pa.us Is there another exit report for the same PID just above the quoted log extract? Because if there isn't, the postmaster shouldn't be thinking that status 0 represents a crash. regards, tom lane
On 2014-04-07 11:15:32 -0400, Tom Lane wrote: > Andres Freund <andres@2ndquadrant.com> writes: > > On 2014-04-07 09:49:09 -0500, Sofer, Yuval wrote: > >> Postgres server (9.2.8) crash on Windows sporadically > > >> 2014-04-06 08:08:01.069 GMTLOG: server process (PID 5304) exited with exit code 0 > >> 2014-04-06 08:08:01.069 GMTLOG: terminating any other active server processes > >> 2014-04-06 08:08:01.833 GMTLOG: all server processes terminated; reinitializing > >> 2014-04-06 08:08:11.183 GMTFATAL: pre-existing shared memory block is still in use > >> 2014-04-06 08:08:11.183 GMTHINT: Check if there are any old server processes still running, and terminate them. > >> > >> This is production, Please help! > > > This is unfortunately not giving us many details to work with... > > The "exit code 0" bit reminds me of this: > > http://www.postgresql.org/message-id/21027.1393546453@sss.pgh.pa.us > > Is there another exit report for the same PID just above the quoted log > extract? Because if there isn't, the postmaster shouldn't be thinking > that status 0 represents a crash. Wouldn't a pl or library doing a exit(0); cause exactly that, because it will still be in PM_CHILD_ASSIGNED? Greetings, Andres Freund -- Andres Freund http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services
Andres Freund <andres@2ndquadrant.com> writes: > On 2014-04-07 11:15:32 -0400, Tom Lane wrote: >> The "exit code 0" bit reminds me of this: >> >> http://www.postgresql.org/message-id/21027.1393546453@sss.pgh.pa.us >> >> Is there another exit report for the same PID just above the quoted log >> extract? Because if there isn't, the postmaster shouldn't be thinking >> that status 0 represents a crash. > Wouldn't a pl or library doing a exit(0); cause exactly that, because it > will still be in PM_CHILD_ASSIGNED? Oh, hm, that's a possibility, if the OP is using any untrusted PLs. As you say, we lack sufficient context. regards, tom lane
Hi,=20 We use several dblink functions (CREATE EXTENSION dblink), but only once an= d during installation of Postgres database server. The crash happens few mi= nutes later.=20 Also, we use one homemade function, which is being activated more often (to= get disk usage information, using Windows API). Anyway, I don't think it is the problem - whenever I activate it, I get the= expected results.=20 I activated it for several times - Postgres didn't reports anything unusual= .=20 >>Is there another exit report for the same PID just above the quoted log e= xtract? =20 No error reported above this message Let me know if you need more info. I can send you any c code or the PL func= tions which using these contributions.=20 Thanks,=20 Yuval -----Original Message----- From: Tom Lane [mailto:tgl@sss.pgh.pa.us]=20 Sent: Monday, April 07, 2014 6:39 PM To: Andres Freund Cc: Sofer, Yuval; pgsql-bugs@postgresql.org Subject: Re: [BUGS] Postgres 9.2.8 crash sporadically on Windows Andres Freund <andres@2ndquadrant.com> writes: > On 2014-04-07 11:15:32 -0400, Tom Lane wrote: >> The "exit code 0" bit reminds me of this: >>=20 >> http://www.postgresql.org/message-id/21027.1393546453@sss.pgh.pa.us >>=20 >> Is there another exit report for the same PID just above the quoted=20 >> log extract? Because if there isn't, the postmaster shouldn't be=20 >> thinking that status 0 represents a crash. > Wouldn't a pl or library doing a exit(0); cause exactly that, because=20 > it will still be in PM_CHILD_ASSIGNED? Oh, hm, that's a possibility, if the OP is using any untrusted PLs. As you say, we lack sufficient context. regards, tom lane
On 2014-04-08 05:12:16 -0500, Sofer, Yuval wrote: > Also, we use one homemade function, which is being activated more often (to get disk usage information, using Windows API). > Anyway, I don't think it is the problem - whenever I activate it, I get the expected results. > I activated it for several times - Postgres didn't reports anything unusual. I still would bet it's related to that. > >>Is there another exit report for the same PID just above the quoted log extract? > No error reported above this message It's not really the error, but the statements I am interested in. > Let me know if you need more info. I can send you any c code or the PL functions which using these contributions. That would be useful. Greetings, Andres Freund -- Andres Freund http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services
"Sofer, Yuval" <Yuval_Sofer@bmc.com> writes: > code is attached below - c and h file , as well as the sql to create the function in postgres repository. Hm ... no obvious way that that could cause an exit(0). I didn't inspect it closely for garden-variety bugs, but if it were crashing in an ordinary way the symptoms would be different from what you're reporting. There's always the catch-all explanation for random weirdness on Windows machines: do you have any antivirus software installed? If so, does removing it make the problem go away? regards, tom lane
Hi,=20 We restored database to different machine and for now, no crashes...=20 I hope it is something related to the environment (anti-virus , Windows mem= ory etc)=20 Tom, Andres - thanks a lot for your quick response=20 Yuval=20 -----Original Message----- From: Tom Lane [mailto:tgl@sss.pgh.pa.us]=20 Sent: Tuesday, April 08, 2014 4:46 PM To: Sofer, Yuval Cc: Andres Freund; pgsql-bugs@postgresql.org Subject: Re: [BUGS] Postgres 9.2.8 crash sporadically on Windows "Sofer, Yuval" <Yuval_Sofer@bmc.com> writes: > code is attached below - c and h file , as well as the sql to create the = function in postgres repository. Hm ... no obvious way that that could cause an exit(0). I didn't inspect i= t closely for garden-variety bugs, but if it were crashing in an ordinary w= ay the symptoms would be different from what you're reporting. There's always the catch-all explanation for random weirdness on Windows machines: do you have any antivirus software installed? If so, does removi= ng it make the problem go away? regards, tom lane