Xcode 10 beta 7 - Playground crashes when deleting characters

Hello,


Xcode 10 beta 7 (and beta 6 was the same) crashes almost everytime I edit a Playground and delete code. For example, with a newly created Playground:


import UIKit
var str = "Hello, playground"


if I remove the last quote Xcode will *always* crash. The details of the crash are always the same, something like this:


Crashed Thread:        0  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_BAD_INSTRUCTION (SIGILL)
Exception Codes:       0x0000000000000001, 0x0000000000000000
Exception Note:        EXC_CORPSE_NOTIFY

Termination Signal:    Illegal instruction: 4
Termination Reason:    Namespace SIGNAL, Code 0x4
Terminating Process:   exc handler [0]


Application Specific Information:
ProductBuildVersion: 10L232m


Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   com.apple.dt.SourceEditor     0x000000011d8f37c4 $S12SourceEditor0ab4DataA0C30internalCharOffsetFromPositionySiAA0abH0VFTf4xn_n + 1204
1   com.apple.dt.SourceEditor     0x000000011d93f6a4 $S12SourceEditor35CursorTextAttributeOverrideProvider33_F4E0FDEBDAE4300D9964F2BC65F79097LLC04textE16OverridesForLine_2inSayAA0abdeF0VGSi_AA0aB13LayoutManagerCtF + 1028

Currently I fail to see what is "special" about my configuration. What I've tried:

  1. Reinstalling Xcode;
  2. Removed the DerivedData;
  3. Rebooting;


Nothing seems to work

Replies

Wow... I found how to make it work/fail.

I had configured a theme with a "Block cursor". If I pick a "Vertical Bar Cursor" the problem goes away.


I hope people with the same problem find this post. I will file a Radar.

Radar 43247461

I'm facing the same problem with xcode 10 (not beta) and mac OS Mojave. It was working fine, but with no reason it beguns to crash.


I'm configured it to run on manual mode, but even so it keep crashing all the time. Bellow is part of the problem report. Every time I got a crash, the report seems to be the same.


Process:               Xcode [1034]
Path:                  /Applications/Xcode.app/Contents/MacOS/Xcode
Identifier:            com.apple.dt.Xcode
Version:               10.0 (14320.25)
Build Info:            IDEFrameworks_Fall2018-14320025000000000~2
App Item ID:           497799835
App External ID:       828536089
Code Type:             X86-64 (Native)
Parent Process:        ??? [1]
Responsible:           Xcode [1034]
User ID:               501


Date/Time:             2018-10-03 02:17:12.502 -0300
OS Version:            Mac OS X 10.14 (18A391)
Report Version:        12
Anonymous UUID:        FCF52753-A822-8AB2-0220-AD93DC8E9374




Time Awake Since Boot: 3200 seconds


System Integrity Protection: enabled


Crashed Thread:        0  Dispatch queue: com.apple.main-thread


Exception Type:        EXC_BAD_INSTRUCTION (SIGILL)
Exception Codes:       0x0000000000000001, 0x0000000000000000
Exception Note:        EXC_CORPSE_NOTIFY


Termination Signal:    Illegal instruction: 4
Termination Reason:    Namespace SIGNAL, Code 0x4
Terminating Process:   exc handler [1034]


Application Specific Information:
ProductBuildVersion: 10A255
Crashing on exception: *** -[__NSCFString rangeOfCharacterFromSet:options:range:]: Range {0, 3353} out of bounds; string length 3342


Application Specific Backtrace 1:
0   CoreFoundation                      0x00007fff35d7e571 __exceptionPreprocess + 256
1   DVTFoundation                       0x0000000109384f71 DVTFailureHintExceptionPreprocessor + 274
2   libobjc.A.dylib                     0x00007fff61d2fefb objc_exception_throw + 48
3   CoreFoundation                      0x00007fff35d7e3a3 +[NSException raise:format:] + 193
4   Foundation                          0x00007fff3807d2e1 -[NSString rangeOfCharacterFromSet:options:range:] + 171
5   IDEPegasusPlaygroundEditor          0x0000000124cef079

OMG, I have the same problem with Xcode 11 beta 7 on Mojave 10.14.6, and I JUST SET MY CURSOR TO BLOCK CURSOR. If this is the problem, and if "Vertical Bar Cursor" is the solution, I will report back. Several people are experiencing this problem in Sept. 2019.

A Block Cursor was not the problem. I reset it back to Vertical Bar Cursor, and still have hangs in .playgrounds upon saving. All The Time. Xcode 11 beta 7 on Mojave 10.14.6.