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

tutorial program gives no output #49687

Closed
paolini opened this issue Mar 9, 2021 · 13 comments
Closed

tutorial program gives no output #49687

paolini opened this issue Mar 9, 2021 · 13 comments
Milestone

Comments

@paolini
Copy link

paolini commented Mar 9, 2021

Problem encountered on https://dotnet.microsoft.com/learn/dotnet/hello-world-tutorial/run
Operating System: linux

I have followed the tutorial as shown below. When executing dotnet run no output is given (not the expected "Hello World" nor any error). Only a 139 exit code.

[13:06:58]:~
> dotnet new console -o myApp
The template "Console Application" was created successfully.

Processing post-creation actions...
Running 'dotnet restore' on myApp/myApp.csproj...
  Determining projects to restore...
  Restored /home/emanuele/myApp/myApp.csproj (in 77 ms).
Restore succeeded.

[13:07:16]:~
> cd myApp
[13:07:33]:~/myApp
> dotnet run
[13:08:03]:~/myApp
> dotnet --version
5.0.200
[13:08:13]:~/myApp
> uname -a
Linux emanuele-XPS 5.4.0-66-generic dotnet/core#74-Ubuntu SMP Wed Jan 27 22:54:38 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
[13:10:59]:~/myApp
> which dotnet
/snap/bin/dotnet
[13:18:37]:~/myApp
> dotnet run
[13:18:46]:~/myApp
> echo $?
139
[15:37:14]:~/myApp
> lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 20.04.2 LTS
Release:	20.04
Codename:	focal

@antonfirsov
Copy link
Member

antonfirsov commented Mar 9, 2021

@paolini what version of Ubuntu are you using? (Can't figure out from the log)

/cc @mairaw @agocke

@paolini
Copy link
Author

paolini commented Mar 9, 2021

Ubuntu 20.04.2 LTS
(updated original message)

@mairaw mairaw transferred this issue from dotnet/core Mar 10, 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.

@mairaw mairaw removed their assignment Mar 10, 2021
@marcpopMSFT marcpopMSFT self-assigned this Mar 15, 2021
@marcpopMSFT marcpopMSFT transferred this issue from dotnet/sdk Mar 15, 2021
@marcpopMSFT
Copy link
Member

Not sure if this should go to templating as a problem with the template or runtime with a problem on Ubuntu.

@marcpopMSFT marcpopMSFT removed their assignment Mar 15, 2021
@DavidKarlas DavidKarlas transferred this issue from dotnet/templating Mar 16, 2021
@dotnet-issue-labeler dotnet-issue-labeler bot added area-Host untriaged New issue has not been triaged by the area owner labels Mar 16, 2021
@ghost
Copy link

ghost commented Mar 16, 2021

Tagging subscribers to this area: @vitek-karas, @agocke
See info in area-owners.md if you want to be subscribed.

Issue Details

Problem encountered on https://dotnet.microsoft.com/learn/dotnet/hello-world-tutorial/run
Operating System: linux

I have followed the tutorial as shown below. When executing dotnet run no output is given (not the expected "Hello World" nor any error). Only a 139 exit code.

[13:06:58]:~
> dotnet new console -o myApp
The template "Console Application" was created successfully.

Processing post-creation actions...
Running 'dotnet restore' on myApp/myApp.csproj...
  Determining projects to restore...
  Restored /home/emanuele/myApp/myApp.csproj (in 77 ms).
Restore succeeded.

[13:07:16]:~
> cd myApp
[13:07:33]:~/myApp
> dotnet run
[13:08:03]:~/myApp
> dotnet --version
5.0.200
[13:08:13]:~/myApp
> uname -a
Linux emanuele-XPS 5.4.0-66-generic dotnet/core#74-Ubuntu SMP Wed Jan 27 22:54:38 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
[13:10:59]:~/myApp
> which dotnet
/snap/bin/dotnet
[13:18:37]:~/myApp
> dotnet run
[13:18:46]:~/myApp
> echo $?
139
[15:37:14]:~/myApp
> lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 20.04.2 LTS
Release:	20.04
Codename:	focal

Author: paolini
Assignees: -
Labels:

area-Host, untriaged

Milestone: -

@DavidKarlas
Copy link
Contributor

Moved to runtime since 139 indicates runtime SIGSEGV.

@vitek-karas
Copy link
Member

Can you try running the app directly? Should be something like ./bin/Debug/net5.0/myApp

If it fails the same way please try:

  • export COREHOST_TRACE=1
  • export COREHOST_TRACEFILE=host.txt
  • run the app directly

This should produce host.txt in the current directory. Take a look near the end the file, you should see something like:

CoreCLR path = ...
Loaded library from ... coreclr.so
..
Execute managed assembly exit code: ...

If you don't see this, it would be interesting to see the end of that file.

Note: the host.txt may contain information like environment variables, local paths, user name and so on - please make sure you're OK sharing it.

@paolini
Copy link
Author

paolini commented Mar 16, 2021

the file host.txt is not created:

[13:38:54]emanuele@emanuele-XPS:~/myApp
> export COREHOST_TRACE=1
[13:39:27]emanuele@emanuele-XPS:~/myApp
> export COREHOST_TRACEFILE=host.txt
[13:39:31]emanuele@emanuele-XPS:~/myApp
> ./bin/Debug/net5.0/myApp 
Segmentation fault (core dumped)
[13:39:34]emanuele@emanuele-XPS:~/myApp
> tail host.txt
tail: cannot open 'host.txt' for reading: No such file or directory
[13:39:41]emanuele@emanuele-XPS:~/myApp
> find . -name host.txt
[13:39:45]emanuele@emanuele-XPS:~/myApp
> find .
.
./obj
./obj/Debug
./obj/Debug/net5.0
./obj/Debug/net5.0/apphost
./obj/Debug/net5.0/myApp.csproj.CoreCompileInputs.cache
./obj/Debug/net5.0/myApp.csprojAssemblyReference.cache
./obj/Debug/net5.0/ref
./obj/Debug/net5.0/ref/myApp.dll
./obj/Debug/net5.0/.NETCoreApp,Version=v5.0.AssemblyAttributes.cs
./obj/Debug/net5.0/myApp.GeneratedMSBuildEditorConfig.editorconfig
./obj/Debug/net5.0/myApp.genruntimeconfig.cache
./obj/Debug/net5.0/myApp.AssemblyInfoInputs.cache
./obj/Debug/net5.0/myApp.csproj.FileListAbsolute.txt
./obj/Debug/net5.0/myApp.dll
./obj/Debug/net5.0/myApp.pdb
./obj/Debug/net5.0/myApp.assets.cache
./obj/Debug/net5.0/myApp.AssemblyInfo.cs
./obj/myApp.csproj.nuget.g.props
./obj/project.nuget.cache
./obj/myApp.csproj.nuget.g.targets
./obj/myApp.csproj.nuget.dgspec.json
./obj/project.assets.json
./Program.cs
./myApp.csproj
./bin
./bin/Debug
./bin/Debug/net5.0
./bin/Debug/net5.0/myApp.runtimeconfig.json
./bin/Debug/net5.0/myApp.deps.json
./bin/Debug/net5.0/myApp.runtimeconfig.dev.json
./bin/Debug/net5.0/myApp
./bin/Debug/net5.0/ref
./bin/Debug/net5.0/ref/myApp.dll
./bin/Debug/net5.0/myApp.dll
./bin/Debug/net5.0/myApp.pdb
[13:39:51]emanuele@emanuele-XPS:~/myApp
> set | grep COREHOST
COREHOST_TRACE=1
COREHOST_TRACEFILE=host.txt

@vitek-karas
Copy link
Member

Hmm... can you try running:
dotnet ./bin/Debug/net5.0/myApp.dll

And one last thing (out of desperation) - can you try creating a folder and trying the whole process on a new application?

Would it be possible to share the dump? If you're OK with sharing it, can you please send it to vitek.karas at microsoft.com?

@paolini
Copy link
Author

paolini commented Mar 16, 2021

This is working:

[18:16:59]emanuele@emanuele-XPS:~/myApp
> dotnet ./bin/Debug/net5.0/myApp.dll
Hello World!

I've tried to restart all the process from zero, even from another computer of mines with no luck. Maybe there is some application I use that is interfering? Maybe docker?

I would be glad to share the dump. Which file is it?

@ForNeVeR
Copy link
Contributor

I was able to reproduce the same with .NET 5 SDK installed from Snap (according to the docs – notably, .NET Core 3.1 SDK was by default there, so I had to install .NET 5 SDK via terminal).

Hello World program simply gives no output when started by dotnet run, but works if I start it via dotnet ./bin/Debug/net5.0/myproj.dll.

Notably, .NET 3.1 had another critical problem when installed from Snap, which has a similar workaround: #3792.

@ForNeVeR
Copy link
Contributor

After reading #3775 (comment), I was able to fix the issue locally.

I was starting a Hello World program from a directory /tmp/myproj2:

$ cd /tmp
$ dotnet new console -o myproj2
$ cd myproj2
$ dotnet run
<no output>
$

If I start it from a directory /tmp/1/2/3/4/myproj2, then it works!

@vitek-karas vitek-karas added this to the 6.0.0 milestone Jul 9, 2021
@vitek-karas vitek-karas removed the untriaged New issue has not been triaged by the area owner label Jul 9, 2021
@agocke
Copy link
Member

agocke commented Aug 2, 2021

Dup of #51322

@agocke agocke closed this as completed Aug 2, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Sep 1, 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

8 participants