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

Crash when querying with not on empty group #4168

Closed
rorbech opened this issue Dec 4, 2020 · 0 comments · Fixed by #4916
Closed

Crash when querying with not on empty group #4168

rorbech opened this issue Dec 4, 2020 · 0 comments · Fixed by #4916
Assignees

Comments

@rorbech
Copy link
Contributor

rorbech commented Dec 4, 2020

The following query from the tests in realm/realm-java#7234

        realm.where(AllTypes.class)
                .equalTo(AllTypes.FIELD_LONG, 5)
                .or()
                .not()
                .beginGroup()
                .endGroup()

crashes with the below stack trace. Don't know if we are supposed to guard for the "syntax error" from Java SDK side. It seems like the usual pattern for checking validity is to check with Q(nativeQueryPtr)->validate() after building up the query.

2020-12-04 15:25:08.709 3860-3860/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
2020-12-04 15:25:08.709 3860-3860/? A/DEBUG: Build fingerprint: 'Android/sdk_phone_x86_64/generic_x86_64:10/QPP6.190730.005.B1/5775370:userdebug/test-keys'
2020-12-04 15:25:08.709 3860-3860/? A/DEBUG: Revision: '0'
2020-12-04 15:25:08.709 3860-3860/? A/DEBUG: ABI: 'x86_64'
2020-12-04 15:25:08.716 3860-3860/? A/DEBUG: Timestamp: 2020-12-04 15:25:08+0100
2020-12-04 15:25:08.716 3860-3860/? A/DEBUG: pid: 3823, tid: 3854, name: roidJUnitRunner  >>> io.realm.test <<<
2020-12-04 15:25:08.716 3860-3860/? A/DEBUG: uid: 10138
2020-12-04 15:25:08.716 3860-3860/? A/DEBUG: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x78
2020-12-04 15:25:08.716 3860-3860/? A/DEBUG: Cause: null pointer dereference
2020-12-04 15:25:08.716 3860-3860/? A/DEBUG:     rax 0000000000000000  rbx 000078ddf0118c00  rcx 000078dda52e2fd0  rdx 000078dda66cb200
2020-12-04 15:25:08.716 3860-3860/? A/DEBUG:     r8  000000000000000b  r9  0000000000000000  r10 fffffffffffff277  r11 0000000000000000
2020-12-04 15:25:08.716 3860-3860/? A/DEBUG:     r12 000078dda52e35b0  r13 000078ddec1cea3c  r14 000000000000000c  r15 000078dda52e3bb8
2020-12-04 15:25:08.716 3860-3860/? A/DEBUG:     rdi 000078dda52e2fd0  rsi 0000000000000078
2020-12-04 15:25:08.716 3860-3860/? A/DEBUG:     rbp 000078dda52e2f50  rsp 000078dda52e2f50  rip 000078dda3d64cf9
2020-12-04 15:25:08.825 3860-3860/? A/DEBUG: backtrace:
2020-12-04 15:25:08.825 3860-3860/? A/DEBUG:       #00 pc 000000000019acf9  /data/app/io.realm.test-_rfBxh6moNbGPmP5utSK6Q==/lib/x86_64/librealm-jni.so (realm::ConstTableRef::operator==(realm::ConstTableRef const&) const+25) (BuildId: 9a8b0c7812a402248044a54d5e0a61ec8d80f1c6)
2020-12-04 15:25:08.825 3860-3860/? A/DEBUG:       #01 pc 000000000083b3b7  /data/app/io.realm.test-_rfBxh6moNbGPmP5utSK6Q==/lib/x86_64/librealm-jni.so (realm::ParentNode::set_table(realm::ConstTableRef)+71) (BuildId: 9a8b0c7812a402248044a54d5e0a61ec8d80f1c6)
2020-12-04 15:25:08.825 3860-3860/? A/DEBUG:       #02 pc 0000000000e22f40  /data/app/io.realm.test-_rfBxh6moNbGPmP5utSK6Q==/lib/x86_64/librealm-jni.so (realm::NotNode::table_changed()+80) (BuildId: 9a8b0c7812a402248044a54d5e0a61ec8d80f1c6)
2020-12-04 15:25:08.825 3860-3860/? A/DEBUG:       #03 pc 000000000083b4ea  /data/app/io.realm.test-_rfBxh6moNbGPmP5utSK6Q==/lib/x86_64/librealm-jni.so (realm::ParentNode::set_table(realm::ConstTableRef)+378) (BuildId: 9a8b0c7812a402248044a54d5e0a61ec8d80f1c6)
2020-12-04 15:25:08.825 3860-3860/? A/DEBUG:       #04 pc 000000000083b601  /data/app/io.realm.test-_rfBxh6moNbGPmP5utSK6Q==/lib/x86_64/librealm-jni.so (realm::Query::add_node(std::__ndk1::unique_ptr<realm::ParentNode, std::__ndk1::default_delete<realm::ParentNode>>)+225) (BuildId: 9a8b0c7812a402248044a54d5e0a61ec8d80f1c6)
2020-12-04 15:25:08.825 3860-3860/? A/DEBUG:       #05 pc 000000000084e3a5  /data/app/io.realm.test-_rfBxh6moNbGPmP5utSK6Q==/lib/x86_64/librealm-jni.so (realm::Query::handle_pending_not()+277) (BuildId: 9a8b0c7812a402248044a54d5e0a61ec8d80f1c6)
2020-12-04 15:25:08.825 3860-3860/? A/DEBUG:       #06 pc 000000000083f98f  /data/app/io.realm.test-_rfBxh6moNbGPmP5utSK6Q==/lib/x86_64/librealm-jni.so (realm::Query::end_group()+287) (BuildId: 9a8b0c7812a402248044a54d5e0a61ec8d80f1c6)
2020-12-04 15:25:08.825 3860-3860/? A/DEBUG:       #07 pc 00000000001f6444  /data/app/io.realm.test-_rfBxh6moNbGPmP5utSK6Q==/lib/x86_64/librealm-jni.so (Java_io_realm_internal_TableQuery_nativeEndGroup+36) (BuildId: 9a8b0c7812a402248044a54d5e0a61ec8d80f1c6)
2020-12-04 15:25:08.825 3860-3860/? A/DEBUG:       #08 pc 0000000000174641  /apex/com.android.runtime/lib64/libart.so (art_quick_generic_jni_trampoline+209) (BuildId: 8bb3225e7c408f2ca23abac3db0417f2)
2020-12-04 15:25:08.825 3860-3860/? A/DEBUG:       #09 pc 0000000000169354  /apex/com.android.runtime/lib64/libart.so (art_quick_invoke_stub+756) (BuildId: 8bb3225e7c408f2ca23abac3db0417f2)
2020-12-04 15:25:08.825 3860-3860/? A/DEBUG:       #10 pc 0000000000179c50  /apex/com.android.runtime/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+288) (BuildId: 8bb3225e7c408f2ca23abac3db0417f2)
2020-12-04 15:25:08.825 3860-3860/? A/DEBUG:       #11 pc 0000000000340ffc  /apex/com.android.runtime/lib64/libart.so (art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*)+380) (BuildId: 8bb3225e7c408f2ca23abac3db0417f2)
2020-12-04 15:25:08.825 3860-3860/? A/DEBUG:       #12 pc 000000000033b20f  /apex/com.android.runtime/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+1151) (BuildId: 8bb3225e7c408f2ca23abac3db0417f2)
2020-12-04 15:25:08.825 3860-3860/? A/DEBUG:       #13 pc 000000000066bb14  /apex/com.android.runtime/lib64/libart.so (MterpInvokeDirect+724) (BuildId: 8bb3225e7c408f2ca23abac3db0417f2)
2020-12-04 15:25:08.825 3860-3860/? A/DEBUG:       #14 pc 0000000000162919  /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_direct+25) (BuildId: 8bb3225e7c408f2ca23abac3db0417f2)
2020-12-04 15:25:08.825 3860-3860/? A/DEBUG:       #15 pc 00000000000087d0  [anon:dalvik-classes19.dex extracted in memory from /data/app/io.realm.test-_rfBxh6moNbGPmP5utSK6Q==/base.apk!classes19.dex] (io.realm.internal.TableQuery.endGroup+4)
2020-12-04 15:25:08.825 3860-3860/? A/DEBUG:       #16 pc 00000000006692dd  /apex/com.android.runtime/lib64/libart.so (MterpInvokeVirtual+1789) (BuildId: 8bb3225e7c408f2ca23abac3db0417f2)
2020-12-04 15:25:08.825 3860-3860/? A/DEBUG:       #17 pc 0000000000162819  /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_virtual+25) (BuildId: 8bb3225e7c408f2ca23abac3db0417f2)
2020-12-04 15:25:08.825 3860-3860/? A/DEBUG:       #18 pc 0000000000007310  [anon:dalvik-classes18.dex extracted in memory from /data/app/io.realm.test-_rfBxh6moNbGPmP5utSK6Q==/base.apk!classes18.dex] (io.realm.RealmQuery.endGroupWithoutThreadValidation+4)
2020-12-04 15:25:08.825 3860-3860/? A/DEBUG:       #19 pc 000000000066be41  /apex/com.android.runtime/lib64/libart.so (MterpInvokeDirect+1537) (BuildId: 8bb3225e7c408f2ca23abac3db0417f2)
2020-12-04 15:25:08.825 3860-3860/? A/DEBUG:       #20 pc 0000000000162919  /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_direct+25) (BuildId: 8bb3225e7c408f2ca23abac3db0417f2)
2020-12-04 15:25:08.825 3860-3860/? A/DEBUG:       #21 pc 00000000000072f2  [anon:dalvik-classes18.dex extracted in memory from /data/app/io.realm.test-_rfBxh6moNbGPmP5utSK6Q==/base.apk!classes18.dex] (io.realm.RealmQuery.endGroup+10)
2020-12-04 15:25:08.825 3860-3860/? A/DEBUG:       #22 pc 00000000006692dd  /apex/com.android.runtime/lib64/libart.so (MterpInvokeVirtual+1789) (BuildId: 8bb3225e7c408f2ca23abac3db0417f2)
2020-12-04 15:25:08.825 3860-3860/? A/DEBUG:       #23 pc 0000000000162819  /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_virtual+25) (BuildId: 8bb3225e7c408f2ca23abac3db0417f2)
2020-12-04 15:25:08.825 3860-3860/? A/DEBUG:       #24 pc 00000000000ef100  [anon:dalvik-classes2.dex extracted in memory from /data/app/io.realm.test-_rfBxh6moNbGPmP5utSK6Q==/base.apk!classes2.dex] (io.realm.RealmQueryTests.not_emptyGroup_throws+68)
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants