Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unaligned 64-bit atomic operation #152

Closed
GreenLightning opened this issue May 7, 2023 · 2 comments
Closed

Unaligned 64-bit atomic operation #152

GreenLightning opened this issue May 7, 2023 · 2 comments

Comments

@GreenLightning
Copy link

GreenLightning commented May 7, 2023

Hello,

I got the following panic. My setup is running owncloud/ocis on a Raspberry Pi with ARM (32-bit) architecture.

panic: unaligned 64-bit atomic operation
goroutine 6508 [running]:
runtime/internal/atomic.panicUnaligned()
     runtime/internal/atomic/unaligned.go:8 +0x24
runtime/internal/atomic.Xadd64(0x88bc7f4, 0x4)
     runtime/internal/atomic/atomic_arm.s:258 +0x14
github.com/blevesearch/zapx/v15.(*chunkedContentCoder).incrementBytesWritten(...)
     github.com/blevesearch/zapx/v15@v15.3.6/contentcoder.go:114
github.com/blevesearch/zapx/v15.(*chunkedContentCoder).flushContents(0x88bc780)
     github.com/blevesearch/zapx/v15@v15.3.6/contentcoder.go:143 +0x294
github.com/blevesearch/zapx/v15.(*chunkedContentCoder).Close(...)
     github.com/blevesearch/zapx/v15@v15.3.6/contentcoder.go:110
github.com/blevesearch/zapx/v15.(*interim).writeDicts(0x81f81e0)
     github.com/blevesearch/zapx/v15@v15.3.6/new.go:803 +0x11d8
github.com/blevesearch/zapx/v15.(*interim).convert(0x81f81e0)
     github.com/blevesearch/zapx/v15@v15.3.6/new.go:277 +0x2f8
github.com/blevesearch/zapx/v15.(*ZapPlugin).newWithChunkMode(0x4724798, {0x88c79c0, 0x1, 0x1}, 0x402)
     github.com/blevesearch/zapx/v15@v15.3.6/new.go:72 +0x218
github.com/blevesearch/zapx/v15.(*ZapPlugin).New(0x4724798, {0x88c79c0, 0x1, 0x1})
     github.com/blevesearch/zapx/v15@v15.3.6/new.go:47 +0x40
github.com/blevesearch/bleve/v2/index/scorch.(*Scorch).Batch(0x68c6800, 0x88d8d20)
     github.com/blevesearch/bleve/v2@v2.3.5/index/scorch/scorch.go:412 +0x5cc
github.com/blevesearch/bleve/v2/index/scorch.(*Scorch).Update(0x68c6800, {0x33b11d4, 0x88da9c0})
     github.com/blevesearch/bleve/v2@v2.3.5/index/scorch/scorch.go:335 +0x104
github.com/blevesearch/bleve/v2.(*indexImpl).Index(0x774b5e0, {0x88e8a80, 0x6e}, {0x1d79548, 0x88e0500})
     github.com/blevesearch/bleve/v2@v2.3.5/index_impl.go:258 +0x218
github.com/owncloud/ocis/v2/services/search/pkg/search/index.(*Index).Add(0x723d8a0, 0x88da8c0, 0x7ec9380)
     github.com/owncloud/ocis/v2/services/search/pkg/search/index/index.go:97 +0x9c
github.com/owncloud/ocis/v2/services/search/pkg/search/provider.(*Provider).doIndexSpace.func1({0x0, 0x0}, 0x7ec9380, {0x0,
     github.com/owncloud/ocis/v2/services/search/pkg/search/provider/searchprovider.go:337 +0x590
github.com/cs3org/reva/v2/pkg/storage/utils/walker.(*revaWalker).walkRecursively(0x988fe3c, {0x33ac284, 0x88c31d0}, {0x0, 0x
     github.com/cs3org/reva/v2@v2.12.0/pkg/storage/utils/walker/walker.go:81 +0x90
github.com/cs3org/reva/v2/pkg/storage/utils/walker.(*revaWalker).Walk(0x719fe3c, {0x33ac284, 0x88c31d0}, 0x88cb740, 0x719fe6
     github.com/cs3org/reva/v2@v2.12.0/pkg/storage/utils/walker/walker.go:65 +0x84
github.com/owncloud/ocis/v2/services/search/pkg/search/provider.(*Provider).doIndexSpace(0x774bf40, {0x33ac244, 0x6538000},
     github.com/owncloud/ocis/v2/services/search/pkg/search/provider/searchprovider.go:308 +0x6c8
github.com/owncloud/ocis/v2/services/search/pkg/search/provider.New.func1(0x88c26f0, 0x84577d0)
     github.com/owncloud/ocis/v2/services/search/pkg/search/provider/searchprovider.go:93 +0x44
github.com/owncloud/ocis/v2/services/search/pkg/search/provider.(*SpaceDebouncer).Debounce.func1()
     github.com/owncloud/ocis/v2/services/search/pkg/search/provider/events.go:60 +0x1a4
created by time.goFunc
     time/sleep.go:176 +0x2c

Please also see the documentation on the sync/atomic package:

On ARM, 386, and 32-bit MIPS, it is the caller's responsibility to arrange for 64-bit alignment of 64-bit words accessed atomically via the primitive atomic functions (types Int64 and Uint64 are automatically aligned). The first word in an allocated struct, array, or slice; in a global variable; or in a local variable (because the subject of all atomic operations will escape to the heap) can be relied upon to be 64-bit aligned.

Thanks and have a nice day!

@abhinavdangeti
Copy link
Member

Thanks for raising this issue. I believe we've already addressed this with #148 .

The above pull request is available in zapx@v15.3.9 onwards. I'd recommend you upgrade to bleve@v2.3.7+ for the fix.

@GreenLightning
Copy link
Author

Sorry, I somehow missed this while looking for an already existing fix.

Thanks for the quick reply!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants