Powershell: Unable to load DLL 'psl-native'

Created on 13 Dec 2017  路  10Comments  路  Source: PowerShell/PowerShell

Steps to reproduce

./pwsh

Expected behavior


Actual behavior

Unhandled Exception: System.TypeInitializationException: The type initializer for 'System.Management.Automation.Tracing.PSEtwLog' threw an exception. ---> System.TypeInitializationException: The type initializer for 'System.Management.Automation.Tracing.PSSysLogProvider' threw an exception. ---> System.DllNotFoundException: Unable to load DLL 'psl-native': The specified module or one of its dependencies could not be found.
 (Exception from HRESULT: 0x8007007E)
   at System.Management.Automation.Tracing.NativeMethods.OpenLog(IntPtr ident, SysLogPriority facility)
   at System.Management.Automation.Tracing.SysLogProvider..ctor(String applicationId, PSLevel level, PSKeyword keywords, PSChannel channels) in /release/ps/src/System.Management.Automation/utils/tracing/SysLogProvider.cs:line 101
   at System.Management.Automation.Tracing.PSSysLogProvider..cctor() in /release/ps/src/System.Management.Automation/utils/tracing/PSSysLogProvider.cs:line 27
   --- End of inner exception stack trace ---
   at System.Management.Automation.Tracing.PSSysLogProvider..ctor()
   at System.Management.Automation.Tracing.PSEtwLog..cctor() in /release/ps/src/System.Management.Automation/utils/tracing/PSEtwLog.cs:line 27
   --- End of inner exception stack trace ---
   at System.Management.Automation.Tracing.PSEtwLog.LogOperationalInformation(PSEventId id, PSOpcode opcode, PSTask task, PSKeyword keyword, Object[] args) in /release/ps/src/System.Management.Automation/utils/tracing/PSEtwLog.cs:line 134
   at Microsoft.PowerShell.UnmanagedPSEntry.Start(String consoleFilePath, String[] args, Int32 argc) in /release/ps/src/Microsoft.PowerShell.ConsoleHost/host/msh/ManagedEntrance.cs:line 45
   at Microsoft.PowerShell.ManagedPSEntry.Main(String[] args) in /release/ps/src/powershell/Program.cs:line 23
Aborted

Environment data

> $PSVersionTable

My pc:
Linux 3.4.113-sun8i #4 SMP PREEMPT Wed Nov 22 13:45:28 CET 2017 armv7l GNU/Linux
with powershell-6.0.0-rc-linux-arm32.tar.gz

Area-Maintainers-Build Issue-Question

All 10 comments

@wojtulab what OS are you using with the arm32 build? Currently only Raspbian Stretch is supported.

oh, ok... its Armbian based on Debian (jessie):
ARMBIAN 5.36 user-built Debian GNU/Linux 8 (jessie) 3.4.113-sun8i

Unfortunately we are only currently support Raspbian Stretch. Maybe we can look into this post 6.0.0

Same here also fails on 6.1.0 Preview 2
But i tried it on a Xiamo Mi Vacuum, so no surprise.

root@rockrobo:/mnt/data/powershell/6.1.0# uname -a
Linux rockrobo 3.4.39 #1 SMP PREEMPT Wed Mar 21 16:39:25 CST 2018 armv7l armv7l armv7l GNU/Linux

