Re: hashtable issue - HASH_FIND??

From: Jay Flattery <jaycode(at)rocketmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: hashtable issue - HASH_FIND??
Date: 2010-08-04 15:41:38
Message-ID: 433265.37914.qm@web120110.mail.ne1.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Thanks for your reply.

Actually I had already changed the sizeof()s..

Not sure of the actual error, postmaster just dies:
NOTICE: Didn't find 9 -- good
NOTICE: about to extract object at key 0 (extra notice added by me)
LOG: server process (PID 55483) was terminated by signal 11: Segmentation fault

Wondering if it was just me..?

----- Original Message ----
From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jay Flattery <jaycode(at)rocketmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Sent: Wed, August 4, 2010 3:46:24 PM
Subject: Re: [GENERAL] hashtable issue - HASH_FIND??

Jay Flattery <jaycode(at)rocketmail(dot)com> writes:
> I'm looking to use the PostgreSQL Hash Table for some custom functions.
> However, the example, as per http://wiki.postgresql.org/wiki/HashTable crashes

> postmaster (or segfaults from the cmd line) when trying to retrieve an element

> from the hash.

I think the "palloc(sizeof(key))" bits ought to be
"palloc(sizeof(*key))" ... or personally I'd have used
sizeof(HashKey). Although offhand it looks like that should
be the same size or larger, so it doesn't seem to explain a crash.
Where's the crash happening exactly?

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2010-08-04 15:51:30 Re: hashtable issue - HASH_FIND??
Previous Message gnuoytr 2010-08-04 15:30:21 tgname munged