Software Archive
Read-only legacy content
17060 Discussions

Wierd VB overflow/divide by zero error from CVF DLL.

Intel_C_Intel
Employee
502 Views
Hi. I'm writing a VB interface into a CVF DLL. Currently, I'm getting an unexplainable overflow error in the VB interface, after control comes back from the DLL. The line that gets flagged is a simple assignment of a real number to a variable declared as single precision. Assignments to integers, variants, boolean, etc., work fine. And there ain't no overflow. In fact, as far as we can tell, there is no error condition at all. We've checked everything on both sides of the interface and it all looks good. If I put an error handler in the VB, the program completes execution properly. Initially, it would give me a divide by zero error but after changing all the intrinsic calls in the DLL to double precision (which they should have been in the first place) it went to being a overflow error. Same line.

Full debug versions run using a Fortran driver in lieu of the VB interface reveal no problems.

Has anybody seen anything like this before? Please help, this has been going on for nearly a month now and it's starting to make me look real, real bad...

-John
0 Kudos
2 Replies
Steven_L_Intel1
Employee
502 Views
My guess would be a mismatch in argument lists between the VB and Fortran code, causing stack corruption. Check every call to make sure that the number and datatypes of arguments are correct, and that any CHARACTER arguments on the Fortran side are specified with the REFERENCE attribute on the argument and the routine, to prevent a hidden length argument from being expected.

Steve
0 Kudos
Intel_C_Intel
Employee
502 Views
Steve, I've checked them every way possible. And the values are correct on either side of the interface. Thing is, it was working fine with the same interface before the FORTRAN guys made some mods. Actually, they made a lot of mods down in the guts of the code and my guess is that there is some kind of data alignment problem on their side. Or an array bounds problem. Something the debugger is missing??? Somewhere, memory is being corrupted, and VB is interpreting it as an error. But where? And how?
0 Kudos
Reply