-
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
Crash when query executed in background #1077
Comments
This sounds like it might be an |
Just tried to remove passcode from the same iphone5s and reproduce the issue. And it didn't! So you're right it's something related with file protection. |
@jpsim Any plans to fix this issue? |
I haven't been able to reproduce the issue. For example, this code works fine on my locked iOS 8 device: - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[application registerUserNotificationSettings:[UIUserNotificationSettings settingsForTypes:UIUserNotificationTypeAlert categories:nil]];
[[RLMRealm defaultRealm] transactionWithBlock:^{
[DemoObject createInDefaultRealmWithObject:@[@"Hello from Realm!"]];
}];
UILocalNotification *localNotif = [[UILocalNotification alloc] init];
localNotif.fireDate = [NSDate dateWithTimeIntervalSinceNow:10];
localNotif.alertBody = @"Hello!";
[[UIApplication sharedApplication] scheduleLocalNotification:localNotif];
return YES;
}
- (void)application:(UIApplication *)app didReceiveLocalNotification:(UILocalNotification *)notif {
NSLog(@"Recieved Notification %@",notif);
NSLog(@"all realm objects: %@", [DemoObject allObjects]);
} |
@jpsim I can't understand why I can't reproduce this issue on a synthetic app/test but it looks like this issue related with memory corruption or leak because I constantly get EXC_BAD_ACCESS in RLMResultsValidateAttached: |
Is there any chance you could send us your project privately? It would help troubleshoot this issue. help@realm.io. |
Hi @kronik, were you ever able to reproduce this issue outside your project? Could you try sending us your project privately so we can identify and fix the issue? You can send it to us at help@realm.io. Thanks! |
Closing since we were never able to reproduce and have yet to receive sufficient troubleshooting information from @kronik. |
I have the same issue that realm crash when handle push notification in background .. |
@frankcjw if your phone is locked when this happens, please refer to my answer in #1260 (comment). If the phone is unlocked, then that's possibly a bug in Realm and we'd really appreciate a sample Xcode project that we can run to reproduce the issue. Thanks! |
I get the same issue. Totally works on simulator, crashes on device |
@Fab1n have you tried setting the realm file's parent directory to use
|
I found the "bug". My fault, used a file from the bundle with file protection... And then realm cannot alter the file. Should be as expected. Sorry for the inconvenience |
is there a way we can have a better error message around this? |
OK, still there is an issue. I cannot open the file on device from bundle in readonly mode. The FilePermission exception is not catched but instead the last catch statement (exception ex). |
@Fab1n could you send us a project that reproduces this issue? You should definitely be able to open a readonly realm file in your app bundle. |
Sorry for this late answer. I managed to open the realm from the bundles folder in readonly mode. No problem here with Realm!!! It was my own issue!!! |
Hi!
My app is crashing almost every time (about 90% cases) when the app (voip) is running in background and later is trying to handle push notification. It executes a query to select all object of particular type. Crash:
Error Domain=io.realm Code=1 "open() failed: Operation not permitted" UserInfo=0x170a62340 {NSLocalizedDescription=open() failed: Operation not permitted, Error Code=1}
iOS8, iPhone5S, Locked with passcode. This issue doesn't happen on iOS7 Locked WITHOUT passcode.
The text was updated successfully, but these errors were encountered: