Implement fuzzPriv.MP() in FuzzingFunctions
Categories
(Core :: Fuzzing, enhancement)
Tracking
()
Tracking | Status | |
---|---|---|
firefox85 | --- | fixed |
People
(Reporter: tsmith, Assigned: pbone)
Details
Attachments
(1 file)
The old implementation can be found here: https://github.com/MozillaSecurity/fuzzpriv/blob/legacy/content/fuzzPriv.js#L157
Comment 1•5 years ago
|
||
Basically, you'd add a new method to FuzzingFunctions.webidl
The implementation in C++ would just be:
nsCOMPtr<nsIObserverService> os = services::GetObserverService();
os->NotifyObservers(nullptr, "memory-pressure", u"heap-minimize");
Comment 2•5 years ago
|
||
It might be better to rename this to "memoryPressure" or something because mp is a bit opaque IMO.
Paul, do you have time to look at this? It is sort of a "good first bug" for WebIDL.
Assignee | ||
Comment 3•5 years ago
|
||
Yeah, agreed it'd be good to do a "good first bug" for WebIDL.
A problem with the observer notification is that it is asynchronous (AIUI). It might be nice if the caller could wait until the compaction finished, maybe it could make some fuzzing things more deterministic.
Comment 4•5 years ago
|
||
That's a good point. The observer notification itself is synchronous, but the part where it propagates to the child processes is indeed async.
Comment 5•5 years ago
|
||
Hmm but I guess this will be run from a content process, so that shouldn't be an issue.
Assignee | ||
Comment 6•5 years ago
|
||
I think the completion of the GC will be async also. I'll check this when I implement it.
Comment 7•5 years ago
|
||
One thing I forgot to mention is that FuzzingFunctions is only available in fuzzing builds. You probably don't want to have to rebuild Firefox just to test this. I think you can avoid that by editing dom/base/moz.build and dom/webidl/moz.build to edit away the if CONFIG["FUZZING"]:
for FuzzingFunctions.{h,cpp,webidl}
.
Then you'll have to set the fuzzing.enabled pref in Firefox, because the FuzzingFunctions WebIDL interface has the property Pref="fuzzing.enabled"
Comment 8•5 years ago
|
||
This page has some documentation on WebIDL: https://developer.mozilla.org/en-US/docs/Mozilla/WebIDL_bindings
Most of that won't be stuff that you will need for this, because you are just adding one function.
Assignee | ||
Comment 9•5 years ago
|
||
This change runs a non-incremental shrinking GC if the new parameter is set
to true.
Updated•5 years ago
|
Comment 10•5 years ago
|
||
Comment 11•5 years ago
|
||
bugherder |
Description
•