6.0.2

        Unhandled Exception: System.TypeInitializationException: The type initializer for 'System.Management.Automation.Tracing.PSEtwLog' threw an exception. ---> System.TypeInitializationException: The type initializer for 'System.Management.Automation.Tracing.PSSysLogProvider' threw an exception. ---> System.DllNotFoundException: Unable to load DLL 'libpsl-native': The specified module or one of its dependencies could not be found.
        (Exception from HRESULT: 0x8007007E)
        at System.Management.Automation.Tracing.NativeMethods.OpenLog(IntPtr ident, SysLogPriority facility)
        at System.Management.Automation.Tracing.SysLogProvider..ctor(String applicationId, PSLevel level, PSKeyword keywords, PSChannel channels) in /PowerShell/src/System.Management.Automation/utils/tracing/SysLogProvider.cs:line 101
        at System.Management.Automation.Tracing.PSSysLogProvider..cctor() in /PowerShell/src/System.Management.Automation/utils/tracing/PSSysLogProvider.cs:line 28
        --- End of inner exception stack trace ---
        at System.Management.Automation.Tracing.PSSysLogProvider..ctor()
        at System.Management.Automation.Tracing.PSEtwLog..cctor() in /PowerShell/src/System.Management.Automation/utils/tracing/PSEtwLog.cs:line 27
        --- End of inner exception stack trace ---
        at System.Management.Automation.Tracing.PSEtwLog.LogOperationalInformation(PSEventId id, PSOpcode opcode, PSTask task, PSKeyword keyword, Object[] args) in /PowerShell/src/System.Management.Automation/utils/tracing/PSEtwLog.cs:line 134
        at Microsoft.PowerShell.UnmanagedPSEntry.Start(String consoleFilePath, String[] args, Int32 argc) in /PowerShell/src/Microsoft.PowerShell.ConsoleHost/host/msh/ManagedEntrance.cs:line 45
        at Microsoft.PowerShell.ManagedPSEntry.Main(String[] args) in /PowerShell/src/powershell/Program.cs:line 23

6.1.0-preview2

PowerShell v6.1.0-preview.2
Copyright (c) Microsoft Corporation. All rights reserved.

https://aka.ms/pscore6-docs
Type 'help' to get help.

FailFast: The type initializer for 'System.Management.Automation.Tracing.PSEtwLo               g' threw an exception.

   at System.Environment.FailFast(System.String, System.Exception)
   at System.Environment.FailFast(System.String, System.Exception)
   at Microsoft.PowerShell.UnmanagedPSEntry.Start(System.String, System.String[]               , Int32)
   at Microsoft.PowerShell.ManagedPSEntry.Main(System.String[])

@dantraMSFT should we consider just outputting a warning if Logging can't be enabled?

Still trying to wrap my head around it...

strace reveals, pwsh is reading the library:

open("/mnt/data/powershell/6.0.2/libpsl-native.so", O_RDONLY|O_CLOEXEC) = 56
read(56, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0\4\27\0\0004\0\0\0"..., 512) = 512
read(56, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 1480) = 1480
read(56, "A0\0\0\0aeabi\0\1&\0\0\0\0057-A\0\6\n\7A\10\1\t\2\n\3\22"..., 49) = 49
close(56)                               = 0
open("/mnt/data/powershell/6.0.2/libpsl-native.so", O_RDONLY|O_CLOEXEC) = 56
read(56, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0\4\27\0\0004\0\0\0"..., 512) = 512
read(56, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 1480) = 1480
read(56, "A0\0\0\0aeabi\0\1&\0\0\0\0057-A\0\6\n\7A\10\1\t\2\n\3\22"..., 49) = 49
close(56)                               = 0
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 56
close(56)                               = 0
open("/mnt/data/powershell/6.0.2/libpsl-native.so", O_RDONLY|O_CLOEXEC) = 56
read(56, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0\4\27\0\0004\0\0\0"..., 512) = 512
read(56, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 1480) = 1480
read(56, "A0\0\0\0aeabi\0\1&\0\0\0\0057-A\0\6\n\7A\10\1\t\2\n\3\22"..., 49) = 49
close(56)  

So I guess it's more a "can't load the library" issue, and the "file not found" is misleading...
I also tried to add the pwsh directory to my ldconfig without success.

@SteveL-MSFT: Yes, we should, either a warning or error record. I created https://github.com/PowerShell/PowerShell/issues/6858 for this.

If I understand correctly this library (psl-native) was needed because of the limitations of .Net Core 1.0. Now we are on .Net Core 2.1 and maybe could review the code and could migrate to C#.

@iSazonov I agree that we should review whether this library is still needed

Tracking Issue #6874.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rkeithhill picture rkeithhill  路  3Comments

concentrateddon picture concentrateddon  路  3Comments

SteveL-MSFT picture SteveL-MSFT  路  3Comments

HumanEquivalentUnit picture HumanEquivalentUnit  路  3Comments

JohnLBevan picture JohnLBevan  路  3Comments