matrix-org / matrix-org/matrix-rust-sdk
Android crash after removal of ring dependency
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 2.3k
- Forks
- 500
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 106
Description
We have pulled in a recent version of the matrix-rust-sdk into our app, and have noted that the android app seems to now crash on initialization (on emulators, and perhaps real devices). After some digging, it appears to be related to the recent change to remove the 'ring' dependency: https://github.com/matrix-org/matrix-rust-sdk/pull/6334/changes
Specifically, it looks like now that reqwest pulls in rustls which defaults to aws-lc-rs. It seems like the aws-lc-rs crate has known issues on certain Android targets/emulators — it can fail to initialize or produce invalid code on arm64 emulators with 16KB pages. The crash we got seemed to indicate an issue with 16kb page sizes specifically, and restoring ring on android seemed to fix the issue.
Not sure on the best way to fix this or not, but figured a post about the issue we're experiencing might help others in a similar situation.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the crash during Android initialization on an arm64 emulator with 16KB pages, then trace the reqwest/rustls dependency choice and the aws-lc-rs initialization failure. Compare that behavior with the Android configuration that restores ring; done means the SDK initializes without crashing on the affected emulator and device targets.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, rust
- Domain
- mobile-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 42/100