G
Guest
I have created an C++ application with Windows Forms, ADO and SQL server
2005. Now I need to change something and started debugging the code. Then
suddenly I receive an error.
"An unhandled exception of type 'System.AccessViolationException' occurred
in mscorlib.dll
Additional information: Attempted to read or write protected memory. This is
often an indication that other memory is corrupt."
The progran ends on a windows form designer generated line:
this->pictureBox1->Image = (cli::safe_cast<System:rawing::Image^
I ran a memory test and there is nothing wrong with the memory of the
computer. I even changed the memory chips with the same results. I also
defragmented the disks thinking of some help for possible swap area problems.
This didn't help.
The code compiles without errors and the funny thing is that when I ran the
compiled exe-file, it works without errors, only I can't debug the code.
The debugger produces a log as follows:
"
'C2.exe': Loaded 'D:\MEVET32\MEVET2005_1\MevetC3\C2\Debug\C2.exe', Symbols
loaded.
'C2.exe': Loaded 'C:\WINDOWS\system32\ntdll.dll', No symbols loaded.
'C2.exe': Loaded 'C:\WINDOWS\system32\mscoree.dll', No symbols loaded.
'C2.exe': Loaded 'C:\WINDOWS\system32\kernel32.dll', No symbols loaded.
'C2.exe': Loaded 'C:\WINDOWS\system32\advapi32.dll', No symbols loaded.
'C2.exe': Loaded 'C:\WINDOWS\system32\rpcrt4.dll', No symbols loaded.
'C2.exe': Loaded
'C:\WINDOWS\WinSxS\x86_Microsoft.VC80.DebugCRT_1fc8b3b9a1e18e3b_8.0.50727.42_x-ww_f75eb16c\msvcr80d.dll', Symbols loaded.
'C2.exe': Loaded 'C:\WINDOWS\system32\msvcrt.dll', No symbols loaded.
'C2.exe': Loaded
'C:\WINDOWS\WinSxS\x86_Microsoft.VC80.DebugCRT_1fc8b3b9a1e18e3b_8.0.50727.42_x-ww_f75eb16c\msvcm80d.dll', Symbols loaded.
'C2.exe': Loaded 'C:\WINDOWS\system32\ole32.dll', No symbols loaded.
'C2.exe': Loaded 'C:\WINDOWS\system32\gdi32.dll', No symbols loaded.
'C2.exe': Loaded 'C:\WINDOWS\system32\user32.dll', No symbols loaded.
'C2.exe': Loaded 'C:\WINDOWS\system32\shlwapi.dll', No symbols loaded.
'C2.exe': Loaded 'C:\WINDOWS\system32\shell32.dll', No symbols loaded.
'C2.exe': Loaded
'C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2180_x-ww_a84f1ff9\comctl32.dll', No symbols loaded.
'C2.exe': Loaded 'C:\WINDOWS\system32\comctl32.dll', No symbols loaded.
'C2.exe': Loaded 'C:\WINDOWS\system32\wininet.dll', No symbols loaded.
'C2.exe': Loaded 'C:\WINDOWS\system32\crypt32.dll', No symbols loaded.
'C2.exe': Loaded 'C:\WINDOWS\system32\msasn1.dll', No symbols loaded.
'C2.exe': Loaded 'C:\WINDOWS\system32\oleaut32.dll', No symbols loaded.
'C2.exe': Loaded 'C:\WINDOWS\system32\psapi.dll', No symbols loaded.
'C2.exe': Loaded
'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\mscorwks.dll', No symbols
loaded.
'C2.exe': Loaded
'C:\WINDOWS\WinSxS\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.42_x-ww_0de06acd\msvcr80.dll', Symbols loaded.
'C2.exe': Loaded
'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Culture.dll', No symbols
loaded.
'C2.exe': Unloaded 'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Culture.dll'
'C2.exe': Loaded
'C:\WINDOWS\assembly\NativeImages_v2.0.50727_32\mscorlib\e5fcecdfe1e37b4da85a482f3ae3828a\mscorlib.ni.dll', No symbols loaded.
'C2.exe' (Managed): Loaded
'C:\WINDOWS\assembly\GAC_32\mscorlib\2.0.0.0__b77a5c561934e089\mscorlib.dll',
No symbols loaded.
'C2.exe': Loaded 'C:\WINDOWS\system32\uxtheme.dll', No symbols loaded.
'C2.exe': Loaded 'C:\WINDOWS\system32\msctf.dll', No symbols loaded.
'C2.exe': Loaded 'E:\OHJELMAT\ATI Technologies\HydraMDH.dll', Binary was not
built with debug information.
'C2.exe' (Managed): Loaded 'd:\MEVET32\MEVET2005_1\MevetC3\C2\Debug\C2.exe',
Symbols loaded.
'C2.exe': Loaded
'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\mscorjit.dll', No symbols
loaded.
'C2.exe': Loaded
'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\diasymreader.dll', No symbols
loaded.
'C2.exe': Loaded 'C:\WINDOWS\system32\rsaenh.dll', No symbols loaded.
'C2.exe' (Managed): Loaded
'C:\WINDOWS\WinSxS\x86_Microsoft.VC80.DebugCRT_1fc8b3b9a1e18e3b_8.0.50727.42_x-ww_f75eb16c\msvcm80d.dll', Symbols loaded.
'C2.exe': Loaded
'C:\WINDOWS\assembly\NativeImages_v2.0.50727_32\System\9ab675b1a240c545928e4db46e091273\System.ni.dll', No symbols loaded.
'C2.exe' (Managed): Loaded
'C:\WINDOWS\assembly\GAC_MSIL\System\2.0.0.0__b77a5c561934e089\System.dll',
No symbols loaded.
'C2.exe': Loaded
'C:\WINDOWS\assembly\NativeImages_v2.0.50727_32\System.Drawing\891af85bc3dbcb4fb545fd59ede0c4c1\System.Drawing.ni.dll', No symbols loaded.
'C2.exe': Loaded
'C:\WINDOWS\assembly\NativeImages_v2.0.50727_32\System.Windows.Forms\b92f931eb8bad2439d07738cb9a02ad7\System.Windows.Forms.ni.dll', No symbols loaded.
'C2.exe' (Managed): Loaded
'C:\WINDOWS\assembly\GAC_MSIL\System.Windows.Forms\2.0.0.0__b77a5c561934e089\System.Windows.Forms.dll', No symbols loaded.
'C2.exe' (Managed): Loaded
'C:\WINDOWS\assembly\GAC_MSIL\System.Drawing\2.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll', No symbols loaded.
'C2.exe': Loaded
'C:\WINDOWS\WinSxS\x86_Microsoft.Windows.GdiPlus_6595b64144ccf1df_1.0.2600.2180_x-ww_522f9f82\GdiPlus.dll', No symbols loaded.
First-chance exception at 0x009ba954 in C2.exe: 0xC0000005: Access violation
reading location 0x001f0000.
First-chance exception at 0x7c812a5b in C2.exe: Microsoft C++ exception:
[rethrow] at memory location 0x00000000..
A first chance exception of type 'System.AccessViolationException' occurred
in mscorlib.dll
An unhandled exception of type 'System.AccessViolationException' occurred in
mscorlib.dll
Additional information: Attempted to read or write protected memory. This is
often an indication that other memory is corrupt.
'C2.exe': Loaded
'C:\WINDOWS\assembly\NativeImages_v2.0.50727_32\System.Configuration\b39f20c71193c542bbd774fd4df00b03\System.Configuration.ni.dll', No symbols loaded.
'C2.exe' (Managed): Loaded
'C:\WINDOWS\assembly\GAC_MSIL\System.Configuration\2.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll', No symbols loaded.
'C2.exe': Loaded
'C:\WINDOWS\assembly\NativeImages_v2.0.50727_32\System.Xml\52bdb6df64cea543a5fbd60480b9abf4\System.Xml.ni.dll', No symbols loaded.
'C2.exe' (Managed): Loaded
'C:\WINDOWS\assembly\GAC_MSIL\System.Xml\2.0.0.0__b77a5c561934e089\System.Xml.dll', No symbols loaded.
The program '[776] C2.exe: Managed' has exited with code 0 (0x0).
The program '[776] C2.exe: Native' has exited with code 0 (0x0).
"
There were some hints that writing to protected memory could have something
to do with null values. This might not be true as the compiled exe-file works
fine without errors.
So the only problem is that I can't use the debugger.
Could you possibly have some solution to overcome this problem?
2005. Now I need to change something and started debugging the code. Then
suddenly I receive an error.
"An unhandled exception of type 'System.AccessViolationException' occurred
in mscorlib.dll
Additional information: Attempted to read or write protected memory. This is
often an indication that other memory is corrupt."
The progran ends on a windows form designer generated line:
this->pictureBox1->Image = (cli::safe_cast<System:rawing::Image^
(resources->GetObject(L"pictureBox1.Image")));
I ran a memory test and there is nothing wrong with the memory of the
computer. I even changed the memory chips with the same results. I also
defragmented the disks thinking of some help for possible swap area problems.
This didn't help.
The code compiles without errors and the funny thing is that when I ran the
compiled exe-file, it works without errors, only I can't debug the code.
The debugger produces a log as follows:
"
'C2.exe': Loaded 'D:\MEVET32\MEVET2005_1\MevetC3\C2\Debug\C2.exe', Symbols
loaded.
'C2.exe': Loaded 'C:\WINDOWS\system32\ntdll.dll', No symbols loaded.
'C2.exe': Loaded 'C:\WINDOWS\system32\mscoree.dll', No symbols loaded.
'C2.exe': Loaded 'C:\WINDOWS\system32\kernel32.dll', No symbols loaded.
'C2.exe': Loaded 'C:\WINDOWS\system32\advapi32.dll', No symbols loaded.
'C2.exe': Loaded 'C:\WINDOWS\system32\rpcrt4.dll', No symbols loaded.
'C2.exe': Loaded
'C:\WINDOWS\WinSxS\x86_Microsoft.VC80.DebugCRT_1fc8b3b9a1e18e3b_8.0.50727.42_x-ww_f75eb16c\msvcr80d.dll', Symbols loaded.
'C2.exe': Loaded 'C:\WINDOWS\system32\msvcrt.dll', No symbols loaded.
'C2.exe': Loaded
'C:\WINDOWS\WinSxS\x86_Microsoft.VC80.DebugCRT_1fc8b3b9a1e18e3b_8.0.50727.42_x-ww_f75eb16c\msvcm80d.dll', Symbols loaded.
'C2.exe': Loaded 'C:\WINDOWS\system32\ole32.dll', No symbols loaded.
'C2.exe': Loaded 'C:\WINDOWS\system32\gdi32.dll', No symbols loaded.
'C2.exe': Loaded 'C:\WINDOWS\system32\user32.dll', No symbols loaded.
'C2.exe': Loaded 'C:\WINDOWS\system32\shlwapi.dll', No symbols loaded.
'C2.exe': Loaded 'C:\WINDOWS\system32\shell32.dll', No symbols loaded.
'C2.exe': Loaded
'C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2180_x-ww_a84f1ff9\comctl32.dll', No symbols loaded.
'C2.exe': Loaded 'C:\WINDOWS\system32\comctl32.dll', No symbols loaded.
'C2.exe': Loaded 'C:\WINDOWS\system32\wininet.dll', No symbols loaded.
'C2.exe': Loaded 'C:\WINDOWS\system32\crypt32.dll', No symbols loaded.
'C2.exe': Loaded 'C:\WINDOWS\system32\msasn1.dll', No symbols loaded.
'C2.exe': Loaded 'C:\WINDOWS\system32\oleaut32.dll', No symbols loaded.
'C2.exe': Loaded 'C:\WINDOWS\system32\psapi.dll', No symbols loaded.
'C2.exe': Loaded
'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\mscorwks.dll', No symbols
loaded.
'C2.exe': Loaded
'C:\WINDOWS\WinSxS\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.42_x-ww_0de06acd\msvcr80.dll', Symbols loaded.
'C2.exe': Loaded
'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Culture.dll', No symbols
loaded.
'C2.exe': Unloaded 'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Culture.dll'
'C2.exe': Loaded
'C:\WINDOWS\assembly\NativeImages_v2.0.50727_32\mscorlib\e5fcecdfe1e37b4da85a482f3ae3828a\mscorlib.ni.dll', No symbols loaded.
'C2.exe' (Managed): Loaded
'C:\WINDOWS\assembly\GAC_32\mscorlib\2.0.0.0__b77a5c561934e089\mscorlib.dll',
No symbols loaded.
'C2.exe': Loaded 'C:\WINDOWS\system32\uxtheme.dll', No symbols loaded.
'C2.exe': Loaded 'C:\WINDOWS\system32\msctf.dll', No symbols loaded.
'C2.exe': Loaded 'E:\OHJELMAT\ATI Technologies\HydraMDH.dll', Binary was not
built with debug information.
'C2.exe' (Managed): Loaded 'd:\MEVET32\MEVET2005_1\MevetC3\C2\Debug\C2.exe',
Symbols loaded.
'C2.exe': Loaded
'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\mscorjit.dll', No symbols
loaded.
'C2.exe': Loaded
'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\diasymreader.dll', No symbols
loaded.
'C2.exe': Loaded 'C:\WINDOWS\system32\rsaenh.dll', No symbols loaded.
'C2.exe' (Managed): Loaded
'C:\WINDOWS\WinSxS\x86_Microsoft.VC80.DebugCRT_1fc8b3b9a1e18e3b_8.0.50727.42_x-ww_f75eb16c\msvcm80d.dll', Symbols loaded.
'C2.exe': Loaded
'C:\WINDOWS\assembly\NativeImages_v2.0.50727_32\System\9ab675b1a240c545928e4db46e091273\System.ni.dll', No symbols loaded.
'C2.exe' (Managed): Loaded
'C:\WINDOWS\assembly\GAC_MSIL\System\2.0.0.0__b77a5c561934e089\System.dll',
No symbols loaded.
'C2.exe': Loaded
'C:\WINDOWS\assembly\NativeImages_v2.0.50727_32\System.Drawing\891af85bc3dbcb4fb545fd59ede0c4c1\System.Drawing.ni.dll', No symbols loaded.
'C2.exe': Loaded
'C:\WINDOWS\assembly\NativeImages_v2.0.50727_32\System.Windows.Forms\b92f931eb8bad2439d07738cb9a02ad7\System.Windows.Forms.ni.dll', No symbols loaded.
'C2.exe' (Managed): Loaded
'C:\WINDOWS\assembly\GAC_MSIL\System.Windows.Forms\2.0.0.0__b77a5c561934e089\System.Windows.Forms.dll', No symbols loaded.
'C2.exe' (Managed): Loaded
'C:\WINDOWS\assembly\GAC_MSIL\System.Drawing\2.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll', No symbols loaded.
'C2.exe': Loaded
'C:\WINDOWS\WinSxS\x86_Microsoft.Windows.GdiPlus_6595b64144ccf1df_1.0.2600.2180_x-ww_522f9f82\GdiPlus.dll', No symbols loaded.
First-chance exception at 0x009ba954 in C2.exe: 0xC0000005: Access violation
reading location 0x001f0000.
First-chance exception at 0x7c812a5b in C2.exe: Microsoft C++ exception:
[rethrow] at memory location 0x00000000..
A first chance exception of type 'System.AccessViolationException' occurred
in mscorlib.dll
An unhandled exception of type 'System.AccessViolationException' occurred in
mscorlib.dll
Additional information: Attempted to read or write protected memory. This is
often an indication that other memory is corrupt.
'C2.exe': Loaded
'C:\WINDOWS\assembly\NativeImages_v2.0.50727_32\System.Configuration\b39f20c71193c542bbd774fd4df00b03\System.Configuration.ni.dll', No symbols loaded.
'C2.exe' (Managed): Loaded
'C:\WINDOWS\assembly\GAC_MSIL\System.Configuration\2.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll', No symbols loaded.
'C2.exe': Loaded
'C:\WINDOWS\assembly\NativeImages_v2.0.50727_32\System.Xml\52bdb6df64cea543a5fbd60480b9abf4\System.Xml.ni.dll', No symbols loaded.
'C2.exe' (Managed): Loaded
'C:\WINDOWS\assembly\GAC_MSIL\System.Xml\2.0.0.0__b77a5c561934e089\System.Xml.dll', No symbols loaded.
The program '[776] C2.exe: Managed' has exited with code 0 (0x0).
The program '[776] C2.exe: Native' has exited with code 0 (0x0).
"
There were some hints that writing to protected memory could have something
to do with null values. This might not be true as the compiled exe-file works
fine without errors.
So the only problem is that I can't use the debugger.
Could you possibly have some solution to overcome this problem?