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
------------------------------------------------------------------------
moggel's Profile: http://www.hightechtalks.com/m544
View this thread: http://www.hightechtalks.com/t2308188
-chris
"Nicolai Andersen" <Nicolai...@discussions.microsoft.com> wrote in
message news:349BC236-B0C4-4A42...@microsoft.com...
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
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
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.
thank you for your answer. But what or where is the "event log"?
Tanks
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 !!! :-)
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... :(
pavlsp.dll info: 2005-04-20 16:22:36 File Version: v5.4.12.36 Product
Version: 5, 4, 20, 0
*** Sent via Developersdex http://www.developersdex.com ***
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