RE: <EXTERNAL> Re: Invalid memory alloc querying field type bytea

From: "Thompson, Shon" <Shon(dot)Thompson(at)MaineGeneral(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "pgsql-bugs(at)lists(dot)postgresql(dot)org" <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: RE: <EXTERNAL> Re: Invalid memory alloc querying field type bytea
Date: 2020-07-08 15:25:18
Message-ID: 1EE72409308D54419CC1915B28D0FC2A52910C99@EXCPRDMS02.mainegeneral.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

I tried installing the latest version of postgress, and I get the same error. Postgres returns the smaller rows without errors, but cannot return the two largest bytea fields. The length function for the bytea data of these two rows returns:
647,034,150
819,319,303

This is a windows machine. I'd expect the OS to use paging file if there's not enough memory. My computer doesn't seem to be memory bound because I have 16 gig and 6 gig free when the query runs. I'm getting the same error on these two versions of postgres:
11.2 build 1914
12.3 build 1914

Shon Thompson
Office:  207-624-4391

-----Original Message-----
From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Sent: Wednesday, June 17, 2020 2:46 PM
To: Thompson, Shon <Shon(dot)Thompson(at)MaineGeneral(dot)org>
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: <EXTERNAL> Re: Invalid memory alloc querying field type bytea

CAUTION: EXTERNAL EMAIL --- THIS EMAIL ORIGINATED OUTSIDE OF MAINEGENERAL. DO NOT CLICK ANY LINKS OR OPEN ANY ATTACHMENTS UNLESS YOU KNOW THE SENDER. REPORT ALL SUSPICIOUS EMAIL TO SPAM(at)MAINEGENERAL(dot)ORG <mailto:SPAM(at)MAINEGENERAL(dot)ORG>

"Thompson, Shon" <Shon(dot)Thompson(at)MaineGeneral(dot)org> writes:
> I'm getting errors when I query a table that uses data type bytea. I can query the table if I don't include the field for data type bytea. Here are the two error messages I get. The first error is one generated from visual studio:
> "ERROR: XX000: invalid memory alloc request size 1294068297"

Looks like a corrupt-data problem. I doubt it's directly the fault of bytea; any variable-length field would have given a similar type of error, because what this seems to be is a damaged field length word.

Do you see any clearly bogus data in other columns of the table? That might help isolate which row(s) have gotten damaged. It seems somewhat unlikely that only the bytea field header would be clobbered and not any adjacent data.

The questions you should be asking yourself include whether your PG version is up-to-date and whether the storage stack is reliable.

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2020-07-08 16:24:45 Re: BUG #16531: listen_addresses wide open?
Previous Message PG Bug reporting form 2020-07-08 13:20:23 BUG #16531: listen_addresses wide open?