Re: BUG #17619: AllocSizeIsValid violation in parallel hash join

From: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
To: Dmitry Astapov <dastapov(at)gmail(dot)com>
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #17619: AllocSizeIsValid violation in parallel hash join
Date: 2022-09-23 23:00:00
Message-ID: CA+hUKGL1OuDjd5EipFwUnKxKUTWZLhLssBHLOj4Vzo46M9XCYw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Fri, Sep 23, 2022 at 4:38 AM Dmitry Astapov <dastapov(at)gmail(dot)com> wrote:
>> I think >= on line 342 should be just > . I tried this change locally, and it fixed the issue for me.
>>
>> Do you agree with my analysis?

Yeah. It was hard to repro the problem from SQL, so I wrote a C
module to show the issue. CREATE EXTENSION test_sts; SELECT
test_sts(10, 32756); shows it, and is fixed by your proposed change.
I will look at the analysis and fix some more next week, and see if
the test can be improved some more and is worth keeping.

While testing with that module I found another bug: the
per-participant npages counter was not explicitly initialised to zero
in sts_initialize(). That wasn't exactly a problem when the code was
written because new DSM memory is always zeroed and this always
happens in new DSM memory, but it shows up in this test module because
it uses palloc() memory instead. It *is* a problem since v14, if you
use min_dynamic_shared_memory for a pool of recyclable shared memory,
because then it is not zeroed.

Attachment Content-Type Size
0001-Simple-test-for-sharedtuplestore.c.patch text/x-patch 6.1 KB
0002-Fix-sharedtuplestore.c-corruption.patch text/x-patch 2.1 KB

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2022-09-23 23:19:33 Re: BUG #17619: AllocSizeIsValid violation in parallel hash join
Previous Message Tom Lane 2022-09-23 14:10:09 Re: BUG #17618: unnecessary filter column <> text even after adding index