The content process crashes when running with rr
Categories
(Core :: Gecko Profiler, defect, P5)
Tracking
()
Tracking | Status | |
---|---|---|
firefox-esr91 | --- | unaffected |
firefox97 | --- | unaffected |
firefox98 | --- | unaffected |
firefox99 | --- | wontfix |
firefox100 | --- | fixed |
People
(Reporter: julienw, Assigned: julienw)
References
(Regression)
Details
(Keywords: regression)
Attachments
(1 file)
STR:
- run:
MOZ_PROFILER_STARTUP=1 MOZ_PROFILER_STARTUP_FEATURES=js,cpu,nostacksampling MOZ_PROFILER_SHUTDOWN=./profile.json ./mach run --debugger=rr --debugger-args="record --disable-avx-512 --disable-cpuid-features-ext 0xfc230000,0x2c42,0xc"
(you may need to adapt the arguments for your CPU)
- Notice that you can't load any website in Firefox.
In the console, I see:
Sandbox: seccomp sandbox violation: pid 246172, tid 246172, syscall 309, args 140736847751764 0 0 140736847751864 0 140736847751120. Killing process.
With this diff, this works:
diff --git a/tools/profiler/core/platform.cpp b/tools/profiler/core/platform.cpp
index c54e94b64ff63..dffa052c49c14 100644
--- a/tools/profiler/core/platform.cpp
+++ b/tools/profiler/core/platform.cpp
@@ -6314,16 +6314,17 @@ void profiler_thread_sleep() {
profiler_mark_thread_asleep();
ThreadRegistration::WithOnThreadRef(
[](ThreadRegistration::OnThreadRef aOnThreadRef) {
aOnThreadRef.UnlockedConstReaderAndAtomicRWRef().SetSleeping();
});
}
void profiler_mark_thread_awake() {
+ return;
if (!profiler_thread_is_being_profiled_for_markers()) {
return;
}
int64_t cpuId = 0;
#if defined(GP_OS_windows)
cpuId = GetCurrentProcessorNumber();
#elif defined(GP_OS_darwin)
Then the issue may come from the syscall sched_getcpu()
:
https://searchfox.org/mozilla-central/rev/ad38c9d1f0a9036c4da5271a849f47342b68adc8/tools/profiler/core/platform.cpp#6340
Is it really a sandbox issue given this works fine when not using rr
?
Assignee | ||
Updated•2 years ago
|
Comment 1•2 years ago
|
||
What is the --disable-cpuid-features-ext
parameter doing? Isn't it disabling the thing that sched_getcpu
needs?
Assignee | ||
Comment 2•2 years ago
|
||
I think this is disabling some CPU features, that pernosco doesn't support.
Comment 3•2 years ago
|
||
Set release status flags based on info from the regressing bug 1753305
From :khuey: "The profiler is not compatible with rr's syscall buffering. Use rr record -n."
And I'm rarely running Linux, so I won't spend time on this. Patches welcome.
Updated•2 years ago
|
Assignee | ||
Comment 5•2 years ago
|
||
In the past before bug 1753305, this was working properly, with nostacksampling
. It would be a shame that we can't use rr anymore because this tool helped us a lot in the past.
Assignee | ||
Comment 6•2 years ago
|
||
Recently bug 1753305 introduced the use of the getcpu syscall to add
this information to a profiler marker, but didn't allow this syscall
from the sandbox. For a yet-unexplained reason, the sandbox crashes the
process when starting the profiler but only when running under rr.
Thanks :padenot for all the help.
Updated•2 years ago
|
Assignee | ||
Comment 7•2 years ago
|
||
For posterity, the failing syscall is at https://searchfox.org/mozilla-central/rev/a17011de808c24f015ad03debe7a157c1b43b602/tools/profiler/core/platform.cpp#6363.
Assignee | ||
Comment 8•2 years ago
|
||
(In reply to Julien Wajsberg [:julienw] from comment #6)
Created attachment 9265504 [details]
Bug 1756791 - Allow the getcpu syscall in the sandbox r=jldRecently bug 1753305 introduced the use of the getcpu syscall to add
this information to a profiler marker, but didn't allow this syscall
from the sandbox. For a yet-unexplained reason, the sandbox crashes the
process when starting the profiler but only when running under rr.Thanks :padenot for all the help.
The current guess is that without rr the call goes through the vdso mechanism, and therefore isn't caught by the sandbox. Because rr disables the vdso mechanism, this always goes through the sandbox in that case.
Updated•2 years ago
|
Updated•2 years ago
|
Pushed by jwajsberg@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/5c92b5b84d4f Allow the getcpu syscall in the sandbox r=gcp
Comment 10•2 years ago
|
||
bugherder |
Updated•2 years ago
|
Description
•