SIGSEGV when using Realm to store heavy data on a thread
Hello, I encountered : A/libc﹕ Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1), this error when I tried to store a complex RealmObject on a thread. I then tried storing a very simple test object and it worked fine. Actully this error does not occur always. Most of the times when I finally finish committing my transaction, the auto-refresh of my realListener does not get called. In fact after running this operation none of the real listeners work no matter what.
My runnable that stores results :
private final Runnable findAndAddFriends = new Runnable() {
.
.
final List
} // end of runnable
if instead of running the above operation I create and store a simple object everything runs fine and even my listeners are triggered.
My RealmObject that gives trouble has : 5 strings 5 longs 4 realmLists of realmObjects, these realm objects have 3 strings and a realList of a realmObject which has 9 strings.
I finally gave up and ran the realm part of the code on UI thread (onPostExecute) and everything worked fine. This is weird.
Im sorry its mostly that SIGSEGV error, not the other way around
Hello and thanks for the report!
Is the result the same if you make one big transaction (outside the for loop) instead of many small ones? It's surely more efficient since opening and closing write transactions has of course an overhead.
Yes, I actully did that because I thought memory was being over used due do holding an un-commited transaction (desperate attempt). Its same both ways. UPDATE : doing my opeartion on an IntentService works perfectly fine
That sounds odd. Is there any way for you to share your code, even in a private way? That would speed up the investigation considerably of course.
Ok i will try to port this into a sample application. Meanwhile, I ran a simple test.
@Override
protected List
Realm realm = Realm.getInstance(getActivity()); realm.beginTransaction();for(int i=0; i < 100; i++) { RealmTest realmTest = realm.createObject(RealmTest.class); realmTest.setHelp("GGGG"); } realm.commitTransaction(); realm.close(); } // end of doInBackground
This did not call my RealmChangeListeners. But if I iterate 10 times it does. The bound seems to be 70.
Sorry for the trouble. I made a new application with just the basic functionality of storing my data and displaying it in a list. It works perfectly fine. Everything. I must have messed up the integration in my main app. Closing the issue.