From: zoulx1982@163.com
To: pgsql-bugs@postgresql.org
Subject: BUG #6460: routine my_log2 use incorrect data type ?
Date: Fri, 17 Feb 2012 05:25:43 +0000
Message-ID: <E1RyGKF-0007i4-6P@wrigleys.postgresql.org> (raw)
The following bug has been logged on the website:
Bug reference: 6460
Logged by: lxzou
Email address: zoulx1982@163.com
PostgreSQL version: 9.1.2
Operating system: Windows Server 2008 64 bit
Description:
Hi,
I startup postgres in win server 2008 64-bit with
shared_buffers=1073741819, but find it doesn't work.
I debug the postgres use vs2008, and find it enter an Infinite loop in
my_log2.
when the parameter num is between (2^30) + 1 and (2^31) -1, it will be an
Infinite loop.
because long in win 64 is 4 bytes, so (2^30) << 1 is 2^31, i.e. -2^31.
move left again it will be zero.
size_t in win64 is 8 bytes,so add_size and mul_size can't check overflow,
but in win32 it can do that.
So, whether we should use Size instead of long ?
Best wishes
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: zoulx1982@163.com
Subject: Re: BUG #6460: routine my_log2 use incorrect data type ?
In-Reply-To: <E1RyGKF-0007i4-6P@wrigleys.postgresql.org>
References: <E1RyGKF-0007i4-6P@wrigleys.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox