Обсуждение: BUG #13618: terminated by exception 0xC0000005

Поиск
Список
Период
Сортировка

BUG #13618: terminated by exception 0xC0000005

От
eelke@bolt.nl
Дата:
The following bug has been logged on the website:

Bug reference:      13618
Logged by:          Eelke Klein
Email address:      eelke@bolt.nl
PostgreSQL version: 9.5alpha2
Operating system:   Windows 7 Profession 64 bits
Description:

Using the installer provided by enterprise DB for the 64-bits version of
9.5alpha2 the server crashing when the script below is run doesn't matter if
I connect to a populated database or a newly created empty database. I have
done my best to remove all code from the original script that isn't needed
to trigger the error.

The crash goes away when you either
simplify the first code block to do a simple RAISE NOTICE 'Hello';
or when you remove the declartion of the text variable in
pg_temp.RandomString
or when you remove the call password := pg_temp.RandomString(12); in the
last code block.

BEGIN;

DO $CODE$
DECLARE
    versie text := '1.7';
BEGIN
    RAISE NOTICE 'Dit is versie % van het rechten-script.', versie;
END
$CODE$;


CREATE OR REPLACE FUNCTION pg_temp.RandomString(length integer) RETURNS text
AS
$CODE$
DECLARE
    chars text[] :=
'{2,3,4,5,6,7,8,9,A,B,C,D,E,F,G,H,I,J,K,L,M,N,P,Q,R,S,T,U,W,X,Y,Z,a,b,c,d,e,f,g,h,i,j,k,m,n,o,p,q,r,s,t,u,w,x,y,z}';
BEGIN
    RETURN 'bar';
END;
$CODE$ LANGUAGE plpgsql;


DO $CODE$
DECLARE
    password varchar;
BEGIN
    password := pg_temp.RandomString(12);
END
$CODE$;

COMMIT;




Relevant part of the log:

2015-09-14 12:03:12 CEST LOG:  server process (PID 8108) was terminated by
exception 0xC0000005
2015-09-14 12:03:12 CEST DETAIL:  Failed process was running:
    BEGIN;

    DO $CODE$
    DECLARE
        versie text := '1.7';
    BEGIN
        RAISE NOTICE 'Dit is versie % van het rechten-script.', versie;
    END
    $CODE$;


    CREATE OR REPLACE FUNCTION pg_temp.RandomString(length integer) RETURNS
text AS
    $CODE$
    DECLARE
        chars text[] :=
'{2,3,4,5,6,7,8,9,A,B,C,D,E,F,G,H,I,J,K,L,M,N,P,Q,R,S,T,U,W,X,Y,Z,a,b,c,d,e,f,g,h,i,j,k,m,n,o,p,q,r,s,t,u,w,x,y,z}';
    BEGIN
        RETURN 'bar';
    END;
    $CODE$ LANGUAGE plpgsql;


    DO $CODE$
    DECLARE
        password varchar;
    BEGIN
        password := pg_temp.RandomString(12);
    END
    $CODE$;

    COMMIT;

2015-09-14 12:03:12 CEST HINT:  See C include file "ntstatus.h" for a
description of the hexadecimal value.
2015-09-14 12:03:12 CEST LOG:  terminating any other active server
processes
2015-09-14 12:03:12 CEST WARNING:  terminating connection because of crash
of another server process
2015-09-14 12:03:12 CEST DETAIL:  The postmaster has commanded this server
process to roll back the current transaction and exit, because another
server process exited abnormally and possibly corrupted shared memory.
2015-09-14 12:03:12 CEST HINT:  In a moment you should be able to reconnect
to the database and repeat your command.
2015-09-14 12:03:12 CEST LOG:  all server processes terminated;
reinitializing
2015-09-14 12:03:22 CEST FATAL:  pre-existing shared memory block is still
in use
2015-09-14 12:03:22 CEST HINT:  Check if there are any old server processes
still running, and terminate them.

Re: BUG #13618: terminated by exception 0xC0000005

От
Tom Lane
Дата:
eelke@bolt.nl writes:
> Using the installer provided by enterprise DB for the 64-bits version of
> 9.5alpha2 the server crashing when the script below is run doesn't matter if
> I connect to a populated database or a newly created empty database. I have
> done my best to remove all code from the original script that isn't needed
> to trigger the error.

I can't reproduce a crash with this script in HEAD or 9.5 branch tip.
I think that it is hitting the bug I fixed in commit 1f6a7eba466d0cb3.
But there is one thing I'm not too sure about: the fact that the whole
script shows up as one statement in your log says that you're not feeding
it to psql in the usual way.  So maybe there's some aspect of that angle
that provokes an otherwise-unseen crash.  Could you confirm exactly what
you're doing to execute the script?

            regards, tom lane