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

IID Optimizer writes zero byte patched DLL on exception #953

Closed
Scottj1s opened this issue Aug 6, 2021 · 1 comment · Fixed by #960
Closed

IID Optimizer writes zero byte patched DLL on exception #953

Scottj1s opened this issue Aug 6, 2021 · 1 comment · Fixed by #960
Assignees
Labels
bug Something isn't working fixed Issue has been fixed in an upcoming or existing release
Milestone

Comments

@Scottj1s
Copy link
Member

Scottj1s commented Aug 6, 2021

If the optimizer throws an exception, it corrupts the patched DLL, writing zero bytes. Workaround is to disable optimization via CsWinRTIIDOptimizerOptOut.

Build log excerpt from a recent WinUI build follows:

2021-08-04T22:12:11.9946856Z CsWinRTInvokeGuidPatcher:
2021-08-04T22:12:11.9947992Z "C:\a\1\s\packages\microsoft.windows.cswinrt\1.3.3\build\tools\IIDOptimizer\IIDOptimizer.exe" @"C:\a\1\s\BuildOutput\obj\x86chk\controls\test\MUXControlsTestApp\TAEF.Desktop\MUXControlsTestApp.TAEF.Desktop\net5.0-windows10.0.18362.0\win10-x86\IIDOptimizer\cswinrt_iidoptimizer.rsp"
2021-08-04T22:12:11.9958642Z "C:\a\1\s\packages\microsoft.windows.cswinrt\1.3.3\build\tools\IIDOptimizer\IIDOptimizer.exe" @"C:\a\1\s\BuildOutput\obj\x86chk\controls\test\MUXControlsTestApp\TAEF.Desktop\MUXControlsTestApp.TAEF.Desktop\net5.0-windows10.0.18362.0\win10-x86\IIDOptimizer\cswinrt_iidoptimizer.rsp"
2021-08-04T22:12:12.8969155Z Unhandled exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
2021-08-04T22:12:12.8970165Z ---> Mono.Cecil.ResolutionException: Failed to resolve Microsoft.UI.Xaml.Controls.ScrollingInteractionState
2021-08-04T22:12:12.8970875Z at Mono.Cecil.Mixin.CheckedResolve(TypeReference self)
2021-08-04T22:12:12.8971497Z at Mono.Cecil.MetadataBuilder.GetConstantType(TypeReference constant_type, Object constant)
2021-08-04T22:12:12.8972168Z at Mono.Cecil.MetadataBuilder.AddConstant(IConstantProvider owner, TypeReference type)
2021-08-04T22:12:12.8972865Z at Mono.Cecil.MetadataBuilder.AddField(FieldDefinition field)
2021-08-04T22:12:12.8973443Z at Mono.Cecil.MetadataBuilder.AddFields(TypeDefinition type)

2021-08-04T22:12:12.9241771Z CsWinRTReplaceForPatchedRuntime:
2021-08-04T22:12:12.9243130Z Copying file from "C:\a\1\s\BuildOutput\obj\x86chk\controls\test\MUXControlsTestApp\TAEF.Desktop\MUXControlsTestApp.TAEF.Desktop\net5.0-windows10.0.18362.0\win10-x86\IIDOptimizer\MUXControlsTestApp.TAEF.Desktop.dll" to "C:\a\1\s\BuildOutput\obj\x86chk\controls\test\MUXControlsTestApp\TAEF.Desktop\MUXControlsTestApp.TAEF.Desktop\net5.0-windows10.0.18362.0\win10-x86\MUXControlsTestApp.TAEF.Desktop.dll".

@Scottj1s Scottj1s added the bug Something isn't working label Aug 6, 2021
@j0shuams
Copy link
Contributor

Looks like the command-line-api wrapper we use is not passing the optimizer's exit code along when the program terminates

@manodasanW manodasanW added this to the Release 1.3.4 milestone Aug 18, 2021
@angelazhangmsft angelazhangmsft added the fixed Issue has been fixed in an upcoming or existing release label Oct 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed Issue has been fixed in an upcoming or existing release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants