[R-SIG-Mac] R App crashes when opening files, navigating within open file pane

Ben Haller bhaller at mac.com
Mon Mar 5 08:34:28 CET 2018


Robert Gulotty previously wrote:

> I am using macOS High Sierra, 10.13.2 (17C205)  with R.App GUI 1.70 (7463) x86_64-apple-darwin15.6.0  R version 3.4.3
> 
> R hangs when I try to open a .R script in finder, even if R has been running.  It also hangs every time I use the File Open menu to select a file.  It either crashes when I try to navigate from folder to folder within the open file interface, or upon selecting a file.   This has been the case for several updates of macOS, and through several versions of R and across two computers.  I have uninstalled and reinstalled the R app, R, and the various suggested tools for Mac OSX.

  I am experiencing much the same problem, on macS 10.13.3 (17D102) with R.app GUI 1.70 (7463 El Capitan build), R version 3.4.3.

  R.app hangs when I try to open an existing file through any avenue.  I can open a new document and paste content into it from TextEdit, so that is now what I do every time I want to run or edit an existing R file – rather inconvenient.

  I am a Mac developer, familiar with Xcode, and am happy to work with somebody on this problem if there is difficulty in reproducing the bug; it happens 100% of the time for me.

  If I do “sample R 10” in Terminal after the app has hung, I get the following output for the thread that is hung.  This is a very weird backtrace; note the 0x0 in the middle of it, following sigactionSegv.  Maybe R.app is installing a signal handler, and a segfault is happening inside NSTypesetter, and then things go south from there?  I have no idea.  :->

Call graph:
    8871 Thread_2856867   DispatchQueue_1: com.apple.main-thread  (serial)
    + 8871 start  (in libdyld.dylib) + 1  [0x7fff5c7c9115]
    +   8871 main  (in R) + 817  [0x105ee9ba1]
    +     8871 -[REngine runREPL]  (in R) + 225  [0x105efae31]
    +       8871 run_REngineRmainloop  (in R) + 287  [0x105f06ddf]
    +         8871 R_ReplDLLdo1  (in libR.dylib) + 139  [0x1060e4e6b]  main.c:365
    +           8871 Re_ReadConsole  (in R) + 184  [0x105ef85c8]
    +             8871 -[RController handleReadConsole:]  (in R) + 186  [0x105eeec6a]
    +               8871 -[RController doProcessEvents:]  (in R) + 204  [0x105ef4a4c]
    +                 8871 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:]  (in AppKit) + 3044  [0x7fff32c2eb4c]
    +                   8871 _DPSNextEvent  (in AppKit) + 2788  [0x7fff3249921e]
    +                     8871 AEProcessAppleEvent  (in HIToolbox) + 55  [0x7fff341dd5e0]
    +                       8871 aeProcessAppleEvent  (in AE) + 383  [0x7fff35f9b565]
    +                         8871 dispatchEventAndSendReply(AEDesc const*, AEDesc*)  (in AE) + 41  [0x7fff35f9b677]
    +                           8871 aeDispatchAppleEvent(AEDesc const*, AEDesc*, unsigned int, unsigned char*)  (in AE) + 1788  [0x7fff35f9bdd0]
    +                             8871 _NSAppleEventManagerGenericHandler  (in Foundation) + 102  [0x7fff36fb0282]
    +                               8871 -[NSAppleEventManager dispatchRawAppleEvent:withRawReply:handlerRefCon:]  (in Foundation) + 287  [0x7fff36fb0404]
    +                                 8871 -[NSApplication(NSAppleEventHandling) _handleCoreEvent:withReplyEvent:]  (in AppKit) + 766  [0x7fff3249db95]
    +                                   8871 -[NSApplication(NSAppleEventHandling) _handleAEOpenDocumentsForURLs:]  (in AppKit) + 235  [0x7fff32697138]
    +                                     8871 __69-[NSApplication(NSAppleEventHandling) _handleAEOpenDocumentsForURLs:]_block_invoke  (in AppKit) + 891  [0x7fff326976dd]
    +                                       8871 -[NSApplication(NSAppleEventHandling) _openURLs:withCompletionHandler:]  (in AppKit) + 1026  [0x7fff328bd965]
    +                                         8871 withWindowOrderingObserverHeuristic  (in AppKit) + 496  [0x7fff328bddab]
    +                                           8871 __69-[NSApplication(NSAppleEventHandling) _handleAEOpenDocumentsForURLs:]_block_invoke_2  (in AppKit) + 2122  [0x7fff326b3667]
    +                                             8871 +[_NSWindowTransformAnimation waitForAnimationToCompleteOnWindows:forFullScreen:]  (in AppKit) + 69  [0x7fff326b3922]
    +                                               8871 CA::Transaction::commit()  (in QuartzCore) + 487  [0x7fff3ffe343d]
    +                                                 8871 CA::Context::commit_transaction(CA::Transaction*)  (in QuartzCore) + 326  [0x7fff3ffe3894]
    +                                                   8871 CA::Layer::layout_and_display_if_needed(CA::Transaction*)  (in QuartzCore) + 35  [0x7fff3ffe47f9]
    +                                                     8871 CA::Layer::display_if_needed(CA::Transaction*)  (in QuartzCore) + 633  [0x7fff3ffe4d3b]
    +                                                       8871 -[NSTextLayer display]  (in AppKit) + 1591  [0x7fff32fcec67]
    +                                                         8871 -[NSTextLayer drawInContext:]  (in AppKit) + 235  [0x7fff325ecfb5]
    +                                                           8871 -[NSTextView(NSTextView_LayerBacking) displayTextLayer:withContext:]  (in AppKit) + 130  [0x7fff3301f13d]
    +                                                             8871 -[NSFocusStack performWithFocusView:inWindow:usingBlock:]  (in AppKit) + 99  [0x7fff325ed1fe]
    +                                                               8871 __68-[NSTextView(NSTextView_LayerBacking) displayTextLayer:withContext:]_block_invoke  (in AppKit) + 449  [0x7fff3301f30b]
    +                                                                 8871 -[RScriptEditorTextView drawRect:]  (in R) + 437  [0x105f3ac15]
    +                                                                   8871 -[RTextView drawRect:]  (in R) + 608  [0x105f26f70]
    +                                                                     8871 -[NSTextView drawRect:]  (in AppKit) + 1203  [0x7fff325ed8a4]
    +                                                                       8871 -[NSLayoutManager glyphRangeForBoundingRect:inTextContainer:]  (in UIFoundation) + 81  [0x7fff5867c59f]
    +                                                                         8871 -[NSLayoutManager(NSPrivate) _glyphRangeForBoundingRect:inTextContainer:fast:okToFillHoles:]  (in UIFoundation) + 918  [0x7fff5867c93b]
    +                                                                           8871 -[NSLayoutManager(NSPrivate) _firstPassGlyphRangeForBoundingRect:inTextContainer:okToFillHoles:]  (in UIFoundation) + 1534  [0x7fff5867df5e]
    +                                                                             8871 _NSFastFillAllLayoutHolesForGlyphRange  (in UIFoundation) + 1851  [0x7fff5867ebda]
    +                                                                               8871 _resizeTextViewsIfNeeded  (in UIFoundation) + 285  [0x7fff5878e09f]
    +                                                                                 8871 -[NSLayoutManager(NSPrivate) _resizeTextViewForTextContainer:]  (in UIFoundation) + 938  [0x7fff58679dbc]
    +                                                                                   8871 -[NSTextView setConstrainedFrameSize:]  (in AppKit) + 635  [0x7fff32550438]
    +                                                                                     8871 -[NSTextView setFrameSize:]  (in AppKit) + 143  [0x7fff32550ec6]
    +                                                                                       8871 -[NSTextView(NSPrivate) _setFrameSize:forceScroll:]  (in AppKit) + 1081  [0x7fff325513c7]
    +                                                                                         8871 -[NSView setFrameSize:]  (in AppKit) + 1413  [0x7fff324bba73]
    +                                                                                           8871 -[NSView(NSInternal) _updateLayerGeometryFromView]  (in AppKit) + 755  [0x7fff324a307c]
    +                                                                                             8871 -[NSView setNeedsDisplay:]  (in AppKit) + 79  [0x7fff324775e1]
    +                                                                                               8871 -[NSTextView setNeedsDisplayInRect:]  (in AppKit) + 58  [0x7fff3256e563]
    +                                                                                                 8871 -[NSTextView setNeedsDisplayInRect:avoidAdditionalLayout:]  (in AppKit) + 1428  [0x7fff3254f41f]
    +                                                                                                   8871 -[NSLayoutManager glyphRangeForBoundingRect:inTextContainer:]  (in UIFoundation) + 81  [0x7fff5867c59f]
    +                                                                                                     8871 -[NSLayoutManager(NSPrivate) _glyphRangeForBoundingRect:inTextContainer:fast:okToFillHoles:]  (in UIFoundation) + 918  [0x7fff5867c93b]
    +                                                                                                       8871 -[NSLayoutManager(NSPrivate) _firstPassGlyphRangeForBoundingRect:inTextContainer:okToFillHoles:]  (in UIFoundation) + 1534  [0x7fff5867df5e]
    +                                                                                                         8871 _NSFastFillAllLayoutHolesForGlyphRange  (in UIFoundation) + 1615  [0x7fff5867eaee]
    +                                                                                                           8871 -[NSLayoutManager(NSPrivate) _fillLayoutHoleForCharacterRange:desiredNumberOfLines:isSoft:]  (in UIFoundation) + 722  [0x7fff58696846]
    +                                                                                                             8871 -[NSATSTypesetter layoutCharactersInRange:forLayoutManager:maximumNumberOfLineFragments:]  (in UIFoundation) + 580  [0x7fff5869828c]
    +                                                                                                               8871 -[NSTypesetter layoutCharactersInRange:forLayoutManager:maximumNumberOfLineFragments:]  (in UIFoundation) + 242  [0x7fff5869851a]
    +                                                                                                                 8871 -[NSTypesetter _layoutGlyphsInLayoutManager:startingAtGlyphIndex:maxNumberOfLineFragments:maxCharacterIndex:nextGlyphIndex:nextCharacterIndex:]  (in UIFoundation) + 2762  [0x7fff5873bc24]
    +                                                                                                                   8871 -[NSATSTypesetter layoutParagraphAtPoint:]  (in UIFoundation) + 181  [0x7fff58698ce9]
    +                                                                                                                     8871 -[NSATSTypesetter _layoutLineFragmentStartingWithGlyphAtIndex:characterIndex:atPoint:renderingContext:]  (in UIFoundation) + 7734  [0x7fff586854bc]
    +                                                                                                                       8871 -[NSTypesetter setLineFragmentRect:forGlyphRange:usedRect:baselineOffset:]  (in UIFoundation) + 276  [0x7fff5869aa67]
    +                                                                                                                         8871 -[NSLayoutManager(NSPrivate) setLineFragmentRect:forGlyphRange:usedRect:baselineOffset:]  (in UIFoundation) + 115  [0x7fff5869adb3]
    +                                                                                                                           8871 -[NSLayoutManager setLineFragmentRect:forGlyphRange:usedRect:]  (in UIFoundation) + 394  [0x7fff5869af5d]
    +                                                                                                                             8871 -[NSLayoutManager(NSPrivate) _updateUsageForTextContainer:addingUsedRect:]  (in UIFoundation) + 611  [0x7fff586709f7]
    +                                                                                                                               8871 -[NSLayoutManager(NSPrivate) _resizeTextViewForTextContainer:]  (in UIFoundation) + 938  [0x7fff58679dbc]
    +                                                                                                                                 8871 -[NSTextView setConstrainedFrameSize:]  (in AppKit) + 635  [0x7fff32550438]
    +                                                                                                                                   8871 -[NSTextView setFrameSize:]  (in AppKit) + 143  [0x7fff32550ec6]
    +                                                                                                                                     8871 -[NSTextView(NSPrivate) _setFrameSize:forceScroll:]  (in AppKit) + 1081  [0x7fff325513c7]
    +                                                                                                                                       8871 -[NSView setFrameSize:]  (in AppKit) + 2061  [0x7fff324bbcfb]
    +                                                                                                                                         8871 -[NSView _postFrameChangeNotification]  (in AppKit) + 83  [0x7fff324c16f8]
    +                                                                                                                                           8871 -[NSClipView _reflectDocumentViewFrameChange]  (in AppKit) + 692  [0x7fff3255769d]
    +                                                                                                                                             8871 __45-[NSClipView _reflectDocumentViewFrameChange]_block_invoke  (in AppKit) + 98  [0x7fff32943f3a]
    +                                                                                                                                               8871 -[NSScrollView reflectScrolledClipView:]  (in AppKit) + 892  [0x7fff324888a0]
    +                                                                                                                                                 8871 -[NSScrollView _tileWithoutRecursing]  (in AppKit) + 47  [0x7fff3247e8cb]
    +                                                                                                                                                   8871 -[NSScrollView tile]  (in AppKit) + 712  [0x7fff3247ec3d]
    +                                                                                                                                                     8871 -[NSScrollView _setContentViewFrame:]  (in AppKit) + 362  [0x7fff32480604]
    +                                                                                                                                                       8871 -[NSView setFrame:]  (in AppKit) + 371  [0x7fff324d1fae]
    +                                                                                                                                                         8871 -[NSClipView setFrameSize:]  (in AppKit) + 431  [0x7fff324e0179]
    +                                                                                                                                                           8871 -[NSView setFrameSize:]  (in AppKit) + 1672  [0x7fff324bbb76]
    +                                                                                                                                                             8871 -[NSView resizeSubviewsWithOldSize:]  (in AppKit) + 504  [0x7fff324dd345]
    +                                                                                                                                                               8871 -[NSView resizeWithOldSuperviewSize:]  (in AppKit) + 814  [0x7fff324ddb9a]
    +                                                                                                                                                                 8871 -[NSView setFrame:]  (in AppKit) + 371  [0x7fff324d1fae]
    +                                                                                                                                                                   8871 -[NSTextView setFrameSize:]  (in AppKit) + 143  [0x7fff32550ec6]
    +                                                                                                                                                                     8871 -[NSTextView(NSPrivate) _setFrameSize:forceScroll:]  (in AppKit) + 1278  [0x7fff3255148c]
    +                                                                                                                                                                       8871 -[NSLayoutManager boundingRectForGlyphRange:inTextContainer:]  (in UIFoundation) + 51  [0x7fff586a2211]
    +                                                                                                                                                                         8871 -[NSLayoutManager(NSPrivate) _boundingRectForGlyphRange:inTextContainer:fast:fullLineRectsOnly:]  (in UIFoundation) + 125  [0x7fff5869da30]
    +                                                                                                                                                                           8871 -[NSLayoutManager(NSPrivate) _rectArrayForRange:withinSelectionRange:rangeIsCharRange:singleRectOnly:fullLineRectsOnly:inTextContainer:rectCount:rangeWithinContainer:glyphsDrawOutsideLines:]  (in UIFoundation) + 59  [0x7fff587891bf]
    +                                                                                                                                                                             8871 -[NSLayoutManager(NSPrivate) _rectArrayForRange:withinSelectionRange:rangeIsCharRange:singleRectOnly:fullLineRectsOnly:inTextContainer:rectCount:rangeWithinContainer:glyphsDrawOutsideLines:rectArray:rectArrayCapacity:]  (in UIFoundation) + 749  [0x7fff58786f1d]
    +                                                                                                                                                                               8871 _NSFastFillAllLayoutHolesForGlyphRange  (in UIFoundation) + 1615  [0x7fff5867eaee]
    +                                                                                                                                                                                 8871 -[NSLayoutManager(NSPrivate) _fillLayoutHoleForCharacterRange:desiredNumberOfLines:isSoft:]  (in UIFoundation) + 722  [0x7fff58696846]
    +                                                                                                                                                                                   8871 -[NSATSTypesetter layoutCharactersInRange:forLayoutManager:maximumNumberOfLineFragments:]  (in UIFoundation) + 295  [0x7fff5869816f]
    +                                                                                                                                                                                     8871 -[NSATSTypesetter layoutCharactersInRange:forLayoutManager:maximumNumberOfLineFragments:]  (in UIFoundation) + 580  [0x7fff5869828c]
    +                                                                                                                                                                                       8871 -[NSTypesetter layoutCharactersInRange:forLayoutManager:maximumNumberOfLineFragments:]  (in UIFoundation) + 242  [0x7fff5869851a]
    +                                                                                                                                                                                         8871 -[NSTypesetter _layoutGlyphsInLayoutManager:startingAtGlyphIndex:maxNumberOfLineFragments:maxCharacterIndex:nextGlyphIndex:nextCharacterIndex:]  (in UIFoundation) + 2599  [0x7fff5873bb81]
    +                                                                                                                                                                                           8871 -[NSTypesetter _getRemainingNominalParagraphRange:andParagraphSeparatorRange:charactarIndex:layoutManager:string:]  (in UIFoundation) + 1320  [0x7fff58698aab]
    +                                                                                                                                                                                             8871 0x0
    +                                                                                                                                                                                               8871 _sigtramp  (in libsystem_platform.dylib) + 26  [0x7fff5ca4af5a]
    +                                                                                                                                                                                                 8871 sigactionSegv  (in libR.dylib) + 627  [0x1060e70e3]  main.c:612
    +                                                                                                                                                                                                   8871 Re_ReadConsole  (in R) + 184  [0x105ef85c8]
    +                                                                                                                                                                                                     8871 -[RController handleReadConsole:]  (in R) + 186  [0x105eeec6a]
    +                                                                                                                                                                                                       8871 -[RController doProcessEvents:]  (in R) + 204  [0x105ef4a4c]
    +                                                                                                                                                                                                         8871 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:]  (in AppKit) + 3044  [0x7fff32c2eb4c]
    +                                                                                                                                                                                                           8871 _DPSNextEvent  (in AppKit) + 2085  [0x7fff32498f5f]
    +                                                                                                                                                                                                             8871 _BlockUntilNextEventMatchingListInModeWithFilter  (in HIToolbox) + 64  [0x7fff341cd914]
    +                                                                                                                                                                                                               8871 ReceiveNextEventCommon  (in HIToolbox) + 613  [0x7fff341cdb96]
    +                                                                                                                                                                                                                 8871 RunCurrentEventLoopInMode  (in HIToolbox) + 286  [0x7fff341cde26]
    +                                                                                                                                                                                                                   8871 CFRunLoopRunSpecific  (in CoreFoundation) + 483  [0x7fff34eb5f43]
    +                                                                                                                                                                                                                     8871 __CFRunLoopRun  (in CoreFoundation) + 2427  [0x7fff34eb6b4b]
    +                                                                                                                                                                                                                       8871 __CFRunLoopDoTimers  (in CoreFoundation) + 346  [0x7fff34ebf54a]
    +                                                                                                                                                                                                                         8871 __CFRunLoopDoTimer  (in CoreFoundation) + 1095  [0x7fff34ebfa47]
    +                                                                                                                                                                                                                           8871 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__  (in CoreFoundation) + 20  [0x7fff34ebfdd4]
    +                                                                                                                                                                                                                             8871 __NSFireDelayedPerform  (in Foundation) + 409  [0x7fff36fea445]
    +                                                                                                                                                                                                                               8871 _NSFastFillAllLayoutHolesForGlyphRange  (in UIFoundation) + 1615  [0x7fff5867eaee]
    +                                                                                                                                                                                                                                 8871 -[NSLayoutManager(NSPrivate) _fillLayoutHoleForCharacterRange:desiredNumberOfLines:isSoft:]  (in UIFoundation) + 722  [0x7fff58696846]
    +                                                                                                                                                                                                                                   8871 -[NSATSTypesetter layoutCharactersInRange:forLayoutManager:maximumNumberOfLineFragments:]  (in UIFoundation) + 295  [0x7fff5869816f]
    +                                                                                                                                                                                                                                     8871 -[NSATSTypesetter layoutCharactersInRange:forLayoutManager:maximumNumberOfLineFragments:]  (in UIFoundation) + 580  [0x7fff5869828c]
    +                                                                                                                                                                                                                                       8871 -[NSTypesetter layoutCharactersInRange:forLayoutManager:maximumNumberOfLineFragments:]  (in UIFoundation) + 242  [0x7fff5869851a]
    +                                                                                                                                                                                                                                         8871 -[NSTypesetter _layoutGlyphsInLayoutManager:startingAtGlyphIndex:maxNumberOfLineFragments:maxCharacterIndex:nextGlyphIndex:nextCharacterIndex:]  (in UIFoundation) + 2599  [0x7fff5873bb81]
    +                                                                                                                                                                                                                                           8871 -[NSTypesetter _getRemainingNominalParagraphRange:andParagraphSeparatorRange:charactarIndex:layoutManager:string:]  (in UIFoundation) + 1320  [0x7fff58698aab]
    +                                                                                                                                                                                                                                             8871 -[RScriptEditorTypeSetter actionForControlCharacterAtIndex:]  (in R) + 47  [0x105f56c2f]
    +                                                                                                                                                                                                                                               8871 0x0 + 0  [0x0]

Cheers,
-B.

Benjamin C. Haller
Messer Lab
Cornell University



More information about the R-SIG-Mac mailing list