Software Archive
Read-only legacy content
17060 Discussions

Trying to track Heap error

Intel_C_Intel
Employee
470 Views
All,
I'm fixing an Excel app that uses a CVF .dll. I'm having a bug occur that has several symptoms; I've failed using normal bracketing techniques. When running Excel alone and not through the debugger, I get either an Automation error that results in a disconnect from the clients, or Excel crashes with an Application error upon closing the file.

While debugging, I sometimes get an error prompt stating User Breakpoint called from..., and then opens the disassembly window. The last two lines in the debug window are

Loaded symbols for 'C:WINNTsystem32MSVCRTD.DLL'
HEAP[EXCEL.EXE]: Heap block at 001F7808 modified at 001F7818 past requested size of 8
HEAP[EXCEL.EXE]: Invalid Address specified to RtlFreeHeap( 130000, 1f7810 )

Is there a way to track this and find out where it occurs? Any suggestions are appreciated, if I find this one then the project is finished (until the next bug surfaces).

Thanks in advance,
Dennis Hussey
0 Kudos
1 Reply
Intel_C_Intel
Employee
470 Views
I'll answer my own question for the benefit of future message board users.

It looks like a parameter wasn't initialized in a VBA ReDim statement, and a single element array was passed to the CVF dll.

The array size was 51in Fortran, so when the variable was returned, VB only showed one element, but there were another 50 elements added by Fortran in the background. That array was then ReDimmed again to a new size (I didn't write this mess) and the crash would occur sometimes during the execution of the ReDim statement.
0 Kudos
Reply