-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Swift 4 & Xcode 9] Unexpected Crash When Presenting View Controller #5026
Comments
The exception is being thrown on your main thread. The Realm notification listener thread is sitting idle, and isn't relevant to what you're seeing. Can you please share the backtrace of your main thread at the point the exception is thrown? |
Ahh, makes sense. The stack trace doesn't really give me anything I understand but here it is
Just puts a breakpoint with class AppDelegate: UIResponder, UIApplicationDelegate { And prints this to console
If you'd like to take a look at the project yourself you can clone it here: https://github.com/luispadron/GradePoint, in the I thought it might have been a Realm issue due to the fact I was getting Swift errors after updating, however, Realm 2.8.1 has fixed these errors but still getting this odd crash. I've put a breakpoint on every method in the class but can't seem to find where it is actually crashing |
Can you set an exception breakpoint in Xcode and then re-run your application? |
That backtrace indicates that an uncaught Objective-C exception is making it to the main runloop. Adding an exception breakpoint in Xcode for Objective-C exceptions should help you track down where the exception is thrown, and let you inspect the exception object. |
Yeah, I've tried catching all exceptions before posting the issue, but it just completely ignores this and throws at Not sure what else could be going on, I've even checked all interface builder connections and they're all fine and connected (no missing/broken connections) which usually causes these types of crashes. Here are my breakpoints if you guys were curious: Well, if this doesn't seem like a Realm error to you guys feel free to close the issue. Again, I thought it might have had something to do with Realm due to some breaking Swift 4/Xcode 9 stuff. |
The first backtrace you shared in your initial report appears to show your app stopped at the point that the Objective-C exception was thrown. |
I was able to print the reason using LLDB
However still confused about what this even is haha. This doesn't seem to be a Realm issue so I'll go ahead and close the issue now and try to figure out what's going on without wasting your time. I'll update if I find a solution, thanks for all the help! |
Just updating this issue in case anyone wanders upon it. I was assigning a |
@luispadron Thanks, I had this problem and was really confused what was causing this crash, it was NSAttributedString that screwed me over too. |
In which file we need to change UIColor instance to a UIFont via an NSAttributedString. |
Goals
Present view controller and load Realm without crashing
Expected Results
Expected normal operation like what was previously working with Xcode 8.x and Swift 3.1
Actual Results
Unexpected crash with no error message.
All Error & Swift Error
Breakpoints do not seem to catch the crash either.Stacktrace:
![screen shot 2017-06-12 at 6 12 19 pm](https://user-images.githubusercontent.com/13840545/27057585-c6f89280-4f9a-11e7-9203-3833dbdb8515.png)
Following the first event in
RLMNotification
stack trace, the error line seems to be thisSecond line in stack trace points to this:
Steps to Reproduce
Clone the project at: https://github.com/luispadron/GradePoint
When using Xcode 9 Beta 1 switch to the
features/ios11
branch, run through the intro screens, and click on theAdd new class
or the+
button.Code Sample
I believe the issue is caused when instantiating a Realm instance.
Inside the
AddEditClassViewController.swift
file of my project there is this lineAnother oddity is when removing the above line Xcode 9 Beta 1 Refuses to compile with error
Command failed due to signal: Segmentation fault: 11
The log reveals this:
This is strange but it might just be a bug in Xcode 9 and radar should be filed.
Version of Realm and Tooling
Realm framework version: 2.8.1
Realm Object Server version: n/a
Xcode version: Xcode 9 Beta 1
iOS/OSX version: Target iOS 9, ran on iOS 11 simulator.
Dependency manager + version: CocoaPods 1.3.0.beta.1
The text was updated successfully, but these errors were encountered: