| | |
Debug Assertion Failed! Error - how do I fix this?
Thread Solved
![]() |
•
•
Join Date: Dec 2008
Posts: 20
Reputation:
Solved Threads: 0
*When I compile the program it works. However, when I try to run the program, it outputs the first message then gives me the following error-*
CSCI112LAB2.exe has encountered a problem and needs to close. We are sorry for the inconvenience.
*And when I tried to debug it*
Unhandled exception at 0x7855b690 in CSCI112LAB2.exe: 0xC0000005: Access violation reading location 0x00000000.
There is no source code available for the current location.
*And this appears in the output box*
'CSCI112LAB2.exe': Loaded 'C:\Documents and Settings\Tina\My Documents\Visual Studio 2008\Projects\CSCI112LAB2\Release\CSCI112LAB2.exe', Symbols loaded.
'CSCI112LAB2.exe': Loaded 'C:\WINDOWS\system32\ntdll.dll'
'CSCI112LAB2.exe': Loaded 'C:\WINDOWS\system32\kernel32.dll'
'CSCI112LAB2.exe': Loaded 'C:\WINDOWS\WinSxS\x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.21022.8_x-ww_d08d0375\msvcp90.dll'
'CSCI112LAB2.exe': Loaded 'C:\WINDOWS\WinSxS\x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.21022.8_x-ww_d08d0375\msvcr90.dll'
First-chance exception at 0x7855b690 in CSCI112LAB2.exe: 0xC0000005: Access violation reading location 0x00000000.
Unhandled exception at 0x7855b690 in CSCI112LAB2.exe: 0xC0000005: Access violation reading location 0x00000000.
The program '[5520] CSCI112LAB2.exe: Native' has exited with code 0 (0x0).
*So…I have no idea how to fix this. I played around with it for a while and still can’t get it to work. I don’t understand what I can do to fix an error when it says that there is no source code at the location to fix.*
*New error message! – I just got this one this morning when I tried to run the debug. I have no idea what it means, except for the invalid null pointer part, but I don’t think I was using any pointers that I myself deliberately put there.*
Debug Assertion Failed!
Program: …Visual Studio 2008\Projects\CSCI112LAB2\Debug\CSCI112LAB2.exe
File: f:\dd\vctools\crt_bld\self_x86\crt\src\xstring
Line: 1094
Expression: invalid null pointer
For information on how your program can cause an assertion failure, see the Visual C++ documentation on asserts.
(Press Retry to debug the application)
*What do I do to fix this?*
CSCI112LAB2.exe has encountered a problem and needs to close. We are sorry for the inconvenience.
*And when I tried to debug it*
Unhandled exception at 0x7855b690 in CSCI112LAB2.exe: 0xC0000005: Access violation reading location 0x00000000.
There is no source code available for the current location.
*And this appears in the output box*
'CSCI112LAB2.exe': Loaded 'C:\Documents and Settings\Tina\My Documents\Visual Studio 2008\Projects\CSCI112LAB2\Release\CSCI112LAB2.exe', Symbols loaded.
'CSCI112LAB2.exe': Loaded 'C:\WINDOWS\system32\ntdll.dll'
'CSCI112LAB2.exe': Loaded 'C:\WINDOWS\system32\kernel32.dll'
'CSCI112LAB2.exe': Loaded 'C:\WINDOWS\WinSxS\x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.21022.8_x-ww_d08d0375\msvcp90.dll'
'CSCI112LAB2.exe': Loaded 'C:\WINDOWS\WinSxS\x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.21022.8_x-ww_d08d0375\msvcr90.dll'
First-chance exception at 0x7855b690 in CSCI112LAB2.exe: 0xC0000005: Access violation reading location 0x00000000.
Unhandled exception at 0x7855b690 in CSCI112LAB2.exe: 0xC0000005: Access violation reading location 0x00000000.
The program '[5520] CSCI112LAB2.exe: Native' has exited with code 0 (0x0).
*So…I have no idea how to fix this. I played around with it for a while and still can’t get it to work. I don’t understand what I can do to fix an error when it says that there is no source code at the location to fix.*
*New error message! – I just got this one this morning when I tried to run the debug. I have no idea what it means, except for the invalid null pointer part, but I don’t think I was using any pointers that I myself deliberately put there.*
Debug Assertion Failed!
Program: …Visual Studio 2008\Projects\CSCI112LAB2\Debug\CSCI112LAB2.exe
File: f:\dd\vctools\crt_bld\self_x86\crt\src\xstring
Line: 1094
Expression: invalid null pointer
For information on how your program can cause an assertion failure, see the Visual C++ documentation on asserts.
(Press Retry to debug the application)
*What do I do to fix this?*
> (Press Retry to debug the application)
Do this.
When the debugger starts, do something like
view->stack
That will tell you how the code got to that point.
Somewhere through the various stack levels will be your code. Click on the first one you recognise. It should open your source code. Examine really carefully all the parameters which are being passed. Chances are, one of them is NULL, and it shouldn't be.
Do this.
When the debugger starts, do something like
view->stack
That will tell you how the code got to that point.
Somewhere through the various stack levels will be your code. Click on the first one you recognise. It should open your source code. Examine really carefully all the parameters which are being passed. Chances are, one of them is NULL, and it shouldn't be.
•
•
Join Date: Dec 2008
Posts: 20
Reputation:
Solved Threads: 0
It happens the instant the program begins to run. The program outputs the first cout line and then the error occurs before the next line. The lines involved are:
C++ Syntax (Toggle Plain Text)
cout<<"This program seaches Employee data to output a name and salary."<<endl; bool lnfound = false; //last not found boolean char response; //holds user choice for continue search string first; //holds first name user input string last; //holds last name user input string salary = 0; //holds salary cout<<"Beginning File check."<<endl;
•
•
Join Date: Dec 2008
Posts: 20
Reputation:
Solved Threads: 0
Thanks for taking the time to reply!
Perhaps I should have mentioned this in the original post, but when I press Retry is goes back to the first error listed and shuts down...
Wait a minute... I think I see what I did...wow, stupid error.
I wrote string salary = 0 but that's impossible. wow. I can't believe I didn't see that.
Sorry to bother you!
Perhaps I should have mentioned this in the original post, but when I press Retry is goes back to the first error listed and shuts down...
Wait a minute... I think I see what I did...wow, stupid error.

I wrote string salary = 0 but that's impossible. wow. I can't believe I didn't see that.
Sorry to bother you!
![]() |
Other Threads in the C++ Forum
- Previous Thread: Help Need for Resolving a C++ error C2664
- Next Thread: Help (link lists referent)
| Thread Tools | Search this Thread |
api array based binary bitmap c++ c/c++ cdialogbar char class classes code coding compile console conversion convert count delete deploy desktop developer directshow dissertations dll double-linkedlist download dynamic dynamiccharacterarray email encryption error file forms fstream function functions game givemetehcodez graph gui homeworkhelp homeworkhelper iamthwee ifstream input int integer java lib linkedlist linker loan loop looping loops map math matrix memory multiple news node number online output pagerank pointer problem program programming project python random read recursion recursive reference risk rpg string strings superclass temperature template test text text-file tree tutorial url validator variable vector video win32 windows winsock wordfrequency wxwidgets






