Who's feeling brave?

G

greg.merideth

I'm working on a .net remoting application that's taken a strange turn
for the worst. I've posted the shortest code snippet that still causes
the crash below. I've got a server app, a client caller and a remoting
object all in one project.

The kicker is, the remoting call's appear to work but *every* single
time we make a call, and the client exits, the server application
crashes.

The "brave" part is this. The event log shows that the faulting module
is in PGP. Now, how a PGP LSP module would cause the remoting
application to crash is *beyond* me and PGP is about as helpful at
support as sticking your hand down a emu's throat and trying to get
marshmallows.

If anyone has any idea whats going on here I'd like to know what could
be going on here. The error code is below the code. I've squeezed
things down to make it fit.

Code:
///
/// the remote object
///
using System;

namespace c1.Remoting {
public class RemotingInteropClass : MarshalByRefObject { //
singleton
private int counter = 0;

private RemotingInteropClass() { }
public void IncrementCounter(int value) { counter += value; }
public int GetCounter() { return counter; }
public override Object InitializeLifetimeService() { return
null; }

static RemotingInteropClass mInstance = null;
public static RemotingInteropClass Instance {
get { if(mInstance == null) mInstance = new
RemotingInteropClass(); return mInstance; }
}
}
}


/// this works but then promptly crashes the server
/// the client
///
using System;
using System.Runtime.Remoting;
using System.Runtime.Remoting.Channels;
using System.Runtime.Remoting.Channels.Http;
using System.Runtime.Remoting.Channels.Tcp;

using c1.Remoting;

namespace c1Client {
class c1Client {
static void Main(string[] args) {
ChannelServices.RegisterChannel(new TcpChannel());
object objIClass =
Activator.GetObject(typeof(RemotingInteropClass),
"tcp://localhost:8090/IDFF");
RemotingInteropClass iClass =
(RemotingInteropClass)objIClass;
for(int i = 0; i < 10; ++i)
iClass.IncrementCounter(i);
Console.WriteLine("{0}", iClass.GetCounter().ToString());
}
}
}

///
/// the server
///
using System;
using System.Runtime.Remoting;
using System.Runtime.Remoting.Channels;
using System.Runtime.Remoting.Messaging;
using System.Runtime.Remoting.Channels.Tcp;

using c1.Remoting;

namespace c1Server {
class c1Server {
static void Main(string[] args) {
RemotingInteropClass iClass =
RemotingInteropClass.Instance;
TcpChannel ch = new TcpChannel(8090);
ChannelServices.RegisterChannel(ch);
RemotingServices.Marshal(iClass, "IDFF");
Console.ReadLine();
ch.StopListening(null);
}
}
}

The code above works in adding values 1 through 10 and shows the result
of 45 but then crashes with this error:

Faulting application c1server.exe, version 1.0.0.0, stamp 439b8910,
faulting module pgplsp.dll, version 9.0.2.2424, stamp 42e7fb45, debug?
0, fault address 0x0000532d

Any idea's?
 
G

greg.merideth

I just tried this *exact* same code in VS 2003 and it works just fine.
No crashes and it works. Looks like this is a VS2005 issue.
 
B

Brian Gideon

Greg,

I tried the code in VS2005 and it worked fine for me. Perhaps you have
a corrupted install??

Brian
 
G

greg.merideth

I'm beginning to think it's something to do with PGP since .net is
showing that dll in it's fault message. Back to square one for me or
mabye I think it's time to uninstall PGP.

Thanks for trying it though.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top