Re: MSVC2005: problem with valarray<valarray<T> >

Tech-Archive recommends: Speed Up your PC by fixing your registry



Abdelrazak Younes wrote:
Igor Tandetnik wrote:
The program compiles and runs successfully without crashing. Show the complete program that actually produces a crash.

Yes, I did that also and it worked. I guess the problem is elsewhere and that this valarray use is not at cause. It seems that the memory is corrupted somewhere else before because when I insert those two lines before the array2d construction it crashes the same at the delete call:

char * Line_str = new char[10000];
delete Line_str;

Very weird... I guess I have to go step by step through the program to see if there's a problem somewhere... I don't understand though why this problem doesn't show up with VC6...

I know where the problems lies, this simple program crashes for me:

int main(int argc, char * argv[])
{
char * Line_str = new char[10000];
delete[] Line_str;

return 0;

..... the rest of my program ...
}

I have this dialog:

---------------------------
Microsoft Visual C++ Debug Library
---------------------------
Debug Assertion Failed!

Program: d:\PEGASUS\SVN-2005\delivery_debug\gnss_core.exe
File: dbgdel.cpp
Line: 52

Expression: _BLOCK_TYPE_IS_VALID(pHead->nBlockUse)

For information on how your program can cause an assertion
failure, see the Visual C++ documentation on asserts.

(Press Retry to debug the application)
---------------------------
Abort Retry Ignore
---------------------------

And here is the backtrace:

msvcr80d.dll!102527a6()
[Frames below may be incorrect and/or missing, no symbols loaded for msvcr80d.dll]
mfc42.dll!5f403844()
msvcr80d.dll!1026917c()
gnss_core.exe!main(int argc=5, char * * argv=0x00a55f20) Line 25 + 0x15 bytes C++

Could it be that it is because my program is linked to a library that uses mfc42?

Abdel.
.



Relevant Pages

  • Re: CFileException::GetErrorMessage()
    ... I catch CFileException exception as CException inside catchand when ... Microsoft Visual C++ Debug Library ... For information on how your program can cause an assertion ... (Press Retry to debug the application) ...
    (microsoft.public.vc.mfc)
  • Heap memory problems
    ... Those are VC++ 6 debugger error messages: ... Microsoft Visual C++ Debug Library ... For information on how your program can cause an assertion ... (Press Retry to debug the application) ...
    (microsoft.public.vc.mfc)
  • Microsoft Visual C++ Runtime Library Error
    ... For information on how your program can cause an assertion ... failure, see the Visual C++ documentation on asserts ... (Press Retry to debug the application - JIT must be ... Or figure out how to debug the application. ...
    (microsoft.public.windowsxp.general)
  • Re: Displaying a popup dialog from a pretranslatemessage function.
    ... C++ Debug Library". ... Assertion Failed! ... User breakpoint and in wincore.cpp it marks the line ... If it is correct I popup a ...
    (microsoft.public.vc.mfc)
  • How will it new/allocate memory on windows2003 when a class have string-type members?
    ... I declare a class pointer like this: ... windows XP, but It faild on my windows 2003. ... I debug it, and It's assert when the object pointer ccc is released. ... For information on how your program can cause an assertion ...
    (microsoft.public.vc.language)