Re: BUG #14722: Segfault in tuplesort_heap_siftup, 32 bit overflow
Peter Geoghegan <pg@bowt.ie>
From: Peter Geoghegan <pg@bowt.ie>
To: Sergey Koposov <skoposov@cmu.edu>
Cc: "pgsql-bugs@postgresql.org" <pgsql-bugs@postgresql.org>
Date: 2017-06-29T18:10:13Z
Lists: pgsql-bugs
On Thu, Jun 29, 2017 at 10:50 AM, Sergey Koposov <skoposov@cmu.edu> wrote: > For the time being I've just changed the type of i,j from int to long > (or int64) and I am running the index creation now. I let you submit a > patch -- thanks in advance. That's more or less what I had in mind. > I also noticed that the availMem variable was negative in the printout > of the TupleSortState. > availMem =-6442450776, > I don't know whether that's an issue on its own or was caused by the > (i,j) overflow. (availMem seems to be int64 variable though). That's definitely allowed to go negative, which is why it's int64. That's about 6GB of memory, though, which seems unusually large. -- Peter Geoghegan
Commits
-
Avoid integer overflow while sifting-up a heap in tuplesort.c.
- e439bbe9996f 9.4.13 landed
- e7213fe2bda8 9.5.8 landed
- 512f67c8d02c 10.0 landed
- 09c598898166 9.6.4 landed
-
Implement binary heap replace-top operation in a smarter way.
- 24598337c8d2 10.0 cited
-
Permit super-MaxAllocSize allocations with MemoryContextAllocHuge().
- 263865a48973 9.4.0 cited