Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id 700D610D095D for ; Fri, 17 Feb 2012 18:27:27 -0400 (AST) Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1RyWGz-0001FV-MF for pgsql-bugs@postgresql.org; Fri, 17 Feb 2012 22:27:26 +0000 Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id q1HMR47U005690; Fri, 17 Feb 2012 17:27:05 -0500 (EST) To: zoulx1982@163.com cc: pgsql-bugs@postgresql.org Subject: Re: BUG #6460: routine my_log2 use incorrect data type ? In-reply-to: References: Comments: In-reply-to zoulx1982@163.com message dated "Fri, 17 Feb 2012 05:25:43 +0000" Date: Fri, 17 Feb 2012 17:27:04 -0500 Message-ID: <5689.1329517624@sss.pgh.pa.us> From: Tom Lane X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201202/125 X-Sequence-Number: 32468 zoulx1982@163.com writes: > I startup postgres in win server 2008 64-bit with > shared_buffers=1073741819, but find it doesn't work. Well, that's hardly the fault of my_log2. What you should have gotten is FATAL: requested shared memory size overflows size_t and I do get that when I try that value. Apparently the overflow check in mul_size() is broken in your build. Did you build it yourself, and if so with which compiler and what compilation options? If you didn't build it yourself, where did you get it from? > size_t in win64 is 8 bytes, so add_size and mul_size can't check overflow, Sure they can. Or at least if they can't, it's not because of size_t being 8 bytes. That code works fine on every other 64-bit platform. regards, tom lane