Xcode - My app crash and the error is “Invalid pointer dequeued from free list *** set a breakpoint in malloc_error_break to debug”

前端 未结 3 1374
深忆病人
深忆病人 2021-01-01 20:36

My app runs perfect on simulator. But when I run it on device the app crash and display error :

\"malloc: * error for object 0x17415d0c0: Inva

相关标签:
3条回答
  • 2021-01-01 21:06

    Just fixed this same issue with Xcode 8. Preparing an iOS10 compatible build, updated to recommended Swift Migration 2.3, runs perfectly on iOS9 and iOS10 but crashes on iOS8.4. I reverted the changes in the code and the Main.storyboard and built the same content on the iOS8 with Xcode 7.3 fixed my issues.

    0 讨论(0)
  • 2021-01-01 21:08

    I've fixed this error with Xcode 8 on iOS 8.3. I've just changed Deployment Target from 8.3 to 8.0. If the error appears now after migration to Xcode 8 and your device works under control iOS 8 it may be temporary decision.

    UPD: Xcode 8.1 beta is fixed this error.

    0 讨论(0)
  • 2021-01-01 21:23

    I met this strange error too, I google it and people said it is Swift's bug, hasn't been fixed. I debug line by line, find out the solution.

    The reason this error appears

    In EditRecordVC I have generic type function func update<RO>(operation: RO) where RO : RealmOperation, RO.R == EditRecordVC.R

    In its subclass ConflictedRecordEditVC, I override the function, I input update, and Xcode helps me finishing the whole function override func update<RO>(record: Record?, operation: RO?) where RO : RealmOperation, RO.R == Record, compile well.

    Run the code, after the overridden function is executed, this error will appear, the Xcode will stop at some random line, nobody can find out it is caused by this function.

    I debug line by line, find out I have to change the generic type to override func update<RO>(operation: RO) where RO : RealmOperation, RO.R == Record, everything will work well again.

    I forget when I added the ? by mistake and Xcode isn't angry.

    So check you generic type function and make sure it is exactly same with super class

    0 讨论(0)
提交回复
热议问题