Closed Bug 1851154 Opened 1 years ago Closed 1 years ago

Provide our own implementation of C's getline on Android

Categories

(Core :: mozglue, task)

Unspecified
Android
task

Tracking

()

RESOLVED FIXED
119 Branch
Tracking Status
firefox119 --- fixed

People

(Reporter: sergesanspaille, Assigned: sergesanspaille)

References

Details

Attachments

(1 file)

+++ This bug was initially created as a clone of Bug #914190 +++

We can't use getline() from Gecko on Android Jelly Bean because it calls bionic's realloc (not overrideable, despite having default visbility), and the caller needs to free() the result, and that will use jemalloc's free().

So, write a getline(), or import someone else's, and add it to libmozglue.

10 years ago (!) Bug 914190 already choked on the fact that bionic's
getline implementation could realloc a buffer using a function call
we cannot intercept, resulting in different memory allocator being used
to allocate and free the getline buffer.

This got hit again by 1850948, causing a backout. The approach taken at
that time (use std::getline) is neither future-proof (as demonstrated by
the backout) nor always satisfying (std::string as a few limitations in
term of low-level buffer manipulation).

Provide our implementation for Android, as hinted by the original bug.

Blocks: 1850948
Component: Gecko Profiler → mozglue
OS: Gonk (Firefox OS) → Android
Hardware: ARM → Unspecified
Attachment #9351199 - Attachment description: Bug 1851154 - Provide our own implementation of C's getline for Android r=jld → Bug 1851154 - Provide our own implementation of C's getline for Android r=jld!
Pushed by sguelton@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/7cf8ad6c6cb0 Provide our own implementation of C's getline for Android r=jld
Status: NEW → RESOLVED
Closed: 1 years ago
Resolution: --- → FIXED
Target Milestone: --- → 119 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: