• 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: Window freezes app
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Window freezes app


  • Subject: Re: Window freezes app
  • From: Yann Bizeul <email@hidden>
  • Date: Wed, 30 May 2007 10:39:39 +0200

My two cents.

It looks like a deadlock problem, you know AppKit is not thread safe and you have to be very carefull when updating AppKit items in threads, which seem to be the case.
Try adding some locks to avoid this situation ?


Regards,

Yann Bizeul - yann at tynsoe.org
Cocoa Developer

Tynsoe Projects
BuddyPop - GeekTool - SSH Tunnel Manager - ...
http://projects.tynsoe.org/


Le 29 mai 07 à 11:14, António Nunes a écrit :

Hi,

I'm a bit in a fix here:

In my latest builds I am getting a freeze (not always) when bringing up a particular window, even though I have not made any changes to either it's underlying code or to the window's nib file since the last stable release of my software, where this problem did not exist. I had a similar problem in these builds with a panel that hangs off the document window and was able to fix this by recreating the nib file from scratch. But this trick did not work for the other window that exhibits this problem. So I'm in the dark as to what is going on and how to fix it. This window is unrelated to the document windows and is brought up in a non-modal fashion using "showWindow". I have not been able to establish a surefire way to trigger the freeze, but it happens often and seemingly more so when a document window is still in the process of being opened when asking the problem window to open too. The problem is that the threads in the app freeze, apparently waiting for each other. If I pause the app after the freeze I consistently get a readout similar to the one below:

Thread 1:
#0 0x9002c4c8 in semaphore_wait_signal_trap ()
#1 0x90030fac in pthread_cond_wait ()
#2 0x937ca12c in -[NSViewHierarchyLock lockForWriting] ()
#3 0x937dafe8 in -[NSView _displayRectIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:] ( )
#4 0x937d0348 in -[NSView displayIfNeeded] ()
#5 0x937d01b8 in -[NSWindow displayIfNeeded] ()
#6 0x937d0064 in _handleWindowNeedsDisplay ()
#7 0x907de76c in __CFRunLoopDoObservers ()
#8 0x907dea0c in __CFRunLoopRun ()
#9 0x907de4ac in CFRunLoopRunSpecific ()
#10 0x93296b20 in RunCurrentEventLoopInMode ()
#11 0x9329612c in ReceiveNextEventCommon ()
#12 0x93296020 in BlockUntilNextEventMatchingListInMode ()
#13 0x9379cae4 in _DPSNextEvent ()
#14 0x9379c7a8 in -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] ()
#15 0x93798cec in -[NSApplication run] ()
#16 0x9388987c in NSApplicationMain ()


Thread 2:
#0 0x9002c4c8 in semaphore_wait_signal_trap ()
#1 0x90030fac in pthread_cond_wait ()
#2 0x937ca12c in -[NSViewHierarchyLock lockForWriting] ()
#3 0x937ee7b0 in GrowCacheWindow ()
#4 0x937ec218 in GetSharedSpaceFor ()
#5 0x937ebe60 in _NXAllocateImageCache ()
#6 0x937eba84 in -[NSCachedImageRep _initWithSize:depth:separate:alpha:allowDeep:] ()
#7 0x937eb890 in -[NSImage lockFocus] ()
#8 0x9383017c in -[NSButtonCell drawInteriorWithFrame:inView:] ()
#9 0x9382e50c in -[NSButtonCell drawWithFrame:inView:] ()
#10 0x93806d88 in -[NSControl drawRect:] ()
#11 0x937e2858 in -[NSView _drawRect:clip:] ()
#12 0x9383a620 in -[NSView _lightWeightRecursiveDisplayInRect:] ()
#13 0x9383a720 in _lightWeightRecursiveDisplayInRect2 ()
#14 0x907ee3ec in CFArrayApplyFunction ()
#15 0x9383a668 in -[NSView _lightWeightRecursiveDisplayInRect:] ()
#16 0x9383a720 in _lightWeightRecursiveDisplayInRect2 ()
#17 0x907ee3ec in CFArrayApplyFunction ()
#18 0x9383a668 in -[NSView _lightWeightRecursiveDisplayInRect:] ()
#19 0x93839ebc in -[NSButtonCell(NSDefaultButtonIndicatorPrivate) heartBeat:] ()
#20 0x93839ba8 in -[NSWindow(NSWindow_Theme) heartBeat:] ()
#21 0x938397d4 in -[NSUIHeartBeat _heartBeatThread:] ()
#22 0x92bdf1a0 in forkThreadForFunction ()
#23 0x9002be08 in _pthread_body ()


I have not been able yet to trigger the freeze with no document window open. It only happens when a document window is open or opening, and even then not always. It would be very helpful to be offered some ideas on how to track down the exact cause of the freeze, or ways of avoiding it.

Cheers,
António

_______________________________________________

Cocoa-dev mailing list (email@hidden)

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


_______________________________________________

Cocoa-dev mailing list (email@hidden)

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


  • Follow-Ups:
    • Re: Window freezes app
      • From: Antonio Nunes <email@hidden>
References: 
 >Window freezes app (From: António Nunes <email@hidden>)

  • Prev by Date: Re: Predicates with object identity values
  • Next by Date: Re: Objective-C++ and NSInvocation (or IMP)
  • Previous by thread: Window freezes app
  • Next by thread: Re: Window freezes app
  • Index(es):
    • Date
    • Thread