<!---
Questions: If you have questions about HOW TO use Realm, please ask on
StackOverflow: http://stackoverflow.com/questions/ask?tags=realm
We monitor the realm tag.
Feature Request: Just fill in the first two sections below.
Bugs: To help you as fast as possible with an issue please describe your issue
and the steps you have taken to reproduce it in as much detail as possible.
-->
Goals
I am trying to delete all the realm data using the following code sample.
`
realm.write(() =>
{
realm.deleteAll();
});
`
<!--- What are you trying to achieve? -->
h2. Expected Results
Realm objects should be deleted without any crash
<!--- What did you expect to happen? -->
h2. Actual Results
<!--- What happened instead? -->
<!--- e.g. the stack trace of a crash -->
On Android when this method is called, realm is crashing very often.
It is weird that app is not crashing every time - but I am able to replicate this often
----
? A/DEBUG: Build fingerprint: 'samsung/gts3lwifixx/gts3lwifi:9/PPR1.180610.011/T820XXU3CSH9:user/release-keys'
? A/DEBUG: Revision: '5'
? A/DEBUG: ABI: 'arm64'
? A/DEBUG: pid: 28921, tid: 28999, name: mqt_js >>> com.package.name <<<
? A/DEBUG: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x288
? A/DEBUG: Cause: null pointer dereference
? A/DEBUG: x0 0000000000000288 x1 0000000000000000 x2 0000000000000000 x3 0000000000000000
? A/DEBUG: x4 00000077639449d0 x5 0000007778fdcf48 x6 0000000000000005 x7 00000000000000e4
? A/DEBUG: x8 860930d858874cb5 x9 0000007778fdc8c0 x10 860930d858874cb5 x11 0000000000000007
? A/DEBUG: x12 0000000000000008 x13 0000000000000001 x14 0000000000000000 x15 0000000000000003
? A/DEBUG: x16 0000007762a93728 x17 00000078024e6530 x18 0000007778fdcf88 x19 00000077584c7530
? A/DEBUG: x20 00000077584c7490 x21 00000077597a3bc0 x22 00000077597a76c0 x23 0000000000000001
? A/DEBUG: x24 0000007763944cb0 x25 0000000000000001 x26 0000007750fe34e0 x27 ffff000000000000
? A/DEBUG: x28 ffff000000000002 x29 0000007763944d70
? A/DEBUG: sp 0000007763944800 lr 0000007762385b9c pc 0000007762385b9c
? D/PkgPredictorService-NapPreloadController: Sent pkg = com.package.name type: ml
/? D/ActivityManager: [ML] packageName : com.package.name type : ml
/? D/ActivityManager: [ML] This Package is on the Memory
/? A/DEBUG: backtrace:
/? A/DEBUG: #00 pc 00000000002afb9c /data/app/com.package.name-ZHzJiX4Dw2tp5KhiGr6zlw==/lib/arm64/librealmreact.so
/? A/DEBUG: #01 pc 00000000002abf88 /data/app/com.package.name-ZHzJiX4Dw2tp5KhiGr6zlw==/lib/arm64/librealmreact.so
/? A/DEBUG: #02 pc 00000000002a869c /data/app/com.package.name-ZHzJiX4Dw2tp5KhiGr6zlw==/lib/arm64/librealmreact.so
/? A/DEBUG: #03 pc 000000000028fe60 /data/app/com.package.name-ZHzJiX4Dw2tp5KhiGr6zlw==/lib/arm64/librealmreact.so
/? A/DEBUG: #04 pc 000000000032b7f8 /data/app/com.package.name-ZHzJiX4Dw2tp5KhiGr6zlw==/lib/arm64/librealmreact.so
/? A/DEBUG: #05 pc 00000000001c88e0 /data/app/com.package.name-ZHzJiX4Dw2tp5KhiGr6zlw==/lib/arm64/librealmreact.so
/? A/DEBUG: #06 pc 00000000001a9e48 /data/app/com.package.name-ZHzJiX4Dw2tp5KhiGr6zlw==/lib/arm64/librealmreact.so
/? A/DEBUG: #07 pc 00000000001a9ec8 /data/app/com.package.name-ZHzJiX4Dw2tp5KhiGr6zlw==/lib/arm64/librealmreact.so
/? A/DEBUG: #08 pc 00000000000b3b3c /data/app/com.package.name-ZHzJiX4Dw2tp5KhiGr6zlw==/lib/arm64/libjsc.so
/? A/DEBUG: #09 pc 0000000000000028 <anonymous:0000007759cff000>
h2. Steps to Reproduce
<!--- What are steps we can follow to reproduce this issue? -->
Try deleting the realm objects using the deleteAll method
h2. Code Sample
<!---
Please provide a code sample or test case that highlights the issue.
If relevant, include your model definitions.
For larger code samples, links to external gists/repositories are preferred.
Full projects that we can compile and run ourselves are ideal!
-->
{code}
realm.write(() => {
realm.deleteAll();
});
try {
Realm.deleteFile(realmConfig);
} catch (err)
{
console.error('Unable to delete realm file with error: ', err);
}
{code}
Version of Realm and Tooling
- Realm JS SDK Version: 3.6.4
- Node: v10.18.0 (I am using nvm to manage multiple versions of mode)
- React Native: 0.61.2
- Client OS & Version: Android 9
- Which debugger for React Native: ?/None