hashicorp / nomad-driver-exec2

An official Nomad task driver plugin for sandboxing workloads using native Linux kernel features
Mozilla Public License 2.0
8 stars 0 forks source link

(ARM) panic: runtime error: integer divide by zero #59

Open sbaildon opened 3 days ago

sbaildon commented 3 days ago

Tried adopting exec2 into my cluster, but can't get it to run at all.

There's a regex,

https://github.com/hashicorp/nomad-driver-exec2/blob/6d3c12c719b8b27884d8c606cf67ffa48dbeb230/pkg/resources/utilization.go#L79

which is matching for a string that doesn't exist in (my aarch64 hetzner vps) /proc/cpuinfo,

https://github.com/hashicorp/nomad-driver-exec2/blob/6d3c12c719b8b27884d8c606cf67ffa48dbeb230/pkg/resources/utilization.go#L117

causing a divide by zero,

https://github.com/hashicorp/nomad-driver-exec2/blob/6d3c12c719b8b27884d8c606cf67ffa48dbeb230/pkg/resources/utilization.go#L141

$ cat /proc/cpuinfo 
processor   : 0
BogoMIPS    : 50.00
Features    : fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm lrcpc dcpop asimddp ssbs
CPU implementer : 0x41
CPU architecture: 8
CPU variant : 0x3
CPU part    : 0xd0c
CPU revision    : 1

processor   : 1
BogoMIPS    : 50.00
Features    : fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm lrcpc dcpop asimddp ssbs
CPU implementer : 0x41
CPU architecture: 8
CPU variant : 0x3
CPU part    : 0xd0c
CPU revision    : 1

extra

$ uname -a
Linux 6.6.9-200.fc39.aarch64 #1 SMP PREEMPT_DYNAMIC Mon Jan  1 20:26:25 UTC 2024 aarch64 GNU/Linux
$ nomad --version
Nomad v1.9.0
BuildDate 2024-10-10T07:13:43Z
Revision 7ad36851ec02f875e0814775ecf1df0229f0a615
$ dnf list installed | grep exec2
nomad-driver-exec2.aarch64               0.1.0-1                    @hashicorp    
{"@level":"debug","@message":"panic: runtime error: integer divide by zero","@module":"client.driver_mgr.nomad-driver-exec2","@timestamp":"2024-10-17T15:13:57.970024Z","driver":"exec2"}
{"@level":"debug","@message":"","@module":"client.driver_mgr.nomad-driver-exec2","@timestamp":"2024-10-17T15:13:57.970074Z","driver":"exec2"}
{"@level":"debug","@message":"goroutine 11 [running]:","@module":"client.driver_mgr.nomad-driver-exec2","@timestamp":"2024-10-17T15:13:57.970086Z","driver":"exec2"}
{"@level":"debug","@message":"github.com/hashicorp/nomad-driver-exec2/pkg/resources.Bandwidth(...)","@module":"client.driver_mgr.nomad-driver-exec2","@timestamp":"2024-10-17T15:13:57.970099Z","driver":"exec2"}
{"@level":"debug","@message":"\tgithub.com/hashicorp/nomad-driver-exec2/pkg/resources/utilization.go:141","@module":"client.driver_mgr.nomad-driver-exec2","@timestamp":"2024-10-17T15:13:57.970109Z","driver":"exec2"}
{"@level":"debug","@message":"github.com/hashicorp/nomad-driver-exec2/plugin.(*Plugin).StartTask(0x40003fe730, 0x40004c8f20)","@module":"client.driver_mgr.nomad-driver-exec2","@timestamp":"2024-10-17T15:13:57.970117Z","driver":"exec2"}
{"@level":"debug","@message":"\tgithub.com/hashicorp/nomad-driver-exec2/plugin/driver.go:208 +0xac8","@module":"client.driver_mgr.nomad-driver-exec2","@timestamp":"2024-10-17T15:13:57.970127Z","driver":"exec2"}
tgross commented 3 days ago

Hi @sbaildon! We had another report internally on this as well and it looks like this is a problem with ARM specifically. Thanks for reporting this!

(Tracking internally as https://hashicorp.atlassian.net/browse/NET-9566)