RE: BUG #17254: Crash with 0xC0000409 in pg_stat_statements when pg_stat_tmp\pgss_query_texts.stat exceeded 2GB.

Yusuke Egashira (Fujitsu) <egashira.yusuke@fujitsu.com>

From: "egashira.yusuke@fujitsu.com" <egashira.yusuke@fujitsu.com>
To: 'Tom Lane' <tgl@sss.pgh.pa.us>, Juan José Santamaría Flecha <juanjo.santamaria@gmail.com>
Cc: PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
Date: 2021-11-02T02:56:57Z
Lists: pgsql-bugs
=?UTF-8?Q?Juan_Jos=C3=A9_Santamar=C3=ADa_Flecha?= <juanjo.santamaria@gmail.com> writes:
> On Sun, Oct 31, 2021 at 6:07 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Here's a quick patch for that.  I don't have any ability to check it
>> on Windows, but the logic is easy to verify by reducing the arbitrary
>> constant to something small.  (I used 1GB, not INT_MAX, because I figured
>> we ought to read in multiples of a filesystem block if possible.)

> I have tested the patch in Windows and it works as expected.

I have also patched our environment to make sure it does not crash.
Thank you for your prompt work.

Regards.
Yusuke Egashira.

Commits

  1. Don't try to read a multi-GB pg_stat_statements file in one call.