Skip to content

Powershell core fails start interactively on Ubuntu 21.04 #15101

Closed
PowerShell/PowerShell-Snap
#76

Description

Steps to reproduce

Install latest Ubuntu development release (21.04, Hirsute Hippo). Install Powershell-core snap.

Attempt to launch pwsh interactively (launching simple scripts seems to work fine). Observe it crashes:

$ pwsh
PowerShell 7.1.3
Copyright (c) Microsoft Corporation.

https://aka.ms/powershell
Type 'help' to get help.

No usable version of libssl was found
Aborted (core dumped)

When launched with GDB with get the following stacktrace:

$ sudo gdb pwsh
GNU gdb (Ubuntu 10.1-2ubuntu1) 10.1.90.20210103-git
Copyright (C) 2021 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from pwsh...
(No debugging symbols found in pwsh)
(gdb) c
The program is not being run.
(gdb) r
Starting program: /snap/bin/pwsh 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7fffd111e640 (LWP 82839)]
[New Thread 0x7fffd091d640 (LWP 82840)]
[New Thread 0x7fffcb7fe640 (LWP 82842)]
[New Thread 0x7fffcbfff640 (LWP 82841)]
[New Thread 0x7fffcaffd640 (LWP 82843)]
[New Thread 0x7fffca7fc640 (LWP 82844)]
[Thread 0x7fffca7fc640 (LWP 82844) exited]
[Thread 0x7fffcaffd640 (LWP 82843) exited]
[Thread 0x7fffcb7fe640 (LWP 82842) exited]
[Thread 0x7fffcbfff640 (LWP 82841) exited]
[Thread 0x7fffd091d640 (LWP 82840) exited]
[Thread 0x7fffd111e640 (LWP 82839) exited]
process 82835 is executing new program: /snap/snapd/11402/usr/bin/snap
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7ffff7d4f640 (LWP 82845)]
[New Thread 0x7ffff754e640 (LWP 82846)]
[New Thread 0x7ffff6d4d640 (LWP 82847)]
[New Thread 0x7ffff654c640 (LWP 82848)]
[New Thread 0x7ffff5d4b640 (LWP 82849)]
[Detaching after vfork from child process 82850]
[New Thread 0x7ffff536a640 (LWP 82851)]
[Thread 0x7ffff536a640 (LWP 82851) exited]
[Thread 0x7ffff5d4b640 (LWP 82849) exited]
[Thread 0x7ffff6d4d640 (LWP 82847) exited]
[Thread 0x7ffff754e640 (LWP 82846) exited]
[Thread 0x7ffff7d4f640 (LWP 82845) exited]
process 82835 is executing new program: /snap/snapd/11402/usr/lib/snapd/snap-confine
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
process 82835 is executing new program: /snap/snapd/11402/usr/lib/snapd/snap-exec
[New LWP 82857]
[New LWP 82858]
[New LWP 82859]
[New LWP 82860]
[LWP 82859 exited]
[LWP 82857 exited]
[LWP 82858 exited]
[LWP 82860 exited]
process 82835 is executing new program: /usr/bin/dash
process 82835 is executing new program: /usr/bin/dash
process 82835 is executing new program: /snap/powershell/160/opt/powershell/pwsh
warning: File "/snap/core18/1988/lib/x86_64-linux-gnu/libthread_db-1.0.so" auto-loading has been declined by your `auto-load safe-path' set to "$debugdir:$datadir/auto-load".
To enable execution of this file add
	add-auto-load-safe-path /snap/core18/1988/lib/x86_64-linux-gnu/libthread_db-1.0.so
line to your configuration file "/root/.gdbinit".
To completely disable this security protection add
	set auto-load safe-path /
line to your configuration file "/root/.gdbinit".
For more information about this security protection see the
"Auto-loading safe path" section in the GDB manual.  E.g., run from the shell:
	info "(gdb)Auto-loading safe path"
warning: Unable to find libthread_db matching inferior's thread library, thread debugging will not be available.
[New LWP 82861]
[New LWP 82862]
[New LWP 82863]
[New LWP 82864]
[New LWP 82865]
[New LWP 82866]
[New LWP 82867]
[New LWP 82868]
[New LWP 82869]
[New LWP 82870]
[New LWP 82871]
[New LWP 82872]
PowerShell 7.1.3
Copyright (c) Microsoft Corporation.

https://aka.ms/powershell
Type 'help' to get help.

[New LWP 82873]
[New LWP 82874]
[New LWP 82875]
[New LWP 82876]
[New LWP 82877]
[New LWP 82878]
[New LWP 82879]
[New LWP 82880]
[New LWP 82881]
[New LWP 82882]
[New LWP 82883]
No usable version of libssl was found
--Type <RET> for more, q to quit, c to continue without paging--

Thread 40 "Pipeline Execut" received signal SIGABRT, Aborted.
[Switching to LWP 82883]
0x00007f56785e0fb7 in raise () from /snap/core18/current/lib/x86_64-linux-gnu/libc.so.6
(gdb) bt
#0  0x00007f56785e0fb7 in raise () from /snap/core18/current/lib/x86_64-linux-gnu/libc.so.6
#1  0x00007f56785e2921 in abort () from /snap/core18/current/lib/x86_64-linux-gnu/libc.so.6
#2  0x00007f55ac5e93eb in ?? () from /snap/powershell/160/opt/powershell/libSystem.Security.Cryptography.Native.OpenSsl.so
#3  0x00007f56797a28d3 in ?? () from /snap/core18/current/lib64/ld-linux-x86-64.so.2
#4  0x00007f56797a739f in ?? () from /snap/core18/current/lib64/ld-linux-x86-64.so.2
#5  0x00007f56787091ef in _dl_catch_exception () from /snap/core18/current/lib/x86_64-linux-gnu/libc.so.6
#6  0x00007f56797a696a in ?? () from /snap/core18/current/lib64/ld-linux-x86-64.so.2
#7  0x00007f567936ff96 in ?? () from /snap/core18/current/lib/x86_64-linux-gnu/libdl.so.2
#8  0x00007f56787091ef in _dl_catch_exception () from /snap/core18/current/lib/x86_64-linux-gnu/libc.so.6
#9  0x00007f567870927f in _dl_catch_error () from /snap/core18/current/lib/x86_64-linux-gnu/libc.so.6
#10 0x00007f5679370745 in ?? () from /snap/core18/current/lib/x86_64-linux-gnu/libdl.so.2
#11 0x00007f5679370051 in dlopen () from /snap/core18/current/lib/x86_64-linux-gnu/libdl.so.2
#12 0x00007f5677e9bbd4 in ?? () from /snap/powershell/160/opt/powershell/libcoreclr.so
#13 0x00007f5677ab9042 in ?? () from /snap/powershell/160/opt/powershell/libcoreclr.so
#14 0x00007f5677ab9fd4 in ?? () from /snap/powershell/160/opt/powershell/libcoreclr.so
#15 0x00007f5677ab7e4c in ?? () from /snap/powershell/160/opt/powershell/libcoreclr.so
#16 0x00007f5677ab7cf7 in ?? () from /snap/powershell/160/opt/powershell/libcoreclr.so
#17 0x00007f5677ab80c6 in ?? () from /snap/powershell/160/opt/powershell/libcoreclr.so
#18 0x00007f5677b39452 in ?? () from /snap/powershell/160/opt/powershell/libcoreclr.so
#19 0x00007f5677b38cfa in ?? () from /snap/powershell/160/opt/powershell/libcoreclr.so
#20 0x00007f5677d4a73c in ?? () from /snap/powershell/160/opt/powershell/libcoreclr.so
#21 0x00007f5603b2244b in ?? ()
#22 0x00007f5603a0a778 in ?? ()
#23 0x00007f558eff4018 in ?? ()
#24 0x00007f558eff3f40 in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
(gdb)/lib64/ld-linux-x86-64.so.2 (0x00007f9fed99a000)

Expected behavior

pwsh to work on any Ubuntu-version since it is packaged as a snap.

Actual behavior

pwsh not working on specific Ubuntu-versions, seemingly due to hardwired libssl dependency.

Activity

  1. added
    Needs-Triage
    on Mar 25, 2021
  2. josteink commented on Mar 25, 2021

    @josteink
    Author

    Outfor for LDD on the crashing /snap/powershell/160/opt/powershell/libSystem.Security.Cryptography.Native.OpenSsl.so-file:

    $ sudo ldd /snap/powershell/160/opt/powershell/libSystem.Security.Cryptography.Native.OpenSsl.so
    [sudo] password for jostein: 
    	linux-vdso.so.1 (0x00007fff85bfd000)
    	libdl.so.2 => /snap/core18/current/lib/x86_64-linux-gnu/libdl.so.2 (0x00007fece02ca000)
    	libc.so.6 => /snap/core18/current/lib/x86_64-linux-gnu/libc.so.6 (0x00007fecdfed9000)
    	/lib64/ld-linux-x86-64.so.2 (0x00007fece06f4000)
    
  3. added
    WG-Maintainers-Build
    Issue-Question
    on Mar 27, 2021
  4. iSazonov commented on Mar 27, 2021

    @iSazonov
    Collaborator

    Ubuntu 21.04

    It is still not supported neither PowerShell nor .Net.

  5. josteink commented on Mar 27, 2021

    @josteink
    Author

    Sure. It's a development release so I wasn't expecting it to be properly supported yet.

    That said it's fairly close to release, so I thought it made sense to start reporting issues so that you guys can be prepared.

  6. iSazonov commented on Mar 27, 2021

    @iSazonov
    Collaborator

    We have an issue template you can use to request supporting new OS version. Feel free to open new issue with the template.

  7. wfurt commented on Mar 27, 2021

    @wfurt

    The libssl is opened via dlopen and "1.1" should be tried Jostein Kjønigsen (@josteink). (/lib/x86_64-linux-gnu/libssl.so.1.1)
    You can try simple app or check with strace.
    I assume you did not build your own or fiddle with loading, right?
    You can also try to set CLR_OPENSSL_VERSION_OVERRIDE to force particular version. (appends to base name)

  8. adiroiban commented on Jul 27, 2021

    @adiroiban

    I get the same error with the released 21.04 version with powershell 7.1.3 installed via snap.

    and I get the same error for PowerShell 7.2.0-preview.8

  9. wfurt commented on Jul 27, 2021

    @wfurt
  10. stosstange commented on Aug 14, 2021

    @stosstange

    still happening on ubuntu 21.04 Paweł Szczurko (@ps) 7.1.4

    PowerShell 7.1.4
    Copyright (c) Microsoft Corporation.

    https://aka.ms/powershell
    Type 'help' to get help.

    No usable version of libssl was found
    Aborted (core dumped)

  11. wfurt commented on Aug 14, 2021

    @wfurt

    I did quick check with 21.04 in Docker container and https://github.com/PowerShell/PowerShell/releases/download/v7.1.4/powershell_7.1.4-1.ubuntu.20.04_amd64.deb
    Seems to work just fine.

    root@91df8115a438:~# ldd /usr/bin/openssl
    	linux-vdso.so.1 (0x00007ffe649f1000)
    	libssl.so.1.1 => /lib/x86_64-linux-gnu/libssl.so.1.1 (0x00007f7b604f5000)
    	libcrypto.so.1.1 => /lib/x86_64-linux-gnu/libcrypto.so.1.1 (0x00007f7b6021c000)
    	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f7b60030000)
    	libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f7b6000e000)
    	libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f7b60007000)
    	/lib64/ld-linux-x86-64.so.2 (0x00007f7b60650000)
    root@91df8115a438:~# pwsh
    PowerShell 7.1.4
    Copyright (c) Microsoft Corporation.
    
    https://aka.ms/powershell
    Type 'help' to get help.
    
    PS /root>
    

    .Net loads the libraries via dlopen and the libssl.so.1.1 should work just fine.
    So if anything there seems to be something wrong with the snap.

  12. ghost removed
    Needs-Triage
    on Sep 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-QuestionResolution-FixedWG-Maintainers-Build

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions