Closed Turacbey closed 2 years ago
Based on the error you have, it probably means the main thread tries to access a variable that has been freed or deallocated.
Prehaps you could try to test and run your application in Xcode with the Thread Sanitizer
option checked. (Edit Scheme -> Run -> Diagnostics : Thread Sanitizer)
Also, do you know if this happens when there is a memory warning from the watchOS watchdog?
It might help you figure out what's going on.
Based on the error you have, it probably means the main thread tries to access a variable that has been freed or deallocated.
Prehaps you could try to test and run your application in Xcode with the
Thread Sanitizer
option checked. (Edit Scheme -> Run -> Diagnostics : Thread Sanitizer)Also, do you know if this happens when there is a memory warning from the watchOS watchdog?
It might help you figure out what's going on.
Hello, nothing found with Thread Sanitizer.
This issue only occurs on watch 3 series with real device. I couldn't catch any error with simulator. I don't have a watch 3 series, so I can't do a deep test.
@TheLuckyWan
By the way, the function is called like this way;
on MYStaticClass;
init(){
fetchFromRealm(key: "abc", value: [array]())
fetchFromRealm(key: "123", value: [array2]())
fetchFromRealm(key: "xyz", value: [array3]())
}
Hi @Turacbey, Thanks for sharing some info about this issue. As mentioned by @TheLuckyWan it looks like the thread is trying to access an object that has been already deallocated. Because the issue happens only in a real device and you don't have access to it, maybe we can't try with the simulator and reproduce this issue. Can you please force a memory warning during test on simulator and see if you get the crash. You can do this on the debug menu -> Simulate Memory Warning
Hi @Turacbey, Thanks for sharing some info about this issue. As mentioned by @TheLuckyWan it looks like the thread is trying to access an object that has been already deallocated. Because the issue happens only in a real device and you don't have access to it, maybe we can't try with the simulator and reproduce this issue. Can you please force a memory warning during test on simulator and see if you get the crash. You can do this on the debug menu -> Simulate Memory Warning
Hello @dianaafanador3. Thank you for your answer. I tried running the app simulating memory warning but I couldn't get any crash. If you have any other suggestions, I would love to listen.
Hi @Turacbey, Can you share the project with us?, we can try to reproduce this issue in one of our devices, you can send it to diana.perez@mongodb.com.
Hi @Turacbey, Can you share the project with us?, we can try to reproduce this issue in one of our devices, you can send it to diana.perez@mongodb.com.
Hello @dianaafanador3, I am sorry, but the project belongs to our company and I can't share everything for now.
The app is live on the App Store and I can send you the link and maybe you can try debugging it on your devices. If the above option doesn't work then I can create a new project for you with the crash part.
Hi @Turacbey, that will be great, we just want a way to be able to reproduce the issue
Hello @dianaafanador3,
I sent you the project.
Thanks @Turacbey we'll take a look at it.
Thanks @dianaafanador3
@Turacbey I'm trying to debug this on a Watch Series 2 with not much luck. Would you be able to tell us how big the Realm file is that causes the crash? I'm wondering if this is related to the Series 3 being 32bit and having limited address space.
@leemaguire The crash happens only on watch series 3. There is no any crash from series se, series 5 or series 6 etc.
I don't know how big is the realm file, but it can not too big. I added some buttons that add items to arrays, I guess it is not bigger than 1000 items on each array.
Can you able to test it on watch series 3?
@Turacbey unfortunately I do not have a Watch Series 3 to test with.
We will be waiting for someone who has watch series 3.
@Turacbey have you been able to solve this with the latest version of Realm? We require more information to proceed with an investigation as we do not possess a Watch Series 3.
Hi @leemaguire! I switched to CoreData over 7 months ago and changed my data structure long after that (not error related). So for now there is no possibility to try it again with the latest version.
Ok- given that information I'll go ahead and close the issue.
On Watch devices, users are facing with crash issues sometimes.
WatchOS version: 7.1 and up (haven't seen any of below OS 7.1) Affected devices: Watch series 3 Used Realm versions: v10.7.4
I'm sharing crash report and function called fetchFromRealm with you.
Crash report;
fetchFromRealm function; (Function executed on main thread)
How is the function called? MYStaticClass;