NSLinguisticTagger is crashing hard as soon as you feed it a ‘\r’. So the string @"\r Test" will end up in EXC_BAD_ACCESS.

Originator:steipete
Number:rdar://16837973 Date Originated:May 7 2014
Status:Open Resolved:
Product:iOS SDK Product Version:
Classification:Crash Reproducible:Always
 
Summary:
NSLinguisticTagger is crashing hard as soon as you feed it a ‘\r’. So the string @"\r Test" will end up in EXC_BAD_ACCESS.

Steps to Reproduce:
See example project. Run and it crashes instantly.

    // This crashes with an EXC_BAD_ACCESS, code 1, 0xfffffff4.
    // Looks like it can't deal with control characters like \r.
    NSLinguisticTagger *tagger = [[NSLinguisticTagger alloc] initWithTagSchemes:@[NSLinguisticTagSchemeLanguage] options:0];
    tagger.string = @"\r Test";
    [tagger tagAtIndex:0 scheme:NSLinguisticTagSchemeLanguage tokenRange:NULL sentenceRange:NULL];

Expected Results:
No crash.

Actual Results:
Crash.

Version:
7.1

Notes:


Configuration:
Tested on iOS 7.1 Simulator

Attachments:
'Archive.zip' was successfully uploaded.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!