none
Floating-point overflow in mscorjit.dll when calling CreateInstanceAndWrap

    Question

  • The call stack is below:

      mscorjit.dll!Compiler::FlatFPIsSameAsFloat()  + 0xa bytes 
      mscorjit.dll!Compiler::genCodeForTreeFlatFP_Asg()  + 0x24e7e bytes 
      mscorjit.dll!Compiler::genCodeForTreeFlatFP_SmpOp()  - 0x2 bytes 
      mscorjit.dll!Compiler::genCodeForTreeFlatFP()  + 0x2b bytes 
      mscorjit.dll!Compiler::genCodeForTreeFlt()  + 0x12 bytes 
      mscorjit.dll!Compiler::genCodeForTree()  + 0x226eb bytes 
      mscorjit.dll!Compiler::genCodeForBBlist()  + 0x34a bytes 
      mscorjit.dll!Compiler::genGenerateCode()  + 0x69 bytes 
      mscorjit.dll!Compiler::compCompile()  + 0x13e bytes 
      mscorjit.dll!Compiler::compCompile()  + 0x257 bytes 
      mscorjit.dll!jitNativeCode()  + 0x9a bytes 
      mscorjit.dll!CILJit::compileMethod()  + 0x3d bytes 
      mscorlib.dll!System.RuntimeType.CreateInstanceSlow(bool publicOnly, bool fillCache = true) + 0x68 bytes 
      mscorlib.dll!System.Activator.CreateInstance(System.Type type, bool nonPublic) + 0x43 bytes 
      mscorlib.dll!System.RuntimeType.CreateInstanceImpl(System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, object[] args = {Dimensions:[0]}, System.Globalization.CultureInfo culture, object[] activationAttributes = null) + 0x1c9 bytes 
      mscorlib.dll!System.Activator.CreateInstance(System.Type type, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, object[] args, System.Globalization.CultureInfo culture, object[] activationAttributes) + 0x73 bytes 
      mscorlib.dll!System.Activator.CreateInstance(string assemblyName, string typeName, bool ignoreCase, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, object[] args, System.Globalization.CultureInfo culture, object[] activationAttributes, System.Security.Policy.Evidence securityInfo, ref System.Threading.StackCrawlMark stackMark) + 0x58 bytes 
      mscorlib.dll!System.Activator.CreateInstance(string assemblyName, string typeName, bool ignoreCase, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, object[] args, System.Globalization.CultureInfo culture, object[] activationAttributes, System.Security.Policy.Evidence securityInfo) + 0x30 bytes 
      mscorlib.dll!System.AppDomain.CreateInstance(string assemblyName, string typeName, bool ignoreCase, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, object[] args, System.Globalization.CultureInfo culture, object[] activationAttributes, System.Security.Policy.Evidence securityAttributes) + 0x39 bytes 
      mscorlib.dll!System.AppDomain.CreateInstanceAndUnwrap(string assemblyName, string typeName, bool ignoreCase, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, object[] args, System.Globalization.CultureInfo culture, object[] activationAttributes, System.Security.Policy.Evidence securityAttributes) + 0x22 bytes 
    > CreateInstance(System::String^ assemblyName = "DiverseDataRoundTripsServerClass, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null", System::String^ className = "PassTechnologies.DiverseDataRoundTripsServerClass", array<int> ^ args = {Length=0}, int numInArgs = 0) Line 356 + 0x23 bytes C++

    The exception says: First-chance exception at 0x7908bece (mscorjit.dll) in vmm.exe: 0xC0000091: Floating-point overflow.

    If continue to run the programm. it will end because of stack overflow

    I searched the internet for information about this, but found nothing. Did anyone meet this error before?

    Wednesday, September 27, 2006 7:58 AM

Answers

  • is this a C++ application (vmm.exe)? Was it compiled in anything other than VC++ 2005?

    Microsoft Compilers by default mask out this exception. The JIT/CLR code fiddles around with the control word for FPU which may cause this exception to be raised in applications where this is left unmasked. (e.g. Borland Compilers). To prevent this add _control87(MCW_EM, MCW_EM); to the beginning of the program.

    • Marked as answer by Luo Cao Friday, November 14, 2008 2:00 AM
    Wednesday, September 27, 2006 9:22 PM

All replies

  • is this a C++ application (vmm.exe)? Was it compiled in anything other than VC++ 2005?

    Microsoft Compilers by default mask out this exception. The JIT/CLR code fiddles around with the control word for FPU which may cause this exception to be raised in applications where this is left unmasked. (e.g. Borland Compilers). To prevent this add _control87(MCW_EM, MCW_EM); to the beginning of the program.

    • Marked as answer by Luo Cao Friday, November 14, 2008 2:00 AM
    Wednesday, September 27, 2006 9:22 PM
  • Thanks for your reply. But the application is compiled by vs2005

    The application is a mixed application(C,C++, C++/CLI, C#). . The class which will be created by "CreateInstanceAndWrap" is in an assembly written in visual basic.

    The most strange thing is: if there is an exception occured before calling "CreateInstanceAndWrap", it will be ok

    Thursday, September 28, 2006 12:24 PM
  • I have seen this problem mostly when the JIT tries to compile a managed application in an unmanaged process (usually due to a inprocess COM call where the COM component is a .NET com component and the calling application is a unmanged process written in Borland).

    The symptoms look the same for you, as the JIT will try to compile your managed VB assembly on the CreateInstanceAndWrap. I still suspect that this is because the JIT/CLR will fiddle with the Floating point Unit. Try the _control87 or _controlfp instructions to mask rasing floating point exceptions. This has worked for me in the past. However note that you are turning off all floating point exceptions!

    Hope this helps.

    Thursday, September 28, 2006 1:49 PM