Re: [HACKERS] an older problem? hash table out of memory

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] an older problem? hash table out of memory
Date: 1999-05-04 14:04:10
Message-ID: 29625.925826650@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)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

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Lockhart 1999-05-04 14:19:45 Re: [HACKERS] numeric data type on 6.5
Previous Message Thomas Lockhart 1999-05-04 13:54:33 Re: [HACKERS] pg_dump bug (was Re: [SQL] Slow Inserts Again)