pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Flaris Feller <flaris.feller@gmail.com>
Cc: Peter J. Holzer <hjp-pgsql@hjp.at>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: ERROR: invalid memory alloc request size 18446744073709551613
Date: Mon, 22 Jun 2020 12:54:38 -0400
Message-ID: <2080966.1592844878@sss.pgh.pa.us> (raw)
In-Reply-To: <CANNsrHs2ikr+DjW_EUVTxgeaMq+fnqove1fKTp9a9LtJ35aQJA@mail.gmail.com>
References: <CANNsrHtcVk3B0a08z5nk8=RqDRX-2mEkdf6=ei4DLW6WeCWgpw@mail.gmail.com>
	<20200622153315.GA25644@hjp.at>
	<CANNsrHs2ikr+DjW_EUVTxgeaMq+fnqove1fKTp9a9LtJ35aQJA@mail.gmail.com>

Flaris Feller <flaris.feller@gmail.com> writes:
> Em seg., 22 de jun. de 2020 às 12:33, Peter J. Holzer <hjp-pgsql@hjp.at>
> escreveu:
>> On 2020-06-22 11:13:33 -0300, Flaris Feller wrote:
>>> When using Postgres 9.6.15 on "CentOS Linux release 7.5.1804 (Core)" on
>>> Intel x86_64 I noticed "invalid memory alloc request size" error at PostgreSQL
>>> logs.

>> That's 2**64 - 3. So probably the size of some object is (erroneously)
>> computed as -3 bytes.

Yeah.  I don't recall the bit-level details offhand, but this is an
extremely common symptom of a corrupted length word in a variable-length
field.

The usual approach is to try to isolate which row or rows contains corrupt
data and then delete it.  I'm not aware of any tools for doing that
automatically, but you can usually home in on a bad row by a process of
binary search, eg testing how many rows you can fetch without seeing the
error.  Also "select * from mytab where ctid = '(m,n)'" is useful for
probing individual rows, once you get close to the problem area.

			regards, tom lane





view thread (43+ messages)  latest in thread

Message-ID: <2080966.1592844878@sss.pgh.pa.us>
Permalink:  ../2080966.1592844878@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/2080966.1592844878@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: tgl@sss.pgh.pa.us, flaris.feller@gmail.com, hjp-pgsql@hjp.at
  Subject: Re: ERROR: invalid memory alloc request size 18446744073709551613
  In-Reply-To: <2080966.1592844878@sss.pgh.pa.us>
  References: <CANNsrHtcVk3B0a08z5nk8=RqDRX-2mEkdf6=ei4DLW6WeCWgpw@mail.gmail.com> <20200622153315.GA25644@hjp.at> <CANNsrHs2ikr+DjW_EUVTxgeaMq+fnqove1fKTp9a9LtJ35aQJA@mail.gmail.com> <2080966.1592844878@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox