Closed Bug 2036234 Opened 5 months ago Closed 5 months ago

Use pthread API to retrieve stack top on non-Android Linux

Categories

(Core :: Gecko Profiler, task)

task

Tracking

()

RESOLVED FIXED
152 Branch
Tracking Status
firefox152 --- fixed

People

(Reporter: csmantle, Assigned: csmantle)

References

Details

Attachments

(1 external file)

Currently, we only use OS-provided facilities to retrieve the top address of the stack on Windows and Darwin kernels, and use a guessed value on Linux [^0]. Linux also provides Darwin-like functions, pthread_getattr_np(3) [^1] and pthread_attr_getstack(3) [^2] for this purpose. If we can use them, we won't have to guess on Linux.

Paul [:padenot] (CC'd below) raised a concern about the potential blockage of sched_setaffinity(2) by the sandbox [^3]. However, as Jed [:jld] (also CC'd below) pointed out, this isn't a big problem as of the current glibc v2.43, since it will simply give up setting this value [^4].

I'm not very familiar with Android, so I'm limiting the scope of this bug to non-Android Linux for now.

Assignee: nobody → webmaster
Status: NEW → ASSIGNED

(In reply to Rong Bao [:csmantle] from comment #0)

However, as Jed [:jld] (also CC'd below) pointed out, this isn't a big problem as of the current glibc v2.43

For what it's worth, I checked git blame and apparently it's been like that since affinity support was added in 2003.

Pushed by webmaster@csmantle.top: https://github.com/mozilla-firefox/firefox/commit/afcd623846a3 https://hg.mozilla.org/integration/autoland/rev/4309c2c7762a Use pthread API to retrieve stack top on non-Android Linux. r=padenot,jld,profiler-reviewers,mstange
Status: ASSIGNED → RESOLVED
Closed: 5 months ago
Resolution: --- → FIXED
Target Milestone: --- → 152 Branch
QA Whiteboard: [qa-triage-done-c153/b152]
Regressions: 2040038
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: