pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #12785: server process (PID 2872) was terminated by exception 0xC0000005
5+ messages / 3 participants
[nested] [flat]

* BUG #12785: server process (PID 2872) was terminated by exception 0xC0000005
@ 2015-02-19 09:55  daniele.posenato@smartec.ch
  0 siblings, 1 reply; 5+ messages in thread

From: daniele.posenato@smartec.ch @ 2015-02-19 09:55 UTC (permalink / raw)
  To: pgsql-bugs

The following bug has been logged on the website:

Bug reference:      12785
Logged by:          Daniele
Email address:      daniele.posenato@smartec.ch
PostgreSQL version: 9.3.3
Operating system:   W7 professionale 64 bit 
Description:        

Hi, 

For an industrial application I have the same software running on 4
different PCs with the same characteristics and configurations. Each PC has
its how postgresql database. All 4 PC are doing the same things.
On one PC sometimes (about one per week) I get the server process (PID 2872)
was terminated by exception 0xC0000005.

On the log file I have these information:
2015-02-13 22:46:05 CET LOG:  server process (PID 2872) was terminated by
exception 0xC0000005
2015-02-13 22:46:05 CET DETAIL:  Failed process was running: SELECT * FROM
highvaluelogs INNER JOIN (SELECT * FROM hvforeachpoint WHERE logID>0) AS
SQL1 ON highvaluelogs.logID=SQL1.logID ORDER BY highvaluelogs.logtimestamp
DESC;
2015-02-13 22:46:05 CET HINT:  See C include file "ntstatus.h" for a
description of the hexadecimal value.

I am not able to figure out way the query is able to crash the service. The
query is executed every 10 seconds and it is crashing the service only in
one PC. 

Thanks in advance for the support.

Best regard
Daniele


-- 
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] 5+ messages in thread

* Re: BUG #12785: server process (PID 2872) was terminated by exception 0xC0000005
@ 2015-02-20 16:54  Francisco Olarte <folarte@peoplecall.com>
  parent: daniele.posenato@smartec.ch
  0 siblings, 1 reply; 5+ messages in thread

From: Francisco Olarte @ 2015-02-20 16:54 UTC (permalink / raw)
  To: daniele.posenato@smartec.ch; +Cc: pgsql-bugs

Hi Daniele:

On Thu, Feb 19, 2015 at 10:55 AM, <daniele.posenato@smartec.ch> wrote:

> Operating system:   W7 professionale 64 bit
>
​....

> For an industrial application I have the same software running on 4
> different PCs with the same characteristics and configurations. Each PC has
> its how postgresql database. All 4 PC are doing the same things.
> On one PC sometimes (about one per week) I get the server process (PID
> 2872)
> was terminated by exception 0xC0000005.
>

​IIRC ​
0xC0000005
​ is the windows code for access violation, similar to SIGSEGV, which uses
to be caused by stray pointers and similar things. Given you have this
running in 4 machines and only got it in one it MAY be caused by faulty
hardware ( ram flips a bit, corrupts a pointer, postgres uses pointer and
gets the error ). If you can I would suggest doing a good RAM / disk / CPU
test in that machine ( postgres is one of the candidates of getting hit by
ram/disk faults because it uses a lot of them ).

​Best regards
      Francisco Olarte.​

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

* Re: BUG #12785: server process (PID 2872) was terminated by exception 0xC0000005
@ 2015-02-23 17:09  Daniele Posenato <daniele.posenato@smartec.ch>
  parent: Francisco Olarte <folarte@peoplecall.com>
  0 siblings, 1 reply; 5+ messages in thread

From: Daniele Posenato @ 2015-02-23 17:09 UTC (permalink / raw)
  To: Francisco Olarte <folarte@peoplecall.com>; +Cc: pgsql-bugs

Hi Francisco,

Thank you a lot for the answer, I really appreciate it. I will try to do what you have suggested and then I will let you know.

Just for information the problem has occurred  again since  the last email and always on the same query.  I could understand a crash of the service on performing an update or a delete, but I have some difficulties to understand this on a select.  If it was an hardware problem I would expect  the service to crash also on other actions and not randomly (about once per week) only on  a specific select (that is executed every 10  seconds).

Is there a way to write a select that is able to crash the service?

I will let you know the results of the hardware check after the planned restart.

Best regards
Daniele



From: Francisco Olarte [mailto:folarte@peoplecall.com]<mailto:[mailto:folarte@peoplecall.com]>
Sent: Friday, 20 February, 2015 5:51 PM
To: Daniele Posenato
Cc: pgsql-bugs@postgresql.org<mailto:pgsql-bugs@postgresql.org>
Subject: Re: [BUGS] BUG #12785: server process (PID 2872) was terminated by exception 0xC0000005

