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

Fix crashes for RealmAny on ARM 32 bit architectures #7627

Merged
merged 7 commits into from
Jan 10, 2022

Conversation

rorbech
Copy link
Contributor

@rorbech rorbech commented Jan 7, 2022

Closes #7626

@cla-bot cla-bot bot added the cla: yes label Jan 7, 2022
@rorbech
Copy link
Contributor Author

rorbech commented Jan 7, 2022

This fix isn't verified by CI, but I have executed our full test suite as 32-bit tests on an arm devices. Dump of important output is:

$ ./gradlew connectedObjectServerDebugAndroidTest

[...]

[CXX5202] This app only has 32-bit [armeabi-v7a] native libraries. Beginning August 1, 2019 Google Play store requires that all apps that include native libraries must provide 64-bit versions. For more information, visit https://g.co/64-bit-requirement

> Task :kotlin-extensions:connectedObjectServerDebugAndroidTest
Starting 61 tests on SM-G973F - 11

[...]

> Task :realm-library:connectedObjectServerDebugAndroidTest
Starting 8163 tests on SM-G973F - 11

[...]

BUILD SUCCESSFUL in 31m 54s
117 actionable tasks: 7 executed, 110 up-to-date

Copy link
Contributor

@cmelchior cmelchior left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great find 🥇 ... but would still be interesting to understand the root cause.

@rorbech
Copy link
Contributor Author

rorbech commented Jan 7, 2022

Great find 🥇 ... but would still be interesting to understand the root cause.

Guess the pointer size that can differ based on compiler/platform, etc, so forcing it into jlong (int64_t) ensures that it isn't truncated. But if the platform somehow only used smaller types you would think that it could also fit inside the jlong passed to java. Maybe something skew issue around the va_list convention as it seemed like the erroneous pointer was pointing to memory containing (J)V which is the signature argument to the Java call.

I have tried to reach out to the core team if anybody has some insight.

Copy link
Collaborator

@clementetb clementetb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great find ⭐️!

CHANGELOG.md Outdated Show resolved Hide resolved
@rorbech
Copy link
Contributor Author

rorbech commented Jan 10, 2022

The cast is needed due to https://en.cppreference.com/w/cpp/language/reinterpret_cast point 2 and 3 (thanks James)

@rorbech rorbech merged commit 69ff3dc into releases Jan 10, 2022
@rorbech rorbech deleted the ct/investigation-realmany branch January 10, 2022 11:37
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants