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

Segmentation fault (core dumped) while using dotnet #67465

Open
Tracked by #62241
arylee opened this issue Apr 1, 2022 · 23 comments
Open
Tracked by #62241

Segmentation fault (core dumped) while using dotnet #67465

arylee opened this issue Apr 1, 2022 · 23 comments
Milestone

Comments

@arylee
Copy link

arylee commented Apr 1, 2022

Problem encountered on https://dotnet.microsoft.com/en-us/learn/dotnet/hello-world-tutorial/create
Operating System: linux (Ubuntu 21.10 impish)

Provide details about the problem you're experiencing. Include your operating system version, exact error message, code sample, and anything else that is relevant.

dotnet --list-sdks
6.0.201 [/snap/dotnet-sdk/158/sdk]

dotnet --list-runtimes
Microsoft.AspNetCore.App 6.0.3 [/snap/dotnet-sdk/158/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.3 [/snap/dotnet-sdk/158/shared/Microsoft.NETCore.App]

dotnet new console --framework net6.0
Segmentation fault (core dumped)

dotnet complete "dotnet a"
Segmentation fault (core dumped)

@arylee
Copy link
Author

arylee commented Apr 1, 2022

I installed dotnet SDK 6.0 with apt followed by the document. It works! But the snap way fails.

@mairaw mairaw transferred this issue from dotnet/core Apr 1, 2022
@dotnet-issue-labeler dotnet-issue-labeler bot added area-Snap untriaged New issue has not been triaged by the area owner labels Apr 1, 2022
@devhawk
Copy link

devhawk commented Apr 11, 2022

I'm seeing a similar issue. I have a .NET tool Neo.Express that has a dependency on native RocksDB library. Native dependencies installed via APT.

Using a fresh Ubuntu 20.04 VM + .NET 6 installed via SNAP, I can execute the neo express create command (which uses only managed code) but the if I execute the run command (which loads the rocksdb native library) I get seg fault.

Doing the exact same thing with .NET 6 installed via APT works fine.

Note, I can run dotnet new console --framework net6.0 and dotnet complete "dotnet a" on this VM w/o a seg fault

(Update): I'm guessing this is a different issue than what @arylee reported. I tried running under a native debugger and it is crashing when it goes to open the rocksdb .so that is included in my tool package. But I don't understand why it seg faults instead of throwing a load exception. If you try to run this command on Ubuntu when dotnet is APT installed, I get a type load exception instead of a seg fault. I don't understand SNAP vs APT installation well enough to understand the behavior difference.

@devhawk
Copy link

devhawk commented Apr 11, 2022

I created a simple console app via dotnet new on my SNAP based VM. I can run the app from the command line, but if I open up VSCode on the folder I get a warning that the .NET Core SDK cannot be located and OmniSharp can't load this very simple one line project w/o zero additional dependencies. But if I open the terminal inside VSCode, I can dotnet run the app and get "Hello, World!" as the output

@devhawk
Copy link

devhawk commented Apr 11, 2022

Looks like this is a known issue that isn't going to get fixed

@NikolaMilosavljevic NikolaMilosavljevic removed the untriaged New issue has not been triaged by the area owner label Apr 13, 2022
@PhilParisot
Copy link

Same issue on Ubuntu 21.10 install

@PhilParisot
Copy link

Just checked, the Snap installs and runs fine on Ubuntu 20.04 for some reason.

@wcdeich4
Copy link

7.0.100-preview.5.22307.18 worked for me in Ubuntu 22.04 LTS

@NikolaMilosavljevic NikolaMilosavljevic added this to the Future milestone Aug 17, 2022
@njavilas2015
Copy link

the commando is => sudo snap refresh dotnet-sdk --beta

@njavilas2015
Copy link

good evening I'm trying to start a good new project and I can't get it, a hand would be very useful to me I'm just starting

image

@danmoseley
Copy link
Member

@njavilas2015 What is your distro and version?
Can you run under gdb or lldb and get a backtrace?

@njavilas2015
Copy link

I have made the installation from the page as it appears

Linux insert-systemproductname 5.15.0-46-generic #49-Ubuntu SMP Thu Aug 4 18:03:25 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

Linux version 5.15.0-46-generic (buildd@lcy02-amd64-115) (gcc (Ubuntu 11.2.0-19ubuntu1) 11.2.0, GNU ld (GNU Binutils for Ubuntu) 2.38) #49-Ubuntu SMP Thu Aug 4 18:03:25 UTC 2022

Distributor ID: Ubuntu
Description: Ubuntu 22.04.1 LTS
Release: 22.04
Codename: jammy

@gaui
Copy link

gaui commented Sep 5, 2022

Having same issue with .NET 7.0.100-preview.7.22377.5 and the dotnet-sdk snap package.

Context:

$ snap list dotnet-sdk
Name        Version                    Rev  Tracking     Publisher    Notes
dotnet-sdk  7.0.100-preview.7.22377.5  178  latest/beta  dotnetcore✓  classic

$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 22.04.1 LTS
Release:	22.04
Codename:	jammy

$ dotnet --info
.NET SDK:
 Version:   7.0.100-preview.7.22377.5
 Commit:    ba310d9309

Runtime Environment:
 OS Name:     ubuntu
 OS Version:  22.04
 OS Platform: Linux
 RID:         ubuntu.22.04-x64
 Base Path:   /snap/dotnet-sdk/178/sdk/7.0.100-preview.7.22377.5/

Host:
  Version:      7.0.0-preview.7.22375.6
  Architecture: x64
  Commit:       eecb028078

.NET SDKs installed:
  7.0.100-preview.7.22377.5 [/snap/dotnet-sdk/178/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 7.0.0-preview.7.22376.6 [/snap/dotnet-sdk/178/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 7.0.0-preview.7.22375.6 [/snap/dotnet-sdk/178/shared/Microsoft.NETCore.App]

Other architectures found:
  None

Environment variables:
  DOTNET_ROOT       [/snap/dotnet-sdk/178]

global.json file:
  Not found

Learn more:
  https://aka.ms/dotnet/info

Download .NET:
  https://aka.ms/dotnet/download

$ dotnet new console -n test
Segmentation fault (core dumped)

@njavilas2015
Copy link

I have fixed it by just installing apt install dotnet

@thatguywiththefunnyname

Don't know if this is any helpful at all, however on POP 22.04 I checked apt to see if it has any dotnet packages and found that it had the dotnet-sdk-6.0 so it ran
sudo apt install dotnet-sdk-6.0 and it seemed to work fine.

Hope it helps :)

@zamis
Copy link

zamis commented Nov 11, 2022

Some observations on this error in the blog https://www.hanselman.com/blog/13-hours-debugging-a-segmentation-fault-in-net-core-on-raspberry-pi-and-the-solution- was
you can compare apt-get and snap install binaries
I think there will be gaps

@Censacrof
Copy link

Don't know if this is any helpful at all, however on POP 22.04 I checked apt to see if it has any dotnet packages and found that it had the dotnet-sdk-6.0 so it ran sudo apt install dotnet-sdk-6.0 and it seemed to work fine.

Hope it helps :)

Works for me as well, thanks!

@okarpov
Copy link

okarpov commented Dec 14, 2022

has same issue from time to time on different Ubuntu 20.04 VPSs
not obvious at all what causing it, there is no clear information where is the core dumped and how to find out the root of issue

fwcd added a commit to fwcd/advent-of-code-2022 that referenced this issue Dec 23, 2022
@sekhemrekhutawysobekhotep
Copy link

sekhemrekhutawysobekhotep commented Jan 11, 2023

dotnet new console -n test
Segmentation fault (core dumped)




uname -m && uname -r && cat /etc/*release
x86_64
5.15.0-57-generic
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=22.04
DISTRIB_CODENAME=jammy
DISTRIB_DESCRIPTION="Ubuntu 22.04.1 LTS"
PRETTY_NAME="Ubuntu 22.04.1 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.1 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"


snap list dotnet-sdk

Name        Version  Rev  Tracking       Publisher    Notes
dotnet-sdk  7.0.102  192  latest/stable  dotnetcore✓  classic
olaf@oslo ~ $ 
olaf@oslo ~ $ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 22.04.1 LTS
Release:	22.04
Codename:	jammy
olaf@oslo ~ $ 
olaf@oslo ~ $  dotnet --info
.NET SDK:
 Version:   7.0.102
 Commit:    4bbdd14480

Runtime Environment:
 OS Name:     ubuntu
 OS Version:  22.04
 OS Platform: Linux
 RID:         ubuntu.22.04-x64
 Base Path:   /snap/dotnet-sdk/192/sdk/7.0.102/

Host:
  Version:      7.0.2
  Architecture: x64
  Commit:       d037e070eb

.NET SDKs installed:
  7.0.102 [/snap/dotnet-sdk/192/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 7.0.2 [/snap/dotnet-sdk/192/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 7.0.2 [/snap/dotnet-sdk/192/shared/Microsoft.NETCore.App]

Other architectures found:
  None

Environment variables:
  Not set

global.json file:
  Not found

Learn more:
  https://aka.ms/dotnet/info

Download .NET:
  https://aka.ms/dotnet/download



dotnet new console -n test
Segmentation fault (core dumped)



SOLUTION uninstall from snap and just use debian package on my Ubuntu 22.04


snap  remove dotnet-sdk
dotnet-sdk removed


apt-file search dotnet-sdk  #  show what is available

      ..... output
dotnet-host: /usr/share/man/man1/dotnet-sdk-check.1.gz
dotnet-sdk-2.1: /usr/share/doc/dotnet-sdk-2.1/changelog.Debian.gz
dotnet-sdk-2.1: /usr/share/doc/dotnet-sdk-2.1/copyright
dotnet-sdk-3.1: /usr/share/doc/dotnet-sdk-3.1/changelog.Debian.gz
dotnet-sdk-3.1: /usr/share/doc/dotnet-sdk-3.1/copyright
dotnet-sdk-5.0: /usr/share/doc/dotnet-sdk-5.0/changelog.Debian.gz
dotnet-sdk-5.0: /usr/share/doc/dotnet-sdk-5.0/copyright
dotnet-sdk-6.0: /usr/share/doc/dotnet-sdk-6.0/changelog.Debian.gz
dotnet-sdk-6.0: /usr/share/doc/dotnet-sdk-6.0/copyright
dotnet-sdk-6.0-source-built-artifacts: /usr/share/doc/dotnet-sdk-6.0-source-built-artifacts/changelog.Debian.gz
dotnet-sdk-6.0-source-built-artifacts: /usr/share/doc/dotnet-sdk-6.0-source-built-artifacts/copyright
dotnet-sdk-7.0: /usr/share/doc/dotnet-sdk-7.0/changelog.Debian.gz
dotnet-sdk-7.0: /usr/share/doc/dotnet-sdk-7.0/copyright


sudo apt install dotnet-sdk-7.0   #  install what appears to be latest



Please fix your snap install on linux

@goff73
Copy link

goff73 commented Jan 14, 2023

please fix. dotnet new console. segmentation fault (core dumped)

@danmoseley
Copy link
Member

@goff73 please share version used, distro version, how you acquired dotnet, and if possible the stack trace.

@goff73
Copy link

goff73 commented Jan 14, 2023

I think I was using it through snap. I just got it to work when reinstalling with the scripted install. https://learn.microsoft.com/en-us/dotnet/core/install/linux-scripted-manual#scripted-install Thank you. No more errors. (Linux ubuntu with .net 7.)

@orion6dev
Copy link

Same issue here. After removing the SNAP install and re-installing using APT instructions here, it worked.

@esteban-gs
Copy link

Having the same issue, except I didn't install through snap:

.NET SDK (reflecting any global.json):
 Version:   6.0.116
 Commit:    b605cc131f

Runtime Environment:
 OS Name:     pop
 OS Version:  22.04
 OS Platform: Linux
 RID:         ubuntu.22.04-x64
 Base Path:   /usr/lib/dotnet/sdk/6.0.116/

global.json file:
  Not found

Host:
  Version:      6.0.16
  Architecture: x64
  Commit:       1e620a42e7

.NET SDKs installed:
  6.0.116 [/usr/lib/dotnet/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 6.0.16 [/usr/lib/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 6.0.16 [/usr/lib/dotnet/shared/Microsoft.NETCore.App]

Download .NET:
  https://aka.ms/dotnet-download

Learn about .NET Runtimes and SDKs:
  https://aka.ms/dotnet/runtimes-sdk-info

Then, running I get

dotnet run
Segmentation fault (core dumped)

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

No branches or pull requests