Bug 15351 - the Rgui editor crashes occasionally when editing
Summary: the Rgui editor crashes occasionally when editing
Status: ASSIGNED
Alias: None
Product: R
Classification: Unclassified
Component: Mac GUI / Mac specific (show other bugs)
Version: R 3.0.0
Hardware: x86_64/x64/amd64 (64-bit) Mac OS X v10.7
: P5 normal
Assignee: Simon Urbanek
URL:
Depends on:
Blocks:
 
Reported: 2013-06-24 15:39 UTC by sam.mason
Modified: 2013-09-30 14:10 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description sam.mason 2013-06-24 15:39:10 UTC
Hi,
I've not got any reliable way of reproducing this, but after half an hour to an hour of editing/running code/plotting the editor tends to hang (infinite loop?) and stop responding.  The only way to get back again is by killing the process and trying again.
I've noticed that it tends to do it when I hit "undo" (from the keyboard if that helps!) but can't be any more helpful than that.
I've got a 10.8 laptop that appears to do the same, but I can't say if it's actually hanging in the same place, but it appears to.  I've noticed this behaviour since maybe 2.15, and have been hoping somebody would fix it before...
If there's a good way to get debug info when it's hung please let me know, as I'm not sure what would be useful for you.  Would attaching gdb to the process and sending the output of "bt"?
Thanks,
  Sam
Comment 1 Simon Urbanek 2013-06-24 15:58:24 UTC
Yes, stack trace would be great. You could also continue and stop it again to see if it's hanging in the same place. In addition, please provide sessionInfo() and exact version of you OS.
Comment 2 sam.mason 2013-06-24 16:15:06 UTC
Hi Simon,
Yes, I was planning on getting a few stack traces to see what sort of loop it went around.  Not sure where to get debug symbols from, so you'll only get function names—at least that's all I can see when I stop it in the main event loop.

My current sessionInfo() is:

R version 3.0.1 (2013-05-16)
Platform: x86_64-apple-darwin10.8.0 (64-bit)

locale:
[1] en_GB.UTF-8/en_GB.UTF-8/en_GB.UTF-8/C/en_GB.UTF-8/en_GB.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

how would I get this again when it's stuck in the loop?

I'm running 10.7.5, but given that I also see it with 10.8.4 and have been observing similar symptoms (but of course may be a different underlying cause) since the start of the 2.15 series of R for a few months now I think it's unlikely to be triggered by a specific OS version.  Good to rule it out though!

  Sam
Comment 3 sam.mason 2013-06-27 15:43:28 UTC
Hi,
Just had R crash again for me.  Had been editing and pressed undo, and it locked up again.  I've got a backtrace from gdb, when I continued, it immediately crashed as indicated by the output of gdb below.

Hope this helps!

(gdb) bt
#0  0x0000000000000000 in ?? ()
#1  0x0000000100067963 in -[RScriptEditorTypeSetter actionForControlCharacterAtIndex:] ()
#2  0x00007fff97556a87 in -[NSTypesetter _layoutGlyphsInLayoutManager:startingAtGlyphIndex:maxNumberOfLineFragments:maxCharacterIndex:nextGlyphIndex:nextCharacterIndex:] ()
#3  0x00007fff9708facd in -[NSTypesetter layoutGlyphsInLayoutManager:startingAtGlyphIndex:maxNumberOfLineFragments:nextGlyphIndex:] ()
#4  0x00007fff9708f9e4 in -[NSATSTypesetter layoutGlyphsInLayoutManager:startingAtGlyphIndex:maxNumberOfLineFragments:nextGlyphIndex:] ()
#5  0x00007fff9708f8d5 in -[NSATSTypesetter layoutGlyphsInLayoutManager:startingAtGlyphIndex:maxNumberOfLineFragments:nextGlyphIndex:] ()
#6  0x00007fff96f8ba1b in -[NSLayoutManager(NSPrivate) _recalculateUsageForTextContainerAtIndex:] ()
#7  0x00007fff96f99eb8 in -[NSLayoutManager(NSPrivate) _validatedStoredUsageForTextContainerAtIndex:] ()
#8  0x00007fff96f99e2c in -[NSLayoutManager usedRectForTextContainer:] ()
#9  0x00007fff97095b15 in -[NSTextView textContainerOrigin] ()
#10 0x00007fff970abc32 in -[NSTextView drawRect:] ()
#11 0x0000000100044b23 in -[RTextView drawRect:] ()
#12 0x00000001000532af in -[RScriptEditorTextView drawRect:] ()
#13 0x00007fff970ab852 in -[NSTextView _drawRect:clip:] ()
#14 0x00007fff96f3006d in -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] ()
#15 0x00007fff96f30b5e in -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] ()
#16 0x00007fff96f30b5e in -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] ()
#17 0x00007fff96f30b5e in -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] ()
#18 0x00007fff96f30b5e in -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] ()
#19 0x00007fff96f2eda3 in -[NSThemeFrame _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] ()
#20 0x00007fff96f2a1bb in -[NSView _displayRectIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:] ()
#21 0x00007fff96f22c35 in -[NSView displayIfNeeded] ()
#22 0x00007fff96f22375 in _handleWindowNeedsDisplayOrLayoutOrUpdateConstraints ()
#23 0x00007fff95d458e7 in __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ ()
#24 0x00007fff95d45846 in __CFRunLoopDoObservers ()
#25 0x00007fff95d1aaf9 in __CFRunLoopRun ()
#26 0x00007fff95d1a486 in CFRunLoopRunSpecific ()
#27 0x00007fff980e22bf in RunCurrentEventLoopInMode ()
#28 0x00007fff980e94bf in ReceiveNextEventCommon ()
#29 0x00007fff980e93fa in BlockUntilNextEventMatchingListInMode ()
#30 0x00007fff96ee6779 in _DPSNextEvent ()
#31 0x00007fff96ee607d in -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] ()
#32 0x0000000100005f1c in -[RController doProcessEvents:] ()
#33 0x000000010000bc28 in -[RController handleReadConsole:] ()
#34 0x0000000100012bde in Re_ReadConsole ()
#35 0x00000001001d753d in sigactionSegv (signum=90718528, ip=0x100319988, context=0xffffffffffffffff) at main.c:585
#36 <signal handler called>
#37 0x0000000000000000 in ?? ()
#38 0x0000000100067963 in -[RScriptEditorTypeSetter actionForControlCharacterAtIndex:] ()
#39 0x00007fff97556a87 in -[NSTypesetter _layoutGlyphsInLayoutManager:startingAtGlyphIndex:maxNumberOfLineFragments:maxCharacterIndex:nextGlyphIndex:nextCharacterIndex:] ()
#40 0x00007fff9708facd in -[NSTypesetter layoutGlyphsInLayoutManager:startingAtGlyphIndex:maxNumberOfLineFragments:nextGlyphIndex:] ()
#41 0x00007fff9708f9e4 in -[NSATSTypesetter layoutGlyphsInLayoutManager:startingAtGlyphIndex:maxNumberOfLineFragments:nextGlyphIndex:] ()
#42 0x00007fff9708f8d5 in -[NSATSTypesetter layoutGlyphsInLayoutManager:startingAtGlyphIndex:maxNumberOfLineFragments:nextGlyphIndex:] ()
#43 0x00007fff96f8ba1b in -[NSLayoutManager(NSPrivate) _recalculateUsageForTextContainerAtIndex:] ()
#44 0x00007fff96f99eb8 in -[NSLayoutManager(NSPrivate) _validatedStoredUsageForTextContainerAtIndex:] ()
#45 0x00007fff96f99e2c in -[NSLayoutManager usedRectForTextContainer:] ()
#46 0x00007fff97095b15 in -[NSTextView textContainerOrigin] ()
#47 0x00007fff96f98db1 in -[NSLayoutManager _primitiveInvalidateDisplayForGlyphRange:] ()
#48 0x00007fff96f98832 in -[NSLayoutManager invalidateDisplayForCharacterRange:] ()
#49 0x00007fff96f98951 in -[NSLayoutManager(NSPrivate) _invalidateDisplayIfNeeded] ()
#50 0x00007fff96f8d7b8 in -[NSLayoutManager textContainerForGlyphAtIndex:effectiveRange:] ()
#51 0x00007fff97556748 in -[NSTypesetter _layoutGlyphsInLayoutManager:startingAtGlyphIndex:maxNumberOfLineFragments:maxCharacterIndex:nextGlyphIndex:nextCharacterIndex:] ()
#52 0x00007fff9708facd in -[NSTypesetter layoutGlyphsInLayoutManager:startingAtGlyphIndex:maxNumberOfLineFragments:nextGlyphIndex:] ()
#53 0x00007fff9708f9e4 in -[NSATSTypesetter layoutGlyphsInLayoutManager:startingAtGlyphIndex:maxNumberOfLineFragments:nextGlyphIndex:] ()
#54 0x00007fff96f90999 in -[NSLayoutManager(NSPrivate) _fillLayoutHoleForCharacterRange:desiredNumberOfLines:isSoft:] ()
#55 0x00007fff96f9ddba in _NSFastFillAllLayoutHolesForGlyphRange ()
#56 0x00007fff97096f4c in -[NSLayoutManager(NSPrivate) _firstPassGlyphRangeForBoundingRect:inTextContainer:okToFillHoles:] ()
#57 0x00007fff970960ee in -[NSLayoutManager(NSPrivate) _glyphRangeForBoundingRect:inTextContainer:fast:okToFillHoles:] ()
#58 0x00007fff97095e0f in -[NSLayoutManager glyphRangeForBoundingRect:inTextContainer:] ()
#59 0x00007fff970953e4 in -[NSTextView setNeedsDisplayInRect:avoidAdditionalLayout:] ()
#60 0x00007fff97094e2c in -[NSTextView setNeedsDisplayInRect:] ()
#61 0x00007fff974ddfbf in -[NSTextView drawInsertionPointInRect:color:turnedOn:] ()
#62 0x00007fff9750d7c0 in -[NSTextView(NSPrivate) _blinkCaret:] ()
#63 0x00007fff97094920 in -[NSTextView(NSSharing) updateInsertionPointStateAndRestartTimer:] ()
#64 0x00007fff9709c166 in -[NSTextView(NSSharing) setSelectedRanges:affinity:stillSelecting:] ()
#65 0x00007fff974b960b in -[NSUndoTyping undoRedo:] ()
#66 0x00007fff94078ddb in -[_NSUndoLightInvocation invoke] ()
#67 0x00007fff94079022 in -[_NSUndoStack popAndInvoke] ()
#68 0x00007fff9407a747 in -[NSUndoManager undoNestedGroup] ()
#69 0x00000001000520c0 in -[RScriptEditorTextView undo:] ()
#70 0x00007fff95d7570d in -[NSObject performSelector:withObject:] ()
#71 0x00007fff96fe98ca in -[NSApplication sendAction:to:from:] ()
#72 0x00007fff970d67ff in -[NSMenuItem _corePerformAction] ()
#73 0x00007fff970d6536 in -[NSCarbonMenuImpl performActionWithHighlightingForItemAtIndex:] ()
#74 0x00007fff970540d4 in -[NSMenu performKeyEquivalent:] ()
#75 0x00007fff97052d25 in -[NSApplication _handleKeyEquivalent:] ()
#76 0x00007fff96f4be86 in -[NSApplication sendEvent:] ()
#77 0x0000000100005f35 in -[RController doProcessEvents:] ()
#78 0x000000010000bc28 in -[RController handleReadConsole:] ()
#79 0x0000000100012bde in Re_ReadConsole ()
#80 0x00000001001d833d in R_ReplDLLdo1 () at main.c:338
#81 0x000000010001f1f3 in run_REngineRmainloop ()
#82 0x00000001000138fc in -[REngine runREPL] ()
#83 0x0000000100001cde in main ()
(gdb)

(gdb) c
Continuing.

Program received signal SIGSTOP, Stopped (signal).
0x0000000000000000 in ?? ()
(gdb)
Continuing.

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x0000000000000000
0x0000000000000000 in ?? ()
(gdb) bt
#0  0x0000000000000000 in ?? ()
#1  0x0000000100067963 in -[RScriptEditorTypeSetter actionForControlCharacterAtIndex:] ()
#2  0x00007fff97556a87 in -[NSTypesetter _layoutGlyphsInLayoutManager:startingAtGlyphIndex:maxNumberOfLineFragments:maxCharacterIndex:nextGlyphIndex:nextCharacterIndex:] ()
#3  0x00007fff9708facd in -[NSTypesetter layoutGlyphsInLayoutManager:startingAtGlyphIndex:maxNumberOfLineFragments:nextGlyphIndex:] ()
#4  0x00007fff9708f9e4 in -[NSATSTypesetter layoutGlyphsInLayoutManager:startingAtGlyphIndex:maxNumberOfLineFragments:nextGlyphIndex:] ()
#5  0x00007fff9708f8d5 in -[NSATSTypesetter layoutGlyphsInLayoutManager:startingAtGlyphIndex:maxNumberOfLineFragments:nextGlyphIndex:] ()
#6  0x00007fff96f8ba1b in -[NSLayoutManager(NSPrivate) _recalculateUsageForTextContainerAtIndex:] ()
#7  0x00007fff96f99eb8 in -[NSLayoutManager(NSPrivate) _validatedStoredUsageForTextContainerAtIndex:] ()
#8  0x00007fff96f99e2c in -[NSLayoutManager usedRectForTextContainer:] ()
#9  0x00007fff97095b15 in -[NSTextView textContainerOrigin] ()
#10 0x00007fff970abc32 in -[NSTextView drawRect:] ()
#11 0x0000000100044b23 in -[RTextView drawRect:] ()
#12 0x00000001000532af in -[RScriptEditorTextView drawRect:] ()
#13 0x00007fff970ab852 in -[NSTextView _drawRect:clip:] ()
#14 0x00007fff96f3006d in -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] ()
#15 0x00007fff96f30b5e in -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] ()
#16 0x00007fff96f30b5e in -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] ()
#17 0x00007fff96f30b5e in -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] ()
#18 0x00007fff96f30b5e in -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] ()
#19 0x00007fff96f2eda3 in -[NSThemeFrame _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] ()
#20 0x00007fff96f2a1bb in -[NSView _displayRectIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:] ()
#21 0x00007fff96f22c35 in -[NSView displayIfNeeded] ()
#22 0x00007fff96f22375 in _handleWindowNeedsDisplayOrLayoutOrUpdateConstraints ()
#23 0x00007fff95d458e7 in __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ ()
#24 0x00007fff95d45846 in __CFRunLoopDoObservers ()
#25 0x00007fff95d1aaf9 in __CFRunLoopRun ()
#26 0x00007fff95d1a486 in CFRunLoopRunSpecific ()
#27 0x00007fff980e22bf in RunCurrentEventLoopInMode ()
#28 0x00007fff980e94bf in ReceiveNextEventCommon ()
#29 0x00007fff980e93fa in BlockUntilNextEventMatchingListInMode ()
#30 0x00007fff96ee6779 in _DPSNextEvent ()
#31 0x00007fff96ee607d in -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] ()
#32 0x0000000100005f1c in -[RController doProcessEvents:] ()
#33 0x000000010000bc28 in -[RController handleReadConsole:] ()
#34 0x0000000100012bde in Re_ReadConsole ()
#35 0x00000001001d753d in sigactionSegv (signum=90718528, ip=0x100319988, context=0xffffffffffffffff) at main.c:585
#36 <signal handler called>
#37 0x0000000000000000 in ?? ()
#38 0x0000000100067963 in -[RScriptEditorTypeSetter actionForControlCharacterAtIndex:] ()
#39 0x00007fff97556a87 in -[NSTypesetter _layoutGlyphsInLayoutManager:startingAtGlyphIndex:maxNumberOfLineFragments:maxCharacterIndex:nextGlyphIndex:nextCharacterIndex:] ()
#40 0x00007fff9708facd in -[NSTypesetter layoutGlyphsInLayoutManager:startingAtGlyphIndex:maxNumberOfLineFragments:nextGlyphIndex:] ()
#41 0x00007fff9708f9e4 in -[NSATSTypesetter layoutGlyphsInLayoutManager:startingAtGlyphIndex:maxNumberOfLineFragments:nextGlyphIndex:] ()
#42 0x00007fff9708f8d5 in -[NSATSTypesetter layoutGlyphsInLayoutManager:startingAtGlyphIndex:maxNumberOfLineFragments:nextGlyphIndex:] ()
#43 0x00007fff96f8ba1b in -[NSLayoutManager(NSPrivate) _recalculateUsageForTextContainerAtIndex:] ()
#44 0x00007fff96f99eb8 in -[NSLayoutManager(NSPrivate) _validatedStoredUsageForTextContainerAtIndex:] ()
#45 0x00007fff96f99e2c in -[NSLayoutManager usedRectForTextContainer:] ()
#46 0x00007fff97095b15 in -[NSTextView textContainerOrigin] ()
#47 0x00007fff96f98db1 in -[NSLayoutManager _primitiveInvalidateDisplayForGlyphRange:] ()
#48 0x00007fff96f98832 in -[NSLayoutManager invalidateDisplayForCharacterRange:] ()
#49 0x00007fff96f98951 in -[NSLayoutManager(NSPrivate) _invalidateDisplayIfNeeded] ()
#50 0x00007fff96f8d7b8 in -[NSLayoutManager textContainerForGlyphAtIndex:effectiveRange:] ()
#51 0x00007fff97556748 in -[NSTypesetter _layoutGlyphsInLayoutManager:startingAtGlyphIndex:maxNumberOfLineFragments:maxCharacterIndex:nextGlyphIndex:nextCharacterIndex:] ()
#52 0x00007fff9708facd in -[NSTypesetter layoutGlyphsInLayoutManager:startingAtGlyphIndex:maxNumberOfLineFragments:nextGlyphIndex:] ()
#53 0x00007fff9708f9e4 in -[NSATSTypesetter layoutGlyphsInLayoutManager:startingAtGlyphIndex:maxNumberOfLineFragments:nextGlyphIndex:] ()
#54 0x00007fff96f90999 in -[NSLayoutManager(NSPrivate) _fillLayoutHoleForCharacterRange:desiredNumberOfLines:isSoft:] ()
#55 0x00007fff96f9ddba in _NSFastFillAllLayoutHolesForGlyphRange ()
#56 0x00007fff97096f4c in -[NSLayoutManager(NSPrivate) _firstPassGlyphRangeForBoundingRect:inTextContainer:okToFillHoles:] ()
#57 0x00007fff970960ee in -[NSLayoutManager(NSPrivate) _glyphRangeForBoundingRect:inTextContainer:fast:okToFillHoles:] ()
#58 0x00007fff97095e0f in -[NSLayoutManager glyphRangeForBoundingRect:inTextContainer:] ()
#59 0x00007fff970953e4 in -[NSTextView setNeedsDisplayInRect:avoidAdditionalLayout:] ()
#60 0x00007fff97094e2c in -[NSTextView setNeedsDisplayInRect:] ()
#61 0x00007fff974ddfbf in -[NSTextView drawInsertionPointInRect:color:turnedOn:] ()
#62 0x00007fff9750d7c0 in -[NSTextView(NSPrivate) _blinkCaret:] ()
#63 0x00007fff97094920 in -[NSTextView(NSSharing) updateInsertionPointStateAndRestartTimer:] ()
#64 0x00007fff9709c166 in -[NSTextView(NSSharing) setSelectedRanges:affinity:stillSelecting:] ()
#65 0x00007fff974b960b in -[NSUndoTyping undoRedo:] ()
#66 0x00007fff94078ddb in -[_NSUndoLightInvocation invoke] ()
#67 0x00007fff94079022 in -[_NSUndoStack popAndInvoke] ()
#68 0x00007fff9407a747 in -[NSUndoManager undoNestedGroup] ()
#69 0x00000001000520c0 in -[RScriptEditorTextView undo:] ()
#70 0x00007fff95d7570d in -[NSObject performSelector:withObject:] ()
#71 0x00007fff96fe98ca in -[NSApplication sendAction:to:from:] ()
#72 0x00007fff970d67ff in -[NSMenuItem _corePerformAction] ()
#73 0x00007fff970d6536 in -[NSCarbonMenuImpl performActionWithHighlightingForItemAtIndex:] ()
#74 0x00007fff970540d4 in -[NSMenu performKeyEquivalent:] ()
#75 0x00007fff97052d25 in -[NSApplication _handleKeyEquivalent:] ()
#76 0x00007fff96f4be86 in -[NSApplication sendEvent:] ()
#77 0x0000000100005f35 in -[RController doProcessEvents:] ()
#78 0x000000010000bc28 in -[RController handleReadConsole:] ()
#79 0x0000000100012bde in Re_ReadConsole ()
#80 0x00000001001d833d in R_ReplDLLdo1 () at main.c:338
#81 0x000000010001f1f3 in run_REngineRmainloop ()
#82 0x00000001000138fc in -[REngine runREPL] ()
#83 0x0000000100001cde in main ()
(gdb)
Comment 4 sam.mason 2013-09-30 14:10:12 UTC
I've just updated to 3.0.2 and am still getting a similar crash in [RScriptEditorTypeSetter actionForControlCharacterAtIndex].