Closed Bug 1590762 Opened 5 years ago Closed 4 years ago

Fix nsDocShell::OnLinkClickSync to work with fission

Categories

(Core :: DOM: Navigation, defect, P3)

defect

Tracking

()

RESOLVED FIXED
mozilla79
Fission Milestone M6a
Tracking Status
firefox79 --- fixed

People

(Reporter: farre, Assigned: farre)

References

(Blocks 1 open bug)

Details

Attachments

(7 files, 2 obsolete files)

No description provided.

This also ties in with how HTMLFormElement::SubmitSubmission uses it. The only other use of nsDocShell::OnLinkClickSync is by OnLinkClickEven, and that is unproblematic. HTMLFormElement::SubmitSubmission though, expects to get an nsDocShell back from nsDocShell::PerformRetargeting, which isn't possible when nsDocShell::PerformRetargeting retargets to an out of process target.

Depends on: 1590782
Assignee: nobody → afarre
Status: NEW → ASSIGNED
Fission Milestone: --- → M4
Priority: -- → P2

Roll some unfixed bugs from Fission Milestone M4 to M5

0ee3c76a-bc79-4eb2-8d12-05dc0b68e732

Fission Milestone: M4 → M5

This is needed to prevent repeat submission of forms.

Priority: P2 → P3
Blocks: fission

Interesting fact: this actually works in fission.

For now at least. If/when we move loading to the parent this becomes another issue.

I wrote a test case that demonstrates that this is successful currently, and that should help us for further changes as well.

