BUG #13618: terminated by exception 0xC0000005 - Mailing list pgsql-bugs

From eelke@bolt.nl
Subject BUG #13618: terminated by exception 0xC0000005
Date
Msg-id 20150914101249.2680.11397@wrigleys.postgresql.org
Whole thread Raw
Responses Re: BUG #13618: terminated by exception 0xC0000005  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
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.

pgsql-bugs by date:

Previous
From: Michael Paquier
Date:
Subject: Re: PQexec() hangs on OOM
Next
From: Tom Lane
Date:
Subject: Re: BUG #13618: terminated by exception 0xC0000005