Bug 1431441 - Part 7 - Relax WebReplay fcntl rules to avoid sqlite crash r=froydnj
Patch provided by Brian Hackett <bhackett@mozilla.com>.
Only allow a limited set of commands to be used when events are not
passed through and we are recording/replaying the outputs.
Depends on D8474
Differential Revision:
https://phabricator.services.mozilla.com/D8475
--- a/toolkit/recordreplay/ProcessRedirectDarwin.cpp
+++ b/toolkit/recordreplay/ProcessRedirectDarwin.cpp
@@ -1015,17 +1015,24 @@ Preamble_getpid(CallArguments* aArgument
return PreambleResult::Veto;
}
return PreambleResult::Redirect;
}
static PreambleResult
Preamble_fcntl(CallArguments* aArguments)
{
- // Make sure fcntl is only used with a limited set of commands.
+ // We don't record any outputs for fcntl other than its return value, but
+ // some commands have an output parameter they write additional data to.
+ // Handle this by only allowing a limited set of commands to be used when
+ // events are not passed through and we are recording/replaying the outputs.
+ if (AreThreadEventsPassedThrough()) {
+ return PreambleResult::Redirect;
+ }
+
auto& cmd = aArguments->Arg<1, size_t>();
switch (cmd) {
case F_GETFL:
case F_SETFL:
case F_GETFD:
case F_SETFD:
case F_NOCACHE:
case F_SETLK: