neo-project / neo-node

MIT License
229 stars 224 forks source link

Segmentation fault in Ubuntu 16.04 #42

Closed devfive closed 6 years ago

devfive commented 7 years ago

Hi,

I am struggling with neo-cli for some time and unfortunately didn't manage to run it as for now.

When I run dotnet neo-cli.dll I get Segmentation fault error. More info is available when I used diagnostics flag.

root@host:/home/neo/node# dotnet -d neo-cli.dll 
Telemetry is: Disabled
projectfactory: MSBUILD_EXE_PATH = /usr/share/dotnet/sdk/1.1.4/MSBuild.dll
projectfactory: MSBuild project path = 
projecttoolscommandresolver: ProjectFactory did not find Project.
Microsoft.DotNet.Cli.Utils.CommandUnknownException: No executable found matching command "dotnet-neo-cli.dll"
   at Microsoft.DotNet.Cli.Utils.Command.Create(ICommandResolverPolicy commandResolverPolicy, String commandName, IEnumerable`1 args, NuGetFramework framework, String configuration, String outputPath, String applicationName)
   at Microsoft.DotNet.Cli.Utils.Command.Create(String commandName, IEnumerable`1 args, NuGetFramework framework, String configuration, String outputPath, String applicationName)
   at Microsoft.DotNet.Cli.Program.ProcessArgs(String[] args, ITelemetry telemetryClient)
   at Microsoft.DotNet.Cli.Program.Main(String[] args)
root@host:/home/neo/node# dotnet --info
.NET Command Line Tools (1.1.4)

Product Information:
 Version:            1.1.4
 Commit SHA-1 hash:  d2f3571419

Runtime Environment:
 OS Name:     ubuntu
 OS Version:  16.04
 OS Platform: Linux
 RID:         ubuntu.16.04-x64
 Base Path:   /usr/share/dotnet/sdk/1.1.4

Do you have any ideas what can be wrong?

Thanks in advance, Regards

fabwa commented 7 years ago

Can confirm this, i am having this issue with Ubuntu 16.04, 14.04 and CentOS 7.1 - installed all dependencies + tried .NET 1.1.2,1.1.4 and 2.0 with precompiled binaries and compiling from source + portable. The steps outlined here in #13 seem depreciated for neo-cli 2.3.5. Any thoughts? What are the minimum hardware requirements?

khelle commented 7 years ago

I can confirm having the same problem on Ubuntu 16.04. Can we already get any response from the devs?

erikzhang commented 7 years ago

You do not need to install .NET Core on linux. Follow the steps to install NEO-CLI:

Install Dependencies

yum install zip unzip
yum install leveldb-devel
yum install deltarpm
yum install epel-release
yum install libunwind
yum install libcurl-devel
yum install openssl-devel
yum install libicu-devel

Install NEO-CLI

You will need wget for downloading. If you don't have it, install it first:

yum install wget

Then download NEO-CLI:

wget https://github.com/neo-project/neo-cli/releases/download/v2.3.5/neo-cli-centos.7-x64.zip

You can replace v2.3.5 to other version. After downloading, extract the files from the zip:

unzip neo-cli-centos.7-x64.zip
cd neo-cli

Set permission for execution:

chmod u+x neo-cli

If you want to speed up the synchronization, you need to download the chain pack:

wget https://neo.org/client/chain.acc.zip

Run NEO-CLI

Start NEO-CLI:

./neo-cli

Or start it with --rpc

./neo-cli --rpc

Run NEO-CLI In Background

If you want to run NEO-CLI in background, you need to install screen first:

yum install screen

Then start NEO-CLI with screen:

screen ./neo-cli

Or start it with --rpc

screen ./neo-cli --rpc
khelle commented 7 years ago

@erikzhang This does not help. I did following installation on Ubuntu 16.04

sudo sh -c 'echo "deb [arch=amd64] https://apt-mo.trafficmanager.net/repos/dotnet-release/ xenial main" > /etc/apt/sources.list.d/dotnetdev.list'
sudo apt-key adv --keyserver apt-mo.trafficmanager.net --recv-keys 417A0893
sudo apt-get update
sudo apt-get install dotnet-dev-1.0.4
sudo apt-get install zip
sudo apt-get install unzip
sudo apt-get install deltarpm
sudo apt-get install libssl-dev
sudo apt-get install libcurl4-openssl-dev
sudo apt-get install libunwind-dev
sudo apt-get install libicu-dev
sudo apt-get install liblttng-ust-dev
sudo apt-get install uuid-dev
sudo apt-get install libleveldb-dev 
sudo apt-get install sqlite3 
sudo apt-get install libsqlite3-dev

Then I downloaded and unpaked latestest version (I tried all 2.0+ released, the samproblem is in neach one):

wget https://github.com/neo-project/neo-cli/releases/download/v2.3.5/neo-cli-ubuntu.16.04-x64.zip -O src
unzip src
move ./neo-cli ./node
cd ./node
chmod -R 755 ./*
chown -R neo:neo ./*

And then tried to run both:

dotnet neo-cli.dll

and

./neo-cli

In both cases - segmentation fault . It is obvious that current installation instructions placed in docs and/or pasted over github are wrong. Can you do something about this, give us valid instructions and solve the problem? Thanks.

devfive commented 7 years ago

@erikzhang I don't think that copy & paste of instructions from docs will resolve our issue. I still didn't manage to run NEO on Ubuntu. What is more, I also tried different versions of .NET (1.1.4 and 2.0).

.NET installation is correct, as I downloaded and ran some sample project without any difficulties.

You do not need to install .NET Core on linux. Follow the steps to install NEO-CLI:

Hmm, documentation says:

Running of an NEO node requires installation of .NET Core Runtime, version 1.0.1 or above.

So which of those is true?

Any tips with regards to our issue?

erikzhang commented 7 years ago

Yes, you do not need to install .NET Core on linux. I have tested the steps above and it works for me on CentOS 7.4. I will test it on Ubuntu later.

khelle commented 7 years ago

@erikzhang can you please do the tests on clean installation of Ubuntu 16.04?

fabwa commented 7 years ago

@erikzhang the issue was that i allocated too little memory to my box. Increasing to 4GB resolved the segmentation fault. Might solve it for others as well. Please add minimum memory requirements to instructions.

Small remark: in your CentOS command list you should have "yum install epel-release" above "leveldb-devel"

khelle commented 7 years ago

@fabwa Do you mean using some specific instructions for NEO to allow more memory usage or just increasing memory on the server? I run NEO on empty dedicated server with 64 GB RAM so I don't think the amount is not hight enough.

fabwa commented 7 years ago

I see.. i meant add more memory to the server, yes. I just tried CentOS (http://www.osboxes.org/centos/#centos-7-1611-vbox) there it resolved the issue.

devfive commented 7 years ago

@fabwa this doesn't refer to my case either as I tried to run NEO on server with 32 GB RAM.

fabwa commented 7 years ago

Interesting, then i assume its another issue for Ubuntu.

khelle commented 6 years ago

Still no info on solution to this issue?

metachris commented 6 years ago

So for me and at https://github.com/CityOfZion/neo-privatenet-docker, neo-cli works on Ubuntu.

We're using dotnet-sdk-2.0.0. One thing I've noticed is that you have to run dotnet neo-cli.dll, not dotnet -d neo-cli.dll as the original post asked for.

When running dotnet -d neo-cli.dll, I get the same error as described in the initial issue:

# dotnet -d neo-cli.dll

Welcome to .NET Core!
---------------------
Learn more about .NET Core @ https://aka.ms/dotnet-docs. Use dotnet --help to see available commands or go to https://aka.ms/dotnet-cli-docs.

Telemetry
--------------
The .NET Core tools collect usage data in order to improve your experience. The data is anonymous and does not include command-line arguments. The data is collected by Microsoft and shared with the community.
You can opt out of telemetry by setting a DOTNET_CLI_TELEMETRY_OPTOUT environment variable to 1 using your favorite shell.
You can read more about .NET Core tools telemetry @ https://aka.ms/dotnet-cli-telemetry.
Telemetry is: Disabled
No executable found matching command "dotnet-neo-cli.dll"

With this being the meaningful error message: No executable found matching command "dotnet-neo-cli.dll". What is causing this?

But just running dotnet neo-cli.dll works just fine.