Discussion:
Disabling "Debug unmanaged code" rises Interop-C++ Runtime error
(too old to reply)
Ramesh
2009-10-11 08:38:01 UTC
Permalink
I have a C# process calling COM dll. This COM dll in turn calls a 3rd party
File analysing C library. When the memory used by C-library goes higher,
close to 1GB, C# process crashes in a peculiar way. I say peculiar because
crash happens if I have not enable "Debug->Enable Unmanaged Debugging".

This is bizzarre but true, happend on more than one machine. When I enable
'Enable Unmanaged Debugging.' things work fine. Also C++ clients does not
have fail in any case. This indicates to me that 3rd party C-library is not
causing it.

Any idea this is happening. I guessed it to be time-out issue but it is not.
Error I see is
"Runtime Error!
Program:

Since this is a big file, 3rd party library would have taken close to a
minute to process. In case of crash it comes back immidiately, as soon as I
press F10.

Thanks in adavce for your help.
Ramesh
Ben Voigt [C++ MVP]
2009-10-20 21:58:26 UTC
Permalink
Post by Ramesh
I have a C# process calling COM dll. This COM dll in turn calls a 3rd party
File analysing C library. When the memory used by C-library goes higher,
close to 1GB, C# process crashes in a peculiar way. I say peculiar because
crash happens if I have not enable "Debug->Enable Unmanaged Debugging".
This is bizzarre but true, happend on more than one machine. When I enable
'Enable Unmanaged Debugging.' things work fine. Also C++ clients does not
have fail in any case. This indicates to me that 3rd party C-library is not
causing it.
Sounds like heap corruption in the third-party C code. Heap functions act
different when a debugger is attached.

Set the environment variable
_NO_DEBUG_HEAP=1

before starting Visual Studio. Then you should get the same behavior with
debugging on, so you can debug it.
Post by Ramesh
Any idea this is happening. I guessed it to be time-out issue but it is not.
Error I see is
"Runtime Error!
Since this is a big file, 3rd party library would have taken close to a
minute to process. In case of crash it comes back immidiately, as soon as I
press F10.
Thanks in adavce for your help.
Ramesh
Loading...