Closed Bug 1446521 Opened 6 years ago Closed 6 years ago

Web Replay: Support more macOS releases

Categories

(Core :: General, defect)

defect
Not set
normal

Tracking

()

RESOLVED INVALID
Tracking Status
firefox61 --- affected

People

(Reporter: bhackett1024, Assigned: bhackett1024)

References

Details

Attachments

(12 files)

14.17 KB, patch
Details | Diff | Splinter Review
1.00 KB, patch
Details | Diff | Splinter Review
876 bytes, patch
Details | Diff | Splinter Review
4.12 KB, patch
Details | Diff | Splinter Review
1.01 KB, patch
Details | Diff | Splinter Review
2.82 KB, patch
Details | Diff | Splinter Review
15.21 KB, patch
Details | Diff | Splinter Review
1.15 KB, patch
Details | Diff | Splinter Review
927 bytes, patch
Details | Diff | Splinter Review
14.60 KB, patch
Details | Diff | Splinter Review
917 bytes, patch
Details | Diff | Splinter Review
1.08 KB, patch
Details | Diff | Splinter Review
So far all the development and testing of Web Replay has been on 10.12.  This bug is about getting it to work well on other versions of macOS.  The initial patches here mostly fix 10.13 (I get a hang on one of the automated tests I need to figure out, but it seems to work well when trying it out on websites) and fix some problems with 10.9 and 10.10, though they will need more work to run reliably.
This patch has several fixes for problems that were causing library API redirection to fail on other releases, or were corrupting the resulting redirections.
Assignee: nobody → bhackett1024
CUIDraw is only called by Gecko on 10.9.
Mapped memory regions used by system thread stacks need some special treatment.  We were watching in case these stacks were unmapped and then reused for normal heap memory, but didn't have any recovery code in case this actually happened.
This is more a debugger improvement than anything, but this avoids a crash I was seeing while using the debugger on 10.13.
Fix a busted DEBUG-only assert.
Testing with snapshots or child process recovery turned off was running into some crashes and incorrect behavior.
We want to reuse threads whose start routine has finished, and to support this along with pthread_join we were using a hacked-up notion of virtual thread IDs to differentiate different start routines which ran on the same physical thread.  This patch removes this mechanism (it kept breaking when testing on other machines and OS releases) and fixes the problem it was addressing by more closely emulating the pthreads interface: a physical thread which is joinable cannot be reused after its start routine finishes until pthread_join() is actually called on it.

https://hg.mozilla.org/projects/ash/rev/616f3f24439392dd7a057075fcb51518b40f87d3
When a GCD system thread (these are spawned before we initialize record/replay state, alas) is inside a syscall when we are redirecting, we don't want to modify the instructions around that syscall because when that call returns the thread will end up at an invalid ip.  We were already doing this for __workq_kernreturn on 10.12, and on 10.10 need to do this for kevent64 as well.
On my 10.9 and 10.10 test environments, taking snapshots while recording seems to mess up GCD --- the main thread at certain times gives GCD an operation to do and blocks on its completion, which never happens.  I don't know what's going on here, but this patch sidesteps the problem.  On older releases where recording snapshots doesn't work right, snapshots are disabled.  If the user wants to rewind, the recording process just crashes and the middleman spins up a new replaying process (which can take snapshots) to take over.  This is slow, and it would be nice to figure out what is going on in GCD and get a better fix, but for now it's a low priority --- the main reason right now to get things working on older releases is because treeherder runs macOS tests on 10.10.

https://hg.mozilla.org/projects/ash/rev/e4787ca5d449736339a9b346d47a7380816e9e83
The redirection for mmap was assuming that memory ranges used for fixed mmaps can be written to, which they might not be if we haven't been taking snapshots.
Closing this bug, all the changes here will be reviewed in separate bugs dependent on bug 1422587.
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: