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
7.3.0 x86 crashes on startup on Windows 11 22H2 #18545
Comments
|
I have looked for a statement on whether using the x86 version of PS on an x64 platform is supported, but could not find any. |
|
A few questions..
I have just installed the PowerShell-7.3.0-win-x86.msi on Windows 10 Pro 22H2 and that installs in I did not check the box to add to the global PATH, or any other option. I ran it from 64 bit |
|
Sometimes I'm too impatient when writing bug reports.
Reproduction:
The crash happens both with my regular cluttered PATH and with I noticed that the delay, both before the first line of output and between the last line of the stack trace and the return of the prompt, is much shorter with the MSI (<< 1 s start, 1.5 s finish) than with the Zip (~2.5 s start, ~6 s finish). Hope that's better :-) |
|
Does the 64-bit version from a zip work on your system? Given the CPU requirements for Windows 11, are there any x86 only Windows 11 installations? |
|
|
I just tried the 7.3.0 x86 zip on my Windows 11 Pro 22H2 and that throws exactly the same exception as you describe. |
|
The function it crashes in only exists in 11 22H2. That at least explains why it works on 10. Procmon shows no obvious smoking gun, not that I expected one. |
|
If I had to guess, I would guess that https://github.com/PowerShell/PowerShell/blob/master/src/System.Management.Automation/security/wldpNativeMethods.cs#L699 should be "ref Guid". But what do I know?
|
|
https://learn.microsoft.com/en-us/windows/win32/api/wldp/nf-wldp-wldpcanexecutefile Does the export
|
The code at the call site (line 120 of the same file I linked above; I hope it's the right one) catches |
|
Adding I can create a PR for adding the attribute, but I cannot be held responsible for it ... |
|
So how does the 64 bit code work if it goes through the same code path? |
|
Calling conventions. Per The x86 calling conventions, in this case My fix tells .NET to pass the Guid as a pointer to a structure, and the fact that this changes the behavior at all is the best proof that it is correct: If it works when passing a pointer, then it must not have been passing one before, and that is definitely wrong because we know the function expects a Also note that a few lines down in the file, the declaration of Now that I have convinced myself of that (and you, I hope), my next problem is how to create a PR for the fix if I cannot get For illustration, this is a call to This is |
|
I just found that |
The error occurs only when running x86 pwsh on x64 Windows 11 22H2, the first Windows version that has WldpCanExecuteFile().
|
@chrullrich, my condolences. 7.3.0 crashes upon launch on your end, whereas its x64 zip bundle hangs my Windows 7 x64 system completely, until it is rebooted via hard reset (literally holding that reset button for a few seconds). I was advised to try |
Does 7.2.7 work? |
|
Yes, 7.2.7 works. It does not contain this particular bug anyway, that was introduced between v7.3.0-preview.3 and .4 according to git. |
|
@rhubarb-geek-nz, not sure if you asked me or Christian, so let me reply as well. Edit. C:\APPS\System\PowerShell727>pwsh
PowerShell 7.2.7
Copyright (c) Microsoft Corporation.
https://aka.ms/powershell
Type 'help' to get help.
A new PowerShell stable release is available: v7.3.0
Upgrade now, or check out the release page at:
https://aka.ms/PowerShell-Release?tag=v7.3.0
PS C:\APPS\System\PowerShell727> |
|
@sergeevabc It can be turned off by setting an environment variable:
|
It is Windows 10. |
The error occurs only when running x86 pwsh on x64 Windows 11 22H2, the first Windows version that has WldpCanExecuteFile().
chrullrich commentedNov 13, 2022
•
edited
Prerequisites
Steps to reproduce
pwsh.exe.No previous version of PowerShell 7 behaved in this way.
Expected behavior
Actual behavior
Error details
No response
Environment data
Visuals
No response
The text was updated successfully, but these errors were encountered: