From af31ccefc00ff7e98839dd0066c8ddb7a44a7ccb Mon Sep 17 00:00:00 2001 From: Daniel Hiltgen Date: Tue, 6 May 2025 17:36:38 -0700 Subject: [PATCH] fix data race in WriteGGUF (#10598) err in the go routine should not be shared with the outer scope --- fs/ggml/gguf.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/ggml/gguf.go b/fs/ggml/gguf.go index b3120820d..8e75625e0 100644 --- a/fs/ggml/gguf.go +++ b/fs/ggml/gguf.go @@ -569,7 +569,7 @@ func WriteGGUF(f *os.File, kv KV, ts []*Tensor) error { t := t w := io.NewOffsetWriter(f, offset+int64(t.Offset)) g.Go(func() error { - _, err = t.WriteTo(w) + _, err := t.WriteTo(w) return err }) }