smapp icon indicating copy to clipboard operation
smapp copied to clipboard

Check CPU capabilities and avoid SIGILL in GO

Open TBMoonwalker opened this issue 1 year ago • 0 comments

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

  1. Create a VM on a popular Hypervisor
  2. Configure your VM with a emulated CPU
  3. Install SMApp and start smeshing
  4. Get the message, that the CPU is not capable for smeshing with link to documentation - no missleading SIGILL
  5. Fix the VM settings (use CPU Host mode)
  6. 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.

TBMoonwalker avatar Jan 16 '24 13:01 TBMoonwalker