Skip to content
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

Fatal signal 11 (SIGSEGV), code 2, fault addr #3194

Closed
kevinpiske opened this issue Sep 4, 2020 · 8 comments · Fixed by realm/realm-core#3899
Closed

Fatal signal 11 (SIGSEGV), code 2, fault addr #3194

kevinpiske opened this issue Sep 4, 2020 · 8 comments · Fixed by realm/realm-core#3899
Assignees

Comments

@kevinpiske
Copy link

kevinpiske commented Sep 4, 2020

Goals

Insert large amount of data.

Expected Results

No crash.

Actual Results

The app crashs after the last Realm.write.

2020-09-04 11:30:38.575 27010-27049/com.auditoriaqualirede A/libc: Fatal signal 11 (SIGSEGV), code 2, fault addr 0x8e344fcc in tid 27049 (mqt_js)
2020-09-04 11:30:38.637 27112-27112/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
2020-09-04 11:30:38.637 27112-27112/? A/DEBUG: Build fingerprint: 'google/sdk_google_phone_x86/generic_x86:7.1.1/NYC/6400748:userdebug/test-keys'
2020-09-04 11:30:38.637 27112-27112/? A/DEBUG: Revision: '0'
2020-09-04 11:30:38.637 27112-27112/? A/DEBUG: ABI: 'x86'
2020-09-04 11:30:38.637 27112-27112/? A/DEBUG: pid: 27010, tid: 27049, name: mqt_js  >>> com.auditoriaqualirede <<<
2020-09-04 11:30:38.637 27112-27112/? A/DEBUG: signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 0x8e344fcc
2020-09-04 11:30:38.637 27112-27112/? A/DEBUG:     eax 90a27200  ebx ae6777b8  ecx 8f439884  edx 8f619260
2020-09-04 11:30:38.637 27112-27112/? A/DEBUG:     esi ae681268  edi 8f439884
2020-09-04 11:30:38.637 27112-27112/? A/DEBUG:     xcs 00000073  xds 0000007b  xes 0000007b  xfs 0000003b  xss 0000007b
2020-09-04 11:30:38.637 27112-27112/? A/DEBUG:     eip ae643b5e  ebp 8e345018  esp 8e344fd0  flags 00010282
2020-09-04 11:30:38.641 27112-27112/? A/DEBUG: backtrace:
2020-09-04 11:30:38.641 27112-27112/? A/DEBUG:     #00 pc 000a4b5e  /system/lib/libc.so (ifree+14)
2020-09-04 11:30:38.641 27112-27112/? A/DEBUG:     #01 pc 000a517a  /system/lib/libc.so (je_free+122)
2020-09-04 11:30:38.641 27112-27112/? A/DEBUG:     #02 pc 000145aa  /system/lib/libc.so (free+42)
2020-09-04 11:30:38.641 27112-27112/? A/DEBUG:     #03 pc 009ebcd0  /data/app/com.auditoriaqualirede-1/lib/x86/librealmreact.so (_ZdlPv+32)
2020-09-04 11:30:38.641 27112-27112/? A/DEBUG:     #04 pc 000c3179  /data/app/com.auditoriaqualirede-1/lib/x86/librealmreact.so
2020-09-04 11:30:38.641 27112-27112/? A/DEBUG:     #05 pc 000c3141  /data/app/com.auditoriaqualirede-1/lib/x86/librealmreact.so
2020-09-04 11:30:38.641 27112-27112/? A/DEBUG:     #06 pc 000c3100  /data/app/com.auditoriaqualirede-1/lib/x86/librealmreact.so
2020-09-04 11:30:38.641 27112-27112/? A/DEBUG:     #07 pc 000c30ad  /data/app/com.auditoriaqualirede-1/lib/x86/librealmreact.so
2020-09-04 11:30:38.641 27112-27112/? A/DEBUG:     #08 pc 000c303d  /data/app/com.auditoriaqualirede-1/lib/x86/librealmreact.so
2020-09-04 11:30:38.641 27112-27112/? A/DEBUG:     #09 pc 000c2b0d  /data/app/com.auditoriaqualirede-1/lib/x86/librealmreact.so
2020-09-04 11:30:38.641 27112-27112/? A/DEBUG:     #10 pc 000cfe9a  /data/app/com.auditoriaqualirede-1/lib/x86/librealmreact.so
2020-09-04 11:30:38.641 27112-27112/? A/DEBUG:     #11 pc 00101e77  /data/app/com.auditoriaqualirede-1/lib/x86/librealmreact.so
2020-09-04 11:30:38.641 27112-27112/? A/DEBUG:     #12 pc 00101c6a  /data/app/com.auditoriaqualirede-1/lib/x86/librealmreact.so
2020-09-04 11:30:38.641 27112-27112/? A/DEBUG:     #13 pc 000fe76c  /data/app/com.auditoriaqualirede-1/lib/x86/librealmreact.so
2020-09-04 11:30:38.641 27112-27112/? A/DEBUG:     #14 pc 00615751  /data/app/com.auditoriaqualirede-1/lib/x86/librealmreact.so
2020-09-04 11:30:38.641 27112-27112/? A/DEBUG:     #15 pc 006152cc  /data/app/com.auditoriaqualirede-1/lib/x86/librealmreact.so
2020-09-04 11:30:38.641 27112-27112/? A/DEBUG:     #16 pc 00615217  /data/app/com.auditoriaqualirede-1/lib/x86/librealmreact.so
2020-09-04 11:30:38.641 27112-27112/? A/DEBUG:     #17 pc 0061674e  /data/app/com.auditoriaqualirede-1/lib/x86/librealmreact.so
2020-09-04 11:30:38.641 27112-27112/? A/DEBUG:     #18 pc 006166df  /data/app/com.auditoriaqualirede-1/lib/x86/librealmreact.so
2020-09-04 11:30:38.641 27112-27112/? A/DEBUG:     #19 pc 00616687  /data/app/com.auditoriaqualirede-1/lib/x86/librealmreact.so
2020-09-04 11:30:38.641 27112-27112/? A/DEBUG:     #20 pc 00616619  /data/app/com.auditoriaqualirede-1/lib/x86/librealmreact.so
2020-09-04 11:30:38.641 27112-27112/? A/DEBUG:     #21 pc 006150a8  /data/app/com.auditoriaqualirede-1/lib/x86/librealmreact.so
2020-09-04 11:30:38.642 27112-27112/? A/DEBUG:     #22 pc 00614f8b  /data/app/com.auditoriaqualirede-1/lib/x86/librealmreact.so
2020-09-04 11:30:38.642 27112-27112/? A/DEBUG:     #23 pc 0061c44c  /data/app/com.auditoriaqualirede-1/lib/x86/librealmreact.so
2020-09-04 11:30:38.642 27112-27112/? A/DEBUG:     #24 pc 0061c375  /data/app/com.auditoriaqualirede-1/lib/x86/librealmreact.so
2020-09-04 11:30:38.642 27112-27112/? A/DEBUG:     #25 pc 0061c31f  /data/app/com.auditoriaqualirede-1/lib/x86/librealmreact.so
2020-09-04 11:30:38.642 27112-27112/? A/DEBUG:     #26 pc 0061c2ed  /data/app/com.auditoriaqualirede-1/lib/x86/librealmreact.so
2020-09-04 11:30:38.642 27112-27112/? A/DEBUG:     #27 pc 0061c2bf  /data/app/com.auditoriaqualirede-1/lib/x86/librealmreact.so
2020-09-04 11:30:38.642 27112-27112/? A/DEBUG:     #28 pc 00609cd9  /data/app/com.auditoriaqualirede-1/lib/x86/librealmreact.so
2020-09-04 11:30:38.642 27112-27112/? A/DEBUG:     #29 pc 00609c59  /data/app/com.auditoriaqualirede-1/lib/x86/librealmreact.so
2020-09-04 11:30:38.642 27112-27112/? A/DEBUG:     #30 pc 00609b08  /data/app/com.auditoriaqualirede-1/lib/x86/librealmreact.so
2020-09-04 11:30:38.642 27112-27112/? A/DEBUG:     #31 pc 00609ac5  /data/app/com.auditoriaqualirede-1/lib/x86/librealmreact.so
2020-09-04 11:30:38.642 27112-27112/? A/DEBUG:     #32 pc 00609a97  /data/app/com.auditoriaqualirede-1/lib/x86/librealmreact.so
2020-09-04 11:30:38.642 27112-27112/? A/DEBUG:     #33 pc 006097d1  /data/app/com.auditoriaqualirede-1/lib/x86/librealmreact.so
2020-09-04 11:30:38.642 27112-27112/? A/DEBUG:     #34 pc 00609795  /data/app/com.auditoriaqualirede-1/lib/x86/librealmreact.so
2020-09-04 11:30:38.642 27112-27112/? A/DEBUG:     #35 pc 00609767  /data/app/com.auditoriaqualirede-1/lib/x86/librealmreact.so
2020-09-04 11:30:38.642 27112-27112/? A/DEBUG:     #36 pc 00609723  /data/app/com.auditoriaqualirede-1/lib/x86/librealmreact.so
2020-09-04 11:30:38.642 27112-27112/? A/DEBUG:     #37 pc 006096f1  /data/app/com.auditoriaqualirede-1/lib/x86/librealmreact.so
2020-09-04 11:30:38.642 27112-27112/? A/DEBUG:     #38 pc 006096c3  /data/app/com.auditoriaqualirede-1/lib/x86/librealmreact.so
2020-09-04 11:30:38.642 27112-27112/? A/DEBUG:     #39 pc 0060967f  /data/app/com.auditoriaqualirede-1/lib/x86/librealmreact.so
2020-09-04 11:30:38.642 27112-27112/? A/DEBUG:     #40 pc 0060964d  /data/app/com.auditoriaqualirede-1/lib/x86/librealmreact.so
2020-09-04 11:30:38.642 27112-27112/? A/DEBUG:     #41 pc 0060961f  /data/app/com.auditoriaqualirede-1/lib/x86/librealmreact.so
2020-09-04 11:30:38.642 27112-27112/? A/DEBUG:     #42 pc 0060955f  /data/app/com.auditoriaqualirede-1/lib/x86/librealmreact.so
2020-09-04 11:30:38.642 27112-27112/? A/DEBUG:     #43 pc 0061b770  /data/app/com.auditoriaqualirede-1/lib/x86/librealmreact.so
2020-09-04 11:30:38.642 27112-27112/? A/DEBUG:     #44 pc 0061b72d  /data/app/com.auditoriaqualirede-1/lib/x86/librealmreact.so
2020-09-04 11:30:38.642 27112-27112/? A/DEBUG:     #45 pc 0061c869  /data/app/com.auditoriaqualirede-1/lib/x86/librealmreact.so
2020-09-04 11:30:38.642 27112-27112/? A/DEBUG:     #46 pc 0061c837  /data/app/com.auditoriaqualirede-1/lib/x86/librealmreact.so
2020-09-04 11:30:38.642 27112-27112/? A/DEBUG:     #47 pc 00609690  /data/app/com.auditoriaqualirede-1/lib/x86/librealmreact.so
2020-09-04 11:30:38.642 27112-27112/? A/DEBUG:     #48 pc 0060964d  /data/app/com.auditoriaqualirede-1/lib/x86/librealmreact.so
2020-09-04 11:30:38.642 27112-27112/? A/DEBUG:     #49 pc 0060961f  /data/app/com.auditoriaqualirede-1/lib/x86/librealmreact.so
2020-09-04 11:30:38.642 27112-27112/? A/DEBUG:     #50 pc 0060955f  /data/app/com.auditoriaqualirede-1/lib/x86/librealmreact.so
2020-09-04 11:30:38.642 27112-27112/? A/DEBUG:     #51 pc 0061b770  /data/app/com.auditoriaqualirede-1/lib/x86/librealmreact.so
2020-09-04 11:30:38.642 27112-27112/? A/DEBUG:     #52 pc 0061b72d  /data/app/com.auditoriaqualirede-1/lib/x86/librealmreact.so
2020-09-04 11:30:38.642 27112-27112/? A/DEBUG:     #53 pc 0061c869  /data/app/com.auditoriaqualirede-1/lib/x86/librealmreact.so
2020-09-04 11:30:38.642 27112-27112/? A/DEBUG:     #54 pc 0061c837  /data/app/com.auditoriaqualirede-1/lib/x86/librealmreact.so
2020-09-04 11:30:38.642 27112-27112/? A/DEBUG:     #55 pc 00609690  /data/app/com.auditoriaqualirede-1/lib/x86/librealmreact.so
2020-09-04 11:30:38.642 27112-27112/? A/DEBUG:     #56 pc 0060964d  /data/app/com.auditoriaqualirede-1/lib/x86/librealmreact.so
2020-09-04 11:30:38.642 27112-27112/? A/DEBUG:     #57 pc 0060961f  /data/app/com.auditoriaqualirede-1/lib/x86/librealmreact.so
2020-09-04 11:30:38.642 27112-27112/? A/DEBUG:     #58 pc 0060955f  /data/app/com.auditoriaqualirede-1/lib/x86/librealmreact.so
2020-09-04 11:30:38.642 27112-27112/? A/DEBUG:     #59 pc 0061b770  /data/app/com.auditoriaqualirede-1/lib/x86/librealmreact.so
2020-09-04 11:30:38.642 27112-27112/? A/DEBUG:     #60 pc 0061b72d  /data/app/com.auditoriaqualirede-1/lib/x86/librealmreact.so
2020-09-04 11:30:38.642 27112-27112/? A/DEBUG:     #61 pc 0061c869  /data/app/com.auditoriaqualirede-1/lib/x86/librealmreact.so
2020-09-04 11:30:38.642 27112-27112/? A/DEBUG:     #62 pc 0061c837  /data/app/com.auditoriaqualirede-1/lib/x86/librealmreact.so
2020-09-04 11:30:38.642 27112-27112/? A/DEBUG:     #63 pc 00609690  /data/app/com.auditoriaqualirede-1/lib/x86/librealmreact.so

Steps to Reproduce

I believe this problem is relative to size of inserted data, because if inserts data of 0 to 4 offset, crash doesnt occurs.

Short Code Sample

static async test() {
   for (let offset = 0; offset < 999999; offset++) {
     const array = await http request for offset data by 1000 items

     if no data on array, return

     Realm.write(() => {
       array.forEach((item) => {
         Realm.create(`Schema`, item, `modified`);
       });
     });
   }
}## Version of Realm and Tooling
  • Realm JS SDK Version: 6.1.0
  • Node: 12.18.3
  • React Native: 0.62.2
  • Client OS & Version: Android Emulator 7.1.1
@kneth
Copy link
Contributor

kneth commented Sep 7, 2020

@kevinpiske

Thank you for reporting. I have a couple of follow-up questions:

  • Do you only see it on Android? Can you reproduce it on iOS?
  • What kind of object is item? Properties, values??
  • Do you also see the crash if you have many small transactions?

@kevinpiske
Copy link
Author

kevinpiske commented Sep 7, 2020

@kneth

Do you only see it on Android? Can you reproduce it on iOS?

I am developing only for Android on a Windows machine. Unfortunately I won't be able to test on iOS.

Do you also see the crash if you have many small transactions?

I had no problems with many smaller object transactions, I even tested with about 1 million small records and there was no crash.

What kind of object is item? Properties, values??

The item is from type Schema01. I am currently inserting about 10000 items.

const Schema01 = {
  name: `Schema01`,
  primaryKey: `id`,
  properties: {
    id: `int`,
    prop01: `string?`,
    prop02: `string?`,
    prop03: `Schema02?`,
    prop04: `Schema03?`,
    prop05: `string?`,
    prop06: `string?`,
    prop07: `string?`,
    prop08: `int?`,
    prop09: `int?`,
    prop10: `string?`,
    prop11: `Schema04[]`,
    prop12: `string?`,
    prop13: `int?`,
    prop14: `int?`,
    prop15: `Schema05[]`,
    prop16: `string?`,
    prop17: `bool?`,
    prop18: `int?`,
    prop19: `string?`,
    prop20: {
      type: `string`,
      default: `defaultValue`,
    },
  },
};

const Schema02 = {
  name: Schema02
  primaryKey: 'id',
  properties: {
    id: 'string',
    prop01: 'string?',
    prop02: 'string?',
    prop03: 'string?',
  },
};

const Schema03 = {
  name: 'Schema03',
  properties: {
    prop01: 'string?',
    prop02: 'string?',
    prop03: 'string?',
    prop04: 'int?',
    prop05: 'string?',
    prop06: 'string?',
  },
};

