I am following along the tutorial on the EOS website at https://developers.eos.io/eosio-home/docs/your-first-contract

At the first smart contract development section, I cannot manage to publish the simplest hello world contract. Here is the error message I face:

[******** hello]$ cleos set contract hello . -p hello@active
Reading WASM from /home/*****/eos/contracts/hello/hello.wasm...
Publishing contract...
Error 3070003: Serialization Error Processing WASM
Error Details:
invalid index: localIndex>=locals.size()
pending console output:
[******** hello]$

My hello.cpp is as follows:

#include <eosio/eosio.hpp>

using namespace eosio;

class [[eosio::contract]] hello : public contract {
      using contract::contract;

      void hi( name user ) {
         print( "Hello, ", name{user});

(By the way, the tutorial website seems slightly unclear on whether it should be print( "Hello, ", name{user}); or print( "Hello, ", user);)

I have also noticed that eosio-cpp -abigen -o hello.wasm hello.cpp will hang forever and needs to be terminated manually with ctrl+c. This seems similar to https://github.com/EOSIO/eosio.cdt/issues/123

The suggested fixe mentions having a 2-core CPU, which I have set my VM to use already.

However, in my case, hello.abi and hello.wasm ARE generated, In which case I continue and then run into the error message mentioned at the beginning.

I have noticed that when I run cat hello.wasm, I can read the following among all the messy characters :

                    !failed to allocate pagesHello, A▒▒

Here some info about my setup :

[*** hello]$ eosio-cpp --version
eosio-cpp version 1.6.0
[*** hello]$ eosio-abigen --version
eosio-abigen version 1.6.0
[*** hello]$ nodeos --version
[*** hello]$ cat /etc/os-release
NAME="CentOS Linux"
VERSION="7 (Core)"
ID_LIKE="rhel fedora"
PRETTY_NAME="CentOS Linux 7 (Core)"


How can I fix this and complete the EOS tutorial?

1 Answer 1


The problem you are describing definitely appears to be related to your VM only having one core. Please double check that your VM has 2 or more cores allocated to it, and that you have restarted your VM after making the necessary adjustment.

Additionally, eosio.cdt 1.6.0 has some issues that may cause problems, please upgrade to eosio.cdt 1.6.1 immediately.

  • My VM now does have two cores: "lscpu" outputs : ... " CPU(s): 2 On-line CPU(s) list: 0,1 Thread(s) per core: 1 Core(s) per socket: 2 Socket(s): 1 " ...and my cdt is upgraded to 1.6.1:" $ eosio-cpp --version" gives me "eosio-cpp version 1.6.1" The issue still persists however Commented May 7, 2019 at 1:57
  • PS: the problem IS solved now. I spoke too soon when I saw the compilation hanging several times, but once it decided to complete, the resulting .wasm was correct. Commented May 7, 2019 at 2:23
  • glad to hear it!!!!
    – Sandwich
    Commented May 7, 2019 at 16:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.