From 4f15cd56680d63a2470b2b94b6c9f71e038c6022 Mon Sep 17 00:00:00 2001 From: Reinhard Tartler Date: Tue, 16 Jun 2026 05:40:26 -0400 Subject: [PATCH] fix: avoid unaligned 64-bit atomic panic on 32-bit platforms Reorder fields in regexCacheWatcher to place int64 counters before the *sync.Map pointer. On 32-bit architectures (i386, armhf), pointers are 4 bytes, causing the int64 fields to start at offset 4 -- which is not 8-byte aligned. Go's sync/atomic.AddInt64 panics when the target int64 is not 8-byte aligned on 32-bit platforms. Found during Debian package build (golang-github-pb33f-libopenapi-validator) on i386 and armhf. --- parameters/path_parameters_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parameters/path_parameters_test.go b/parameters/path_parameters_test.go index 5972439..901b0a8 100644 --- a/parameters/path_parameters_test.go +++ b/parameters/path_parameters_test.go @@ -2249,10 +2249,10 @@ paths: } type regexCacheWatcher struct { - inner *sync.Map missCount int64 hitCount int64 storeCount int64 + inner *sync.Map } func (c *regexCacheWatcher) Load(key any) (value any, ok bool) {