• 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: DO deadlock problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: DO deadlock problem


  • Subject: Re: DO deadlock problem
  • From: David McGavran <email@hidden>
  • Date: Thu, 14 Sep 2006 11:51:42 +0200

Ignore... Sorry the server thread was dieing. Guess I still would like it not to deadlock, but I found the real problem

Cheers

Dave
On Sep 14, 2006, at 11:24 AM, David McGavran wrote:

Hoping someone can chime in on this....

I have a Distributed objects server that is also a client. Kind of a man in the middle thing.

It gets a call on one of its methods that will turn around and connect to another server.

Inside its CreateLink method it calls [NSConnection rootProxyForConnectionWithRegisteredName]; This seems to pump the CFRunLoop (via the stack trace). Inside this RunLoop I get another call to start another connection with a different name. So I have reentered. My code is reentrant and that should be ok. However when this method calls [NSConnection rootProxyForConnectionWithRegisteredName] it deadlocks and doesn't call back. It gets stuck in mach_msg_trap.


The stack trace is something like this

#0	0x9000b268 in mach_msg_trap
#1	0x9000b1bc in mach_msg
#2	0x907dbb78 in __CFRunLoopRun
#3	0x907db47c in CFRunLoopRunSpecific
#4	0x92939598 in -[NSConnection sendInvocation:]
#5	0x92938034 in -[NSObject(NSForwardInvocation) forward::]
#6	0x90a430b0 in _objc_msgForward


!!!!!!!!! Here I have been reentered !!!!!!!!!!!!!!!!!!!!!!! #7 0x00005304 in -[MYSERVEROBJECT CREATENEWLINK] at main.mm:563 !!!!!!!!! Here I have been reentered !!!!!!!!!!!!!!!!!!!!!!!


#9 0x90a431f4 in objc_msgSendv #10 0x9293fd50 in -[NSInvocation invoke] #11 0x9293f74c in -[NSConnection dispatchInvocation:] #12 0x9293d858 in -[NSConnection handleRequest:sequence:] #13 0x9293d1cc in -[NSConnection handlePortCoder:] #14 0x9293cf38 in -[NSConcretePortCoder dispatch] #15 0x9293c918 in __NSFireMachPort #16 0x907e9820 in __CFMachPortPerform #17 0x907e9734 in __CFRunLoopDoSource1 #18 0x907dbe4c in __CFRunLoopRun #19 0x907db47c in CFRunLoopRunSpecific #20 0x92939598 in -[NSConnection sendInvocation:] #21 0x92938034 in -[NSObject(NSForwardInvocation) forward::] #22 0x90a430b0 in _objc_msgForward


#23 0x00005304 in -[MYSERVEROBJECT CREATENEWLINK] at main.mm:563

How can I fix this? Is it possible to make sure that I don't get any method calls until the current is done? Or to block NSConnection from pumping the messages?

Thanks

Dave

_______________________________________________
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: 
 >DO deadlock problem (From: David McGavran <email@hidden>)

  • Prev by Date: DO deadlock problem
  • Next by Date: Populate NSTextView from NSPopupButton
  • Previous by thread: DO deadlock problem
  • Next by thread: Populate NSTextView from NSPopupButton
  • Index(es):
    • Date
    • Thread