• 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: hang in CFStream code
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: hang in CFStream code


  • Subject: Re: hang in CFStream code
  • From: Becky Willrich <email@hidden>
  • Date: Wed, 30 Apr 2003 09:49:28 -0700

This is a blown lock in the socket code (we use a lock to make sure the read stream and the write stream don't both try to manipulate the socket at the same time). When we've seen this reported, it's usually a rogue memory stomper or someone doing evil to the socket or CFSocket behind our back (like closing it, for instance). Try running with the environment variable MallocScribble set, and see if the hang/crash moves; if so, you've got a memory stomper. Also, if your program is multithreaded, check the stacks of the other threads; there might be something telling in one of them.

Hope that helps,
REW


On Friday, April 25, 2003, at 3:07 PM, James Matthews wrote:

I have a Carbon test program that opens a CFReadStream and a CFWriteStream on the Unix domain socket it shares with a child process -- it uses a class similar to the NSTask class in Cocoa. It works a few times (e.g. I can launch "/bin/ls" and read the output) but eventually hangs: the child process is launched and the CFStreams are opened but no callbacks come through. Here's the stack crawl while it's hung:

#0 0x620f9d28 in clock_sleep_trap ()
#1 0x620f9904 in nanosleep (requested_time=0xbfffe920, remaining_time=0x0) at /SourceCache/Libc/Libc-262/gen/nanosleep.c:51
#2 0x901c2140 in socketCallBack ()
#3 0x90162ce8 in __CFSocketPerform ()
#4 0x90149534 in __CFRunLoopDoSources0 ()
#5 0x90148918 in __CFRunLoopRun ()
#6 0x90180fe4 in CFRunLoopRunSpecific ()
#7 0x969a3160 in RunCurrentEventLoopInMode ()
#8 0x969b3090 in ReceiveNextEventCommon ()
#9 0x969f2074 in _AcquireNextEvent ()
#10 0x96ab3ff4 in RunApplicationEventLoop ()
#11 0x00003b00 in SimpleHello::Run() ()
#12 0x00004198 in main ()
#13 0x00003550 in _start ()
#14 0x000033d0 in start ()

This is on 10.2.4, with the debug version of libSystem providing the details about nanosleep.

What's the next step I should take to figure out why the code is hanging? Is there a debug version of the CFNetwork framework that would provide more information in the backtrace?

Thanks,
--
Jim Matthews
Fetch Softworks
http://fetchsoftworks.com
_______________________________________________
macnetworkprog mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/macnetworkprog
Do not post admin requests to the list. They will be ignored.
_______________________________________________
macnetworkprog mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/macnetworkprog
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: hang in CFStream code
      • From: James Matthews <email@hidden>
References: 
 >hang in CFStream code (From: James Matthews <email@hidden>)

  • Prev by Date: Re: Getting own IP address
  • Next by Date: Re: hang in CFStream code
  • Previous by thread: hang in CFStream code
  • Next by thread: Re: hang in CFStream code
  • Index(es):
    • Date
    • Thread