[RESOLVED] [2008] Read Write error on Vista.
Hi guys,
I am running my application which in run on 64-bit vista machine. when the program is running somewhere near halfway, it throws an error:
Attempted to read write protected memory.This is often an indication that other memory is corrupt.
Can anybody suggest what could be the problem?
Re: [2008] Read Write error on Vista.
Its a generic error which could mean that or a bad HD or bad code. Without seeing anything it would be hard to do anything more then a wild guess. Can you post your related code?
Re: [2008] Read Write error on Vista.
actually its a GIS CODE with front end in .NET. the code works for small data but doesnt work for larger data.
Re: [2008] Read Write error on Vista.
Quote:
Originally Posted by david_reinjal
actually its a GIS CODE with front end in .NET. the code works for small data but doesnt work for larger data.
That narrows it down to just about everything. You'll need to debug your code and determine where the exception is being thrown. One option is to handle the UnhandledException event of your app, which really should be being done in every VB app. It will provide you with the exception's call stack so you can see exactly where the issue occurred. You can then add code to that section and get even more information.
Re: [2008] Read Write error on Vista.
The spatial data can be quite large. You really need to add better error handling to identify the precise location of the offending code.
Re: [2008] Read Write error on Vista.
ok guys. thanks a lot for the response. i will try doing that.
Re: [RESOLVED] [2008] Read Write error on Vista.
this is the error i am getting:
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
at Test.XTNAPI.XtnGeom_Intersection(Int32 XGOGEOMETRY1, Int32 XGOGEOMETRY2)
at Test.GridOfInterest.grid_processing(Int64 x1, Int64 y1, Int64 x2, Int64 y2) in C:\Users\Rohit\Desktop\Grid Formation Matrix_Finish\Test\Form1.vb:line 318
at Test.GridOfInterest.btnProcess_Click(Object sender, EventArgs e) in C:\Users\Rohit\Desktop\Grid Formation Matrix_Finish\Test\Form1.vb:line 161
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
************** Loaded Assemblies **************
mscorlib
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
Test
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///C:/Documents%20and%20Settings/Narasimha/Desktop/Debug/Test.exe
----------------------------------------
Microsoft.VisualBasic
Assembly Version: 8.0.0.0
Win32 Version: 8.0.50727.1433 (REDBITS.050727-1400)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.VisualBasic/8.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll
----------------------------------------
System
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Windows.Forms
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Configuration
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
System.Runtime.Remoting
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Runtime.Remoting/2.0.0.0__b77a5c561934e089/System.Runtime.Remoting.dll
----------------------------------------
System.Data
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
CodeBase: file:///C:/WINDOWS/assembly/GAC_32/System.Data/2.0.0.0__b77a5c561934e089/System.Data.dll
----------------------------------------
AxInterop.OCXMAPLib
Assembly Version: 1.22.0.0
Win32 Version: 1.22.0.0
CodeBase: file:///C:/Documents%20and%20Settings/Narasimha/Desktop/Debug/AxInterop.OCXMAPLib.DLL
----------------------------------------
CircleOf
Assembly Version: 1.0.3091.22268
Win32 Version: 1.0.3091.22268
CodeBase: file:///C:/Documents%20and%20Settings/Narasimha/Desktop/Debug/CircleOf.DLL
----------------------------------------
Interop.OCXMAPLib
Assembly Version: 1.22.0.0
Win32 Version: 1.22.0.0
CodeBase: file:///C:/Documents%20and%20Settings/Narasimha/Desktop/Debug/Interop.OCXMAPLib.DLL
----------------------------------------
Accessibility
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Accessibility/2.0.0.0__b03f5f7f11d50a3a/Accessibility.dll
----------------------------------------
AddonWrap
Assembly Version: 1.0.2462.17495
Win32 Version: 1.1.0.0
CodeBase: file:///C:/PROGRA~1/GEOCON~1/GEOCON~1/Widget_Locator.xgo
----------------------------------------
System.Transactions
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
CodeBase: file:///C:/WINDOWS/assembly/GAC_32/System.Transactions/2.0.0.0__b77a5c561934e089/System.Transactions.dll
----------------------------------------
System.EnterpriseServices
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400)
CodeBase: file:///C:/WINDOWS/assembly/GAC_32/System.EnterpriseServices/2.0.0.0__b03f5f7f11d50a3a/System.EnterpriseServices.dll
----------------------------------------
************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.
For example:
<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>
When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.
Re: [RESOLVED] [2008] Read Write error on Vista.
i tried my code on XP, then i got the above error.
Re: [RESOLVED] [2008] Read Write error on Vista.
Form1 line 318 and btnProcess_Click. Can you post those code procedures?
Re: [RESOLVED] [2008] Read Write error on Vista.
The call stack tells you where the error is occurring:
Quote:
at Test.XTNAPI.XtnGeom_Intersection(Int32 XGOGEOMETRY1, Int32 XGOGEOMETRY2)
which is called from the line Rob mentioned. Have you investigated that code? This information is provided to you for a reason. Could it have anything to do with the fact that you have Int64 parameters in one method and then Int32 in the next?
Re: [RESOLVED] [2008] Read Write error on Vista.
its a GIS code? shoudl i post that? or should i explain what it does?
Re: [RESOLVED] [2008] Read Write error on Vista.
Code:
dim geom_intsct as long
For i = 0 To geomlist.Count - 1
geom_intsct = XtnGeom_Intersection(geomlist(i), geom_grid)
geominstlist.Add(geom_intsct)
Next
Re: [RESOLVED] [2008] Read Write error on Vista.
both geomlist(i) and geom_grid are declared as long. I will try to declare it as integer and run.
Re: [RESOLVED] [2008] Read Write error on Vista.
What does the function " XtnGeom_Intersection" take as its arguments data types? If you reduce it to a Integer from the Long it may create other issues
Place a breakpoint on
For i = 0 To geomlist.Count - 1
and step through the loop checking the values to see if they are correct and as expected. Step until you get the error. It may be related to some data value
Re: [RESOLVED] [2008] Read Write error on Vista.
Quote:
Originally Posted by david_reinjal
both geomlist(i) and geom_grid are declared as long. I will try to declare it as integer and run.
That's probably the issue. The call stack says that the method parameters are type Int32 and you're saying that you are passing Int64 values. That could be a problem. Do you have Option Strict turned On? If not that's the very first thing you should be fixing. If you did then the compiler wouldn't even let you pass Int64 value's where an Int32 is expected. It's better to catch these issues at design time than run time, yes?
Re: [RESOLVED] [2008] Read Write error on Vista.
thnxs jm..its working fine now. i changed api variables all to long. thnx u all for replying.