Re: BUG #14722: Segfault in tuplesort_heap_siftup, 32 bit overflow

From: Peter Geoghegan <pg(at)bowt(dot)ie>
To: Sergey Koposov <skoposov(at)cmu(dot)edu>
Cc: "pgsql-bugs(at)postgresql(dot)org" <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #14722: Segfault in tuplesort_heap_siftup, 32 bit overflow
Date: 2017-06-29 18:10:13
Message-ID: CAH2-WznbKHkY-sEFHjjdtLzF_tVeaXVn9nvSRKZDrJUnBLUFPg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Thu, Jun 29, 2017 at 10:50 AM, Sergey Koposov <skoposov(at)cmu(dot)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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Peter Geoghegan 2017-06-29 18:59:12 Re: BUG #14722: Segfault in tuplesort_heap_siftup, 32 bit overflow
Previous Message Sergey Koposov 2017-06-29 17:50:36 Re: BUG #14722: Segfault in tuplesort_heap_siftup, 32 bit overflow