0

We have a customer that is calling our calculation engine from a VB6 application. They've shared a bug with us, that in our .Net test harness we've not been able to reproduce.

The exception occurs the second time they make a call to our calculation engine. New object are being created with each call. The arithmetic exception is thrown when in a line of code that uses Math.Sqrt() http://msdn.microsoft.com/en-us/library/system.math.sqrt(v=vs.110).aspx Math.Sqrt() returns a Nan because of a negative number, this seems related. The input values to our function are all Double type.

The exact exception is "Overflow or underflow in the arithmetic operation."

In researching this the closest thing I found was the following SO article... Perhaps something similar going on here? For now we've worked around the issue by using the complex number library to calculate the square root.

C# - cc3260mt.dll throws ArithmeticException whenever I load it

Any ideas?

Community
  • 1
  • 1
GetFuzzy
  • 2,116
  • 3
  • 26
  • 42
  • Can you reproduce it in house with their VB6? – Rob Jul 17 '14 at 15:26
  • Yes, the issue is reproducible when running their code. – GetFuzzy Jul 17 '14 at 15:40
  • Sounds a bit like the issue here: http://support.microsoft.com/kb/326219 – Bob77 Jul 17 '14 at 15:51
  • @Bob77 Kind of like that issue, except Vb6 code is calling managed code. – GetFuzzy Jul 17 '14 at 15:54
  • 1
    It is the same problem you already found. Their code is changing the FPU control word and unmasking exceptions. You of course can't help them do that, they'll have to fix their own code. It is not their VB6 code, some other kind of DLL they have a dependency on. – Hans Passant Jul 17 '14 at 16:34

0 Answers0