Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TiFR9-00025m-IA for pgsql-bugs@arkaria.postgresql.org; Tue, 11 Dec 2012 02:19:11 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1TiFR8-0004dZ-E3 for pgsql-bugs@arkaria.postgresql.org; Tue, 11 Dec 2012 02:19:10 +0000 Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TiFR7-0004dR-Qi for pgsql-bugs@postgresql.org; Tue, 11 Dec 2012 02:19:09 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TiFR6-0007KA-Jf for pgsql-bugs@postgresql.org; Tue, 11 Dec 2012 02:19:09 +0000 Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.5/8.14.5) with ESMTP id qBB2J7DT002051; Mon, 10 Dec 2012 21:19:07 -0500 (EST) From: Tom Lane To: Jeff Davis cc: pgsql-bugs@postgresql.org Subject: Re: init_htab causes SIGFPE (or worse) due to miscalculation for large nbuckets In-reply-to: <1355191549.15663.10.camel@sussancws0025> References: <1355079715.3896.14.camel@jdavis> <18018.1355093132@sss.pgh.pa.us> <1355185776.13316.4.camel@sussancws0025> <1036.1355189242@sss.pgh.pa.us> <1355191549.15663.10.camel@sussancws0025> Comments: In-reply-to Jeff Davis message dated "Mon, 10 Dec 2012 18:05:49 -0800" Date: Mon, 10 Dec 2012 21:19:07 -0500 Message-ID: <2050.1355192347@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org Jeff Davis writes: > On Mon, 2012-12-10 at 20:27 -0500, Tom Lane wrote: >> That does seem like a good idea. We need one for an int-sized result >> too, to fix the original problem in init_htab. So I propose these >> functions: > Looks good to me. One other corner case in the version of the patch I > was working on was that nbuckets is compared to num_partitions, which is > a long. We can assert that it is less than or equal to INT_MAX in > hash_create. > Aside from that, I'll drop my version of the patch, which doesn't have > any useful differences from yours. I hadn't gone any further than to code and test the functions I listed. If you are working on a complete patch, please press on. regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs