COM Interop problem

P

Pete Davis

It's unlikely that this is really a stack size issue. Generally stack faults
happen because of unending recursion or other bugs that cause the stack to
overflow. Increasing the stack size will generally only buy you some more
time.

There are some quirks in Interop that may be causing your problem as well.

I don't know how you can change the stack size from C# and I'm not even sure
it's possible. If you have the source to the control, I'd try to find the
real source of the problem.

Pete
 
N

Nadav

Hi,

I am using a COM object with my C# application, once in a while I get a
Stack overflow exception generated by the COM Object, I wonder... I want to
try to increase the size of the stack, how can this be done with a C# Win32
Forms application? I didn't find anything in the C# project settings... What
is the default stack size used by C# applications???

Nadav.
 
U

Uri Dor

I guess it's likely that no stack size will help you - I'm guessing it
increases indefinitely. What does the stack look like when it crashes?
 
B

Branimir Giurov

Hi,

You're probably facing a bug -
this happens if you make too many recursive calls to the same method - Is
there a possibility to be facing a bug inside that particular COM object or
your code?

Cheers,
Branimir
 
N

Nadav

Well,

Thanks for your immediate response, The overflow is generated from within a
3rd party API ( that is being called only once ), following is the stack
trace although I am sceptic if it will help, it seem there is a certain
recursion but it doesn't seem to be endless...
NTDLL.DLL!RtlDosPathNameToNtPathName_U() + 0x25
KERNEL32.DLL!CreateFileW() + 0xe0
KERNEL32.DLL!CreateFileA() + 0x2e
FPLibrary.dll!fp_open() + 0xad
FPLibrary.dll!69be6a0a()
NTDLL.DLL!RtlpNtEnumerateSubKey() + 0x5c6a
NTDLL.DLL!RtlAllocateHeap() + 0xb2
18c13460()
FPLibrary.dll!_ZN15ACE_Errno_GuardaSEi() + 0x5711
FPLibrary.dll!Neo_DeleteCommand() + 0x11046
FPLibrary.dll!Neo_DeleteCommand() + 0x103cd
FPLibrary.dll!Neo_DeleteCommand() + 0x104fb
FPLibrary.dll!Neo_DeleteCommand() + 0x1071d
FPLibrary.dll!FPStream_GetMarker() + 0xc4f
FPLibrary.dll!69be6a63()
NTDLL.DLL!RtlpNtEnumerateSubKey() + 0x5c6a
NTDLL.DLL!RtlAllocateHeap() + 0xb2
18c137e0()
FPLibrary.dll!_ZN15ACE_Errno_GuardaSEi() + 0x5711
FPLibrary.dll!Neo_DeleteCommand() + 0x11046
FPLibrary.dll!Neo_DeleteCommand() + 0x103cd
FPLibrary.dll!Neo_DeleteCommand() + 0x104fb
FPLibrary.dll!Neo_DeleteCommand() + 0x1071d
FPLibrary.dll!FPStream_GetMarker() + 0xc4f
FPLibrary.dll!69be6a63()
NTDLL.DLL!RtlpNtEnumerateSubKey() + 0x5c6a
NTDLL.DLL!RtlAllocateHeap() + 0xb2
18c13b60()
FPLibrary.dll!_ZN15ACE_Errno_GuardaSEi() + 0x5711
FPLibrary.dll!Neo_DeleteCommand() + 0x11046
FPLibrary.dll!Neo_DeleteCommand() + 0x103cd
FPLibrary.dll!Neo_DeleteCommand() + 0x104fb
FPLibrary.dll!Neo_DeleteCommand() + 0x1071d
FPLibrary.dll!FPStream_GetMarker() + 0xc4f
FPLibrary.dll!69be6a63()
NTDLL.DLL!RtlFreeHeap() + 0x27c
NTDLL.DLL!RtlpNtEnumerateSubKey() + 0x5c6a

Nadav.
 
U

Uri Dor

- I don't see a process entry point (something like main or a winmessage
handler), so I guess the stack is endless, but you only got to see part
- since it looks like the runtime library is calling
FPLibrary.dll!69be6a0a(), I'd guess that is some kind of exception
handler which is going wild.

my only 3 tips could be:
1) use filemon (sysinternals.com) to see which files are accessed
2) contact the 3rd party
3) pray

not much, but that's what comes to mind.
 
S

Santhosh Pillai [MS]

Please share the unmanaged method signature and the C# code that access the
method. We may be able to figure out if there are some obvious issues.
 
W

Willy Denoyette [MVP]

I suggest you to try to create an instance from a native client (VB6 or even
Vbscript should do) and see whether this problem is related to the COM
object or your own .NET code, I guess you have a bug in your code, my best
guess is that you have consumed a large part of the stack prior to calling
into COM.

Willy.
 
R

Ravichandran J.V.

The most likely cause is that the component has a recursive call that
goes on and on or your .net code has trespassed some internal call
without having first overridden the original method.

with regards,


J.V.Ravichandran
- http://www.geocities.com/
jvravichandran
- http://www.411asp.net/func/search?
qry=Ravichandran+J.V.&cob=aspnetpro
- http://www.southasianoutlook.com
- http://www.MSDNAA.Net
- http://www.csharphelp.com
- http://www.poetry.com/Publications/
display.asp?ID=P3966388&BN=999&PN=2
- Or, just search on "J.V.Ravichandran"
at http://www.Google.com
 

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

Top