Hi Daniele:

On Thu, Feb 19, 2015 at 10:55 AM, <daniele.posenato@smartec.ch<mailto:daniele.posenato@smartec.ch>> wrote:
Operating system:   W7 professionale 64 bit
​....
For an industrial application I have the same software running on 4
different PCs with the same characteristics and configurations. Each PC has
its how postgresql database. All 4 PC are doing the same things.
On one PC sometimes (about one per week) I get the server process (PID 2872)
was terminated by exception 0xC0000005.

​IIRC ​
0xC0000005
​ is the windows code for access violation, similar to SIGSEGV, which uses to be caused by stray pointers and similar things. Given you have this running in 4 machines and only got it in one it MAY be caused by faulty hardware ( ram flips a bit, corrupts a pointer, postgres uses pointer and gets the error ). If you can I would suggest doing a good RAM / disk / CPU test in that machine ( postgres is one of the candidates of getting hit by ram/disk faults because it uses a lot of them ).

​Best regards
      Francisco Olarte.​


Roctest Barracuda scanned !

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

* Re: BUG #12785: server process (PID 2872) was terminated by exception 0xC0000005
@ 2015-02-23 17:59  Francisco Olarte <folarte@peoplecall.com>
  parent: Daniele Posenato <daniele.posenato@smartec.ch>
  0 siblings, 1 reply; 5+ messages in thread

From: Francisco Olarte @ 2015-02-23 17:59 UTC (permalink / raw)
  To: Daniele Posenato <daniele.posenato@smartec.ch>; +Cc: pgsql-bugs

Hi Daniele:

On Mon, Feb 23, 2015 at 6:09 PM, Daniele Posenato <
daniele.posenato@smartec.ch> wrote:

>  Thank you a lot for the answer, I really appreciate it. I will try to do
> what you have suggested and then I will let you know.
>

​That's ok, but I doubt I can help you more ( I abandoned Windows more than
a dozen years ago, haven't looked back, although I still remember how that
code appeared when I did something wrong in my programs ).​



>
> Just for information the problem has occurred  again since  the last email
> and always on the same query.  I could understand a crash of the service on
> performing an update or a delete, but I have some difficulties to
> understand this on a select.  If it was an hardware problem I would expect
> the service to crash also on other actions and not randomly (about once per
> week) only on  a specific select (that is executed every 10  seconds).
>

​Is that query consuming a lot of your resources? ( It may be due to it
being lengthy or just frequent ) because in that case it makes sense.

In many applications I have 99.9% of the work / ram usage are selects, so a
random crash is normally going to hit me in one of this.

On the crashing on select stuff. Suppose you have a faulty sector or ram
location. When you write to it ( upd or del ) nothing happens, it just
sotres the bad value, when you read it ( select, part 1, reading from
disk/ram ) nothing happens, you just get bad data, say a null pointer, then
when you use ( select part 2 ) you get the fault. In fact, if a ram
location loses data written you do not notice it on writting it, or on
reading it ( unless you get a parity error ) but on using what you read
from it.

​This is a normal pattern on programming bugs too. You have an error in
some code  and store something in a random ( or not so random ) ram
location . That code seems to work ok. But then an unrelated piece of code
reads the corrupted data and crashes ( it is one of the way the buffer
overflows work, the guilty code overflows a buffer, but works, and another
chunk of code gets its data overwritten and crashes ).


>
> Is there a way to write a select that is able to crash the service?
>

​With a good database, on good hardware, with adequate ( inifinite, as you
can crash any service by just joining enough copies of a table to exhaust
avalible  ) memory and disk there shouldn't be, but if you read corrupted
data or get hit by a bit flips in the middle of processing, it may Are you
able to do a full database dump ( pg_dump, not base backup ) of your
database? If you are then you are able to read all the tables, and I would
suggest trying to reindex every table if you have quiescent periods (
pg_dump does not touch indexes, so if you have good data bad corrupted
indexes that should fix it  )​


>
> I will let you know the results of the hardware check after the planned
> restart.
>

​I do not know ( or remember )  what your DB sizes ​and uptime requirements
are. But I've had that kind of problems caused by corrupted disk
structures, and have being able to recover them rewritting the database,
that means dump, drop, restore, but this depends on the system, I cannot
recommend doing it, but as I said before, if I had the same aplication in 4
machines crashing randomly in only one of them I would try to triple test
the machine and dump / restore it.

Best ergards.
    Francisco Olarte.

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

