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
x/mobile: fatal error: bulkBarrierPreWrite: unaligned arguments #46893
Comments
I've encountered this problem as well in the past, issue started with Go 1.16 (1.15 seems unaffected). In my case I had a function signature |
I had the same issue using Go 1.16. Reverted to Go 1.13 and it works fine. Also just affected a few users and couldn't reproduce it consistently. |
I have experienced the same issue using https://github.com/ProtonMail/gopenpgp in an iOS app (with gomobile). |
Can consistently repro with 1.17.x on iOS. It occurs when calling into Go from C. The stack frame C sets up for Go is four-byte aligned, which makes it likely that the address of the results aren't properly aligned, and therefore casues I think this is a |
An update: we patched |
@elagergren-spideroak when should we expect a release that fixes it, do you have any idea? |
I am not a member of the Go team, so I am not the person to ask. However, I'm going to submit a CL with the patch to get things started. |
Bump - just ran into this: |
@elagergren-spideroak just to know if I/we can assist in any way, the current status is what exactly? Thanks for letting us know how you fixed it! |
@elagergren-spideroak thanks for looking into this! Did you get a chance to make the CL? If you didn't, I'd really appreciate a gist so I can patch locally for the time being. I just got a new batch of ocurrences of this I can't seem to sidestep :( |
How we've fixed it for our iOS builds is by replacing Line 1005 in 97e740e
|
Thanks @elagergren-spideroak! Just tested it out and works great 👌 |
@elagergren-spideroak Where you able to create a CL? If so can you share the link to follow here. |
Irregularly typedmemmove and bulkBarrierPreWrite crashes on unaligned arguments. By aligning the arguments on 8 bytes this is fixed. Fixes golang#46893
Change https://go.dev/cl/408395 mentions this issue: |
Thanks for the fix. It fixed our |
I just started using Golang. Can anyone tell me if I need to recompile the Golang or just need to rebuild my project after I change the source code |
@gopherbot fatal error: bulkBarrierPreWrite: unaligned arguments goroutine 17 [running, locked to thread]: goroutine 21 [GC worker (idle)]: goroutine 2 [force gc (idle)]: goroutine 3 [GC sweep wait]: goroutine 4 [GC scavenge wait]: goroutine 18 [finalizer wait]: goroutine 19 [select, locked to thread]: goroutine 20 [syscall]: goroutine 35 [runnable]: goroutine 36 [GC worker (idle)]: goroutine 5 [GC worker (idle)]: goroutine 37 [GC worker (idle)]: goroutine 38 [GC worker (idle)]: |
I don't think this has actually been fixed yet. There is a CL (https://go-review.googlesource.com/c/go/+/408395) but it hasn't been checked in yet. |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I have an iOS project using a go library via gomobile:
[]byte
The golang code is simple:
And on swift:
A full working reproduction project is at https://github.com/champo/gomobile_panic
What did you expect to see?
No crash.
What did you see instead?
It sometimes crashes inside
bulkBarrierPreWrite
:I tried exposing a free function with a similar signature but no crashers there. Removing the paramters or return values seems to avoid the crash too.
The text was updated successfully, but these errors were encountered: