Re: [HACKERS] HEAD crashes on windows when doing VACUUM ANALYZE

2012-08-30 Thread Albe Laurenz
Matthias wrote:
 when running VACUUM ANALYZE on my database built on win32-x86 from
 yesterday's git checkout I always get this at some point during VACUUM
 ANALYZE:
 
 LOG:  server process (PID 5880) was terminated by exception 0xC094
 DETAIL:  Failed process was running: VACUUM VERBOSE ANALYZE
 HINT:  See C include file ntstatus.h for a description of the
 hexadecimal value.
 LOG:  terminating any other active server processes
 
 I am not sure if it's useful to report it here, but I thought I'd do
 it anyway :)

That seems to be STATUS_INTEGER_DIVIDE_BY_ZERO.

Does it only happen with a certain table?
Are you sure there is no data corruption?
A stack trace would help:
http://wiki.postgresql.org/wiki/Getting_a_stack_trace_of_a_running_Postg
reSQL_backend_on_Windows

Yours,
Laurenz Albe


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


Re: [HACKERS] HEAD crashes on windows when doing VACUUM ANALYZE

2012-08-30 Thread Andres Freund
On Thursday, August 30, 2012 06:50:13 PM Matthias wrote:
 2012/8/30 Albe Laurenz laurenz.a...@wien.gv.at:
  Matthias wrote:
  when running VACUUM ANALYZE on my database built on win32-x86 from
  yesterday's git checkout I always get this at some point during VACUUM
  ANALYZE:
  
  LOG:  server process (PID 5880) was terminated by exception 0xC094
  DETAIL:  Failed process was running: VACUUM VERBOSE ANALYZE
  HINT:  See C include file ntstatus.h for a description of the
  hexadecimal value.
  LOG:  terminating any other active server processes
  
  I am not sure if it's useful to report it here, but I thought I'd do
  it anyway :)
  
  That seems to be STATUS_INTEGER_DIVIDE_BY_ZERO.
  
  Does it only happen with a certain table?
  Are you sure there is no data corruption?
  A stack trace would help:
  http://wiki.postgresql.org/wiki/Getting_a_stack_trace_of_a_running_Postg
  reSQL_backend_on_Windows
 
 Attached the debugger.
 
 It crashes in rangetypes_typeanalyze.c at line 186:
 
 delta = (non_empty_cnt - 1) / (num_hist - 1);
 
 According to the debugger num_hist = 1, so it divides by zero.
Its curious though that the SIGFPE isn't properly cought though. That would 
only lead to a different error, but ...
Postgres does install a handler for it. What happens if you run SELECT 
-2147483648/-1;?

Greetings,

Andres
-- 
 Andres Freund http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training  Services


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


Re: [HACKERS] HEAD crashes on windows when doing VACUUM ANALYZE

2012-08-30 Thread Matthias
2012/8/30 Albe Laurenz laurenz.a...@wien.gv.at:
 Matthias wrote:
 when running VACUUM ANALYZE on my database built on win32-x86 from
 yesterday's git checkout I always get this at some point during VACUUM
 ANALYZE:

 LOG:  server process (PID 5880) was terminated by exception 0xC094
 DETAIL:  Failed process was running: VACUUM VERBOSE ANALYZE
 HINT:  See C include file ntstatus.h for a description of the
 hexadecimal value.
 LOG:  terminating any other active server processes

 I am not sure if it's useful to report it here, but I thought I'd do
 it anyway :)

 That seems to be STATUS_INTEGER_DIVIDE_BY_ZERO.

 Does it only happen with a certain table?
 Are you sure there is no data corruption?
 A stack trace would help:
 http://wiki.postgresql.org/wiki/Getting_a_stack_trace_of_a_running_Postg
 reSQL_backend_on_Windows

Attached the debugger.

It crashes in rangetypes_typeanalyze.c at line 186:

delta = (non_empty_cnt - 1) / (num_hist - 1);

According to the debugger num_hist = 1, so it divides by zero. I guess
this is due to the new statistics collection for range types?

-Matthias


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


Re: [HACKERS] HEAD crashes on windows when doing VACUUM ANALYZE

2012-08-30 Thread Heikki Linnakangas

On 30.08.2012 19:50, Matthias wrote:

It crashes in rangetypes_typeanalyze.c at line 186:

 delta = (non_empty_cnt - 1) / (num_hist - 1);

According to the debugger num_hist = 1, so it divides by zero. I guess
this is due to the new statistics collection for range types?


Yep. Fixed, thanks for the report!

I added just a check that the histogram is not created if there are less 
than 2 values in the sample. The corresponding code for scalars also 
checks that there are more than 1 distinct value, so that the histogram 
doesn't consist of all duplicates. We don't currently count the number 
of distinct values for ranges, so that would require a bit more work, 
but I don't think it makes much difference in practice.


- Heikki


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


Re: [HACKERS] HEAD crashes on windows when doing VACUUM ANALYZE

2012-08-30 Thread Tom Lane
Andres Freund and...@2ndquadrant.com writes:
 On Thursday, August 30, 2012 06:50:13 PM Matthias wrote:
 According to the debugger num_hist = 1, so it divides by zero.

 Its curious though that the SIGFPE isn't properly cought though. That would 
 only lead to a different error, but ...

Not all platforms think an integer divide-by-zero maps to SIGFPE.

regards, tom lane


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


[HACKERS] HEAD crashes on windows when doing VACUUM ANALYZE

2012-08-29 Thread Matthias
Hello,

when running VACUUM ANALYZE on my database built on win32-x86 from
yesterday's git checkout I always get this at some point during VACUUM
ANALYZE:

LOG:  server process (PID 5880) was terminated by exception 0xC094
DETAIL:  Failed process was running: VACUUM VERBOSE ANALYZE
HINT:  See C include file ntstatus.h for a description of the
hexadecimal value.
LOG:  terminating any other active server processes

I am not sure if it's useful to report it here, but I thought I'd do
it anyway :)

-Matthias


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