matrix-org / matrix-org/matrix-rust-sdk

Android crash after removal of ring dependency

Open
#6,442 4 comments 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.