Open Bug 1725255 Opened 4 years ago Updated 2 months ago

Use Bionic's dynamic linker flags to improve sharing of read-only data between processes

Categories

(Core :: mozglue, enhancement)

Unspecified
Android
enhancement

Tracking

()

People

(Reporter: bugzilla, Unassigned)

References

(Blocks 1 open bug)

Details

(Whiteboard: [fxdroid] [foundation][android-tab-reloading] )

Attachments

(1 file)

On Android versions where it is possible, we should switch from dlopen to using Bionic's android_dlopen_ext with the appropriate flags for loading .so files such that read-only GNU RELRO sections can be shared between all our content processes.

This offers big wins in memory savings.

"Available since API level 21." That's Android 5.0.
I forget, do we still support Android 4.x?

(it kind of blows my mind that the linker requires manual hints)

Component: General → mozglue
Product: GeckoView → Core

(In reply to Mike Hommey [:glandium] from comment #1)

"Available since API level 21." That's Android 5.0.
I forget, do we still support Android 4.x?

Current API levels

See Also: → 1752594
Whiteboard: [fission:android:m3] → [fxdroid] [foundation]

Hi Glandium, the Firefox Android is preparing to run Fission related experiments staring around the end of Q3, and would like to get any remaining blocking bugs addressed by 128 Release. Could you help triage and fix this issue?

Flags: needinfo?(mh+mozilla)
Depends on: 1898109

The attached proof of concept works, but needs some polishing for e.g. better error handling. However, while it potentially saves 6M per process on a aarch64 build, it also introduces a large number of VMAs, because e.g. libc can't be guaranteed to be at the same address, so all GOT entries pointing to libc are different. A large number of VMAs can have an impact on performance, so this would have to be measured. Similarly, what the system linker does to make this work can have an impact on startup time.

All these things would need to be measured, and the loss of ASLR for the location of libxul.so between processes need to be evaluated from a security standpoint.

Can someone from the Android team look at those aspects?

Flags: needinfo?(mh+mozilla) → needinfo?(bugzeeeeee)
No longer blocks: 1725251
Severity: -- → N/A
Blocks: 1725251
No longer blocks: gv-fission

Hey Kaya, can you please take a look?

Flags: needinfo?(bugzeeeeee) → needinfo?(kkaya)
Flags: needinfo?(kkaya)
Whiteboard: [fxdroid] [foundation] → [fxdroid] [foundation][android-tab-reloading]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: