*** -[NSCFString substringWithRange:]: Range index out of bounds crashes xcode

Discussion in 'Mac Programming' started by vladimir929, Feb 7, 2009.

  1. macrumors newbie

    Joined:
    Oct 22, 2008
    #1
    I was writing an Applescript Studio Application in Xcode when I got this error, it displayed a dialog box saying "*** -[NSCFString substringWithRange:]: Range index out of bounds crashes xcode" Then Xcode would hang for a couple seconds then crash. I am wondering if anyone knows how to fix this or what is wrong. Thank You.

    Here are the Console Logs:

    2/7/09 9:22:50 PM Xcode[468] ** INTERNAL ERROR: Uncaught Exception **
    Exception: *** -[NSCFString substringWithRange:]: Range or index out of bounds
    Stack:
    0 0x90dd910b __raiseError (in CoreFoundation)
    1 0x90890e3b objc_exception_throw (in libobjc.A.dylib)
    2 0x90dd8eeb +[NSException raise:format:arguments:] (in CoreFoundation)
    3 0x90dd8f2a +[NSException raise:format:] (in CoreFoundation)
    4 0x9339a65d -[NSCFString substringWithRange:] (in Foundation)
    5 0x0a5908e0 -[OSAScriptParser getStringUntilEndOfLineFromBuffer:] (in OSAKit)
    6 0x0a592088 -[OSAScriptParser parseUnknownUntilEndOfLineInBuffer:] (in OSAKit)
    7 0x0a590c61 -[OSAScriptParser parseBuffer:forToken:] (in OSAKit)
    8 0x0a592c42 -[OSAScriptParser parseBuffer:] (in OSAKit)
    9 0x0a592328 -[OSAScriptParser parse] (in OSAKit)
    10 0x0a390cff
    11 0x00c919ee -[PBXMethodsList parse] (in DevToolsInterface)
    12 0x00c91e32 -[PBXMethodsList list] (in DevToolsInterface)
    13 0x00bc7d4d -[PBXTextFileDocument methodsList] (in DevToolsInterface)
    14 0x00b4c1b3 -[PBXFileNavigator lineBrowser:numberOfRowsInColumn:] (in DevToolsInterface)
    15 0x00b4c12e -[PBXLineBrowser _askDataSourceForNumberOfRowsInColumn:] (in DevToolsInterface)
    16 0x00b4bf8d -[PBXLineBrowser _reloadData] (in DevToolsInterface)
    17 0x00b4ba63 -[PBXLineBrowser _tile] (in DevToolsInterface)
    18 0x93394e1a _nsnote_callback (in Foundation)
    19 0x90d408da __CFXNotificationPost (in CoreFoundation)
    20 0x90d40bb3 _CFXNotificationPostNotification (in CoreFoundation)
    21 0x93392080 -[NSNotificationCenter postNotificationName:eek:bject:userInfo:] (in Foundation)
    22 0x9339b8c8 -[NSNotificationCenter postNotificationName:eek:bject:] (in Foundation)
    23 0x95a34c2a -[NSWindow update] (in AppKit)
    24 0x95a33bc4 -[NSWindow _reallyDoOrderWindow:relativeTo:findKey:forCounter:force:isModal:] (in AppKit)
    25 0x95a33700 -[NSWindow orderWindow:relativeTo:] (in AppKit)
    26 0x959fb092 -[NSWindow makeKeyAndOrderFront:] (in AppKit)
    27 0x00ad8fe7 -[PBXModule showModule:] (in DevToolsInterface)
    28 0x00b4951f -[PBXFileNavigator becomeActive] (in DevToolsInterface)
    29 0x00b4947d -[PBXNavigatorGroup _navigatorDidLoadFileDocument:] (in DevToolsInterface)
    30 0x93394e1a _nsnote_callback (in Foundation)
    31 0x90d408da __CFXNotificationPost (in CoreFoundation)
    32 0x90d40bb3 _CFXNotificationPostNotification (in CoreFoundation)
    33 0x93392080 -[NSNotificationCenter postNotificationName:eek:bject:userInfo:] (in Foundation)
    34 0x00b3dbc0 -[PBXFileNavigator _replaceBookmark:restoreSelection:] (in DevToolsInterface)
    35 0x00b2bed4 -[PBXFileNavigator _windowUpdated:] (in DevToolsInterface)
    36 0x93394e1a _nsnote_callback (in Foundation)
    37 0x90d408da __CFXNotificationPost (in CoreFoundation)
    38 0x90d40bb3 _CFXNotificationPostNotification (in CoreFoundation)
    39 0x93392080 -[NSNotificationCenter postNotificationName:eek:bject:userInfo:] (in Foundation)
    40 0x9339b8c8 -[NSNotificationCenter postNotificationName:eek:bject:] (in Foundation)
    41 0x95a34c2a -[NSWindow update] (in AppKit)
    42 0x95a33bc4 -[NSWindow _reallyDoOrderWindow:relativeTo:findKey:forCounter:force:isModal:] (in AppKit)
    43 0x95a33700 -[NSWindow orderWindow:relativeTo:] (in AppKit)
    44 0x959fb092 -[NSWindow makeKeyAndOrderFront:] (in AppKit)
    45 0x00b27079 -[PBXWindowController showWindow:] (in DevToolsInterface)
    46 0x00b3beac +[PBXNavigatorGroup makeNewSeparateNavigatorWithGroup:focusedOnBookmark:projectDocument:usePinning:] (in DevToolsInterface)
    47 0x00b3b654 +[PBXNavigatorGroup makeNewSeparateNavigatorWithGroup:focusedOnBookmark:projectDocument:] (in DevToolsInterface)
    48 0x00b36c47 -[PBXProjectDocument performAction:withSelection:] (in DevToolsInterface)
    49 0x00b359ce -[PBXFileTableDataSource simulateDoubleClickAction:] (in DevToolsInterface)
    50 0x95a4753b -[NSApplication sendAction:to:from:] (in AppKit)
    51 0x95a47478 -[NSControl sendAction:to:] (in AppKit)
    52 0x95a8f477 -[NSTableView _sendAction:to:row:column:] (in AppKit)
    53 0x95a8d7e1 -[NSTableView mouseDown:] (in AppKit)
    54 0x00b34c62 -[PBXExtendedTableView mouseDown:] (in DevToolsInterface)
    55 0x95a441a3 -[NSWindow sendEvent:] (in AppKit)
    56 0x00b32199 -[XCWindow sendEvent:] (in DevToolsInterface)
    57 0x95a10d49 -[NSApplication sendEvent:] (in AppKit)
    58 0x00ad759c -[PBXExtendedApplication sendEvent:] (in DevToolsInterface)
    59 0x9596e69f -[NSApplication run] (in AppKit)
    60 0x9593b8a4 NSApplicationMain (in AppKit)

    Also :
    2/7/09 9:22:59 PM Xcode[468] ** INTERNAL ERROR: Uncaught Exception **
    Exception: *** -[NSCFString substringWithRange:]: Range or index out of bounds
    Stack:
    0 0x90dd910b __raiseError (in CoreFoundation)
    1 0x90890e3b objc_exception_throw (in libobjc.A.dylib)
    2 0x90dd8eeb +[NSException raise:format:arguments:] (in CoreFoundation)
    3 0x90dd8f2a +[NSException raise:format:] (in CoreFoundation)
    4 0x9339a65d -[NSCFString substringWithRange:] (in Foundation)
    5 0x0a5908e0 -[OSAScriptParser getStringUntilEndOfLineFromBuffer:] (in OSAKit)
    6 0x0a592088 -[OSAScriptParser parseUnknownUntilEndOfLineInBuffer:] (in OSAKit)
    7 0x0a590c61 -[OSAScriptParser parseBuffer:forToken:] (in OSAKit)
    8 0x0a592c42 -[OSAScriptParser parseBuffer:] (in OSAKit)
    9 0x0a592328 -[OSAScriptParser parse] (in OSAKit)
    10 0x0a390cff
    11 0x00c919ee -[PBXMethodsList parse] (in DevToolsInterface)
    12 0x00c91c61 -[PBXMethodsList methodAtLocation:includeAll:ensureUpToDate:] (in DevToolsInterface)
    13 0x00b9d8b5 -[PBXTextStorage methodAtLocation:includeAll:] (in DevToolsInterface)
    14 0x00b9d959 -[PBXTextStorage methodAtLocation:] (in DevToolsInterface)
    15 0x00bc806e -[PBXTextFileDocument methodAtLocation:] (in DevToolsInterface)
    16 0x00b54dae -[PBXFileNavigator editorSelectionDidChange] (in DevToolsInterface)
    17 0x00bcef4f -[PBXTextFileEditor textViewDidChangeSelection:] (in DevToolsInterface)
    18 0x93394e1a _nsnote_callback (in Foundation)
    19 0x90d408da __CFXNotificationPost (in CoreFoundation)
    20 0x90d40bb3 _CFXNotificationPostNotification (in CoreFoundation)
    21 0x93392080 -[NSNotificationCenter postNotificationName:eek:bject:userInfo:] (in Foundation)
    22 0x95ac6c10 -[NSTextView(NSSharing) setSelectedRanges:affinity:stillSelecting:] (in AppKit)
    23 0x00bd6c10 -[PBXTextView setSelectedRanges:affinity:stillSelecting:] (in DevToolsInterface)
    24 0x95ac5b50 -[NSTextView(NSSharing) setSelectedRange:] (in AppKit)
    25 0x00bd1c61 -[PBXTextView setSelectedRange:] (in DevToolsInterface)
    26 0x00b48c6a -[PBXTextFileEditor setSelectionFromBookmark:] (in DevToolsInterface)
    27 0x00b3f1b4 -[PBXFileNavigator _updateEditorWithCurrentBookmark] (in DevToolsInterface)
    28 0x00b3dab2 -[PBXFileNavigator _replaceBookmark:restoreSelection:] (in DevToolsInterface)
    29 0x00b3d35f -[PBXFileNavigator replaceBookmark:restoreSelection:] (in DevToolsInterface)
    30 0x00b69328 -[PBXFileNavigator replaceBookmark:becomeActive:] (in DevToolsInterface)
    31 0x00b692e5 -[PBXFileNavigator replaceBookmark:] (in DevToolsInterface)
    32 0x00b3b553 +[PBXNavigatorGroup separateNavigatorWithBookmark:createIfNeeded:projectDocument:] (in DevToolsInterface)
    33 0x00b3b41a +[PBXNavigatorGroup separateNavigatorWithBookmark:createIfNeeded:] (in DevToolsInterface)
    34 0x00b36bcb -[PBXProjectDocument performAction:withSelection:] (in DevToolsInterface)
    35 0x00b359ce -[PBXFileTableDataSource simulateDoubleClickAction:] (in DevToolsInterface)
    36 0x95a4753b -[NSApplication sendAction:to:from:] (in AppKit)
    37 0x95a47478 -[NSControl sendAction:to:] (in AppKit)
    38 0x95a8f477 -[NSTableView _sendAction:to:row:column:] (in AppKit)
    39 0x95a8d7e1 -[NSTableView mouseDown:] (in AppKit)
    40 0x00b34c62 -[PBXExtendedTableView mouseDown:] (in DevToolsInterface)
    41 0x95a441a3 -[NSWindow sendEvent:] (in AppKit)
    42 0x00b32199 -[XCWindow sendEvent:] (in DevToolsInterface)
    43 0x95a10d49 -[NSApplication sendEvent:] (in AppKit)
    44 0x00ad759c -[PBXExtendedApplication sendEvent:] (in DevToolsInterface)
    45 0x9596e69f -[NSApplication run] (in AppKit)
    46 0x9593b8a4 NSApplicationMain (in AppKit)
     
  2. Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
    #2
    What's your code doing when this happens? Can you post some parts of it?
     

Share This Page