- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have a user using ALLOCATABLE arrays in a FORTRAN DLL. As far as I can tell, he has set up the ALLOCATION correctly, but is having problems with DEALLOCATE at the end of the routine.
The first DEALLOCATE statement brings up the following message:
Debug Error!
Program: C:Program Fileslah blah
DAMAGE: After normal block (#63) at 0x025c2828
(Press Retry To Debug Application)
Abort Retry Ignore
The normal block number and memory address can change.
If I 'Ignore' execution proceeds without further errora but the following message is written to the debug output in devstudio:
memory check error at 0x025C2828 = 0x00 should be 0xfd
I've never had this problem using allocatable arrays before...any ideas anyone?
(Can avoid the error by not explicitly deallocating, but that isn't good form is it?)
The first DEALLOCATE statement brings up the following message:
Debug Error!
Program: C:Program Fileslah blah
DAMAGE: After normal block (#63) at 0x025c2828
(Press Retry To Debug Application)
Abort Retry Ignore
The normal block number and memory address can change.
If I 'Ignore' execution proceeds without further errora but the following message is written to the debug output in devstudio:
memory check error at 0x025C2828 = 0x00 should be 0xfd
I've never had this problem using allocatable arrays before...any ideas anyone?
(Can avoid the error by not explicitly deallocating, but that isn't good form is it?)
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The user is passing the allocatable arrays and their sizes (n) to sub-functions, where the arrays are locally defined to be of size (n). Could this cause any problems?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This alone shouldn't; it all looks like array bounds violation. However, note that CVF cannot detect array out of bounds exceptions for assumed-size arrays. My guess is that the routines write into (most probably) array(0), which does not cause a run-time exception, but rather just silently corrupts the heap -- it gets detected just on DEALLOCATE.
If you convert the arguments to assumed-size (:) CVF will be able to detect array bounds exceeded (however, note that it requires having explicit interfaces to the callees).
Jugoslav
If you convert the arguments to assumed-size (:) CVF will be able to detect array bounds exceeded (however, note that it requires having explicit interfaces to the callees).
Jugoslav
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jugoslav,
It was an array-bounds problem. Well several actually. Once I turned array-bound checking on, everything worked out (i.e. the debugger 'exceptioned' in the right places)!
Cheers,
Dan
It was an array-bounds problem. Well several actually. Once I turned array-bound checking on, everything worked out (i.e. the debugger 'exceptioned' in the right places)!
Cheers,
Dan
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page