Repository: minio/minio (language: go)

Issue:
[bug] "Erasure Coding self test failed" on Graviton4 since `RELEASE.2024-07-13T01-46-15Z`
Hi, first of all, thanks for your work!

I'm facing an error when trying to initialize the server using the latest `minio` image in a pretty clean spot instance of `R8g.medium` (Graviton4) using Fedora 39 AMI, I imagine it has something to do with https://github.com/minio/minio/pull/20081 and the underlying https://github.com/klauspost/reedsolomon/pull/281, as it was greatest recent arm-exclusive change, and I have no problem running `RELEASE.2024-07-10`.

## Steps to Reproduce

`sudo docker run -it --rm --env MINIO_ROOT_USER=user --env MINIO_ROOT_PASSWORD=password --env MINIO_URL='http://minio:9000' minio/minio:latest server /minio`

```
Unable to find image 'minio/minio:latest' locally
latest: Pulling from minio/minio
7248256e11e2: Already exists 
c5c747a2f644: Pull complete 
c86aefe997bc: Pull complete 
5e97c7e77097: Pull complete 
4f4fb700ef54: Pull complete 
e63bb121cbda: Pull complete 
146303b30229: Pull complete 
a70d64e7f416: Pull complete 
Digest: sha256:235d4bd2a97e87c76d404d44661a2ebe210455a77f90483c08af11eca869c0c7
Status: Downloaded newer image for minio/minio:latest

ReedSolomon: error on self-test [d:2,p:2]: want map[cmd.ErasureAlgo]uint64{0x1:0x23fb21be2496f5d3}, got map[cmd.ErasureAlgo]uint64{0x1:0x8faeb37714901001}
ReedSolomon: error on self-test [d:3,p:1]: want map[cmd.ErasureAlgo]uint64{0x1:0x60ab052148b010b4}, got map[cmd.ErasureAlgo]uint64{0x1:0xf7343acadd206bec}
ReedSolomon: error on self-test [d:2,p:3]: want map[cmd.ErasureAlgo]uint64{0x1:0xa5cd5600ba0d8e7c}, got map[cmd.ErasureAlgo]uint64{0x1:0x357336e60e2c5e0b}
ReedSolomon: error on self-test [d:3,p:2]: want map[cmd.ErasureAlgo]uint64{0x1:0xe64927daef76435a}, got map[cmd.ErasureAlgo]uint64{0x1:0x8daa3de9101f98b7}
ReedSolomon: error on self-test [d:4,p:1]: want map[cmd.ErasureAlgo]uint64{0x1:0x524eaa814d5d86e2}, got map[cmd.ErasureAlgo]uint64{0x1:0x6c10f141e80fb000}
ReedSolomon: error on self-test [d:3,p:3]: want map[cmd.ErasureAlgo]uint64{0x1:0x672f6f242b227b21}, got map[cmd.ErasureAlgo]uint64{0x1:0xaa4b43dd13ecdd86}
ReedSolomon: error on self-test [d:4,p:2]: want map[cmd.ErasureAlgo]uint64{0x1:0x62b9552945504fef}, got map[cmd.ErasureAlgo]uint64{0x1:0x926ee7d421aa7f2e}
ReedSolomon: error on self-test [d:3,p:4]: want map[cmd.ErasureAlgo]uint64{0x1:0x571e41ba23a6dc6}, got map[cmd.ErasureAlgo]uint64{0x1:0x72b29943833698ee}
ReedSolomon: error on self-test [d:4,p:3]: want map[cmd.ErasureAlgo]uint64{0x1:0xcbf9065ee053e518}, got map[cmd.ErasureAlgo]uint64{0x1:0x73513e0f4c04791f}
ReedSolomon: error on self-test [d:4,p:4]: want map[cmd.ErasureAlgo]uint64{0x1:0x9a07581dcd03da8}, got map[cmd.ErasureAlgo]uint64{0x1:0x3d97b28d62f7586b}
ReedSolomon: error on self-test [d:4,p:5]: want map[cmd.ErasureAlgo]uint64{0x1:0xbf2d27b55370113f}, got map[cmd.ErasureAlgo]uint64{0x1:0x99e0a0d7bfe1f5f8}
FATAL Erasure Coding self test failed: self test failed. unsafe to start server
```

## Possible Solution

I've tried my best to catch anything suspicious in the changes from a naive perspective, and the only thing that caught my eyes was the line https://github.com/klauspost/reedsolomon/pull/281/files#diff-d790c6cdfdd7dc1b43f3d5e57cb377586b8d8a716c842116267681523c816fc5R581, with commented out code `if codeGen /* && r.o.useAVX2 */ {`,  but that might have nothing to do with it.

## Context

We use minio in our testing pipeline at https://gitlab.com/cki-project/pipeline-definition as a mock for AWS S3, as a tiny part of the RHEL kernel development process.

We are currently pinning the last known working image.


I'm available to run more tests in order to debug this issue!

Thanks again,
Tales



Discussion / hints:

Fix patch:
diff --git a/go.mod b/go.mod
index 140dd84638981..eb4480965b44e 100644
--- a/go.mod
+++ b/go.mod
@@ -40,7 +40,7 @@ require (
 	github.com/klauspost/filepathx v1.1.1
 	github.com/klauspost/pgzip v1.2.6
 	github.com/klauspost/readahead v1.4.0
-	github.com/klauspost/reedsolomon v1.12.2
+	github.com/klauspost/reedsolomon v1.12.3
 	github.com/lib/pq v1.10.9
 	github.com/lithammer/shortuuid/v4 v4.0.0
 	github.com/miekg/dns v1.1.61
diff --git a/go.sum b/go.sum
index 2bb9601221dd2..90f7381e3f570 100644
--- a/go.sum
+++ b/go.sum
@@ -373,8 +373,8 @@ github.com/klauspost/pgzip v1.2.6 h1:8RXeL5crjEUFnR2/Sn6GJNWtSQ3Dk8pq4CL3jvdDyjU
 github.com/klauspost/pgzip v1.2.6/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs=
 github.com/klauspost/readahead v1.4.0 h1:w4hQ3BpdLjBnRQkZyNi+nwdHU7eGP9buTexWK9lU7gY=
 github.com/klauspost/readahead v1.4.0/go.mod h1:7bolpMKhT5LKskLwYXGSDOyA2TYtMFgdgV0Y8gy7QhA=
-github.com/klauspost/reedsolomon v1.12.2 h1:TC0hlL/tTRxiMNnqHCzKsY11E0fIIKGCoZ2vQoPKIEM=
-github.com/klauspost/reedsolomon v1.12.2/go.mod h1:nEi5Kjb6QqtbofI6s+cbG/j1da11c96IBYBSnVGtuBs=
+github.com/klauspost/reedsolomon v1.12.3 h1:tzUznbfc3OFwJaTebv/QdhnFf2Xvb7gZ24XaHLBPmdc=
+github.com/klauspost/reedsolomon v1.12.3/go.mod h1:3K5rXwABAvzGeR01r6pWZieUALXO/Tq7bFKGIb4m4WI=
 github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
 github.com/kr/fs v0.1.0 h1:Jskdu9ieNAYnjxsi0LbQp1ulIKZV1LAFgK1tWhpZgl8=
 github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg=


Test patch: