Skip to content
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

Debian - segmentation fault dotnet new console #973

Closed
erralb opened this issue Sep 18, 2017 · 30 comments
Closed

Debian - segmentation fault dotnet new console #973

erralb opened this issue Sep 18, 2017 · 30 comments

Comments

@erralb
Copy link

erralb commented Sep 18, 2017

Hi, just followed the official guide to install dotnet on debian.

Install went fine, but when I tried to launch the tutorial example, I get :

`
$ dotnet new console -o hwapp

Getting ready...

[1] 18216 segmentation fault dotnet new console -o hwapp
`

@omajid
Copy link
Member

omajid commented Sep 18, 2017

Can you run an strace and upload the log file (logfile below) somewhere?

strace -f -o logfile dotnet new console -o hwapp

Edit: does dotnet --info work?

@erralb
Copy link
Author

erralb commented Sep 18, 2017

Here you go :

$ dotnet --info
.NET Command Line Tools (2.0.0)

Product Information:
 Version:            2.0.0
 Commit SHA-1 hash:  cdcd1928c9

Runtime Environment:
 OS Name:     debian
 OS Version:  
 OS Platform: Linux
 RID:         debian-x64
 Base Path:   /usr/share/dotnet/sdk/2.0.0/

Microsoft .NET Core Shared Framework Host

  Version  : 2.0.0
  Build    : e8b8861ac7faf042c87a5c2f9f2d04c98b69f28d

The strace also returns a segmentation fault :


$ strace -f -o logfile dotnet new console -o hwapp
Getting ready...
[1]    1297 segmentation fault  strace -f -o logfile dotnet new console -o hwapp

@erralb
Copy link
Author

erralb commented Sep 20, 2017

Hi, any news on this ? Anything else I can do to help debug?

@Petermarcu
Copy link
Member

@livarcocc is this the one people have been working around by disabling the first run experience?

@Petermarcu
Copy link
Member

Looks like this one: #649 (comment)

@livarcocc do you have an issue tracking fixing this in the cli?

@erralb
Copy link
Author

erralb commented Sep 20, 2017

export DOTNET_CLI_TELEMETRY_OPTOUT=1

removed the segmentation fault for me

@Petermarcu
Copy link
Member

👍

@erralb
Copy link
Author

erralb commented Sep 20, 2017

should I close the issue or you want it left open until a real fix has been issued?

@Petermarcu
Copy link
Member

Lets leave it open until @livarcocc confirms that there is an issue somewhere tracking the fix. Once we have that, this can be closed. Thanks @ierpe!

@livarcocc
Copy link

@Petermarcu @steveharter can you help debug this and understand why the telemetry code is causing a seg fault? If this were in native code, I would expect a stack trace somewhere. But we will investigate.

@omajid
Copy link
Member

omajid commented Sep 20, 2017

Could this be an incompatibility via libcurl? See #963 (comment) and https://github.com/dotnet/corefx/issues/8951#issuecomment-299793545

@erralb
Copy link
Author

erralb commented Sep 20, 2017

@Petermarcu you're welcome!

@omajid For info my version of libcurl is : libcurl 7.55.1

@steveharter
Copy link
Member

@livarcocc I'm installing fresh debian now, will report back tomorrow.

@steveharter
Copy link
Member

I couldn't repro. I used debian stretch. One difference is that dotnet --info reports the RID as Linux-x64 instead of debian-x64.

dotnet --info
.NET Command Line Tools (2.0.0)

Product Information:
 Version:            2.0.0
 Commit SHA-1 hash:  cdcd1928c9

Runtime Environment:
 OS Name:     debian
 OS Version:  9
 OS Platform: Linux
 RID:         linux-x64
 Base Path:   /usr/share/dotnet/sdk/2.0.0/

Microsoft .NET Core Shared Framework Host

  Version  : 2.0.0
  Build    : e8b8861ac7faf042c87a5c2f9f2d04c98b69f28d

@ierpe what is the contents of your /etc/apt/sources.list.d/dotnetdev.list file? I have:

deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-debian-stretch-prod stretch main

@icedfish
Copy link

the same issue @Mac
the official guide says:

dotnet new console -o hwapp
cd hwapp

I checked the dotnet help (dotnet core sdk 2.0)

~ dotnet help new
.NET Initializer

Usage: dotnet new [options]

Options:
  -h|--help             Show help information
  -l|--lang <LANGUAGE>  Language of project [C#|F#]
  -t|--type <TYPE>      Type of project
➜  source mkdir dotnet

all the guide shuold be update to :

mkdir -p hwapp
cd hwapp
dotnet new -t console

@erralb
Copy link
Author

erralb commented Sep 21, 2017

@steveharter /etc/apt/sources.list.d/dotnetdev.list file :

deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-debian-stretch-prod stretch main

@steveharter
Copy link
Member

steveharter commented Sep 21, 2017

FWIW here's my Debian Stretch environment (no repro, clean install)


$ curl -V
curl 7.52.1 (x86_64-pc-linux-gnu) libcurl/7.52.1 OpenSSL/1.0.2l zlib/1.2.8 libidn2/0.16 libpsl/0.17.0 (+libidn2/0.16) libssh2/1.7.0 nghttp2/1.18.1 librtmp/2.3
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtmp rtsp scp sftp smb smbs smtp smtps telnet tftp
Features: AsynchDNS IDN IPv6 Largefile GSS-API Kerberos SPNEGO NTLM NTLM_WB SSL libz TLS-SRP HTTP2 UnixSockets HTTPS-proxy PSL

$ openssl version
OpenSSL 1.1.0f  25 May 2017

$ cat /proc/version
Linux version 4.9.0-3-amd64 (debian-kernel@lists.debian.org) (gcc version 6.3.0 20170516 (Debian 6.3.0-18) ) #1 SMP Debian 4.9.30-2+deb9u5 (2017-09-19)

$ cat /etc/*-release
PRETTY_NAME="Debian GNU/Linux 9 (stretch)"
NAME="Debian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

@steveharter
Copy link
Member

@icedfish

the same issue @mac

So you're also getting the seg fault during dotnet new console?

Does export DOTNET_CLI_TELEMETRY_OPTOUT=1 prevent the seg fault?

@steveharter
Copy link
Member

@ierpe have you tried to debug the seg fault, or look at any dumps in order to determine the crashing module\stack? I can send you gdb instructions.

@omajid
Copy link
Member

omajid commented Sep 21, 2017

@icedfish

I checked the dotnet help (dotnet core sdk 2.0)

Can you confirm this? What does dotnet --version say? What does dotnet --info say?

~ dotnet help new
.NET Initializer

Usage: dotnet new [options]

Options:
  -h|--help             Show help information
  -l|--lang <LANGUAGE>  Language of project [C#|F#]
  -t|--type <TYPE>      Type of project
➜  source mkdir dotnet

That looks like the older 1.0 Preview SDK. -t does not work with the 1.x or 2.x SDKs.

@erralb
Copy link
Author

erralb commented Sep 21, 2017

@steveharter nope I haven't, don't know how actually...

@steveharter
Copy link
Member

@ierpe probably the easiest way is to catch the seg fault with gdb if you can. You'll likely need to be root to install that. So

su
apt-get install gdb
exit

and then run dotnet:

gdb --args dotnet new console
run

after seg fault

backtrace

hopefully you get a crashing module (libcurl?) and stack.

@icedfish
Copy link

@omajid sorry , I checked my system, find that I used to install the old 1.0RC SDK before install the new 2.0 sdk.

after uninstall the old version by the cli script
and reinstalled the sdk 2.0, It's ok now.

But it's really puzzle, the the 2.0 sdk not remove the old sdk automaticlly or even notify me the incompact.....

@erralb
Copy link
Author

erralb commented Sep 22, 2017

@steveharter is that what you wanted ?


$ gdb --args dotnet new console
GNU gdb (Debian 7.12-6) 7.12.0.20161007-git
Copyright (C) 2016 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:
<http://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 dotnet...(no debugging symbols found)...done.
(gdb) run
Starting program: /usr/bin/dotnet new console
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7f0ea6576700 (LWP 11703)]
[New Thread 0x7f0e9ffff700 (LWP 11704)]
[New Thread 0x7f0ea5d75700 (LWP 11705)]
[New Thread 0x7f0ea5574700 (LWP 11706)]
[New Thread 0x7f0ea4d73700 (LWP 11707)]
[New Thread 0x7f0e9f7fe700 (LWP 11708)]
[New Thread 0x7f0e2e140700 (LWP 11709)]
[Thread 0x7f0e2e140700 (LWP 11709) exited]
[New Thread 0x7f0e2e140700 (LWP 11710)]
[New Thread 0x7f0ea41b9700 (LWP 11711)]
[New Thread 0x7f0e2d93f700 (LWP 11712)]
[New Thread 0x7f0e2d13e700 (LWP 11713)]
[New Thread 0x7f0ea4178700 (LWP 11714)]
[New Thread 0x7f0e07ffd700 (LWP 11715)]
[New Thread 0x7f0e077fc700 (LWP 11716)]
[New Thread 0x7f0deed59700 (LWP 11717)]
[New Thread 0x7f0dee558700 (LWP 11718)]
[Thread 0x7f0dee558700 (LWP 11718) exited]

Thread 16 "dotnet" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7f0deed59700 (LWP 11717)]
0x00007f0e2c67dd6d in ?? () from /usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.0
(gdb) backtrace
#0  0x00007f0e2c67dd6d in ?? ()
   from /usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.0
#1  0x00007f0e2c678c8b in X509_verify_cert ()
   from /usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.0
#2  0x00007f0e31168e06 in ?? ()
#3  0x00007f0deed57e50 in ?? ()
#4  0x6c00fa377b77ae7b in ?? ()
#5  0x0000000007bcbd60 in ?? ()
#6  0x00007f0ea83f5488 in ?? ()
   from /usr/share/dotnet/shared/Microsoft.NETCore.App/2.0.0/libcoreclr.so
#7  0x00007f0deed58688 in ?? ()
#8  0x00007f0e312a2580 in ?? ()
#9  0x00007f0e312a2580 in ?? ()
#10 0x00007f0deed57e50 in ?? ()
#11 0x00007f0e31168e06 in ?? ()
#12 0x00007f0deed57ee0 in ?? ()
#13 0x00007f0e312a2580 in ?? ()
#14 0x00007f0e083b6760 in ?? ()
#15 0x0000000000000001 in ?? ()
#16 0x00007f0e080de958 in ?? ()
#17 0x00007f0e08634f90 in ?? ()
#18 0x00007f0e08634f20 in ?? ()
#19 0x00007f0e083b6760 in ?? ()
---Type <return> to continue, or q <return> to quit---
#20 0x00007f0de40ff270 in ?? ()
#21 0x00007f0deed57f50 in ?? ()
#22 0x00007f0e30f7ce57 in ?? ()
#23 0x00007f0deed57ef0 in ?? ()
#24 0x00007f0e08634f20 in ?? ()
#25 0x00007f0e080de958 in ?? ()
#26 0x0000000000000000 in ?? ()

@steveharter
Copy link
Member

@ierpe yes thanks. It is likely crashing when calling into OpenSsl.

Can you run a couple commands please:
$ openssl version
and
ls /usr/lib/x86_64-linux-gnu/libssl.so.*

You should get back
OpenSSL 1.1.0f 25 May 2017
and
/usr/lib/x86_64-linux-gnu/libssl.so.1.0.2 /usr/lib/x86_64-linux-gnu/libssl.so.1.1

If not, and you're getting the 1.0.0 version you can give this a try:

apt-get remove ssl1.0.0
apt-get install ssl1.0.2

@erralb
Copy link
Author

erralb commented Sep 24, 2017

@steveharter


$ openssl version
OpenSSL 1.1.0f  25 May 2017

$ ls /usr/lib/x86_64-linux-gnu/libssl.so.*
/usr/lib/x86_64-linux-gnu/libssl.so.1.0.0
/usr/lib/x86_64-linux-gnu/libssl.so.1.0.2
/usr/lib/x86_64-linux-gnu/libssl.so.1.1

@steveharter
Copy link
Member

@ierpe since you have the 1.0.0 version, that is likely conflicting and has been a problem for others. You can remove that by doing an apt-get remove ssl1.0.0

Typically the 1.0.0 version is there due to an upgrade to stretch or buster, and not a clean install. It could have come from another app's dependency as well.

cc @bartonjs is there an issue to address this in some manner? Like if 1.0.2 is there use that first. Thanks

@erralb
Copy link
Author

erralb commented Sep 26, 2017

@steveharter removing ssl1.0.0 fixed it for me, thanks for the support!

@thetravis
Copy link

@steveharter The reason I had 1.0.0 version was that spotify-client depends on it and I had manually installed it. Please refer to my post in #649

@JoeKays
Copy link

JoeKays commented Aug 28, 2018

I have multiple apps that depend on version 1.0.0 and others that depend on 1.0.2.
What do I do?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants