Re: server process exited with exit code -1073741819 on 8.2 Windows

Lists: pgsql-bugs
From: "JEAN-PIERRE PELLETIER" <pelletier_32(at)sympatico(dot)ca>
To: pgsql-bugs(at)postgresql(dot)org
Cc: tgl(at)sss(dot)pgh(dot)pa(dot)us
Subject: server process exited with exit code -1073741819 on 8.2 Windows
Date: 2006-12-20 17:55:05
Message-ID: BAY133-F1911BDA71E26212169F50595CF0@phx.gbl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

Hi,

Tom:
Sorry to email you directly but the mailing lists seem to be down
and you fixed a similar problem I reported back in October.

I just upgraded to PostgreSQL 8.2 and have a function
which crashes PostgreSQL 8.2 while logging these messages:

server process exited with exit code -1073741819
terminating any other active server processes

It crashes under Windows XP Service Pack 2 and Windows Server 2003.
Note that it worked fine with PostgreSQL 8.1

Strangely, Yesterday I got it working a few hours by calling it with
select * from UDFActualPerformanceVsStandard($1,$2::CHAR) from within
another plpgsql function but then it got back to crashing.

Thanks,
Jean-Pierre Pelletier
e-djuster

To Reproduce:

CREATE TABLE Claim (
ClaimId INTEGER NOT NULL,
AssociatePersonId INTEGER NULL,
IsOnSite BOOLEAN NOT NULL
);

CREATE TABLE SubTask (
TaskCode VARCHAR(3) NOT NULL,
subTaskId SMALLINT NOT NULL,
ReportTaskCode VARCHAR(2) NULL
);

CREATE TABLE WorkEntry (
DurationHour INTERVAL(0) NULL,
TaskCode VARCHAR(3) NULL,
SubTaskId SMALLINT NULL,
PersonId INTEGER NOT NULL,
ClaimId INTEGER NULL,
ExtensionNo CHAR(1) NULL
);

INSERT INTO Claim values (1,0,false);

CREATE TYPE UDTActualPerformanceVsStandard AS (
ClaimId INTEGER,
ExtensionNo CHAR,
IsStandard BOOLEAN,
StandardRoleId SMALLINT,
PersonId INTEGER,
ReportTaskCode VARCHAR,
PersonOrStandardRoleTaskCountItem BIGINT,
PersonOrStandardRoleTaskDistanceKm DECIMAL,
PersonOrStandardRoleTaskDurationHour INTERVAL
);

CREATE OR REPLACE FUNCTION UDFActualPerformanceVsStandard(
PClaimId INTEGER,
PExtensionNo CHAR
) RETURNS SETOF UDTActualPerformanceVsStandard AS $$
DECLARE
isOnSite BOOLEAN;
associatePersonId INTEGER;
ResultRow UDTActualPerformanceVsStandard%ROWTYPE;
BEGIN
SELECT INTO isOnSite, associatePersonId C.IsOnSite,
C.AssociatePersonId FROM Claim C WHERE PClaimId = C.ClaimId;

FOR resultRow IN
SELECT
PClaimId AS ClaimId,
PExtensionNo AS ExtensionNo,
IsStandard,
NULL AS StandardRoleId,
PersonId,
ReportTaskCode,
SUM(PersonOrStandardRoleTaskCountItem),
SUM(PersonOrStandardRoleTaskDistanceKm),
SUM(PersonOrStandardRoleTaskDurationHour)
FROM
(SELECT
FALSE AS IsStandard,
WE.PersonId,
ST.ReportTaskCode,
CAST(NULL AS BIGINT) AS PersonOrStandardRoleTaskCountItem,
CAST(NULL AS DECIMAL) AS PersonOrStandardRoleTaskDistanceKm,
SUM(WE.DurationHour) AS PersonOrStandardRoleTaskDurationHour
FROM
WorkEntry WE

INNER JOIN SubTask ST
ON WE.TaskCode = ST.TaskCode
AND WE.SubTaskId = ST.SubTaskId
WHERE
WE.ClaimId = PClaimId
AND WE.ExtensionNo = PExtensionNo
GROUP BY
WE.PersonId,

ST.ReportTaskCode
UNION ALL
SELECT
FALSE,
associatePersonId,
'DE',
NULL,
NULL,
NULL
) NamedSubselect
WHERE
PersonOrStandardRoleTaskCountItem IS NOT NULL
OR PersonOrStandardRoleTaskDistanceKm IS NOT NULL
OR PersonOrStandardRoleTaskDurationHour IS NOT NULL
OR (associatePersonId = personId AND 'DE' = ReportTaskCode)
GROUP BY
IsStandard,
PersonId,
ReportTaskCode
LOOP
RETURN NEXT resultRow;
END LOOP;

RETURN;
END;
$$ LANGUAGE PLPGSQL STABLE;

select * from UDFActualPerformanceVsStandard(1,'A');


From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: JEAN-PIERRE PELLETIER <pelletier_32(at)sympatico(dot)ca>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: server process exited with exit code -1073741819 on 8.2 Windows
Date: 2006-12-20 18:31:11
Message-ID: 20061220183111.GU30769@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

JEAN-PIERRE PELLETIER wrote:

> I just upgraded to PostgreSQL 8.2 and have a function
> which crashes PostgreSQL 8.2 while logging these messages:
>
> server process exited with exit code -1073741819
> terminating any other active server processes

There was an SPI bug which may explain your problem, fixed after 8.2 was
released. This is the fix:

http://archives.postgresql.org/pgsql-committers/2006-12/msg00063.php

Not sure how you could get a patched version short of compiling it
yourself. Or you could wait for 8.2.1.

--
Alvaro Herrera http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.


From: "JEAN-PIERRE PELLETIER" <pelletier_32(at)sympatico(dot)ca>
To: pgsql-bugs(at)postgresql(dot)org
Cc: alvherre(at)commandprompt(dot)com
Subject: Re: server process exited with exit code -1073741819 on 8.2 Windows
Date: 2006-12-20 23:29:56
Message-ID: BAY133-F19B4CD1300379710E2849C95CF0@phx.gbl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

I've compiled the 8.2.0 sources from
http://www.postgresql.org/ftp/source/v8.2/
and when run, it crash by logging the same messages.

I'll compile from the nightly snapshot tarball (which is probably 8.3 ?) and
will post
the result.

Jean-Pierre Pelletier

>From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
>To: JEAN-PIERRE PELLETIER <pelletier_32(at)sympatico(dot)ca>
>CC: pgsql-bugs(at)postgresql(dot)org
>Subject: Re: [BUGS] server process exited with exit code -1073741819 on 8.2
>Windows
>Date: Wed, 20 Dec 2006 15:31:11 -0300
>
>JEAN-PIERRE PELLETIER wrote:
>
> > I just upgraded to PostgreSQL 8.2 and have a function
> > which crashes PostgreSQL 8.2 while logging these messages:
> >
> > server process exited with exit code -1073741819
> > terminating any other active server processes
>
>There was an SPI bug which may explain your problem, fixed after 8.2 was
>released. This is the fix:
>
>http://archives.postgresql.org/pgsql-committers/2006-12/msg00063.php
>
>Not sure how you could get a patched version short of compiling it
>yourself. Or you could wait for 8.2.1.
>
>--
>Alvaro Herrera http://www.CommandPrompt.com/
>The PostgreSQL Company - Command Prompt, Inc.


From: "JEAN-PIERRE PELLETIER" <pelletier_32(at)sympatico(dot)ca>
To: pgsql-bugs(at)postgresql(dot)org
Cc: alvherre(at)commandprompt(dot)com
Subject: Re: server process exited with exit code -1073741819 on 8.2 Windows
Date: 2006-12-21 01:13:10
Message-ID: BAY133-F3339AEDBA4D3363F3628CB95CE0@phx.gbl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

I've compiled 8.3 devel from
the latest nightly snapshot tarball, did an initdb
and when run, it crash by logging the same messages.

Jean-Pierre Pelletier

>From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
>To: JEAN-PIERRE PELLETIER <pelletier_32(at)sympatico(dot)ca>
>CC: pgsql-bugs(at)postgresql(dot)org
>Subject: Re: [BUGS] server process exited with exit code -1073741819 on 8.2
>Windows
>Date: Wed, 20 Dec 2006 15:31:11 -0300
>
>JEAN-PIERRE PELLETIER wrote:
>
> > I just upgraded to PostgreSQL 8.2 and have a function
> > which crashes PostgreSQL 8.2 while logging these messages:
> >
> > server process exited with exit code -1073741819
> > terminating any other active server processes
>
>There was an SPI bug which may explain your problem, fixed after 8.2 was
>released. This is the fix:
>
>http://archives.postgresql.org/pgsql-committers/2006-12/msg00063.php
>
>Not sure how you could get a patched version short of compiling it
>yourself. Or you could wait for 8.2.1.
>
>--
>Alvaro Herrera http://www.CommandPrompt.com/
>The PostgreSQL Company - Command Prompt, Inc.


From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: JEAN-PIERRE PELLETIER <pelletier_32(at)sympatico(dot)ca>
Cc: pgsql-bugs(at)postgresql(dot)org, tgl(at)sss(dot)pgh(dot)pa(dot)us
Subject: Re: server process exited with exit code -1073741819 on 8.2 Windows
Date: 2006-12-21 01:20:57
Message-ID: 20061221012057.GC30769@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

JEAN-PIERRE PELLETIER wrote:

> Tom:
> Sorry to email you directly but the mailing lists seem to be down
> and you fixed a similar problem I reported back in October.
>
> I just upgraded to PostgreSQL 8.2 and have a function
> which crashes PostgreSQL 8.2 while logging these messages:
>
> server process exited with exit code -1073741819
> terminating any other active server processes

Ok, I took the latest from the 8.2 branch and tried your function. My
server doesn't crash, but shows this error:

alvherre=# select * from UDFActualPerformanceVsStandard(1,'A');
ERROR: tupdesc reference 0xa0e148 is not owned by resource owner Portal
CONTEXTO: PL/pgSQL function "udfactualperformancevsstandard" line 9 at for over select rows

--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "JEAN-PIERRE PELLETIER" <pelletier_32(at)sympatico(dot)ca>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: server process exited with exit code -1073741819 on 8.2 Windows
Date: 2006-12-26 21:38:06
Message-ID: 8980.1167169086@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

"JEAN-PIERRE PELLETIER" <pelletier_32(at)sympatico(dot)ca> writes:
> I just upgraded to PostgreSQL 8.2 and have a function
> which crashes PostgreSQL 8.2 while logging these messages:
> server process exited with exit code -1073741819

Fixed for 8.2.1, thanks for the report.

regards, tom lane