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

Juan José Santamaría Flecha <juanjo.santamaria@gmail.com>

From: Juan José Santamaría Flecha <juanjo.santamaria@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: egashira.yusuke@fujitsu.com, PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
Date: 2021-10-31T23:34:15Z
Lists: pgsql-bugs
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.

Regards,

Juan José Santamaría Flecha

Commits

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