-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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 refreshing in background #773
Comments
Hi Martin, |
Are you seeing this in both Debug and Release builds? |
I do have problems to create a simple test application to really demonstrate the issue, but I've figured out that in the app I'm working on: If I comment out the dispatch_async parts below it won't crash => it doesn't crash when it's writing changes on the main thread.
|
Adding backtrace. [And simply commenting out dealloc part for _sharedGroup in RLMRealm.mm will stop crashes as well.]
|
I've been trying to reproduce this without success. Do you have more details regarding what else you are doing which could be causing the issue? |
Are you still having this issue on master? We have made some changes to this part of the code base which may have an effect on the issue assuming you are still having it. One thing you could try is to set |
Apologies for the delay in response. I'll test over the weekend and let you know the results. |
I think we finally have a way to reproduce this issue with XCode6/Swift although we still haven't isolated the cause. One way to work around the issue is to not hold onto any RLMRealm instances or RLMObject instances obtained in a background queue and to add an autorelease block around your dispatched code. This prevents refresh from being called on a background Realm and avoids the issue altogether. |
Hi, Just finished with testing using the latest code and:
Thanks, |
Hi,
Crashing everytime I lock the iPhone's screen.
Let me know if you need more details.
Here is the stack trace:
Thread 1
Queue : com.apple.main-thread (serial)
#0 0x000000010060170c in tightdb::util::Atomic::load_relaxed() const at /Users/tightdb/workspace/core_osx/tightdb/src/tightdb/../tightdb/util/thread.hpp:756
#1 0x00000001006018ec in tightdb::util::Atomic::load_acquire() const at /Users/tightdb/workspace/core_osx/tightdb/src/tightdb/../tightdb/util/thread.hpp:730
#2 0x00000001005fe768 in (anonymous namespace)::Ringbuffer::last() const at /Users/tightdb/workspace/core_osx/tightdb/src/tightdb/group_shared.cpp:261
#3 0x00000001005fe4e8 in tightdb::SharedGroup::get_current_version() at /Users/tightdb/workspace/core_osx/tightdb/src/tightdb/group_shared.cpp:1372
#4 0x00000001005fe484 in tightdb::SharedGroup::has_changed() at /Users/tightdb/workspace/core_osx/tightdb/src/tightdb/group_shared.cpp:866
#5 0x00000001003f5600 in -[RLMRealm refresh] at /Users/lexam/Development/iOS/realm-cocoa/Realm/RLMRealm.mm:527
#6 0x00000001003f2794 in -[RLMWeakTarget checkForUpdate] at /Users/lexam/Development/iOS/realm-cocoa/Realm/RLMRealm.mm:92
#7 0x00000001842515c4 in __NSFireTimer ()
#8 0x000000018368f704 in CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION ()
#9 0x000000018368f374 in __CFRunLoopDoTimer ()
#10 0x000000018368d09c in __CFRunLoopRun ()
#11 0x00000001835cddd0 in CFRunLoopRunSpecific ()
#12 0x00000001892b5c0c in GSEventRunModal ()
#13 0x00000001866fefc4 in UIApplicationMain ()
#14 0x00000001000c6158 in top_level_code at /Users/lexam/Development/TestApp/AppDelegate.swift:13
#15 0x00000001000c6198 in main ()
#16 0x00000001901cbaa0 in start ()
Thanks,
Martin
The text was updated successfully, but these errors were encountered: