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

Segfault on load DB #1487

Open
JorisBodin opened this issue Aug 23, 2023 · 12 comments
Open

Segfault on load DB #1487

JorisBodin opened this issue Aug 23, 2023 · 12 comments

Comments

@JorisBodin
Copy link

JorisBodin commented Aug 23, 2023

How frequently does the bug occur?

Sometimes

Description

Our app crashed for some users (including me) at launch, when loading the database. And this only happens once per user.
We suspect it's due to a migration ...
This migration: https://github.com/Infomaniak/android-kMail/blob/1.0.9/app/src/main/java/com/infomaniak/mail/data/cache/RealmDatabase.kt#L175

Stacktrace & log output

OS Version: Android 13 (TQ3A.230805.001)
Report Version: 104

Exception Type: Unknown (SIGSEGV)

Application Specific Information:
Segfault

Thread 0 Crashed:
0   libart.so                       0x6d179e5f6c        <unknown> + 468547690348
1   split_config.arm64_v8a.apk      0x6c91704f48        register_results_notification_cb
2   split_config.arm64_v8a.apk      0x6c91702744        Java_io_realm_kotlin_internal_interop_realmcJNI_register_1results_1notification_1cb
3   base.odex                       0x6c9a7a4744        <unknown> + 466448172868

https://sentry-mobile.infomaniak.com/share/issue/1dd3e2bd23154ad0982af11835ad33d3/

Can you reproduce the bug?

No

Reproduction Steps

No response

Version

1.10.2

What Atlas App Services are you using?

Local Database only

Are you using encryption?

No

Platform OS and version(s)

Android 12 and 13

Build environment

https://github.com/Infomaniak/android-kMail/blob/1.0.9/app/build.gradle
https://github.com/Infomaniak/android-kMail/blob/1.0.9/gradle/libs.versions.toml#L17

@JorisBodin
Copy link
Author

This always happens with "1.11.1".

And given the breadcrump, I don't think it's migration.

It's getting to be a lot 😬
image

https://sentry-mobile.infomaniak.com/share/issue/1dd3e2bd23154ad0982af11835ad33d3/
https://sentry-mobile.infomaniak.com/share/issue/293c388ca27f4c82bf24efdc41aebf16/

@JorisBodin
Copy link
Author

All events affect only android 12 and 13 devices

I checked, we already had 1.10.2 realm on our application in 1.0.8.

But what's changed on our side is that we've gone from compileSdk 33 to 34
Infomaniak/android-kMail@1.0.8...1.0.9

Is Android 14 the problem?

@cmelchior
Copy link
Contributor

Hi @JorisBodin

I don't think Android 14 is the problem. My guess is you are trying to register a change listener to a type deleted by the migration, but I'm not sure how that is possible.

Following your migration logic it looks like you ended up calling newRealm.deleteAll() which should be fine and at least I could not reproduce the error using the same method.

I'm still investigating it.

@cmelchior cmelchior self-assigned this Oct 3, 2023
@JorisBodin
Copy link
Author

Hello @cmelchior,

The problem occurred between 1.0.8 and 1.0.9
The newRealm.deleteAll() was already present before 1.0.8, so that's not the problem.

Thank you

@sync-by-unito sync-by-unito bot assigned rorbech and unassigned cmelchior and rorbech Dec 11, 2023
@rorbech
Copy link
Contributor

rorbech commented Dec 11, 2023

The stacktrace looks like it could be related to #1598. The callback class reference did not create a global reference so the class could potentially be unloaded behind the scene of the static initalized jclass.

I can't explain how this would be related to migration though, but maybe the issue is otherwise related to two simultaneous instances of the app during an upgrade.

@JorisBodin
Copy link
Author

What version will be available?

@rorbech
Copy link
Contributor

rorbech commented Dec 12, 2023

@JorisBodin The above fix will be in 1.14.0. It is already available in 1.14.0-SNAPSHOT (using snapshots) if you want to see if it changes anything already.

@JorisBodin
Copy link
Author

Not reproducing the bug, we'll see if the error disappears from sentry after 1.14.0 update 🤞

@rorbech rorbech mentioned this issue Apr 19, 2024
@rorbech
Copy link
Contributor

rorbech commented Apr 19, 2024

@JorisBodin This popped up from another user on 1.14.1. Are you still seeing this and have you been able to gather more insights on exactly when it is happening?

@nirinchev nirinchev added the More-information-needed More information needed from the reporter. The issue will autoclose if no more information is given. label Apr 21, 2024
Copy link
Contributor

github-actions bot commented May 6, 2024

This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further.

@github-actions github-actions bot closed this as completed May 6, 2024
@JorisBodin
Copy link
Author

@tevincent explained here #1726 (comment)
I thought that was enough

Is it possible to reopen the PR?

Thanks

@github-actions github-actions bot removed the More-information-needed More information needed from the reporter. The issue will autoclose if no more information is given. label May 6, 2024
@github-actions github-actions bot reopened this May 6, 2024
@JorisBodin
Copy link
Author

Need more info?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants