Windows debugging symbols for python 2.5.4 and pywin32 214

Mark Hammond skippy.hammond at
Fri Apr 23 02:36:01 EDT 2010

On 22/04/2010 7:23 AM, Alexandre Fayolle wrote:
> Hi everyone,
> I have a production server running a Windows Service written in Python, which
> uses python 2.5.4 (yes I know it is old, but I am somewhat stuck with this for
> now) and pywin32 214.
> Given a set of manipulations, I get a stack overflow in the service, and a bad
> crash. The same operation when running without
> win32serviceutil.ServiceFramework does not trigger the bug. I'm looking for
> some debugging tools (debug build of the interpreter and the pywin32
> libraries) that some good soul could have kept from a previous debugging
> session to try to get a C stack trace and understand what causes this.

I expect the problem might be that pythonservice.exe isn't linked with a 
large enough stack - python itself builds with a larger than default 
stack.  That difference could cause a recursive function to hard-crash 
before Python itself detected the recursion as being too deep.

You could test this by playing with the sys.setrecursionlimit function - 
at some limit I expect you would find the hard-crash would be replaced 
with a max recursion exception.  Let me know if that is the case and 
I'll be sure to adjust the stack size for the next pywin32 build.

> Any hint towards what could cause that stack overflow would be welcome too.
> The application is multithreaded (and uses pyro and twisted). I can provide
> more information for the curious.

Some parts of twisted are written such that server responses are 
processed recursively, and very large input can cause the recursion 
limit to be hit.  I'm still occasionally bitten by this in the IMAP 
client code...



More information about the Python-list mailing list