• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Problem with distributed objects.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem with distributed objects.


  • Subject: Re: Problem with distributed objects.
  • From: The Karl Adam <email@hidden>
  • Date: Tue, 8 Feb 2005 20:48:50 -0500

I've seen this too, though it does get fixed.  Instead of NSLoggin the
object NSLog the object's -description. I've always assumed the
problem had to do with attempting the serialize an object that isn't
necessarily concrete.

-Karl

On Wed, 9 Feb 2005 12:42:50 +1100, Tobias Sargeant <email@hidden> wrote:
> For some reason, trying to log a proxy causes a core dump. Emulating
> what I believe should be going on behind the scenes doesn't cause the
> same problem, and I'm at a loss to work out why. I realise that it's a
> case of 'Doctor, it hurts when I do this...', but I'm curious to know
> why...
>
> If anyone can enlighten me, I'd be very happy.
>
> Thanks,
> Toby.
>
> The code snippet:
>
>        id addr = [addrs objectAtIndex: 0];
>        struct sockaddr *sa = (struct sockaddr *)[addr bytes];
>        NSSocketPort *net_port = [[NSSocketPort alloc]
> initRemoteWithProtocolFamily: sa->sa_family
>                                                       socketType:
> SOCK_STREAM
>                                                       protocol:
> IPPROTO_TCP
>                                                       address: addr];
>        NSConnection *net_conn = [[NSConnection
> connectionWithReceivePort: nil sendPort: net_port] retain];
>        id root = [[net_conn rootProxy] retain];
>        [root setProtocolForProxy: @protocol(IQServer)];
>        NSLog(@"root = %p", root);
>        NSLog(@"[root foo] = %@", [root foo]);
>        NSLog(@"[root
> respondsToSelector:@selector(descriptionWithLocale:)] = %d", [root
> respondsToSelector:@selector(descriptionWithLocale:)]);
>        NSLog(@"[root description] = %@", [root description]);
>        NSLog(@"root = %@", root);
>        [root release];
>        [net_conn release];
>        [net_port release];
>
> And the result:
>
> 2005-02-09 12:39:36.095 qservertest[15120] root = 0x11ece0
> 2005-02-09 12:39:36.103 qservertest[15120] [root foo] = foo
> 2005-02-09 12:39:36.106 qservertest[15120] [root
> respondsToSelector:@selector(descriptionWithLocale:)] = 0
> 2005-02-09 12:39:36.108 qservertest[15120] [root description] =
> <QServer: 0x500cc0>
> 2005-02-09 12:39:36.112 qservertest[15120] root = <QServer: 0x500cc0>
>
> Program received signal EXC_BAD_ACCESS, Could not access memory.
> 0x908311f4 in objc_msgSend ()
> (gdb) bt
> #0  0x908311f4 in objc_msgSend ()
> #1  0x90a12014 in -[NSInvocation invalidate] ()
> #2  0x90a02c4c in -[NSInvocation dealloc] ()
> #3  0x909f15d4 in NSPopAutoreleasePool ()
> #4  0x90a74abc in NSLog ()
> #5  0x00009048 in -[QServerBrowser serverListUpdated] (self=0x100f70,
> _cmd=0x4ba18) at
> /Users/toby/projects/PERSONAL/quixotic/source/server/test/
> qservertest.mm:173
> #6  0x00008bd8 in -[QServerBrowser netServiceDidResolveAddress:]
> (self=0x100f70, _cmd=0x90b2a9fc, service=0x101350) at
> /Users/toby/projects/PERSONAL/quixotic/source/server/test/
> qservertest.mm:135
> #7  0x90a76ce0 in netServiceDispatchCallBack ()
> #8  0x927487d4 in NetService::PerformCallBack(NetService*) ()
> #9  0x90193ca8 in __CFRunLoopDoSources0 ()
> #10 0x90191560 in __CFRunLoopRun ()
> #11 0x90195e8c in CFRunLoopRunSpecific ()
> #12 0x909fc850 in -[NSRunLoop runMode:beforeDate:] ()
> #13 0x90a15454 in -[NSRunLoop run] ()
>
>  _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Cocoa-dev mailing list      (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
>
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Problem with distributed objects. (From: Tobias Sargeant <email@hidden>)

  • Prev by Date: Problem with distributed objects.
  • Next by Date: Re: Disclosure triangles?
  • Previous by thread: Problem with distributed objects.
  • Next by thread: IB subviews?
  • Index(es):
    • Date
    • Thread