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

dotnet 3 sdk snap *** stack smashing detected *** #3792

Closed
paaland opened this issue Oct 3, 2019 · 9 comments
Closed

dotnet 3 sdk snap *** stack smashing detected *** #3792

paaland opened this issue Oct 3, 2019 · 9 comments
Milestone

Comments

@paaland
Copy link

paaland commented Oct 3, 2019

dotnet 3 sdk snap *** stack smashing detected ***

OS Name: debian
OS Version: 10
OS Platform: Linux
RID: debian.10-x64

Install dotnet-sdk via snap:

$ snap install dotnet-sdk --classic
$ snap alias dotnet-sdk.dotnet dotnet

Create new console application

$ dotnet new console
$ dotnet run

Should write "Hello World", but instead ends up with

*** stack smashing detected ***: terminated

General

$ which dotnet
/snap/bin/dotnet
$ snap --version

Debian 10 buster
snap    2.41
snapd   2.41
series  16
debian  10
kernel  4.19.0-6-amd64
$ dotnet -info

.NET Core SDK (reflecting any global.json):
 Version:   3.0.100
 Commit:    04339c3a26

Runtime Environment:
 OS Name:     debian
 OS Version:  10
 OS Platform: Linux
 RID:         debian.10-x64
 Base Path:   /snap/dotnet-sdk/49/sdk/3.0.100/

Host (useful for support):
  Version: 3.0.0
  Commit:  7d57652f33

.NET Core SDKs installed:
  3.0.100 [/snap/dotnet-sdk/49/sdk]

.NET Core runtimes installed:
  Microsoft.AspNetCore.App 3.0.0 [/snap/dotnet-sdk/49/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 3.0.0 [/snap/dotnet-sdk/49/shared/Microsoft.NETCore.App]

To install additional .NET Core runtimes or SDKs:
  https://aka.ms/dotnet-download
@leecow
Copy link
Member

leecow commented Oct 3, 2019

@paaland - What happens if you invoke the dll directly with dotnet bin/Debug/netcoreapp3.0/[your-application.dll] ?

@paaland
Copy link
Author

paaland commented Oct 4, 2019

If I run the DLL it seems to work. It's the new "executable" that is causing issues. That and running via dotnet run test.csproj

$ dotnet build
Microsoft (R) Build Engine version 16.3.0+0f4c62fea for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

  Restore completed in 17.58 ms for /home/user/src/test/test.csproj.
  test -> /home/user/src/test/bin/Debug/netcoreapp3.0/test.dll

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

Time Elapsed 00:00:00.97

Run via dotnet and dll:

$ dotnet bin/Debug/netcoreapp3.0/test.dll
Hello World!

Run via new executable:

$ bin/Debug/netcoreapp3.0/test
*** stack smashing detected ***: <unknown> terminated
Aborted

Run via project file:

$ dotnet run test.csproj
*** stack smashing detected ***: <unknown> terminated

@leecow
Copy link
Member

leecow commented Oct 4, 2019

Thanks, @paaland - looks like this is another of the rough edges with the Snap install. I'm going to move this to the core-setup repo where it can be tracked.

@leecow leecow transferred this issue from dotnet/core Oct 4, 2019
@msftgits msftgits transferred this issue from dotnet/core-setup Jan 30, 2020
@dagood dagood removed the Triaged label Jan 30, 2020
@maryamariyan maryamariyan added the untriaged New issue has not been triaged by the area owner label Feb 23, 2020
@martin-cermak
Copy link

martin-cermak commented Mar 18, 2020

We are also facing *** stack smashing detected ***: terminated

We are not using SNAP. Application runs in Docker. Currently we cant caugh when it happends, no debug, no exception.

Environment: .NET Core 3.1, Debian 10.3, Docker version 19.03.8

@dleeapho dleeapho removed the untriaged New issue has not been triaged by the area owner label Jul 6, 2020
@dleeapho dleeapho added this to the 6.0.0 milestone Jul 6, 2020
@misterspeedy
Copy link

Hit identical issue on Ubuntu 20.4.2:

Repro, brand new Ubuntu 20.4.2 VM:

sudo snap install dotnet-sdk --classic --channel=3.1
sudo snap alias dotnet-sdk.dotnet dotnet
mkdir demo
cd demo
dotnet new console -lang F#
dotnet run
*** stack smashing detected ***: terminated

@rubenpetrosyan1
Copy link

We are also facing *** stack smashing detected ***: terminated

We are not using SNAP. Application runs in Docker. Currently we cant caugh when it happends, no debug, no exception.

Environment: .NET Core 3.1, Debian 10.3, Docker version 19.03.8

hi martin-cermak
did you resolve the issue?
we are running into the same issue with dotnet build inside docker container.

@martin-cermak
Copy link

Hi Ruben,
we spent a lot of time with diagnostics and I have only ideas where bug is related. At first I must say that our app had bugs. BUT on Windows, app was crashed and shown exception.

On Linux runtime there was this strange "stack smashing". It was related to more things, I thing a combination of async call / event rutine where was some function called on NULL object. On windows there was right exception about NULL object, but on Linux it crashed.

So in our solution, after many hours we changed this:
SomeObject.CallFunction()

to

if (SomeObject != null) {
SomeObject.CallFunction() // or simplier version using ?
}

I thing it was also not related to docker but linux runtime itself...

Martin

@rubenpetrosyan1
Copy link

thank you @martin-cermak

@NikolaMilosavljevic
Copy link
Member

[Triage] Closing Snap issues to reflect current priorities.

@ghost ghost locked as resolved and limited conversation to collaborators Aug 28, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

9 participants