Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebBrowser doesn't like multiple UI threads #3473

Merged
merged 1 commit into from
Jun 22, 2020

Conversation

weltkante
Copy link
Contributor

@weltkante weltkante commented Jun 19, 2020

Workaround for #3358

(Extended version of PR #3423 and #3429)

Like mentioned on the other PR this is only a workaround and not a final solution, further investigation to the memory corruption issues are desired. There is also the possibility of another memory corruption source we did not pinpoint yet.

Proposed changes

Prevent running WebBrowser control tests on multiple UI threads in parallel as that seems to cause memory corruption (unknown whether root cause is in WinForms or native control)

Customer Impact

no random crashes due to memory corruption in unit tests, should improve CI sucess rates

Regression?

no

Risk

may slow down tests a bit

Before

random CI crashes or test failures that made no sense due to memory corruption

After

prevent memory corruption, allowing CI runs to perform normally

Test methodology

isolated repro scenario into a separate application, it doesn't seem to cause memory corruption when only one UI thread is running the WebBrowser control

Microsoft Reviewers: Open in CodeFlow

@weltkante weltkante requested a review from a team as a code owner June 19, 2020 22:56
@ghost ghost assigned weltkante Jun 19, 2020
@weltkante
Copy link
Contributor Author

weltkante commented Jun 19, 2020

@RussKie somehow I missed "hidden" usages of WebBrowser (AxHost instantiated via WebBrowser GUID), its not worth to look at any dumps until this is merged or crashes in the CI of this PR, since without this fix you won't be able to easily differentiate WebBrowser corruption from potential other corruption.

Lets hope we were just observing more WebBrowser corruption and there is no second source. 🙏

@weltkante
Copy link
Contributor Author

Failed test Clipboard_SetText_InvokeStringTextDataFormat_GetReturnsExpected is probably not related to the issue investigated here, can be covered by #3456

RussKie
RussKie previously approved these changes Jun 19, 2020
@RussKie
Copy link
Member

RussKie commented Jun 19, 2020

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@weltkante
Copy link
Contributor Author

linking failed test run if inspection is desired

  • debug test runner is hanging, I don't have the bigger picture but if this is still a thing happening on CI we may want to reopen the issue about getting minidumps for that (preferably after they can be read again)
  • release test runner seems to have crashed. Not sure if we can learn much from crash dumps even if they are present
  • retrying CI one more time, if it keeps crashing we may need to wait for the runtime to solve the problem with the unreadable dumps first.

@codecov
Copy link

codecov bot commented Jun 20, 2020

Codecov Report

Merging #3473 into master will increase coverage by 31.75568%.
The diff coverage is n/a.

@@                 Coverage Diff                  @@
##              master       #3473          +/-   ##
====================================================
+ Coverage   66.75048%   98.50616%   +31.75567%     
====================================================
  Files           1340         446         -894     
  Lines         503081      249692      -253389     
  Branches       40834        4091       -36743     
====================================================
- Hits          335809      245962       -89847     
+ Misses        161711        3019      -158692     
+ Partials        5561         711        -4850     
Flag Coverage Δ
#Debug 98.50616% <ø> (+31.75567%) ⬆️
#production ?
#test 98.50616% <ø> (ø)

@RussKie RussKie merged commit 581525b into dotnet:master Jun 22, 2020
@ghost ghost added this to the 5.0 Preview7 milestone Jun 22, 2020
@RussKie RussKie added the test-bug Problem in test source code (most likely) label Jun 22, 2020
@weltkante
Copy link
Contributor Author

Took a look at the crash dump, its heap corruption, that means I either missed a test invoking WebBrowser COM objects or there is a second source of corruption. Can't tell much more at the moment, dumps still unreadable.

@weltkante weltkante deleted the issue3358 branch June 22, 2020 12:50
@ghost ghost locked as resolved and limited conversation to collaborators Jan 31, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
test-bug Problem in test source code (most likely)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants