-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Microsoft.WindowsDesktop.App (latest runtime) 5.0.0-preview.8.20330.4 cannot display #3226
Comments
5.0.100-preview.6.20325.9 and 5.0.100-preview.7.20357.1 are working: repros on 5.0.0-preview.8.20328.6. Replacing \Program Files\dotnet\shared\Microsoft.NETCore.App\5.0.0-preview.8.20328.6 coreclr.dll and clrjit.dll with Preview7 versions fixes the regression. Repros with the default WPF template (impacts all WPF applications): dotnet new wpf Windows have a client area height of 0. |
@mangod9 can you ask someone take a look? |
@ryalanms I am able to repro it, to make diagnosing quicker is there a specific property/field on the window which doesnt seem to be initialized correctly? That would help narrow down where the issue might be. I looked at the |
I'm not seeing any obviously bad values in the parameters of the p/invoke calls for win32 class registration, Window creation, or size/placement (SetWindowPos).
Inspecting the Window with Spy++ shows that the client area height is 0. Unhelpful, I know. I'll keep looking. |
@mangod9: Yes, that is correct. SetWindowPos will eventually be called to set the Window size. |
@AaronRobinsonMSFT fyi.. |
@mangod9 I don't think this is a P/Invoke issue - at least not with The generated code for the dispatch in question is the following: 00007FFA8FD07D4F 48 8B 4D B8 mov rcx,qword ptr [rbp-48h]
00007FFA8FD07D53 48 8B 55 B0 mov rdx,qword ptr [rbp-50h]
00007FFA8FD07D57 4C 8B C3 mov r8,rbx
00007FFA8FD07D5A 4D 8B CE mov r9,r14
00007FFA8FD07D5D 4C 8B 55 A8 mov r10,qword ptr [rbp-58h]
00007FFA8FD07D61 4C 89 95 78 FF FF FF mov qword ptr [rbp-88h],r10
00007FFA8FD07D68 4C 8D 15 0B 00 00 00 lea r10,[7FFA8FD07D7Ah]
00007FFA8FD07D6F 4C 89 55 90 mov qword ptr [rbp-70h],r10
00007FFA8FD07D73 41 C6 47 0C 00 mov byte ptr [r15+0Ch],0
00007FFA8FD07D78 FF D0 call rax This follows the x64 calling convention - RCX, RDX, R8, R9, spill to stack.
The dispatch call should be: Values |
@mangod9 Here is a comparison between the two scenarios. The generated code is slightly different. I don't know how important .NET Core 3.1 00007FFA8F2FD38F 48 8B 4D B8 mov rcx,qword ptr [rbp-48h]
00007FFA8F2FD393 48 8B 55 B0 mov rdx,qword ptr [rbp-50h]
00007FFA8F2FD397 4C 8B C3 mov r8,rbx
00007FFA8F2FD39A 4D 8B CE mov r9,r14
00007FFA8F2FD39D 41 BB 18 00 00 00 mov r11d,18h
00007FFA8F2FD3A3 4C 8B 55 A8 mov r10,qword ptr [rbp-58h]
00007FFA8F2FD3A7 4C 89 95 78 FF FF FF mov qword ptr [rbp-88h],r10
00007FFA8F2FD3AE 4C 8D 15 0B 00 00 00 lea r10,[7FFA8F2FD3C0h]
00007FFA8F2FD3B5 4C 89 55 90 mov qword ptr [rbp-70h],r10
00007FFA8F2FD3B9 41 C6 47 0C 00 mov byte ptr [r15+0Ch],0
00007FFA8F2FD3BE FF D0 call rax First call:
Second call:
.NET 5.0 Preview 8 00007FFA8FCD7A7F 48 8B 4D B8 mov rcx,qword ptr [rbp-48h]
00007FFA8FCD7A83 48 8B 55 B0 mov rdx,qword ptr [rbp-50h]
00007FFA8FCD7A87 4C 8B C3 mov r8,rbx
00007FFA8FCD7A8A 4D 8B CE mov r9,r14
00007FFA8FCD7A8D 4C 8B 55 A8 mov r10,qword ptr [rbp-58h]
00007FFA8FCD7A91 4C 89 95 78 FF FF FF mov qword ptr [rbp-88h],r10
00007FFA8FCD7A98 4C 8D 15 0B 00 00 00 lea r10,[7FFA8FCD7AAAh]
00007FFA8FCD7A9F 4C 89 55 90 mov qword ptr [rbp-70h],r10
00007FFA8FCD7AA3 41 C6 47 0C 00 mov byte ptr [r15+0Ch],0
00007FFA8FCD7AA8 FF D0 call rax First call:
Second call:
|
thanks for investigating @AaronRobinsonMSFT. Yeah these appear to be correct. @ryalanms, is this the only place the size is set? Or per your previous comment is the client area height specified some place else? Just want to ensure we are going down the right path to determine what is going on. |
Bruce and I are happy to help, let us know when/if it makes sense to get us more directly involved. |
Thanks @AndyAyersMS. I believe it would make sense to understand from WPF which precise API(s) are not working as expected. From the initial look doesnt look like |
@AaronRobinsonMSFT |
I've a feeling you're all looking for an x64 (or a 64-bit) problem. Someone should try to repro this on x86 (my hasty 2 min check shows me that it doesn't repro on x86) 😉 |
@BruceForstall I don't think so in this case. The |
If SetWindowPos (or P/Invokes in general) has a problem, then why isn't WinForms also broken by this (or is it) ? |
@vatsan-madhavan That is a good question and something I was going to propose. In this case it was very simple to check the codege so I made the sanity check. I agree with you that it does seem related to any interop at the P/Invoke stub gen time or else many more things would be broken in this area. |
Did we establish if this repros on x64, or is it an x86 only issue? |
Ah, so it is only x64. |
@BruceForstall and I working on this now... will update status in a bit. |
Strongly suspect this is a jit issue. Does not require optimization to repro. We have a suspect change in mind. Bisecting now to confirm. |
Looks like it was dotnet/runtime#38316. We're going to look at reverting this, and in parallel track down where it went wrong. |
This was stack size for SQL hosting. It was removed by dotnet/coreclr#27069 |
We are going to disable the problematic optimization for now, and work on fixing it afterwards. I would like to run the fix through more WPF tests to make sure nothing else comes up. @dotnet/dotnet-wpf can you recommend something? |
Also pinging @dotnet/wpf-developers (realizing it's almost exactly the same folks...) We have a fix/workaround merged into the runtime repo, so in a day or two please install a new nightly build and let us know if anything else seems amiss. |
Latest nightly builds should have the fix; @wli3 or @dotnet/wpf-developers can you confirm? |
I tried yesterday with the lastest SDK master. It is still repros. Could you confirm the latest bit flowed to SDK? Or ping me when it is done and build is available |
The issue appears to be fixed in dotnet-sdk-5.0.100-preview.8.20363.2-win-x64. Thank you for the fast investigation and fix. The test team is running a test pass with this version of the SDK and will have more detailed results by tomorrow morning. Thanks. |
Validation succeeded: Windows 7, Blue, Server 2012, Win10 RS3/4/6, and Server 2016 (all x64). |
Thanks for confirming. Assume its ok to close this issue now? |
Thanks, everyone. |
winver
) 18363.900Problem description:
Run sample WPF-Samples\Data Binding\SortFilter\ on Microsoft.WindowsDesktop.App 5.0.0-preview.8.20330.4 cannot display
Actual behavior:
I only get a tiny window
Expected behavior:
Minimal repro:
dotnet run on WPF-Samples\Data Binding\SortFilter with the latest SDK
I made sure this is not a tooling problem.
I use
dotnet build
on an older SDK 5.0.100-preview.4.20258.7 (will repro use the higher SDK 5.0.100-preview.8.20351.5).And install Microsoft.WindowsDesktop.App 5.0.0-preview.8.20330.4 and Microsoft.NETCore.App 5.0.0-preview.8.20328.6 on my machine.
Double click on the exe. It works since it runs on the lower runtime. Change the SortFilter.runtimeconfig.json to the following. Then double click. You will only see the tiny window
The text was updated successfully, but these errors were encountered: