Python 2.2 (ActiveState, build 224) and access violations/Dr Watson(long)

  • Thread starter =?iso-8859-1?q?Lars_Bj=F8nnes?=
  • Start date
?

=?iso-8859-1?q?Lars_Bj=F8nnes?=

Hi,

I've got an application written in Python that has been very stable,
but last monday, it started crashing. The application is
written as an Windows NT Service, using COM-objects and threads.

I've googled a lot lately trying to find any remotely similar
situations, but I've so far been unsuccessful.

The application processes incoming requests (HTTP POST) in separate
threads using mixin threads and BaseHTTPRequestHander/BaseHTTPServer,
parses the data (XML), instantiates a COM object and does a number of
operations on this object.

I'm (fairly) sure that pythoncom.CoInitialize() is called on the
thread before instantiaton of the COM object, and after I've used the
COM object, I set the COM object to None and call
pythoncom.CoInitialize() on the same thread.

Now, it seems to crash on the odd incoming requests, usually after
running for 24 - 36 hours.

Log and system data:

Application exception occurred:
App: (pid=1800)
When: 10/15/2003 @ 23:04:58.666
Exception number: c0000005 (access violation)

*----> System Information <----*
Computer Name: XXX
User Name: SYSTEM
Number of Processors: 4
Processor Type: x86 Family 15 Model 2 Stepping 9
Windows 2000 Version: 5.0
Current Build: 2195
Service Pack: 4
Current Type: Multiprocessor Free
Registered Organization: XXX
Registered Owner: XXX


In the stack traces from Dr Watson, I see the function
RtlConsoleMultiByteToUnicodeN or RtlAllocateHeap listed as the
culprits, either listed as the function where it occured or somewhere
near the "FAULT ->"

State Dump for Thread Id 0x52c

eax=93b0da48 ebx=00130178 ecx=051405fc edx=0000037f esi=05140000 edi=00000173
eip=77f895a9 esp=07a0eda0 ebp=07a0edac iopl=0 nv up ei ng nz na po nc
cs=001b ss=0023 ds=0023 es=0023 fs=0038 gs=0000 efl=00000286


function: RtlConsoleMultiByteToUnicodeN
77f8958f 8b4e2c mov ecx,[esi+0x2c] ds:05959ee6=????????
77f89592 3914b9 cmp [ecx+edi*4],edx ds:00000173=????????
77f89595 8d0cb9 lea ecx,[ecx+edi*4] ds:00000173=????????
77f89598 7534 jnz RtlReAllocateHeap+0xa9 (77f920ce)
77f8959a 8b16 mov edx,[esi] ds:05140000=00000380
77f8959c 4a dec edx
77f8959d 3bfa cmp edi,edx
77f8959f 0f83744a0000 jnb ZwTerminateThread+0x57 (77f8e019)
77f895a5 85c0 test eax,eax
77f895a7 740c jz ZwFlushVirtualMemory+0x9c (77f8a4b5)
FAULT ->77f895a9 0fb710 movzx edx,word ptr [eax] ds:93b0da48=????
77f895ac 3b5508 cmp edx,[ebp+0x8] ss:08228c92=????????
77f895af 0f846c4a0000 je ZwTerminateThread+0x5f (77f8e021)
77f895b5 832100 and dword ptr [ecx],0x0 ds:051405fc=00180390
77f895b8 8bcf mov ecx,edi
77f895ba 6a01 push 0x1
77f895bc 83e107 and ecx,0x7
77f895bf 5a pop edx
77f895c0 8bc7 mov eax,edi
77f895c2 d3e2 shl edx,cl
77f895c4 8b4e28 mov ecx,[esi+0x28] ds:05959ee6=????????
77f895c7 c1e803 shr eax,0x3

*----> Stack Back Trace <----*

FramePtr ReturnAd Param#1 Param#2 Param#3 Param#4 Function Name
07A0EDAC 77FCD04A 000001F3 00180390 001445A0 00000F40 ntdll!RtlConsoleMultiByteToUnicodeN
07A0EF54 77A530D7 00130000 00000000 00000F40 77A0FEB1 ntdll!RtlFreeHeap
7C4F5D42 000018A1 084D8B00 0F40F983 00CECD83 34608300 ole32!IsValidIid


And similar (I think):

State Dump for Thread Id 0x6a8

eax=20f89af8 ebx=000001fc ecx=000001ee edx=00130608 esi=20f89af0 edi=00130000
eip=77fcc641 esp=0531fbac ebp=0531fd44 iopl=0 nv up ei ng nz na pe cy
cs=001b ss=0023 ds=0023 es=0023 fs=0038 gs=0000 efl=00000283


function: RtlAllocateHeap
77fcc61f 0fb700 movzx eax,word ptr [eax] ds:20f89af8=????
77fcc622 3bc3 cmp eax,ebx
77fcc624 0f82daf3ffff jb RtlSizeHeap+0xfe (77fcba04)
77fcc62a 8b45d4 mov eax,[ebp+0xd4] ss:05b39c2a=????????
77fcc62d 8b00 mov eax,[eax] ds:20f89af8=????????
77fcc62f 8945ac mov [ebp+0xac],eax ss:05b39c2a=????????
77fcc632 3945d4 cmp [ebp+0xd4],eax ss:05b39c2a=????????
77fcc635 0f84c9f3ffff je RtlSizeHeap+0xfe (77fcba04)
77fcc63b 8d70f8 lea esi,[eax+0xf8] ds:217a39de=????????
77fcc63e 8975b0 mov [ebp+0xb0],esi ss:05b39c2a=????????
FAULT ->77fcc641 0fb70e movzx ecx,word ptr [esi] ds:20f89af0=????
77fcc644 3bcb cmp ecx,ebx
77fcc646 72e5 jb 77fd1d2d
77fcc648 56 push esi
77fcc649 ff75a4 push dword ptr [ebp+0xa4] ss:05b39c2a=????????
77fcc64c e8e9cefbff call RtlConsoleMultiByteToUnicodeN+0x348 (77f8953a)
77fcc651 8b4608 mov eax,[esi+0x8] ds:217a39d6=????????
77fcc654 898594feffff mov [ebp+0xfffffe94],eax ss:0531fbd8=00161f88
77fcc65a 8b4e0c mov ecx,[esi+0xc] ds:217a39d6=????????
77fcc65d 898d90feffff mov [ebp+0xfffffe90],ecx ss:0531fbd4=00156bf0
77fcc663 8901 mov [ecx],eax ds:000001ee=????????
77fcc665 894804 mov [eax+0x4],ecx ds:217a39de=????????

*----> Stack Back Trace <----*

FramePtr ReturnAd Param#1 Param#2 Param#3 Param#4 Function Name
0531FD44 77D34AEE 00130000 00000000 00000FD4 77D38A42 ntdll!RtlAllocateHeap
0531FDCC 77D421F8 00141160 0531FDF0 00000338 00000001 rpcrt4!UuidFromStringA
0531FE1C 77D421AE 00141160 00150E90 00138640 00000000 rpcrt4!I_RpcReceive
0531FF74 77D3D9DB 77D3DDED 00138640 00000000 00000000 rpcrt4!I_RpcReceive
0531FFA8 77D3DD0B 00136B90 0531FFEC 7C4E987C 00149B28 rpcrt4!RpcBindingSetOption
0531FFB4 7C4E987C 00149B28 00000000 00000000 00149B28 rpcrt4!RpcBindingSetOption


I'd be grateful for any help regarding this. I've added an extreme
amount of logging to the application, so I hope I'll be able to
produce more information next time the service crashes.
 
?

=?iso-8859-1?q?Lars_Bj=F8nnes?=

I'm (fairly) sure that pythoncom.CoInitialize() is called on the
thread before instantiaton of the COM object, and after I've used the
COM object, I set the COM object to None and call
pythoncom.CoInitialize() on the same thread.

I meant pythoncom.CoUnitialize()
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,226
Members
46,815
Latest member
treekmostly22

Latest Threads

Top