File: 0003-Skip-TestDB_HugeValue-to-avoid-crash-on-32bit.patch

package info (click to toggle)
golang-github-coreos-bbolt 1.4.2-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,300 kB
  • sloc: makefile: 87; sh: 57
file content (33 lines) | stat: -rw-r--r-- 853 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
From: Reinhard Tartler <siretart@tauware.de>
Date: Sat, 9 Aug 2025 12:45:50 -0400
Subject: Skip TestDB_HugeValue to avoid crash on 32bit

Bug-Upstream: https://github.com/etcd-io/bbolt/issues/1044
---
 db_test.go | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/db_test.go b/db_test.go
index 1c13b6b..495b7b3 100644
--- a/db_test.go
+++ b/db_test.go
@@ -15,6 +15,7 @@ import (
 	"sync"
 	"testing"
 	"time"
+	"runtime"
 	"unsafe"
 
 	"github.com/stretchr/testify/assert"
@@ -1375,6 +1376,11 @@ func TestDBUnmap(t *testing.T) {
 }
 
 func TestDB_HugeValue(t *testing.T) {
+	// skip on 32bit
+	if unsafe.Sizeof(uintptr(0)) == 4 {
+		t.Skipf("Skipping on 32-bit arch (%s): huge value test exceeds slice bounds", runtime.GOARCH)
+	}
+
 	dbPath := filepath.Join(t.TempDir(), "db")
 	db, err := bolt.Open(dbPath, 0600, nil)
 	require.NoError(t, err)