Re: Distributed Objects "connection went invalid while waiting for a reply"
Re: Distributed Objects "connection went invalid while waiting for a reply"
- Subject: Re: Distributed Objects "connection went invalid while waiting for a reply"
- From: Ken Thomases <email@hidden>
- Date: Wed, 9 Jul 2008 02:26:24 -0500
On Jul 8, 2008, at 7:11 PM, Hamish Allan wrote:
I'm seeing "connection went invalid while waiting for a reply" in a DO
callback. The client passes self in a call to the server; some time
later, the server calls a method on that client (proxy), the program
hangs for a second or so, the "connection went invalid" connection
appears, but the method call is successful anyway, so it would appear
that the DO machinery is re-connecting everything okay.
According to the debugger, the message appears as a result of an
uncaught NSException from -[NSConnection sendInvocation:internal:],
called from -[NSDistantObject forwardInvocation].
Server and client are both properly retained.
Perhaps the connection or relevant port objects are being released? I
would think that they should be automatically retained by the
corresponding NSDistantObject(s), but maybe not.
If you turn on NSZombie, does that provide any insight?
Similarly, you can use the Object Allocations instrument. When the
exception happens, examine the history of NSConnection and NS(Mach|
Message|Socket)Port objects to see if any have gone missing when they
shouldn't have.
Also, you can try DTrace with the "objc" provider to get a trace,
possibly with backtraces, of every message to NSConnection* or
NS*Port* methods. (That's not the same as tracing all messages to
instances of those classes. Some messages are implemented on
superclasses (like NSObject), of course, and they won't be traced in
that way. Trying to trace every method of NSObject can be done, but
will probably be overwhelming.)
sudo dtrace -n 'objc$target:NSConnection*::entry, objc
$target:NS*Port*::entry {ustack();}' -c /path/to/YourApplication.app/
Contents/MacOS/YourApplication
or
sudo dtrace -n 'objc$target:NSConnection*::entry, objc
$target:NS*Port*::entry {ustack();}' -p <your application's pid>
Good luck,
Ken
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden