Skip to content

Stack corruption with go upgrade #1679

@rkuris

Description

@rkuris

After upgrading to go1.25.7, we're seeing failures like this one:

https://github.com/ava-labs/avalanchego/actions/runs/21972259848/job/63476193719

goroutine 47097 gp=0xc00b2268c0 m=0 mp=0x102708300 [running]:
runtime.sigpanic()
	/Users/runner/hostedtoolcache/go/1.25.7/arm64/src/runtime/signal_unix.go:906 +0x35c fp=0x16fb3d950 sp=0x16fb3d950 pc=0x1003415bc
runtime: g 47097: unexpected return pc for runtime.sigpanic called from 0x10140af84
stack: frame={sp:0x16fb3d950, fp:0x16fb3d950} stack=[0xc0215f4000,0xc0215f5000)

created by github.com/ava-labs/firewood-go-ethhash/ffi.(*Database).Close in goroutine 47117
	/Users/runner/go/pkg/mod/github.com/ava-labs/firewood-go-ethhash/ffi@v0.1.0/firewood.go:436 +0xa4

goroutine 1 gp=0xc0000021c0 m=nil [chan receive]:

Also there are instances of stack overflow:

runtime: newstack sp=0x16fb3d950 stack=[0xc0215f4000, 0xc0215f5000]
	morebuf={pc:0x10140af84 sp:0x16fb3d950 lr:0x0}
	sched={pc:0x1003415bc sp:0x16fb3d950 lr:0x10140af84 ctxt:0x0}
runtime: gp=0xc00b2268c0, goid=47097, gp->status=0x2
 runtime: split stack overflow: 0x16fb3d950 < 0xc0215f4000
fatal error: runtime: split stack overflow

runtime stack:
runtime.throw({0x1015e6c93?, 0xc01477c000?})

Likely related to the slice changes which amplify the effect of pointer provenance issues. From the release notes:

Faster slices¶
The compiler can now allocate the backing store for slices on the stack in more situations, which improves performance. This change has the potential to amplify the effects of incorrect unsafe.Pointer usage, see for example issue 73199. In order to track down these problems, the bisect tool can be used to find the allocation causing trouble using the -compile=variablemake flag. All such new stack allocations can also be turned off using -gcflags=all=-d=variablemakehash=n.
Pinned by demosdemon

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions