Re: Unresolved error 0xC0000409 on Windows Server - Mailing list pgsql-hackers

From Matthew Gerber
Subject Re: Unresolved error 0xC0000409 on Windows Server
Date
Msg-id CAOcpbfrzxaDDWxY0qrssDstYUydCQCSpEKhXi5hQHBRe-jjWtA@mail.gmail.com
Whole thread Raw
In response to Re: Unresolved error 0xC0000409 on Windows Server  (Noah Misch <noah@leadboat.com>)
List pgsql-hackers


On Sun, Nov 11, 2012 at 2:43 PM, Noah Misch <noah@leadboat.com> wrote:
On Sun, Nov 11, 2012 at 10:10:31AM -0500, Matthew Gerber wrote:
> > > Matthew Gerber <gerber.matthew@gmail.com> writes:
> > > >> Here is the command that was executing when the 0xC0000409 exception
> > was
> > > >> raised:
> > > >> INSERT INTO places (bounding_box,country,full_name,id,name,type,url)
> > > >> VALUES
> > > >> (st_transform_null(ST_GeometryFromText('POLYGON((-97.034085
> > > >> 32.771786,-97.034085 32.953966,-96.888789 32.953966,-96.888789
> > > >> 32.771786,-97.034085 32.771786))',4326),26918),'United
> > States','Irving,
> > > >> TX','dce44ec49eb788f5','Irving','city','
> > > >> http://api.twitter.com/1/geo/id/dce44ec49eb788f5.json'),

> A slight update on this:  previously, my insert code involved a long
> "SELECT ... UNION ALL ... SELECT ... UNION ALL ..." command. If this
> command was too long, I would get a stack depth exception thrown back to my
> client application. I reduced the length of the command to eliminate the
> client-side exceptions, but on some occasions I would still get the
> 0xC0000409 crash on the server side. I have eliminated the long "SELECT ...
> UNION ALL ... " command, and I now get no errors on either side. So it
> seems like long commands like this were actually causing the server-side
> crashes. The proper behavior would seem to be throwing the exception back
> to the client application instead of crashing the server.

Above, you quoted an INSERT ... VALUES of two rows.  Have you observed an
exception-0xC0000409 crash with an INSERT ... VALUES query, or only with an
"INSERT ... SELECT ... thousands of UNION" query?

Every time the server crashed with 0xC0000409, the log reported that it was running the simple INSERT command (two rows) that I started this thread with. However, this didn't make any sense to me given the simplicity of the INSERT command and the fact that the error indicated a stack overflow. So I removed the long "SELECT ... UNION ALL ..." command since it seemed more relevant to the error, and the process has been running continuously for a few days now.

To answer your question directly:  I was seeing the server crash when using the simple INSERT and long "SELECT ... UNION ..." (these commands are issued independently at different points in the program). Now my program is only using the simple INSERT, and the crashes are gone.

Hope this helps...

Matt

pgsql-hackers by date:

Previous
From: Jeff Davis
Date:
Subject: Re: Enabling Checksums
Next
From: Pavel Stehule
Date:
Subject: Re: Enabling Checksums