* Re: BUG #12785: server process (PID 2872) was terminated by exception 0xC0000005
@ 2015-02-27 12:27  Daniele Posenato <daniele.posenato@smartec.ch>
  parent: Francisco Olarte <folarte@peoplecall.com>
  0 siblings, 0 replies; 5+ messages in thread

From: Daniele Posenato @ 2015-02-27 12:27 UTC (permalink / raw)
  To: Francisco Olarte <folarte@peoplecall.com>; +Cc: pgsql-bugs

Hi Francisco,

This email is just to inform you that I think we have discovered the source of the issue. The problem seems to be related to the hard disk, even if the server was new the disk started to show some anomalies, now for example we have a lot of logs saying that the disk “needs to be checked for consistency” and “the file system structure on the disk is corrupted”. Also the postgreslq  cannot  be started.

So that you were right, it was an hardware problem.

Thanks again for the support and the time you spend on it, I have really appreciated it.

Best regards
Daniele

From: Francisco Olarte [mailto:folarte@peoplecall.com]
Sent: Monday, 23 February, 2015 6:56 PM
To: Daniele Posenato
Cc: pgsql-bugs@postgresql.org
Subject: Re: [BUGS] BUG #12785: server process (PID 2872) was terminated by exception 0xC0000005

Hi Daniele:

On Mon, Feb 23, 2015 at 6:09 PM, Daniele Posenato <daniele.posenato@smartec.ch<mailto:daniele.posenato@smartec.ch>> wrote:
Thank you a lot for the answer, I really appreciate it. I will try to do what you have suggested and then I will let you know.

​That's ok, but I doubt I can help you more ( I abandoned Windows more than a dozen years ago, haven't looked back, although I still remember how that code appeared when I did something wrong in my programs ).​



Just for information the problem has occurred  again since  the last email and always on the same query.  I could understand a crash of the service on performing an update or a delete, but I have some difficulties to understand this on a select.  If it was an hardware problem I would expect  the service to crash also on other actions and not randomly (about once per week) only on  a specific select (that is executed every 10  seconds).

​Is that query consuming a lot of your resources? ( It may be due to it being lengthy or just frequent ) because in that case it makes sense.
In many applications I have 99.9% of the work / ram usage are selects, so a random crash is normally going to hit me in one of this.

On the crashing on select stuff. Suppose you have a faulty sector or ram location. When you write to it ( upd or del ) nothing happens, it just sotres the bad value, when you read it ( select, part 1, reading from disk/ram ) nothing happens, you just get bad data, say a null pointer, then when you use ( select part 2 ) you get the fault. In fact, if a ram location loses data written you do not notice it on writting it, or on reading it ( unless you get a parity error ) but on using what you read from it.
​This is a normal pattern on programming bugs too. You have an error in some code  and store something in a random ( or not so random ) ram location . That code seems to work ok. But then an unrelated piece of code reads the corrupted data and crashes ( it is one of the way the buffer overflows work, the guilty code overflows a buffer, but works, and another chunk of code gets its data overwritten and crashes ).


Is there a way to write a select that is able to crash the service?

​With a good database, on good hardware, with adequate ( inifinite, as you can crash any service by just joining enough copies of a table to exhaust avalible  ) memory and disk there shouldn't be, but if you read corrupted data or get hit by a bit flips in the middle of processing, it may Are you able to do a full database dump ( pg_dump, not base backup ) of your database? If you are then you are able to read all the tables, and I would suggest trying to reindex every table if you have quiescent periods ( pg_dump does not touch indexes, so if you have good data bad corrupted indexes that should fix it  )​


I will let you know the results of the hardware check after the planned restart.

​I do not know ( or remember )  what your DB sizes ​and uptime requirements are. But I've had that kind of problems caused by corrupted disk structures, and have being able to recover them rewritting the database, that means dump, drop, restore, but this depends on the system, I cannot recommend doing it, but as I said before, if I had the same aplication in 4 machines crashing randomly in only one of them I would try to triple test the machine and dump / restore it.
Best ergards.
    Francisco Olarte.


Roctest Barracuda scanned !


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


end of thread, other threads:[~2015-02-27 12:27 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2015-02-19 09:55 BUG #12785: server process (PID 2872) was terminated by exception 0xC0000005 daniele.posenato@smartec.ch
2015-02-20 16:54 ` Francisco Olarte <folarte@peoplecall.com>
2015-02-23 17:09   ` Daniele Posenato <daniele.posenato@smartec.ch>
2015-02-23 17:59     ` Francisco Olarte <folarte@peoplecall.com>
2015-02-27 12:27       ` Daniele Posenato <daniele.posenato@smartec.ch>

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