grin: Grin node 5.1.0 won't launch on Linux

Describe the bug Grin node v5.1.0 will not launch on Debian Buster, returning “Illegal instruction” to stdout.

To Reproduce

$ grin
Illegal instruction
$ echo $?
132
$ ps aux |grep -E '[g]rin'
$ 

Relevant Information

20210506 16:53:04.446 INFO grin_util::logger - log4rs is initialized, file level: Debug, stdout level: Warn, min. level: Debug                                                                                      
20210506 16:53:04.447 INFO grin - Using configuration file at /home/$USER/.grin/main/grin-server.toml
20210506 16:53:04.447 INFO grin - This is Grin version 5.1.0 (git v5.1.0), built for x86_64-unknown-linux-gnu by rustc 1.51.0 (2fd73fabe 2021-03-23).                                                               
20210506 16:53:04.448 DEBUG grin - Built with profile "release", features "".
20210506 16:53:04.448 INFO grin - Chain: Mainnet
20210506 16:53:04.448 INFO grin - Accept Fee Base: 500000
20210506 16:53:04.449 INFO grin - Future Time Limit: 300
20210506 16:53:04.449 INFO grin - Feature: NRD kernel enabled: false
20210506 16:53:04.449 WARN grin::cmd::server - Starting GRIN in UI mode...
20210506 16:53:04.450 INFO grin_servers::grin::server - Starting server, genesis block: 40adad0aec27
20210506 16:53:04.451 DEBUG grin_store::lmdb - DB Mapsize for /home/$USER/.grin/main/chain_data/lmdb is 549755813888

Desktop (please complete the following information):

$ cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 10 (buster)"
NAME="Debian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 25 (18 by maintainers)

Most upvoted comments

Good catch @antiochp. This is now fixed by #3644. This binary should run fine on linux https://github.com/quentinlesceller/grin/releases/tag/v5.1.0-test3.

Can confirm the binary isn’t working on my i7 running Debian 10.9 in docker. But compiling from source works. I suspect a croaring issue.

Ideally, a binary would check if avx2 support is present before using those instructions. But if croaring is lacking the smarts to do that, then we should avoid avx2 altogether. There’s still a significant number of CPUs without avx2 that I think we should support.

Core was generated by `/tmp/grin-v5.1.0-official'.
Program terminated with signal SIGILL, Illegal instruction.
#0  0x00005648256d4423 in ra_portable_serialize ()
(gdb) where
#0  0x00005648256d4423 in ra_portable_serialize ()
#1  0x000056482567d73b in grin_store::save_via_temp_file ()
#2  0x000056482567cdbc in grin_store::leaf_set::LeafSet::flush ()
#3  0x0000564825618fa1 in grin_store::pmmr::PMMRBackend<T>::sync ()
#4  0x00005648255e563c in grin_chain::txhashset::txhashset::extending ()
#5  0x0000564825632b10 in grin_chain::chain::Chain::init ()
#6  0x0000564825152051 in grin_servers::grin::server::Server::new ()
#7  0x0000564825050b04 in grin_servers::grin::server::Server::start ()
#8  0x0000564825061b31 in grin::cmd::server::start_server_tui ()
#9  0x0000564825062fee in grin::cmd::server::server_command ()
#10 0x000056482504df8e in grin::real_main ()
#11 0x000056482504c0f6 in grin::main ()


(gdb) layout asm

  >│0x5648256d4423 <ra_portable_serialize+355>      vpxord %zmm4,%zmm4,%zmm4   │

so we have an avx512 instruction? https://en.wikipedia.org/wiki/AVX-512 Legacy instructions upgraded with EVEX encoded versions

Legacy encoding - sse sse2 mmx  | avx sse3 sse4.1 | avx2 fma    | Group | Instructions | AVX-512extensions
--------------------------------------------------------------------------------

Yes | Yes | Yes  | VPXOR | VPXORD, VPXORQ | F, VL

Okay, prepending config_file_version = 2 to the top of my grin-server.toml sorted the issue.