(In reply to Andreas Farre [:farre] from comment #5)

Interesting fact: this actually works in fission.

For now at least. If/when we move loading to the parent this becomes another issue.

Matt, what is the bug # for initiating loads in the parent process? This bug should block that bug.

Since this case currently works in Fission, this bug doesn't need to block M5 dogfooding.

Fission Milestone: M5 → M6
Flags: needinfo?(matt.woodrow)

(In reply to Andreas Farre [:farre] from comment #5)

Interesting fact: this actually works in fission.

For now at least. If/when we move loading to the parent this becomes another issue.

I wrote a test case that demonstrates that this is successful currently, and that should help us for further changes as well.

Do you know how it works currently? Seems really surprising, if the target docshell is OOP.

Blocks: 1602318
Flags: needinfo?(matt.woodrow)

(In reply to Andreas Farre [:farre] from comment #5)

Interesting fact: this actually works in fission.

For now at least. If/when we move loading to the parent this becomes another issue.

It doesn't when the target of the submission is already cross-process. And it probably only soft-of works in the other cases.

Attachment #9132270 - Attachment description: Bug 1590762 - Add test for multiple form submit attempts. r=nika → Bug 1590762 - Part 1: Add test for multiple form submit attempts. r=kmag
Attachment #9132270 - Attachment description: Bug 1590762 - Part 1: Add test for multiple form submit attempts. r=kmag → Bug 1590762 - Part 1: Add test for multiple form submit attempts. r=mattwoodrow
Attachment #9148009 - Attachment description: Bug 1590762 - Part 2: Keep track of current loads in BrowsingContext. → Bug 1590762 - Part 2: Keep track of current loads in BrowsingContext. r=mattwoodrow
Attached image neterror.png (deleted) —
Attached file resultcentral.txt (deleted) —
Attached file resulttopic.txt (deleted) —

Added some logs that might help explain why this test fails in the general case, without double-submission attempts.

Flags: needinfo?(matt.woodrow)

I can't get the test to work locally, it just times out.

Looking at that log, it appears that the actual underlying http channel failed.

We successfully redirect the channel to the new process, but the docshell that receives it immediately initiates a load to about:neterror.

That suggests that the channel was in error state.

Maybe adding nsHttp:5 to the logging would show where that happens? Is it possible that we threw an exception from the .sjs file?

Flags: needinfo?(matt.woodrow)

M6a because farre is working on this bug now.

Fission Milestone: M6 → M6a
Attachment #9132270 - Attachment is obsolete: true
Attachment #9155671 - Attachment is obsolete: true

This patch also makes the identifier for channels global, in the sense
that the generated identifier is generated outside of and passed to
the nsIRedirectChannelRegistrar.

Depends on D79145

Attachment #9148009 - Attachment description: Bug 1590762 - Part 2: Keep track of current loads in BrowsingContext. r=mattwoodrow → Bug 1590762 - Part 3: Keep track of current loads in BrowsingContext. r=mattwoodrow!
Blocks: 1645781
Pushed by afarre@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/37fe053b2ed8 Part 1: Test that we don't double submit forms. r=kmag https://hg.mozilla.org/integration/autoland/rev/b1506f4ded81 Part 2: Bump the id for channel registration to uint64_t. r=mattwoodrow,necko-reviewers,valentin https://hg.mozilla.org/integration/autoland/rev/086cab3a701a Part 3: Keep track of current loads in BrowsingContext. r=mattwoodrow https://hg.mozilla.org/integration/autoland/rev/5431d962a10f Part 4: Remove nsIWebProgressListener from HTMLFormElement. r=mattwoodrow

Andreas, could you please investigate why the failures that look like Bug 1358898 increased after the changes here landed?
Treeherder link.
Failure log: https://treeherder.mozilla.org/logviewer.html#?job_id=307315993&repo=autoland

[task 2020-06-23T23:58:31.201Z] 23:58:31     INFO - TEST-OK | docshell/test/mochitest/test_windowedhistoryframes.html | took 1080ms
[task 2020-06-23T23:58:31.240Z] 23:58:31     INFO - TEST-START | Shutdown
[task 2020-06-23T23:58:31.240Z] 23:58:31     INFO - Passed:  297
[task 2020-06-23T23:58:31.240Z] 23:58:31     INFO - Failed:  0
[task 2020-06-23T23:58:31.240Z] 23:58:31     INFO - Todo:    8
[task 2020-06-23T23:58:31.240Z] 23:58:31     INFO - Mode:    e10s
[task 2020-06-23T23:58:31.241Z] 23:58:31     INFO - Slowest: 36522ms - /tests/docshell/test/mochitest/test_double_submit.html
[task 2020-06-23T23:58:31.241Z] 23:58:31     INFO - SimpleTest FINISHED
[task 2020-06-23T23:58:31.241Z] 23:58:31     INFO - TEST-INFO | Ran 1 Loops
[task 2020-06-23T23:58:31.241Z] 23:58:31     INFO - SimpleTest FINISHED
[task 2020-06-23T23:58:31.501Z] 23:58:31     INFO - GECKO(4804) | ###!!! [Parent][RunMessage] Error: Channel closing: too late to send/recv, messages will be lost
[task 2020-06-23T23:58:31.600Z] 23:58:31     INFO - GECKO(4804) | [GPU 6992, Compositor] WARNING: Possibly dropping task posted to updater thread: file /builds/worker/checkouts/gecko/gfx/layers/apz/src/APZUpdater.cpp, line 370
[task 2020-06-23T23:58:31.682Z] 23:58:31     INFO - GECKO(4804) | [Child 3448, Main Thread] WARNING: Extra shutdown CC: 'i < NORMAL_SHUTDOWN_COLLECTIONS', file /builds/worker/checkouts/gecko/xpcom/base/nsCycleCollector.cpp, line 3359
[task 2020-06-23T23:58:32.026Z] 23:58:32     INFO - GECKO(4804) | [2020-06-23T23:58:32Z WARN  xulstore::persist] tried to remove key that isn't in the store
[task 2020-06-23T23:58:32.026Z] 23:58:32     INFO - GECKO(4804) | [2020-06-23T23:58:32Z WARN  xulstore::persist] tried to remove key that isn't in the store
[task 2020-06-23T23:59:35.595Z] 23:59:35     INFO - GECKO(4804) | XPCOM_MEM_BLOAT_LOG: c:\users\task_1592955019\appdata\local\temp\tmpwdfxpm.mozrunner\runtests_leaks.log
[task 2020-06-23T23:59:35.595Z] 23:59:35     INFO - GECKO(4804) | Writing to log: c:\users\task_1592955019\appdata\local\temp\tmpwdfxpm.mozrunner\runtests_leaks.log
[task 2020-06-23T23:59:35.595Z] 23:59:35     INFO - GECKO(4804) | Hit MOZ_CRASH(Shutdown hanging before starting.) at /builds/worker/checkouts/gecko/toolkit/components/terminator/nsTerminator.cpp:203
[task 2020-06-23T23:59:36.041Z] 23:59:36     INFO - GECKO(4804) | #01: pr_root(void*) [nsprpub/pr/src/md/windows/w95thred.c:140]
[task 2020-06-23T23:59:36.041Z] 23:59:36     INFO -  fix-stacks error: failed to read breakpad symbols dir `Z:\task_1592955019\build\symbols\ucrtbase.pdb` for `C:\Windows\System32\ucrtbase.dll`
[task 2020-06-23T23:59:36.041Z] 23:59:36     INFO -  fix-stacks note:  this is expected and harmless for system libraries on debug automation runs
[task 2020-06-23T23:59:36.041Z] 23:59:36     INFO - GECKO(4804) | #02: o_ceil [C:\Windows\System32\ucrtbase.dll + 0x1c4be]
[task 2020-06-23T23:59:36.041Z] 23:59:36     INFO - GECKO(4804) | #03: BaseThreadInitThunk [C:\Windows\System32\KERNEL32.DLL + 0x13034]
[task 2020-06-23T23:59:36.041Z] 23:59:36     INFO - GECKO(4804) | #04: RtlUserThreadStart [C:\Windows\SYSTEM32\ntdll.dll + 0x71461]
[task 2020-06-23T23:59:36.222Z] 23:59:36     INFO - GECKO(4804) | [GPU 6992, Main Thread] WARNING: Shutting down GPU process early due to a crash!: file /builds/worker/checkouts/gecko/gfx/ipc/GPUParent.cpp, line 519
[task 2020-06-23T23:59:36.222Z] 23:59:36     INFO - GECKO(4804) | Exiting due to channel error.
[task 2020-06-23T23:59:36.222Z] 23:59:36     INFO - GECKO(4804) | Exiting due to channel error.
[task 2020-06-23T23:59:37.257Z] 23:59:37     INFO - TEST-INFO | Main app process: exit 1
[task 2020-06-23T23:59:37.257Z] 23:59:37     INFO - Buffered messages finished
[task 2020-06-23T23:59:37.257Z] 23:59:37    ERROR - TEST-UNEXPECTED-FAIL | Last test finished | application terminated with exit code 1
[task 2020-06-23T23:59:37.258Z] 23:59:37     INFO - runtests.py | Application ran for: 0:03:09.089000
[task 2020-06-23T23:59:37.258Z] 23:59:37     INFO - zombiecheck | Reading PID log: c:\users\task_1592955019\appdata\local\temp\tmpjgnzumpidlog
[task 2020-06-23T23:59:37.260Z] 23:59:37     INFO - ==> process 8076 launched child process 6992 ("Z:\task_1592955019\build\application\firefox\firefox.exe" -contentproc --channel="8076.0.863893414\647201031" -parentBuildID 20200623160053 -prefsHandle 2212 -prefMapHandle 2204 -prefsLen 1 -prefMapSize 236383 -appdir "Z:\task_1592955019\build\application\firefox\browser" - 8076 "\\.\pipe\gecko-crash-server-pipe.8076" 2276 gpu)
[task 2020-06-23T23:59:37.260Z] 23:59:37     INFO - ==> process 8076 launched child process 10384 ("Z:\task_1592955019\build\application\firefox\firefox.exe" -contentproc --channel="8076.6.739967726\1984359358" -childID 1 -isForBrowser -prefsHandle 2188 -prefMapHandle 2184 -prefsLen 1779 -prefMapSize 236383 -parentBuildID 20200623160053 -appdir "Z:\task_1592955019\build\application\firefox\browser" - 8076 "\\.\pipe\gecko-crash-server-pipe.8076" 2136 tab)
[task 2020-06-23T23:59:37.260Z] 23:59:37     INFO - ==> process 8076 launched child process 9592 ("Z:\task_1592955019\build\application\firefox\firefox.exe" -contentproc --channel="8076.13.1666077270\963784588" -childID 2 -isForBrowser -prefsHandle 5596 -prefMapHandle 5592 -prefsLen 2193 -prefMapSize 236383 -parentBuildID 20200623160053 -appdir "Z:\task_1592955019\build\application\firefox\browser" - 8076 "\\.\pipe\gecko-crash-server-pipe.8076" 5604 tab)
[task 2020-06-23T23:59:37.260Z] 23:59:37     INFO - ==> process 8076 launched child process 3448 ("Z:\task_1592955019\build\application\firefox\firefox.exe" -contentproc --channel="8076.20.1167894061\608072077" -childID 3 -isForBrowser -prefsHandle 5632 -prefMapHandle 5604 -prefsLen 2233 -prefMapSize 236383 -parentBuildID 20200623160053 -appdir "Z:\task_1592955019\build\application\firefox\browser" - 8076 "\\.\pipe\gecko-crash-server-pipe.8076" 5800 tab)
[task 2020-06-23T23:59:37.260Z] 23:59:37     INFO - ==> process 8076 launched child process 10116 ("Z:\task_1592955019\build\application\firefox\firefox.exe" -contentproc --channel="8076.27.545342746\1587956351" -childID 4 -isForBrowser -prefsHandle 4520 -prefMapHandle 4516 -prefsLen 10675 -prefMapSize 236383 -parentBuildID 20200623160053 -appdir "Z:\task_1592955019\build\application\firefox\browser" - 8076 "\\.\pipe\gecko-crash-server-pipe.8076" 3668 tab)
[task 2020-06-23T23:59:37.260Z] 23:59:37     INFO - ==> process 8076 launched child process 2464 ("Z:\task_1592955019\build\application\firefox\firefox.exe" -contentproc --channel="8076.34.1914694743\573102331" -childID 5 -isForBrowser -prefsHandle 4196 -prefMapHandle 4680 -prefsLen 11544 -prefMapSize 236383 -parentBuildID 20200623160053 -appdir "Z:\task_1592955019\build\application\firefox\browser" - 8076 "\\.\pipe\gecko-crash-server-pipe.8076" 1924 tab)
[task 2020-06-23T23:59:37.261Z] 23:59:37     INFO - zombiecheck | Checking for orphan process with PID: 2464
[task 2020-06-23T23:59:37.261Z] 23:59:37     INFO - zombiecheck | Checking for orphan process with PID: 10384
[task 2020-06-23T23:59:37.261Z] 23:59:37     INFO - zombiecheck | Checking for orphan process with PID: 10116
[task 2020-06-23T23:59:37.261Z] 23:59:37     INFO - zombiecheck | Checking for orphan process with PID: 6992
[task 2020-06-23T23:59:37.261Z] 23:59:37     INFO - zombiecheck | Checking for orphan process with PID: 9592
[task 2020-06-23T23:59:37.262Z] 23:59:37     INFO - zombiecheck | Checking for orphan process with PID: 3448
[task 2020-06-23T23:59:37.262Z] 23:59:37     INFO - mozcrash Copy/paste: Z:/task_1592955019/fetches\minidump_stackwalk\minidump_stackwalk.exe c:\users\task_1592955019\appdata\local\temp\tmpwdfxpm.mozrunner\minidumps\af367aff-32f4-44c1-9b03-687047e19720.dmp Z:\task_1592955019\build\symbols
[task 2020-06-23T23:59:44.054Z] 23:59:44     INFO - mozcrash Saved minidump as Z:\task_1592955019\build\blobber_upload_dir\af367aff-32f4-44c1-9b03-687047e19720.dmp
[task 2020-06-23T23:59:44.054Z] 23:59:44     INFO - mozcrash Saved app info as Z:\task_1592955019\build\blobber_upload_dir\af367aff-32f4-44c1-9b03-687047e19720.extra
[task 2020-06-23T23:59:44.095Z] 23:59:44     INFO - PROCESS-CRASH | Last test finished | application crashed [@ mozilla::`anonymous namespace'::RunWatchdog(void*)]
[task 2020-06-23T23:59:44.095Z] 23:59:44     INFO - Mozilla crash reason: MOZ_CRASH(Shutdown hanging before starting.)
[task 2020-06-23T23:59:44.095Z] 23:59:44     INFO - Crash dump filename: c:\users\task_1592955019\appdata\local\temp\tmpwdfxpm.mozrunner\minidumps\af367aff-32f4-44c1-9b03-687047e19720.dmp
[task 2020-06-23T23:59:44.095Z] 23:59:44     INFO - Operating system: Windows NT
[task 2020-06-23T23:59:44.095Z] 23:59:44     INFO -                   10.0.17134 
[task 2020-06-23T23:59:44.095Z] 23:59:44     INFO - CPU: amd64
[task 2020-06-23T23:59:44.095Z] 23:59:44     INFO -      family 6 model 85 stepping 4
[task 2020-06-23T23:59:44.095Z] 23:59:44     INFO -      8 CPUs
[task 2020-06-23T23:59:44.095Z] 23:59:44     INFO - 
[task 2020-06-23T23:59:44.095Z] 23:59:44     INFO - GPU: UNKNOWN
[task 2020-06-23T23:59:44.095Z] 23:59:44     INFO - 
[task 2020-06-23T23:59:44.095Z] 23:59:44     INFO - Crash reason:  EXCEPTION_BREAKPOINT
[task 2020-06-23T23:59:44.095Z] 23:59:44     INFO - Crash address: 0x95b20437
[task 2020-06-23T23:59:44.095Z] 23:59:44     INFO - Process uptime: 188 seconds
[task 2020-06-23T23:59:44.095Z] 23:59:44     INFO - 
[task 2020-06-23T23:59:44.095Z] 23:59:44     INFO - Thread 68 (crashed)
[task 2020-06-23T23:59:44.095Z] 23:59:44     INFO -  0  xul.dll!mozilla::`anonymous namespace'::RunWatchdog(void*) [nsTerminator.cpp:5431d962a10f33df15f35bc47e62b6740b61308e : 203 + 0x0]
[task 2020-06-23T23:59:44.095Z] 23:59:44     INFO -     rax = 0x00007ffe9952539b   rdx = 0x00007ffed5cca640
[task 2020-06-23T23:59:44.095Z] 23:59:44     INFO -     rcx = 0x00007ffec0c41028   rbx = 0x00007ffec0ff1b33
[task 2020-06-23T23:59:44.095Z] 23:59:44     INFO -     rsi = 0x00007ffed8363ca0   rdi = 0x000000000000003f
[task 2020-06-23T23:59:44.095Z] 23:59:44     INFO -     rbp = 0x00007ffec1048240   rsp = 0x0000006c55ebfa00
[task 2020-06-23T23:59:44.095Z] 23:59:44     INFO -      r8 = 0x0000006c55eb9a48    r9 = 0x00007ffe985afe40
[task 2020-06-23T23:59:44.095Z] 23:59:44     INFO -     r10 = 0x0000000000000000   r11 = 0x0000006c55ebb090
[task 2020-06-23T23:59:44.095Z] 23:59:44     INFO -     r12 = 0x000001b974750538   r13 = 0x000001b974750548
[task 2020-06-23T23:59:44.095Z] 23:59:44     INFO -     r14 = 0x0000000000000000   r15 = 0x00007ffec0ff1b54
[task 2020-06-23T23:59:44.096Z] 23:59:44     INFO -     rip = 0x00007ffe95b20437
[task 2020-06-23T23:59:44.096Z] 23:59:44     INFO -     Found by: given as instruction pointer in context
[task 2020-06-23T23:59:44.096Z] 23:59:44     INFO -  1  nss3.dll!PR_NativeRunThread(void*) [pruthr.c:5431d962a10f33df15f35bc47e62b6740b61308e : 399 + 0x7]
[task 2020-06-23T23:59:44.096Z] 23:59:44     INFO -     rbx = 0x00007ffec0ff1b33   rbp = 0x00007ffec1048240
[task 2020-06-23T23:59:44.096Z] 23:59:44     INFO -     rsp = 0x0000006c55ebfa50   r12 = 0x000001b974750538
[task 2020-06-23T23:59:44.096Z] 23:59:44     INFO -     r13 = 0x000001b974750548   r14 = 0x0000000000000000
[task 2020-06-23T23:59:44.096Z] 23:59:44     INFO -     r15 = 0x00007ffec0ff1b54   rip = 0x00007ffec0eac0eb
[task 2020-06-23T23:59:44.096Z] 23:59:44     INFO -     Found by: call frame info
[task 2020-06-23T23:59:44.096Z] 23:59:44     INFO -  2  nss3.dll!pr_root(void*) [w95thred.c:5431d962a10f33df15f35bc47e62b6740b61308e : 139 + 0x6]
[task 2020-06-23T23:59:44.096Z] 23:59:44     INFO -     rbx = 0x00007ffec0ff1b33   rbp = 0x00007ffec1048240
[task 2020-06-23T23:59:44.096Z] 23:59:44     INFO -     rsp = 0x0000006c55ebfad0   r12 = 0x000001b974750538
[task 2020-06-23T23:59:44.096Z] 23:59:44     INFO -     r13 = 0x000001b974750548   r14 = 0x0000000000000000
[task 2020-06-23T23:59:44.096Z] 23:59:44     INFO -     r15 = 0x00007ffec0ff1b54   rip = 0x00007ffec0e9ca4a
[task 2020-06-23T23:59:44.096Z] 23:59:44     INFO -     Found by: call frame info
[task 2020-06-23T23:59:44.096Z] 23:59:44     INFO -  3  ucrtbase.dll!RtlpHpSegPageRangeShrink + 0xda
[task 2020-06-23T23:59:44.096Z] 23:59:44     INFO -     rbx = 0x00007ffec0ff1b33   rbp = 0x00007ffec1048240
[task 2020-06-23T23:59:44.096Z] 23:59:44     INFO -     rsp = 0x0000006c55ebfb00   r12 = 0x000001b974750538
[task 2020-06-23T23:59:44.096Z] 23:59:44     INFO -     r13 = 0x000001b974750548   r14 = 0x0000000000000000
[task 2020-06-23T23:59:44.096Z] 23:59:44     INFO -     r15 = 0x00007ffec0ff1b54   rip = 0x00007ffed5bfc4be
[task 2020-06-23T23:59:44.096Z] 23:59:44     INFO -     Found by: call frame info
Flags: needinfo?(afarre)

So test_double_submit.html tries to post ~10MB worth of data, because I thought that it needed to do that. Turns out that 1MB of data is sufficient, but I've written 1014*1024 * 10 at one point. That times ten is because of not noticing that 1014 should be 1023 :(

https://treeherder.mozilla.org/#/jobs?repo=try&revision=e47c87542af3dc64d9fb9e3e0699e7d8d7d0869d&group_state=expanded&selectedTaskRun=D2GZVgDgQ6qh_QKLux8qVA.0

seems to agree with me on this. Filed bug 1649066 for correcting this.

Flags: needinfo?(afarre)
Regressions: 1658082
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: