469,353 Members | 2,116 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,353 developers. It's quick & easy.

Attempted to read or write protected memory. This is often an indication that other memory is corrupt

Hi,
I am getting the error message
Attempted to read or write protected memory. This is often an indication
that other memory is corrupt.
It was not coming until yet, for around 2 months. Now, may be the records
have increased and so i am getting this.

anyone has any idea why and when do we get this.

Its a windows based application with c# 2.0 and .Net Framework 2.0.

Regards,
Sugandh Jain
Jul 23 '07 #1
6 49506
Are you using any Interop in the application?

--
HTH,

Kevin Spencer
Microsoft MVP

Printing Components, Email Components,
FTP Client Classes, Enhanced Data Controls, much more.
DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net

"Sugandh Jain" <su**********@nirvana-sol.comwrote in message
news:eD**************@TK2MSFTNGP02.phx.gbl...
Hi,
I am getting the error message
Attempted to read or write protected memory. This is often an indication
that other memory is corrupt.
It was not coming until yet, for around 2 months. Now, may be the records
have increased and so i am getting this.

anyone has any idea why and when do we get this.

Its a windows based application with c# 2.0 and .Net Framework 2.0.

Regards,
Sugandh Jain


Jul 23 '07 #2
Hi,

"Sugandh Jain" <su**********@nirvana-sol.comwrote in message
news:eD**************@TK2MSFTNGP02.phx.gbl...
Hi,
I am getting the error message
Attempted to read or write protected memory. This is often an indication
that other memory is corrupt.
What other memory?

You need to provide more details about your app
Jul 23 '07 #3
Hi,
>Attempted to read or write protected memory. This is often an indication
that other memory is corrupt.
This whole sentence is the part of error message. even I am wondering what
other memory it is talking about.

It is a Windows Based application and I am getting it in the getter of self
defined Indexer for a collection class..
code for the indexer is as follows:

public Position this[Guid positionIdToFind]
{
get
{
Position foundPosition = null;

foreach (Position position in this)
{
if (position.ID.Equals(positionIdToFind))
{
foundPosition = position;
break;
}
}

return foundPosition;

}
set
{
for (int i = 0; i < this.Count; i++)
{
if (this[i].ID.Equals(positionIdToFind))
{
this[i] = value;
break;
}
}
}
}

Is there somethingwrong with this indexer?

Regards,

Sugandh



"Ignacio Machin ( .NET/ C# MVP )" <machin TA laceupsolutions.comwrote in
message news:OZ**************@TK2MSFTNGP05.phx.gbl...
Hi,

"Sugandh Jain" <su**********@nirvana-sol.comwrote in message
news:eD**************@TK2MSFTNGP02.phx.gbl...
>Hi,
I am getting the error message
Attempted to read or write protected memory. This is often an indication
that other memory is corrupt.

What other memory?

You need to provide more details about your app

Jul 24 '07 #4


"Kevin Spencer" wrote:
Are you using any Interop in the application?

--
HTH,

Kevin Spencer
Microsoft MVP

Printing Components, Email Components,
FTP Client Classes, Enhanced Data Controls, much more.
DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net
I am getting the same error in a VS.NET 2005 application working with
Oracle9i Client 9.2.0.1.0.

The error occurs when I call an "oracleConnection.Open()". The application
hangs, and debugging got me this error message.

By the way, I AM using Interop.PCMCOMLib.

I've been chasing this error for some time now and you mentioning Interop
gave me some hope you might know something that could help me.

The message only appears on a couple of PCs, and is working fine for the
others.

So, any ideas?
Oct 18 '07 #5
Hi,

This is the scene:

I have a dll which processes a text file input of data. The data referenced
in the Text file is extracted from the Db and loaded into datasets, where it
worked on, then when completed, uploaded back into the Db.

Here's the issue:
When processing small files, everything is cool. But when doing a 10k or
more line file, I get the same error message as described in this thread.

Now, I do use a unmanaged dll written in Deplhi, but if that is the problem,
why is all smooth when processing small (3k lines) files.

Hope you can help!

"Sugandh Jain" wrote:
Hi,
Attempted to read or write protected memory. This is often an indication
that other memory is corrupt.

This whole sentence is the part of error message. even I am wondering what
other memory it is talking about.

It is a Windows Based application and I am getting it in the getter of self
defined Indexer for a collection class..
code for the indexer is as follows:

public Position this[Guid positionIdToFind]
{
get
{
Position foundPosition = null;

foreach (Position position in this)
{
if (position.ID.Equals(positionIdToFind))
{
foundPosition = position;
break;
}
}

return foundPosition;

}
set
{
for (int i = 0; i < this.Count; i++)
{
if (this[i].ID.Equals(positionIdToFind))
{
this[i] = value;
break;
}
}
}
}

Is there somethingwrong with this indexer?

Regards,

Sugandh



"Ignacio Machin ( .NET/ C# MVP )" <machin TA laceupsolutions.comwrote in
message news:OZ**************@TK2MSFTNGP05.phx.gbl...
Hi,

"Sugandh Jain" <su**********@nirvana-sol.comwrote in message
news:eD**************@TK2MSFTNGP02.phx.gbl...
Hi,
I am getting the error message
Attempted to read or write protected memory. This is often an indication
that other memory is corrupt.
What other memory?

You need to provide more details about your app


Nov 26 '07 #6
Im getting the exact same error message in a small winform application that I
converted from 1.1 to 2.0. The error occurs only on some of the PCs in which
the application is installed on. The error occurs specificaly in the
InitializeComponent method when setting the properties of a tab control.
What makes this really strange is that when I remote desktop connect to the
pc, the application will work correctly but when I login at the desktop it
will not work.

Below is a code snipet from the InitializeComponent() method where the code
crashes:

this.tabControl1.Alignment = System.Windows.Forms.TabAlignment.Bottom;
this.tabControl1.AllowDrop = true;
this.tabControl1.Controls.Add(this.tabProduction);
this.tabControl1.Controls.Add(this.tabProdSupp);
this.tabControl1.Controls.Add(this.tabOther);
this.tabControl1.Controls.Add(this.tabDevelopment) ;
this.tabControl1.Controls.Add(this.tabTest);
this.tabControl1.Controls.Add(this.tabUA);
this.tabControl1.Location = new System.Drawing.Point(15, 12);
this.tabControl1.Name = "tabControl1";
this.tabControl1.SelectedIndex = 0;
this.tabControl1.Size = new System.Drawing.Size(295, 285);
this.tabControl1.TabIndex = 0;
Thanks,

Patrick
Dec 10 '07 #7

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.