const Schema04 = {
  name: `Schema04`,
  properties: {
    id: `int`,
    prop01: `string?`,
    prop02: `int?`,
    prop03: `string?`,
    prop04: `int?`,
    prop05: `int?`,
    prop06: `string?`,
    prop07: `string?`,
    prop08: `int?`,
    prop09: `string?`,
    prop10: {
      type: `string`,
      default: `defaultValue`,
    },
  },
};

const Schema05 = {
  name: 'Schema05',
  primaryKey: 'id',
  properties: {
    id: 'int',
    prop01: 'string?',
    prop02: 'Schema02?',
    prop03: 'Schema04[]',
    prop04: 'string?',
    prop05: 'int?',
    prop06: 'int?',
    prop07: 'string?',
    prop08: 'string?',
  },
};

Example of item data:

    {
        "id": 000000,
        "prop01": "AAAAAAAAAA",
        "prop02": "00000000",
        "prop03": {
            "id": "000000",
            "prop01": "AAA A/A AAAAAAAAAAA AAAAAA A AAAAAAAAAA",
            "prop02": "AA AAAAAAAAA AAAAAAAAA AAAA, 0, AAAAAAAA, AA",
            "prop03": "00000000000000"
        },
        "prop04": {
            "prop01": "00000000000000",
            "prop02": "00000000000",
            "prop03": "1967-09-13T03:00:00.000+0000",
            "prop04": 0,
            "prop05": "AAAA AAAAAA AAAAAAA AAAAA",
            "prop06": "2018-10-31T03:00:00.000+0000"
        },
        "prop05": "000000",
        "prop06": "2019-06-08",
        "prop09": 2,
        "prop11": [
            {
                "id": 000000,
                "prop01": "00",
                "prop02": 0000000,
                "prop03": "AAAAAAAAAA - AAAAAAAAAAA AAAAAAA",
                "prop04": 0
            },
            {
                "id": 000000,
                "prop01": "00",
                "prop02": 000000000,
                "prop03": "AAAAAAAAAAA AAAAAA",
                "prop04": 0
            }
        ],
        "prop12": "AAAAAAAAAA",
        "prop14": 0,
        "prop15": [
            {
                "id": 000000,
                "prop01": "00000000",
                "prop02": {
                    "id": "000000",
                    "prop01": "AAA A/A AAAAAAAAAAA AAAAAA A AAAAAAAAAA",
                    "prop02": "AA AAAAAAAAA AAAAAAAAA AAAA, 0, AAAAAAAA, AA",
                    "prop03": "00000000000000"
                },
                "prop03": [
                    {
                        "id": 000000,
                        "prop01": "00",
                        "prop02": 00000000,
                        "prop03": "AAA AAAAAA",
                        "prop04": 0
                    }
                ],
                "prop04": "AAAAAAAAA",
                "prop06": 0,
                "prop07": "2019-06-10",
                "prop08": "AA: 08/06 A 14/06 - 00 A AA AAA AA"
            }
        ],
        "prop16": "0000000"
    }

@kneth
Copy link
Contributor

kneth commented Sep 7, 2020

@kevinpiske

Thank you for the update.

I had no problems with many smaller object transactions

It indicates an issue in the underlying database, don't you agree @finnschiermer?

@finnschiermer
Copy link
Contributor

Yes, I agree. If we can reproduce this it'll be a big step towards fixing it.

@RealmBot
Copy link
Collaborator

RealmBot commented Sep 8, 2020

➤ Finn Andersen commented:

We have identified root cause of this, and a fix is being developed.

@kneth
Copy link
Contributor

kneth commented Sep 10, 2020

@kevinpiske We have released v6.1.1 with a fix.

@kevinpiske
Copy link
Author

Thanks all for the fast work!

@kneth, in my case, the problem persists.

Now the stack is not detailed anymore, the log is:
Fatal signal 11 (SIGSEGV) at 0x93242ffc (code=2), thread 9766 (mqt_js)

I realized that the problem occurs when inserting data from two specific schemas. If I comment the inserting data of one these schemas, everything goes well.

The problem only occurs by inserting data of these two schemas in separate transactions. Inserting data of these two schemas in the same transaction, it worked.

@Vivaan7
Copy link

Vivaan7 commented Dec 15, 2022

@kevinpiske hey can you help me in my scenario.. i am facing same issue

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants