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 when using dotnet 5.0 from snap #51322

Closed
briguyjm opened this issue Dec 29, 2020 · 7 comments
Closed

Segmentation Fault when using dotnet 5.0 from snap #51322

briguyjm opened this issue Dec 29, 2020 · 7 comments
Labels
area-Snap untriaged New issue has not been triaged by the area owner

Comments

@briguyjm
Copy link

I just installed dotnet sdk 5.0 using snap on Ubuntu 20.10. When creating a simple Hello World and running dotnet test, nothing happens. Running dotnet build builds my Hello World just fine, but dotnet run does nothing. Running the binary directly in the bin/ directory results in a Segmentation Fault.

brian@brian-pc:~/hello$ dotnet build
Microsoft (R) Build Engine version 16.8.0+126527ff1 for .NET
Copyright (C) Microsoft Corporation. All rights reserved.

  Determining projects to restore...
  All projects are up-to-date for restore.
  hello -> /home/brian/hello/bin/Debug/net5.0/hello.dll

Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:00:00.74
brian@brian-pc:~/hello$ dotnet run
brian@brian-pc:~/hello$ cd bin/Debug/net5.0/
brian@brian-pc:~/hello/bin/Debug/net5.0$ ./hello 
Segmentation fault (core dumped)

This is my Program.cs

using System;

namespace hello
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");
        }
    }
}

System info:

lsb_release -cr
Release:	20.10
Codename:	groovy

dotnet --version
5.0.101

uname -r
5.8.0-7630-generic

@kjholzapfel
Copy link

I am having exactly the same issue, installed dotnet with snap.

System:  Kernel: 5.10.16-1-default x86_64 bits: 64 Desktop: KDE Plasma 5.21.0  Distro: openSUSE Tumbleweed 20210222 

dotnet --version
5.0.103

snap list
Name        Version              Rev    Tracking       Publisher      Notes
dotnet-sdk  5.0.103              112    latest/stable  dotnetcore✓    classic

I've tried to debug the issue, but I am inexperienced with it:

/snap/dotnet-sdk/current # lldb dotnet
(lldb) target create "dotnet"
Current executable set to '/snap/dotnet-sdk/current/dotnet' (x86_64).
(lldb) process launch -program_arg build
Process 26812 launched: '/snap/dotnet-sdk/current/dotnet' (x86_64)
Process 26812 stopped
* thread dotnet/sdk#11, name = '.NET ThreadPool', stop reason = signal SIGSEGV: invalid address (fault address: 0x1a0)
    frame #0: 0x00007ffff7ddfc78 ld-2.27.so`___lldb_unnamed_symbol42$$ld-2.27.so + 888
ld-2.27.so`___lldb_unnamed_symbol42$$ld-2.27.so:
->  0x7ffff7ddfc78 <+888>: movl   0x8(%r8), %esi
    0x7ffff7ddfc7c <+892>: movl   $0x0, %eax
    0x7ffff7ddfc81 <+897>: testl  %esi, %esi
    0x7ffff7ddfc83 <+899>: cmoveq %rax, %r8

@danmoseley
Copy link
Member

@janvorli should this get transferred to runtime repo - the VM area?

@ghost
Copy link

ghost commented Apr 14, 2021

Hope this issue been resolved, I am ubuntu linux user, thanks. and love dotnet and fsharp.

@marcpopMSFT marcpopMSFT transferred this issue from dotnet/sdk Apr 15, 2021
@dotnet-issue-labeler
Copy link

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged New issue has not been triaged by the area owner label Apr 15, 2021
@mangod9 mangod9 removed the untriaged New issue has not been triaged by the area owner label Jul 6, 2021
@mangod9 mangod9 added this to the 6.0.0 milestone Jul 6, 2021
@mangod9
Copy link
Member

mangod9 commented Jul 20, 2021

Hi @kouvel, believe you had done some investigation for snap -- does this issue still exist in 6?

@kouvel
Copy link
Member

kouvel commented Jul 31, 2021

This seems to be the same issue as described in detail in #3775 (comment). Snap's dotnet seems to be targeting and should be running under the core18 base snap but it's ending up loading libs from system paths instead of from the base snap paths due to the RPATH issue.

Modifying the RPATH or just putting the app one folder deeper seems to resolve the issue when running the app directly from the build folder. Same issue with dotnet run as well it seems. dotnet bin/Debug/net5.0/hello.dll seems to work without any issues.

@kouvel kouvel removed this from the 6.0.0 milestone Jul 31, 2021
@kouvel kouvel added the untriaged New issue has not been triaged by the area owner label Jul 31, 2021
arwinneil added a commit to EventStore/EventStore that referenced this issue Aug 3, 2021
@NikolaMilosavljevic
Copy link
Member

[Triage] Closing Snap issues to reflect current priorities.

@dotnet dotnet locked as resolved and limited conversation to collaborators Sep 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-Snap untriaged New issue has not been triaged by the area owner
Projects
None yet
Development

No branches or pull requests

8 participants