- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In a program that I am working on, I get the following error:
Debug Assertion Failed!
Program:TAGenPro.exe
File: dbgheap.c
Line: 1044
Expression: _CrtIsValidHeapPointer(pUserData)
It occurs at the line:
DEALLOCATE( NODE%NODE , STAT=STATUS)
where NODE is a linked list. I believe that the NODE being deallocated in the statement was also the target of a previous pointer, and has already been deallocated. However, it seems that if this is the case, then the STAT should catch this anyway.
Am I on the right track? Can anyone suggest anything? (CVF6.6a, Win2k)
Matt.
Debug Assertion Failed!
Program:
File: dbgheap.c
Line: 1044
Expression: _CrtIsValidHeapPointer(pUserData)
It occurs at the line:
DEALLOCATE( NODE%NODE , STAT=STATUS)
where NODE is a linked list. I believe that the NODE being deallocated in the statement was also the target of a previous pointer, and has already been deallocated. However, it seems that if this is the case, then the STAT should catch this anyway.
Am I on the right track? Can anyone suggest anything? (CVF6.6a, Win2k)
Matt.
Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What is happening is that the Debug version of the Visual C++ RTL is detecting that a block of memory is being freed twice, and is issuing the assertion when the Fortran RTL tries to free it. I'm not sure why the Fortran RTL didn't detect the error - you may have corrupted some other data.
If you can send us (to vf-support@compaq.com) a short example that shows the problem, we'll look into it.
Steve
If you can send us (to vf-support@compaq.com) a short example that shows the problem, we'll look into it.
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It seems that, in some way, this should be caught by the STAT identifier instead of causing an execution failure of the RTL.
I am studying how to build a smaller example and/or just avoiding the double-deallocation.
Matt.
I am studying how to build a smaller example and/or just avoiding the double-deallocation.
Matt.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I agree - if it can tell that the pointer has already been deallocated, it should quickly return with an error. However, if the call is made to the C RTL's "free", then if the C RTL signals an assertion, there's not much CVF can do.
Steve
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Well, well ...
I received the same message as well: "Debug Assertion Failed". Please also remember that the program compiled just fine in the Debug mode. It was at the time of testing the program on data that I got this cryptic message.
The program I am using is way over my head and therefore, I did not DARE to change any one of the pointers, allocate/deallocates, ... However, I could
compile and successfully run the program in Release mode.
Now, my question is what happens if the program really needs a debugging for a different reason or part? Wouldn't I get stuck in this nuisance "Assertion Failure" and fail to debug it?
Regards ... Hossein
I received the same message as well: "Debug Assertion Failed". Please also remember that the program compiled just fine in the Debug mode. It was at the time of testing the program on data that I got this cryptic message.
The program I am using is way over my head and therefore, I did not DARE to change any one of the pointers, allocate/deallocates, ... However, I could
compile and successfully run the program in Release mode.
Now, my question is what happens if the program really needs a debugging for a different reason or part? Wouldn't I get stuck in this nuisance "Assertion Failure" and fail to debug it?
Regards ... Hossein

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