Re: Error during hash index scans can cause postgres halt! - Mailing list pgsql-bugs

From Tom Lane
Subject Re: Error during hash index scans can cause postgres halt!
Date
Msg-id 16136.1204906397@sss.pgh.pa.us
Whole thread Raw
In response to Re: Error during hash index scans can cause postgres halt!  ("Heikki Linnakangas" <heikki@enterprisedb.com>)
List pgsql-bugs
"Heikki Linnakangas" <heikki@enterprisedb.com> writes:
> Tom Lane wrote:
>> Ouch.  So this has been broken (by me, I think :-() since 8.0.  Tells
>> you something about how many people use hash indexes :-(

> Yeah. Also, this is very hard to trigger without --enable-cassert (or
> just CLOBBER_FREED_MEMORY). It's extremely unlikely that something new
> is allocated on the piece of memory that was used by an HashScanList
> item, during AbortTransaction processing.

> ykhuang, were you running an assertion-enabled build as well?

The pfree() would touch the context control data, not just the
HashScanList struct itself.  Also on some platforms it's possible that
malloc would've returned the freed context to the system, resulting in
a segfault because we touch unmapped memory.  But I agree that it'd
be far more probable to see the problem with --enable-cassert.

> Want me to hack up a patch, or you going to just commit that yourself?

Already done, I didn't see your message till just now.

            regards, tom lane

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: Error during hash index scans can cause postgres halt!
Next
From: Stephan Szabo
Date:
Subject: Re: BUG #4019: Comparison of user defined domain doesn't work