• 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
Strange deadlock using NSTextView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Strange deadlock using NSTextView


  • Subject: Strange deadlock using NSTextView
  • From: Nicholas Francis <email@hidden>
  • Date: Sun, 17 Aug 2003 11:35:08 +0200

Hi guys. I have what appear to be the strangest deadlock when using an NSTextView in my very simple GUI app. Basically, sometimes when I add/remove lines, the app locks up. Examining the stack trace at this point reveals 2 interesting threads:

#0 0x9003dde8 in semaphore_wait_signal_trap ()
#1 0x9003db64 in _pthread_cond_wait ()
#2 0x90921b60 in -[NSRecursiveLock lock] ()
#3 0x92d99650 in _NSFastFillAllLayoutHolesUpToGlyphIndex ()
#4 0x92e1c850 in -[NSLayoutManager lineFragmentRectForGlyphAtIndex:effectiveRange:] ()
#5 0x92ddf0ac in -[NSTextView drawRect:] ()
#6 0x92ddda74 in -[NSTextView _drawRect:clip:] ()
#7 0x92dc0a48 in -[NSView _lightWeightRecursiveDisplayInRect:] ()
#8 0x92dc0ac4 in -[NSView _lightWeightRecursiveDisplayInRect:] ()
#9 0x92dc0ac4 in -[NSView _lightWeightRecursiveDisplayInRect:] ()
#10 0x92dc0ac4 in -[NSView _lightWeightRecursiveDisplayInRect:] ()
#11 0x92dc0ac4 in -[NSView _lightWeightRecursiveDisplayInRect:] ()
#12 0x92def8dc in -[NSButtonCell(NSDefaultButtonIndicatorPrivate) heartBeat:] ()
#13 0x92e18b4c in -[NSWindow(NSWindow_Theme) heartBeat:] ()
#14 0x92d8c95c in -[NSUIHeartBeat _heartBeatThread:] ()
#15 0x9095f630 in forkThreadForFunction ()
#16 0x9001fe08 in _pthread_body ()

and:

#0 0x9003dde8 in semaphore_wait_signal_trap ()
#1 0x9003db64 in _pthread_cond_wait ()
#2 0x92d879a8 in -[NSViewHierarchyLock lockForWriting] ()
#3 0x92da81f8 in -[NSView setFrameSize:] ()
#4 0x92e1efd8 in -[NSTextView(NSPrivate) _setFrameSize:forceScroll:] ()
#5 0x92dcacbc in -[NSTextView setConstrainedFrameSize:] ()
#6 0x92daa4f8 in -[NSLayoutManager(NSPrivate) _resizeTextViewForTextContainer:] ()
#7 0x92d94c3c in -[NSLayoutManager(NSPrivate) _fillLayoutHoleAtIndex:desiredNumberOfLines:] ()
#8 0x92e275f8 in +[NSLayoutManager(NSPrivate) _doSomeBackgroundLayout] ()
#9 0x92df2350 in _NSPostBackgroundLayout ()
#10 0x90197dec in __CFRunLoopDoObservers ()
#11 0x901981e8 in __CFRunLoopRun ()
#12 0x901d4724 in CFRunLoopRunSpecific ()
#13 0x927e43ac in GetGlobalMouse ()
#14 0x927ee140 in HIObjectGetEventTarget ()
#15 0x92814694 in BlockUntilNextEventMatchingListInMode ()
#16 0x92d8d2b8 in _DPSNextEvent ()
#17 0x92d9f644 in -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] ()
#18 0x92db8994 in -[NSApplication run] ()
#19 0x92e819a0 in NSApplicationMain ()
#20 0x000044c4 in main (argc=1, argv=0xbffffc58)

I don't use any threads in my code what so ever, so I'm a bit surprised by all this. I don't do anything fancy with the text view. I basically just query its string and work with a copy of that. I've searched google, but could not find anything that did not pertain to multithreaded code.

Another thing I find a bit odd is that I get text cursors left behind sometimes. I can definitely live with that if only my app would stop crashing ;-)

If anybody has any help, it would be much appreciated

Cheers,
Nicholas
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: Looking for an ABPerson online.
  • Next by Date: Re: cocoa-dev digest, Vol 2 #2814 - 17 msgs
  • Previous by thread: Looking for an ABPerson online.
  • Next by thread: Getting the System languages
  • Index(es):
    • Date
    • Thread