Question: 'CoreStore was compiled with optimization' -- a crash #58

Closed
opened 2025-12-29 15:23:18 +01:00 by adam · 2 comments
Owner

Originally created by @wm-j-ray on GitHub (May 18, 2016).

I must be doing something wrong. After I get successful stack creation I am trying to insert a record and I am getting the following error and a crash:

CoreStore was compiled with optimization - stepping may behave oddly; variables may not be available

I'm not sure what this error means or what I'm doing wrong. Any help would be appreciated and thanks in advance

The offending line is 67 in BaseDataTransaction.swift and here is my complete code.

        let dataStack = DataStack(modelName: "crashyApp")
    do {
        try dataStack.addSQLiteStoreAndWait(
            fileName: "crashyApp.sqlite",
            configuration: nil,
            resetStoreOnModelMismatch: true)
        print("Successfully created store")

    }
    catch {
        print("Failed creating store with error: \(error as NSError)")
    }


    dataStack.beginAsynchronous { (transaction) -> Void in
        let aNote = transaction.create(Into(NoteMO))
        aNote.content = "Note Five"
        aNote.dateCreated = NSDate()
        aNote.identifier = NSUUID().UUIDString



        transaction.commit { (result) -> Void in
            switch result {
            case .Success(let hasChanges): print("success!")
            case .Failure(let error): print(error)
            }
        }
    }
Originally created by @wm-j-ray on GitHub (May 18, 2016). I must be doing something wrong. After I get successful stack creation I am trying to insert a record and I am getting the following error and a crash: ``` CoreStore was compiled with optimization - stepping may behave oddly; variables may not be available ``` I'm not sure what this error means or what I'm doing wrong. Any help would be appreciated and thanks in advance The offending line is 67 in BaseDataTransaction.swift and here is my complete code. ``` let dataStack = DataStack(modelName: "crashyApp") do { try dataStack.addSQLiteStoreAndWait( fileName: "crashyApp.sqlite", configuration: nil, resetStoreOnModelMismatch: true) print("Successfully created store") } catch { print("Failed creating store with error: \(error as NSError)") } dataStack.beginAsynchronous { (transaction) -> Void in let aNote = transaction.create(Into(NoteMO)) aNote.content = "Note Five" aNote.dateCreated = NSDate() aNote.identifier = NSUUID().UUIDString transaction.commit { (result) -> Void in switch result { case .Success(let hasChanges): print("success!") case .Failure(let error): print(error) } } } ```
adam added the question label 2025-12-29 15:23:18 +01:00
adam closed this issue 2025-12-29 15:23:18 +01:00
Author
Owner

@JohnEstropia commented on GitHub (May 19, 2016):

This has nothing to do with CoreStore, or your code for that matter. This is a problem that sometimes happen when you put a breakpoint in Xcode but the debugger can't read variable (for the debugger) due to optimizations. See http://stackoverflow.com/questions/32772573/project-name-was-compiled-with-optimization-stepping-may-behave-oddly-varia

The crash is just Xcode crashing, not your app.

@JohnEstropia commented on GitHub (May 19, 2016): This has nothing to do with CoreStore, or your code for that matter. This is a problem that sometimes happen when you put a breakpoint in Xcode but the debugger can't read variable (for the debugger) due to optimizations. See http://stackoverflow.com/questions/32772573/project-name-was-compiled-with-optimization-stepping-may-behave-oddly-varia The crash is just Xcode crashing, not your app.
Author
Owner

@wm-j-ray commented on GitHub (May 19, 2016):

Thanks John.
And thanks for all the hard work on CoreStore.

On May 19, 2016, 9:03 AM -0400, John Estropianotifications@github.com, wrote:

This has nothing to do with CoreStore, or your code for that matter. This is a problem that sometimes happen when you put a breakpoint in Xcode but the debugger can't read variable (for the debugger) due to optimizations. Seehttp://stackoverflow.com/questions/32772573/project-name-was-compiled-with-optimization-stepping-may-behave-oddly-varia

The crash is just Xcode crashing, not your app.


You are receiving this because you authored the thread.
Reply to this email directly orview it on GitHub(https://github.com/JohnEstropia/CoreStore/issues/70#issuecomment-220317471)

@wm-j-ray commented on GitHub (May 19, 2016): Thanks John. And thanks for all the hard work on CoreStore. On May 19, 2016, 9:03 AM -0400, John Estropianotifications@github.com, wrote: > This has nothing to do with CoreStore, or your code for that matter. This is a problem that sometimes happen when you put a breakpoint in Xcode but the debugger can't read variable (for the debugger) due to optimizations. Seehttp://stackoverflow.com/questions/32772573/project-name-was-compiled-with-optimization-stepping-may-behave-oddly-varia > > The crash is just Xcode crashing, not your app. > > — > You are receiving this because you authored the thread. > Reply to this email directly orview it on GitHub(https://github.com/JohnEstropia/CoreStore/issues/70#issuecomment-220317471)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/CoreStore#58