Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#3970 defect closed duplicate (duplicate)

Intermittent python.exe crash with iocpreactor/Vista

Reported by: ivank Owned by:
Priority: high Milestone:
Component: core Keywords: iocp iocpreactor security
Cc: Jean-Paul Calderone, PenguinOfDoom Branch:
Author:

Description

If you run

python C:\Python26\Scripts\trial.py -r iocp -e twisted.test.test_udp.UDPTestCase.testSendPackets

enough times manually (not with trial -u) (I used up, enter, up enter), python.exe crashes. This happens less than 0.5% of the time; it is about 5 times less likely than #3969.

When I hit this bug, Vista's "Python has stopped working" dialog opens, and then then Vista's "DEP has stopped this program" balloon opens.

My uneducated guess is memory corruption in iocpsupport.

I tested with Server 2008 SP1, Python 2.6.2 32 bit, Twisted r27226 (built with VS2008).

Change History (7)

comment:1 Changed 8 years ago by ivank

I'm going to try generating iocpsupport's .c files with the latest Cython.

comment:2 Changed 8 years ago by ivank

Cc: Jean-Paul Calderone PenguinOfDoom added

Building Twisted's stock iocpsupport .c files prints these warnings:

building 'twisted.internet.iocpreactor.iocpsupport' extension
creating build\temp.win32-2.6\Release\twisted\internet
creating build\temp.win32-2.6\Release\twisted\internet\iocpreactor
creating build\temp.win32-2.6\Release\twisted\internet\iocpreactor\iocpsupport
C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -DWIN32=1 -IC:\Python26\include -IC:\Python26\PC /Tctwisted/internet/iocpreactor/iocpsupport/iocpsupport.c /Fobuild\temp.win32-2.6\Release\twisted/internet/iocpreactor/iocpsupport/iocpsupport.obj
iocpsupport.c
twisted/internet/iocpreactor/iocpsupport/iocpsupport.c(305) : warning C4047: '=' : '__pyx_t_11iocpsupport_HANDLE' differs in levels of indirection from 'HANDLE'
twisted/internet/iocpreactor/iocpsupport/iocpsupport.c(342) : warning C4022: 'CreateIoCompletionPort' : pointer mismatch for actual parameter 1
twisted/internet/iocpreactor/iocpsupport/iocpsupport.c(342) : warning C4022: 'CreateIoCompletionPort' : pointer mismatch for actual parameter 2
twisted/internet/iocpreactor/iocpsupport/iocpsupport.c(342) : warning C4047: '=' : '__pyx_t_11iocpsupport_HANDLE' differs in levels of indirection from 'HANDLE'
twisted/internet/iocpreactor/iocpsupport/iocpsupport.c(383) : warning C4133: '=' : incompatible types - from 'PyThreadState *' to 'PyThreadState *'
twisted/internet/iocpreactor/iocpsupport/iocpsupport.c(386) : warning C4022: 'GetQueuedCompletionStatus' : pointer mismatch for actual parameter 1
twisted/internet/iocpreactor/iocpsupport/iocpsupport.c(389) : warning C4133: 'function' : incompatible types - from 'PyThreadState *' to 'PyThreadState *'
twisted/internet/iocpreactor/iocpsupport/iocpsupport.c(505) : warning C4022: 'PostQueuedCompletionStatus' : pointer mismatch for actual parameter 1
twisted/internet/iocpreactor/iocpsupport/iocpsupport.c(532) : warning C4022: 'CloseHandle' : pointer mismatch for actual parameter 1
twisted/internet/iocpreactor/iocpsupport/iocpsupport.c(654) : warning C4244: '=' : conversion from 'long' to 'short', possible loss of data
twisted/internet/iocpreactor/iocpsupport/iocpsupport.c(1089) : warning C4133: '=' : incompatible types - from 'PyObject **' to 'PyObject **'
C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -DWIN32=1 -IC:\Python26\include -IC:\Python26\PC /Tctwisted/internet/iocpreactor/iocpsupport/winsock_pointers.c /Fobuild\temp.win32-2.6\Release\twisted/internet/iocpreactor/iocpsupport/winsock_pointers.obj
winsock_pointers.c

comment:3 Changed 8 years ago by ivank

This crash may be quite hard to reproduce with trial and error. After three crashes, I was unable to get any more (so far).

comment:4 Changed 8 years ago by Glyph

Owner: changed from Glyph to PenguinOfDoom

comment:5 Changed 8 years ago by PenguinOfDoom

Resolution: duplicate
Status: newclosed

comment:6 Changed 8 years ago by PenguinOfDoom

dupe of #4172, probably

comment:7 Changed 7 years ago by <automation>

Owner: PenguinOfDoom deleted
Note: See TracTickets for help on using tickets.