From: Greg Smith <greg@2ndQuadrant.com>
To: Richard Broersma <richard.broersma@gmail.com>
Cc: pgsql-testers@postgresql.org
Subject: Re: 9.1Beta1 - Repeatable Crash on Windows
Date: Tue, 10 May 2011 17:41:55 -0400
Message-ID: <4DC9B123.7010309@2ndQuadrant.com> (raw)
In-Reply-To: <BANLkTi=d4SHR_bJ-MDLbV-pU3ZKCAbBz-A@mail.gmail.com>
References: <BANLkTikq8DrkJho-533tHRq3uDc9kjQrNQ@mail.gmail.com>
<4DC85DF3.9030105@agliodbs.com>
<BANLkTi=Z6M2CbFGrrxqyVZZp4q4Ugho6ZQ@mail.gmail.com>
<4DC86132.20604@agliodbs.com>
<4DC87067.4050101@2ndQuadrant.com>
<BANLkTi=JcpNNEZafZFdLYBqMpOFi_kB57w@mail.gmail.com>
<4DC88CFF.9020301@2ndquadrant.com>
<BANLkTi=d4SHR_bJ-MDLbV-pU3ZKCAbBz-A@mail.gmail.com>
On 05/10/2011 01:07 PM, Richard Broersma wrote:
> 0:003> G
> (4ac.158): Access violation - code c0000005 (first chance)
> First chance exceptions are reported before any exception handling.
> This exception may be expected and handled.
> eax=ffffffff ebx=fffffff4 ecx=ffffffff edx=fffffffd esi=00000000 edi=00000000
> eip=0063b890 esp=00d4f614 ebp=00d4f7c0 iopl=0 nv up ei ng nz na pe cy
> cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000 efl=00010287
> postgres!datebsearch+0x30:
> 0063b890 0fbe0c97 movsx ecx,byte ptr [edi+edx*4] ds:0023:fffffff4=??
> 0:000> ~*k
>
> . 0 Id: 4ac.158 Suspend: 1 Teb: 7ffdf000 Unfrozen
> ChildEBP RetAddr
> 00d4f620 0063d738 postgres!datebsearch+0x30
> [c:\pginstaller-repo\postgres.windows\src\backend\utils\adt\datetime.c
> @ 3579]
>
That's interesting...it's going crazy here:
3565 /* datebsearch()
3566 * Binary search -- from Knuth (6.2.1) Algorithm B. Special
case like this
3567 * is WAY faster than the generic bsearch().
3568 */
3569 static const datetkn *
3570 datebsearch(const char *key, const datetkn *base, int nel)
3571 {
3572 const datetkn *last = base + nel - 1,
3573 *position;
3574 int result;
3575
3576 while (last >= base)
3577 {
3578 position = base + ((last - base) >> 1);
3579 result = key[0] - position->token[0];
So something about that is getting really confused when searching back
to negative infinity, but seemingly only on Windows.
Thanks for the great detective work help, I'll bounce this over to
pgsql-hackers where more people will see it.
--
Greg Smith 2ndQuadrant US greg@2ndQuadrant.com Baltimore, MD
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-testers@postgresql.org
Cc: greg@2ndQuadrant.com, richard.broersma@gmail.com
Subject: Re: 9.1Beta1 - Repeatable Crash on Windows
In-Reply-To: <4DC9B123.7010309@2ndQuadrant.com>
References: <BANLkTikq8DrkJho-533tHRq3uDc9kjQrNQ@mail.gmail.com> <4DC85DF3.9030105@agliodbs.com> <BANLkTi=Z6M2CbFGrrxqyVZZp4q4Ugho6ZQ@mail.gmail.com> <4DC86132.20604@agliodbs.com> <4DC87067.4050101@2ndQuadrant.com> <BANLkTi=JcpNNEZafZFdLYBqMpOFi_kB57w@mail.gmail.com> <4DC88CFF.9020301@2ndquadrant.com> <BANLkTi=d4SHR_bJ-MDLbV-pU3ZKCAbBz-A@mail.gmail.com> <4DC9B123.7010309@2ndQuadrant.com>
* 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