Re: PostgreSQL crashes with SIGSEGV

Bernd Helmle <mailings@oopsware.de>

From: Bernd Helmle <mailings@oopsware.de>
To: Peter Geoghegan <pg@bowt.ie>
Cc: pgsql-bugs@postgresql.org
Date: 2017-12-08T09:13:00Z
Lists: pgsql-bugs, pgsql-hackers
Am Donnerstag, den 07.12.2017, 18:23 -0800 schrieb Peter Geoghegan:
> Does "set replacement_sort_tuples = 0" change anything on
> REL9_6_STABLE? If you only get a crash when there is very little
> work_mem, then that might be a good avenue of investigation. Note
> that
> my changes to external sorting started in REL9_6_STABLE, so they
> can't
> be involved here.
> 

replacement_sort_tuples = 0 changes the picture, indeed. With that
setting, the query runs without problems in REL9_6_STABLE.

> Are you aware of commit 512f67c8d02cc558f9c269cc848b0f0f788c4fe1,
> which fixed a bug affecting external sorts? Are you sure that you
> have
> that fix on REL9_5_STABLE + REL9_6_STABLE?

My test instances are build against a fresh pull from yesterday.


Commits

  1. Fix actual and potential double-frees around tuplesort usage.

  2. Allow the built-in ordered-set aggregates to share transition state.

  3. Avoid integer overflow while sifting-up a heap in tuplesort.c.

  4. Allow avoiding tuple copy within tuplesort_gettupleslot().

  5. Remove should_free arguments to tuplesort routines.

  6. Fix use-after-free around DISTINCT transition function calls.

  7. Reuse abbreviated keys in ordered [set] aggregates.