Test panic on go1.14beta1

Whenever I run tests on my system I get a panic. I am running go1.14beta1 and it’s not reproducible with go1.13.x. What’s weird is that on TC the go1.14 build passes just fine. This isn’t urgent being beta and all, but it involves the new db GC, so I thought I’d post in case someone can make sense of it:

panic: runtime error: unsafe pointer conversion

goroutine 226 [running]:
github.com/spaolacci/murmur3.(*digest128).bmix(0xc0000f87e0, 0xc000296481, 0x20, 0x2f, 0x0, 0x48, 0x58)
        /media/ext4_data/Coding/go/pkg/mod/github.com/spaolacci/murmur3@v1.1.0/murmur128.go:67 +0xc0
github.com/spaolacci/murmur3.(*digest).Write(0xc0000f87e0, 0xc000296481, 0x20, 0x2f, 0xbf3004, 0xc0000f87e0, 0xc0000f87e0)
        /media/ext4_data/Coding/go/pkg/mod/github.com/spaolacci/murmur3@v1.1.0/murmur.go:51 +0x127
github.com/willf/bloom.baseHashes(0xc000296481, 0x20, 0x2f, 0x0, 0x0, 0x0, 0x0)
        /media/ext4_data/Coding/go/pkg/mod/github.com/willf/bloom@v2.0.3+incompatible/bloom.go:97 +0xb9
github.com/willf/bloom.(*BloomFilter).Test(0xc00000ee40, 0xc000296481, 0x20, 0x2f, 0x12ada80)
        /media/ext4_data/Coding/go/pkg/mod/github.com/willf/bloom@v2.0.3+incompatible/bloom.go:183 +0x6b
github.com/syncthing/syncthing/lib/db.(*Lowlevel).gcBlocks(0xc000032550, 0x0, 0x0)
        /media/ext4_data/Coding/go/src/github.com/syncthing/syncthing/lib/db/lowlevel.go:575 +0x4d4
        /media/ext4_data/Coding/go/src/github.com/syncthing/syncthing/lib/db/lowlevel.go:488 +0x279
created by github.com/syncthing/syncthing/lib/db.NewLowlevel
        /media/ext4_data/Coding/go/src/github.com/syncthing/syncthing/lib/db/lowlevel.go:65 +0x36a
FAIL    github.com/syncthing/syncthing/lib/model        0.346s

1.14beta1 is a bit old? The RC seems to work, on TC and on my mac. That looks like Linux?

totally missed the RC announcement, will check on Monday. and yes, Linux

Tested with go1.14 RC1 and it still panicks. The reason it passes on TC is that the 1.14 tests run without -race and the panic only occurs with -race. I’ll have closer look tonight and raise it upstream if appropriate.

1 Like

The “investigation” resulted in lib/db: Add closeWaitGroup to allow async operation by imsodin · Pull Request #6317 · syncthing/syncthing · GitHub, which fixes a few things in our db but is unrelated to the panic discussed here. I posted a backtrace to upstreams bugtracker, but given it doesn’t happen consistently and I couldn’t create a minimal reproducer, I kind of doubt it’s useful - lets hope I am wrong :slight_smile: Flaky "unsafe pointer conversion"-panics with -race and go1.14rc1 · Issue #29 · spaolacci/murmur3 · GitHub