Re: [HACKERS] an older problem? hash table out of memory - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [HACKERS] an older problem? hash table out of memory
Date
Msg-id 29625.925826650@sss.pgh.pa.us
Whole thread Raw
In response to Re: [HACKERS] an older problem? hash table out of memory  (Bruce Momjian <maillist@candle.pha.pa.us>)
Responses Re: [HACKERS] an older problem? hash table out of memory
List pgsql-hackers
Bruce Momjian <maillist@candle.pha.pa.us> writes:
>> The "hashtable out of memory" problem is reproducible, however.
>> I'm on it.

> Historically, no one knows much about the hash routines.

Well, I've been learning some unpleasant truths :-(.  Hope to have
some fixes to commit in the next few days.

The immediate cause of one coredump I saw was that someone who was
overenthusiastically replacing sprintf's with snprintf's had written
snprintf(tempname, strlen(tempname), ...);

where tempname points to just-allocated, quite uninitialized
memory.  Exercise for the student: how many different ways can
this go wrong?  Unsettling question: how many other places did
that someone make the same mistake??

I don't have time for this right now, but it'd be a real good idea
to grep the source for strlen near snprintf to see if this same
problem appears anywhere else...
        regards, tom lane


pgsql-hackers by date:

Previous
From: Thomas Lockhart
Date:
Subject: Re: [HACKERS] pg_dump bug (was Re: [SQL] Slow Inserts Again)
Next
From: Thomas Lockhart
Date:
Subject: Re: [HACKERS] numeric data type on 6.5