Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

AccessViolationException

257 views
Skip to first unread message

Nicolai Andersen

unread,
Dec 13, 2005, 11:27:03 AM12/13/05
to
Hi,

I have just migrated a client/server application to .Net 2.0. After that I
get an AccessViolationException in the server program when the client program
is terminated!!

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

at
System.Net.UnsafeNclNativeMethods.OSSOCK.WSAGetOverlappedResult(SafeCloseSocket
socketHandle, IntPtr overlapped, UInt32& bytesTransferred, Boolean wait,
IntPtr ignored)
at
System.Net.Sockets.BaseOverlappedAsyncResult.CompletionPortCallback(UInt32
errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped)
at
System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32
errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)"


The client and server are communicating through .Net Remoting, and we don't
have any other socket communication. Also the server application does not use
any 3rd party code.

Everything worked fine before we migrated.

Thanks for any help you can provide...

moggel

unread,
Dec 18, 2005, 7:21:09 AM12/18/05
to

I have this exact same problem too and would much appreciate an answer
or pointers.


--
moggel
------------------------------------------------------------------------
moggel's Profile: http://www.hightechtalks.com/m544
View this thread: http://www.hightechtalks.com/t2308188

Chris Yager

unread,
Dec 18, 2005, 9:09:08 AM12/18/05
to
What channel and formatter are you using? Try to switch and see if you
still get the error. Start with the formatter - if you are using soap,
switch to binary, etc.
Can you set up a test environment and reproduce the error?

-chris

"Nicolai Andersen" <Nicolai...@discussions.microsoft.com> wrote in
message news:349BC236-B0C4-4A42...@microsoft.com...

Nicolai Andersen

unread,
Dec 18, 2005, 9:35:02 AM12/18/05
to
Hi,

I found the reason: I had installed a program called "Netlimiter" on the
test server (used for testing the app with limmited bandwidth). It was en
error in a nsl dll from that program that caused my problem. After
uninstalling the program it worked fine.

However, I do not know why I only got the error with .Net 2.0 and not with
1.1.

/Nicolai

ms

unread,
Dec 20, 2005, 5:46:36 PM12/20/05
to
I have exactly the same problem. But I don't have "Netlimiter" installed.
This ServerCode ist not working:

using System;
using System.Runtime.Remoting;
using System.Runtime.Remoting.Channels;
using System.Runtime.Remoting.Channels.Tcp;

namespace SimpleServer
{
class Program
{
static void Main(string[] args)
{
TcpChannel chan = new TcpChannel(8085);
ChannelServices.RegisterChannel(chan);
RemotingConfiguration.
RegisterWellKnownServiceType(typeof(SimpleServer.HelloServer), "SayHello",
WellKnownObjectMode.SingleCall);
System.Console.WriteLine("Hit to exit...");
System.Console.ReadLine();
}
}

public class HelloServer : MarshalByRefObject
{
public HelloServer()
{
Console.WriteLine("HelloServer activated");
}

public String HelloMethod(String name)
{
Console.WriteLine("Hello.HelloMethod : {0}", name);
return "Hi there " + name;
}
}
}

Client:

using System;
using System.Collections.Generic;
using System.Text;

namespace SimpleClient
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hit To Start ...");
Console.ReadLine();
SimpleServer.HelloServer obj = (SimpleServer.HelloServer)
Activator.GetObject(
typeof(SimpleServer.HelloServer),
"tcp://localhost:8085/SayHello");
if (obj == null) System.Console.WriteLine("Could not locate
server");
else Console.WriteLine(obj.HelloMethod("Caveman"));

System.Console.WriteLine("Hit to exit...");
System.Console.ReadLine();
}
}
}

It works untill the client terminates. Same Errormessage as above.

Has anyone an idea?

Thanks

Nicolai Andersen

unread,
Dec 21, 2005, 2:52:02 AM12/21/05
to
Hi,

Have you looked in the event log? In my case the root to the error was
logged there. It might be caused by a virus or firewall program.

ms

unread,
Dec 21, 2005, 4:20:15 AM12/21/05
to
Hi,

thank you for your answer. But what or where is the "event log"?

Tanks

ms

unread,
Dec 21, 2005, 5:39:41 AM12/21/05
to
Hi,

it's me again. I found it. In German: "Ereignissüberwachung". After Running the Server and Client not from VS I had an entry that showed me that imon.dll is the problem. After reserches in www i found that NOD32 Antivir has a buggy imon.dll. After deinstallation all worked fine.

Thanx a lot !!! :-)

Igor

unread,
Dec 21, 2005, 3:53:12 PM12/21/05
to

you don't need to deinstall NOD32. IMON has an exclusion list (Imon ->
Setup -> Miscellaneous -> Exclusions -> Edit...). add the HOST file on
the list and everything should work fine.
Nevertheless, there is a bug in NOD32 - only Exclusion works - if you
disable IMON completely, the Host will still crash. even if you disable
all NOD services (except kernel, which you can't)...
Took me a while to figure this one out... :(

Wouter Demuynck

unread,
Jan 12, 2006, 5:28:39 AM1/12/06
to
I encountered the same problem (AccessViolationExceptions on an
IOCompletion threadpool thread), and tracked it down to Panda Antivirus
software, which had an access violation inside pavlsp.dll

pavlsp.dll info: 2005-04-20 16:22:36 File Version: v5.4.12.36 Product
Version: 5, 4, 20, 0

remi ferland

unread,
Aug 3, 2006, 2:16:43 PM8/3/06
to
thanks you so much! my problem was NOD32 (IMON) too

*** Sent via Developersdex http://www.developersdex.com ***

Ronald Ramos

unread,
Jul 9, 2007, 8:09:55 AM7/9/07
to

It also happened to me. The problem is traced to Polesoft LockSpam Pro
3.0.160 iga.dll. Uninstalling the software solved the problem.

Yew Kwee Yen

unread,
Sep 28, 2007, 1:49:16 AM9/28/07
to
Hi,

I have meet some error when i extract the data from postgreSQL with
integration services, SQL 2005. Below is the error description:

System.AccessViolationException: Attempt to read or write protected


memory. This is often an indication that other memory is corrupt.

Can anyone know what is the problem?

Thanks

0 new messages