https://bugs.winehq.org/show_bug.cgi?id=54568
Bug ID: 54568 Summary: Trying retrieve list of WMI classes makes powershell core crash instantly Product: Wine Version: 8.2 Hardware: x86-64 URL: https://github.com/PowerShell/PowerShell/releases/down load/v7.0.3/PowerShell-7.0.3-win-x64.msi OS: Linux Status: NEW Keywords: dotnet, download Severity: normal Priority: P2 Component: wmi&wbemprox Assignee: wine-bugs@winehq.org Reporter: xerox.xerox2000x@gmail.com Distribution: Debian
Hi, trying code snippet below found on the internet (to retrieve all wmi classes) makes powershell core crash instantly.
$managementClass = New-Object System.Management.ManagementClass $enumOptions = New-Object System.Management.EnumerationOptions $enumOptions.EnumerateDeep = $true $managementClass.PSBase.GetSubclasses( $enumOptions ) | Sort-Object
Maybe this is not yet supported in wine, but i guess it shouldn't crash powershell anyway. (Code snippet works fine in powershell core on windows)
From a debuglog: 015c:trace:wbemprox:class_object_Get 000000001FB1DB70, L"__PATH", 0, 0000000022F 1E318, 0000000022F1E548, 0000000022F1E540 015c:trace:seh:dispatch_exception code=c0000005 flags=0 addr=00000001ED48AB7F ip=1ed48ab7f 015c:warn:seh:dispatch_exception EXCEPTION_ACCESS_VIOLATION exception (code=c0000005) raised
Steps to reproduce: - Save 4 lines of code above in e.g. a.ps1 - wine pwsh -f a.ps1
Output from console:
Fatal error. System.AccessViolationException: Attempted to read or write protect ed memory. This is often an indication that other memory is corrupt. at System.Management.IWbemClassObjectFreeThreaded.Get_(System.String, Int32, System.Object ByRef, Int32 ByRef, Int32 ByRef) at System.Management.ManagementObject.Initialize(Boolean) at System.Management.ManagementBaseObject.get_wbemObject() at System.Management.ManagementBaseObject.get_ClassName() at System.Management.ManagementClass.GetSubclasses(System.Management.Enumerat ionOptions) at System.Management.Automation.MethodInformation.Invoke(System.Object, Syste m.Object[])
https://bugs.winehq.org/show_bug.cgi?id=54568
--- Comment #1 from Louis Lenders xerox.xerox2000x@gmail.com --- forgot to mention: needs 'winetricks dotnet48' first