LLVM 4.2 bug: crash on 10.6.8 in loop iteration

Originator:aglee
Number:rdar://13253340 Date Originated:2013-02-20
Status: Resolved:
Product:Developer Tools Product Version:Xcode (4H127)
Classification:Serious Bug Reproducible:Always
 
20-Feb-2013 11:17 AM Andrew Lee:
Summary:

Using Xcode 4.6, I can create a trivial Mac app that crashes when a fast enumeration is attempted.

Steps to Reproduce:

* In Xcode 4.6, create a new Cocoa Application project.
* Change the Deployment Target to 10.6.
* Put the following code in applicationDidFinishLaunching:.

    NSArray *array = [[NSArray alloc] init];
    for (NSString *string in array)
    {
        return;
    }

* Build the app.
* Copy the app to a Mac running 10.6.8 and launch it.

Expected Results:

The app should display an empty window and do nothing else until you quit.

Actual Results:

It crashes immediately.

Regression:

Notes:

Crash log attached.

This seems to be a bug introduced in the Apple LLVM 4.2 compiler. The crash doesn't occur when the app is built with LLVM GCC 4.2 or (in Xcode 4.5.2) with Apple LLVM 4.1.


20-Feb-2013 11:17 AM Andrew Lee:
'OddCrash.txt' 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!