Welcome to MSDN Blogs Sign in | Join | Help

July 2007 - Posts

Lock(object) and ThreadAbortException

We have experience some weird deadlock using managed code. We have a class with some shared resources. To protect the shared resources, we create a synchronization object, and use Lock(object) prior to access the shared resources. There is no nested lock
Posted by junfeng | 2 Comments
Filed under:

Don't catch all exceptions

One of the best practices on exception is don't catch all exceptions. There are many reasons why this is a best practice. For example, You want to look at the application state when the exception is thrown so that you can understand exactly why the exception
Posted by junfeng | 3 Comments
Filed under:

Finding Memory leaks

MSDN and Microsoft support web site have some great information on how to find memory leaks, both for managed application and native applications. Unmanaged: How to use Umdh.exe to find memory leaks http://support.microsoft.com/kb/268343 Managed: Debugging
Posted by junfeng | 1 Comments
Filed under:

Questions and Suggestions -- July 20th Edition

This is the re-occuring post for questions and suggestions. I will not be able to provide any support beyond the trivial Q&A. For guaranteed quality of support, please contact Microsoft Product Support Service.
Posted by junfeng | 5 Comments
Filed under:

64 bit gacutil.exe

32 bit gacutil.exe can install/uninstall/enumerate 64 bit assemblies for GAC, so there is really no need for 64 bit gacutil.exe.
Posted by junfeng | 1 Comments
Filed under: ,

Unknown exception 0xe0434f4e

If you attach windows debugger to a .Net framework application, occasionally you may see debug spew of unknown exception 0xe0434f4e. (cfc.1244): Unknown exception - code e0434f4e (first chance) 0xe0434f4e is defined as EXCEPTION_HIJACK. (Copied from Rotor
Posted by junfeng | 1 Comments
Filed under: ,

BadImageFormatException maybe thrown when loading a valid assembly

We saw some cases when loading a perfect valid assembly, CLR may throw BadImageFormatException occasionally. In one particular case, we discover that it is caused by anti-virus scanners. Turn off the "Protection Against Unknown Threats" feature in the
Posted by junfeng | 0 Comments
Filed under: ,

Reverse P/Invoke Marshaling Performance

Platform Invoke allows managed code to call unmanaged functions exported by an DLL. While the reverse P/Invoke allows managed code to pass a managed delegate as a callback to native code. Both P/Invoke and Reverse P/Invoke requires parameter marshaling
Posted by junfeng | 2 Comments
Filed under:

Break on exception in Windows Debugger

In Windows Debugger, we can break on C++ exception by doing " sxe eh ". We can also break on CLR exception by doing " sxe clr ". But sometimes you may see the following debug spew: (94c.960): C++ EH exception - code e06d7363 (first chance) (94c.960):
Posted by junfeng | 0 Comments
Filed under:
 
Page view tracker