3

Most dotnet commands I run on my Ubuntu 20.04 system gives me the error:
Segmentation fault (core dumped)

I tried rerunning the dotnet installation scripts and I tried modifying the stack size with uint -n (as advised on the internet). (It's important to note that I was using the backend of an app on dotnet without any problems, and this error seems to have come out of nowhere.)

I cannot find a solution for this. What can I do to fix this?

The following commands produce the segfault:

  • dotnet -h
  • dotnet --info

The following commands do not produce a segfault:

  • dotnet (without any arguments)
  • dotnet --list-sdks
  • dotnet --list-runtimes

I used the official microsoft documentation from here https://docs.microsoft.com/en-us/dotnet/core/install/linux-ubuntu to install .NET and it ran just fine until a few days ago.

EDIT: Upon further investigation, I found out that if I uninstall the SDK I stop getting the error but as soon as I reinstall, it reapears.

Szoke Lorand
  • 31
  • 1
  • 3
  • 1
    Please don't post screenshots of terminal output - you should [edit] your question and copy/paste the text from the terminal window. – guntbert Jul 24 '20 at 22:59
  • Follow @guntbergs advice and also add the commands you used to install it. Make sure to use markdown syntax (see https://stackoverflow.com/editing-help#code ) – Garo Jul 25 '20 at 00:08
  • You say “Any dotnet command I run … gives me [this] error”, but your screenshot shows otherwise. – G-Man Says 'Reinstate Monica' Jul 25 '20 at 00:41
  • I improved your question but you still have to add the installation commands that you used – Garo Jul 25 '20 at 00:57
  • Thanks for improving my question :) . I didn't inculde the installation process because I had no problem running the command a few days ago, and I didn't make any important changes to the system that shouldw influenced the sdk. Anyways, I put the official microsoft instalation instructions, as those are what I used. – Szoke Lorand Jul 25 '20 at 08:15
  • Perhaps you could use strace to see what it did just before dying? – Danny Staple Jul 25 '20 at 08:49
  • @DannyStaple It output about 10000 lines but I guess the penultimate line here is the most important, though I dont know what it means or how to fix it :( `mprotect(0x7f8d414e0000, 4096, PROT_READ|PROT_WRITE) = 0 openat(AT_FDCWD, "/sys/fs/cgroup/cpu,cpuacct/user.slice/cpu.cfs_quota_us", O_RDONLY) = ?`THIS-> `+++ killed by SIGSEGV (core dumped) +++`<-THIS `Segmentation fault (core dumped)` – Szoke Lorand Jul 25 '20 at 09:27
  • What is the output of the following commands: `stat /sys/fs/cgroup/cpu,cpuacct/user.slice/cpu.cfs_quota_us` and `cat /sys/fs/cgroup/cpu,cpuacct/user.slice/cpu.cfs_quota_us` and what is the output when you run them as root ? – Garo Jul 25 '20 at 10:46

3 Answers3

2

I had this problem using the dotnet installed via snap. I uninstalled and installed directly, via APT. Now it works perfectly. I used the commands from the following link: Dotnet Core

AlexQL
  • 21
  • 3
0

On arch (Manjaro GNOME 21.2.5 in my case) installing it with pacman instead of snap fixed it.

First, remove the one installed with snap:

sudo snap remove dotnet-sdk

Then, install it with pacman:

sudo pacman -S dotnet-sdk
0

Apparentyly,because of issues with Snaps, snap installs of Microsoft's Dotnet packages requires you to do "sudo dotnet..." And doing so just grants you "segmentation fault" without the core dump.

This is as of Dotnet 6.0.108... And the only real reason that I can see running the snapfu version of dotnet is because the package manager version uses libunwind13, and not (the current as of this writing) libunwind14. In my own use case, I can either have a fully functional, non-snapfu'd dotnet, or I can have Discord... but not both. (Ubuntu 22.04)

I was hoping that I had the answer, but I'm still getting the segmentation fault... just without the core dump. I'm thinking that the actual answer is to drop the snap version and use the version from packages.microsoft.com As it doesn't use libunwind? supposedly and it works. (Once upon a time, I switched from that version the one that comes with ubuntu.)

I'm adding this here because 1) I can't comment; 2) because down the road, it may help someone else.

CherryCoke
  • 111
  • 3