From 7067ee387316b5d3488a88d07a769873457b2e79 Mon Sep 17 00:00:00 2001 From: Mahmood Ali Date: Wed, 27 Oct 2021 06:39:16 -0700 Subject: [PATCH] Fix arm64 panics by updating google/snappy library to latest, 0.0.4 (#11396) Pick up https://github.com/golang/snappy/pull/56 to handle arm64 architectures to fix panics. tldr; Golang 1.16 changed `memmove` implementation for arm64 requiring additional cpu registers that snappy wasn't preserving in its assembly implementation. Other projects have experienced this issue as well, searching for `encode_arm64.s:666` on your favorite search engine will reveal some. Vault updated the dependency earlier this August: https://github.com/hashicorp/vault/pull/12371 . I believe this issue affects Nomad 1.2.x and 1.1.x. Nomad 1.0.x use Golang 1.15 and isn't affected. However, backporting the change to 1.0.x should be harmless. Fixed https://github.com/hashicorp/nomad/issues/11385 . --- .changelog/11396.txt | 3 +++ go.mod | 2 +- go.sum | 3 ++- 3 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 .changelog/11396.txt diff --git a/.changelog/11396.txt b/.changelog/11396.txt new file mode 100644 index 00000000000..5a2d17c6e7f --- /dev/null +++ b/.changelog/11396.txt @@ -0,0 +1,3 @@ +```release-note: bug +server: Fixed a panic on arm64 platform when dispatching a job with a payload +``` diff --git a/go.mod b/go.mod index 90615692656..4656d4ef1d8 100644 --- a/go.mod +++ b/go.mod @@ -46,7 +46,7 @@ require ( github.com/fsnotify/fsnotify v1.4.9 // indirect github.com/fsouza/go-dockerclient v1.6.5 github.com/golang/protobuf v1.5.0 - github.com/golang/snappy v0.0.2 + github.com/golang/snappy v0.0.4 github.com/google/go-cmp v0.5.5 github.com/gorilla/websocket v1.4.2 github.com/gosuri/uilive v0.0.4 diff --git a/go.sum b/go.sum index 23e860bc884..305aab1d790 100644 --- a/go.sum +++ b/go.sum @@ -299,8 +299,9 @@ github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw github.com/golang/protobuf v1.5.0 h1:LUVKkCeviFUMKqHa4tXIIij/lbhnMbP7Fn5wKdKkRh4= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golang/snappy v0.0.2 h1:aeE13tS0IiQgFjYdoL8qN3K1N2bXXtI6Vi51/y7BpMw= github.com/golang/snappy v0.0.2/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= +github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0 h1:0udJVsspx3VBr5FwtLhQQtuAsVc79tTq0ocGIPAU6qo= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=