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

[release/3.1] Application scaling regression. Revert ildasm/ilasm tools to 4.6.2 to fix module initializer injection regression. #5377

Merged
merged 2 commits into from Oct 8, 2021

Conversation

ryalanms
Copy link
Member

@ryalanms ryalanms commented Sep 23, 2021

Description

[release/3.1] Application scaling regression. Revert ildasm/ilasm tools to 4.6.2 to fix module initializer injection regression.

Part of the change that went in to 3.1.18 included a tools version update that broke application scaling. This reverts ildasm/ilasm tools to an earlier working version that successfully reassembles PresentationCore with the additional module initializer.

Apply @ThomasGoulet73's fix for module initializer injection regression in release/3.1.
Fixes #5375.

PresentationCore must load DirectWriteForwarder before performing scaling calculations.

Customer Impact

Missing module initializer in PresentationCore prevents application scaling without an application workaround. This impacts PowerToys and other applications using 3.1. Reported by multiple customers after 3.1.19 was released.

Regression

This is a regression from 3.1.18.

Risk

Very low. We are reverting the ILDasm/ILAsm versions used to disassemble and reassemble PresentationCore with an additional module initializer back to the version used in 4.6.2.

Testing

Disassembled the assembly and verified the module initializer was successfully added. Tested on a clean Windows 10 VM. Reproduced the scaling failure and verified it was fixed with the updated PresentationCore assembly.

@ghost ghost added the PR metadata: Label to tag PRs, to facilitate with triage label Sep 23, 2021
@ghost ghost requested review from fabiant3 and SamBent September 23, 2021 20:30
@ryalanms ryalanms requested a review from a team September 23, 2021 20:31
Comment on lines 65 to 66
ILAsm = ToolLocationHelper.GetPathToDotNetFrameworkFile("ILAsm.exe", TargetDotNetFrameworkVersion.Latest, bitness);
ILDAsm = ToolLocationHelper.GetPathToDotNetFrameworkSdkFile("ILDAsm.exe", TargetDotNetFrameworkVersion.Latest, bitness);
ILAsm = ToolLocationHelper.GetPathToDotNetFrameworkFile("ILAsm.exe", TargetDotNetFrameworkVersion.VersionLatest, bitness);
ILDAsm = ToolLocationHelper.GetPathToDotNetFrameworkSdkFile("ILDAsm.exe", TargetDotNetFrameworkVersion.VersionLatest, bitness);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This reverts the fix for #5059, hence re-introduces that build break. Which was incomprehensible to me and everyone else for many days.

If you must do this, is there somewhere you can announce that building release/3.1 requires having installed the .NET Framework 4.6.2 developer pack? In a way that's discoverable by users who hit the build break.

It's also disturbing that the testing for #5059 didn't discover the problem. There's a gap that needs filling.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we could add it to the requirements in the documentation and update the .vsconfig (for 3.1).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SamBent See my comment for the reason it didn't break the build: #5375 (comment).

In short, ILAsm fails but the Task ILAsm returns true whether or not the process exited with 0 or not. Since the ILAsm simply overrides the original dll, it doesn't break the build and the original dll is kept in the output. One quick fix would be to replace this by this:

Process process = Process.Start(startInfo);
process.WaitForExit();
return process.ExitCode == 0;

EDIT: I re-read your comment and I think I misunderstood what you said. My comment is still valid for avoiding #5375 but not for avoiding #5059.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I put the documentation update in a separate PR: #5402.

@ryalanms ryalanms changed the title Revert ILDasm/ILAsm tools version to 4.6.2 to fix module initializer in PresentationCore [release/3.1] Application scaling regression. Revert ildasm/ilasm tools to 4.6.2 to fix module initializer injection regression. Sep 30, 2021
@leecow leecow added this to the 3.1.21 milestone Oct 5, 2021
@ryalanms ryalanms merged commit 6f2a418 into release/3.1 Oct 8, 2021
@vishalmsft vishalmsft deleted the revert.ildasm.tools.to.4.6.2 branch February 15, 2022 05:34
@dotnet dotnet locked as resolved and limited conversation to collaborators Apr 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
PR metadata: Label to tag PRs, to facilitate with triage Servicing-approved
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants