smapp
smapp copied to clipboard
Check CPU capabilities and avoid SIGILL in GO
Rationale
If you start SMapp or the go-spacemesh cli in a virtualised environment (KVM Hypervisor, VMWare, ... - not Docker or Kubernetes), changes are high, that you get a SIGILL statement in the latest versions. This can be caused by emulated CPU settings, popular in most of the Hypervisors. For example I'm using KVM through Proxmox, which sets the "emulated AMD64 CPU" as default. Switching to "Host" mode (passthrough of the original CPU capabilities) fixes the problem.
Here you can see the error in detail: error.log
Prerequisites
No open issue for that.
User story
Describe the most straightforward usage scenario
As a user I would except an error code which leads me to the right configuration/documentation how to fix it.
Acceptance criteria
- Create a VM on a popular Hypervisor
- Configure your VM with a emulated CPU
- Install SMApp and start smeshing
- Get the message, that the CPU is not capable for smeshing with link to documentation - no missleading SIGILL
- Fix the VM settings (use CPU Host mode)
- Restart smeshing and be happy
Out of scope
Automatically configure the Hypervisor to work with the SMApp or cli
How to implement
Implement an exception who catches the wrong CPU configuration and print out the error with a link to the documentation.
How to test
Create a VM with the missing CPU features and try do run SMApp or go-spacemesh cli. You should get the SIGILL exception right after the ATX syncing start/try.