question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Powershell core fails start interactively on Ubuntu 21.04

See original GitHub issue

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.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:3
  • Comments:9

github_iconTop GitHub Comments

3reactions
wfurtcommented, Aug 14, 2021

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.

0reactions
stosstangecommented, Aug 14, 2021

still happening on ubuntu 21.04 @PS 7.1.4

PowerShell 7.1.4 Copyright © Microsoft Corporation.

https://aka.ms/powershell Type ‘help’ to get help.

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Powershell Core (7.1.3) and (7.2.0-preview.7) crashing on ...
Steps to reproduce Powershell and Powershell-Preview installed as snaps on Ubuntu 21.04 Expected behavior Powershell enters interactive mode ...
Read more >
problem using powershell in version 21.04
I am using Ubuntu 21.04 with Gnome desktop. Today I tried to install Powershell from the snap store. I used the command in...
Read more >
Installing PowerShell on Ubuntu
PowerShell for Linux is published to package repositories for easy installation and updates. The URL to the package varies by OS version:.
Read more >
Error when exiting Powershell Core remote session
I am running into a SOAP error when I am exiting out of a PowerShell remote session where I am remoting from a...
Read more >
How to install PowerShell 7 on Ubuntu 20.04?
I used Ubuntu Software to install powershell 7.0.3, which is the latest/stable version available. After an error-free installation, I cannot ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found