A framework generated with gomobile bind -target=ios has two global constructors: one initializing a data structure and another using it. These constructors are defined in different translation units, which (I believe, reasoning from C++ global constructors) means their order of initialization is undefined. A capturing block is stack allocated. Its memory is invalid after the function returns. Make a copy of the interface initializer blocks so they can be saved to the heap. Block implementation background: http://www.cocoawithlove.com/2009/10/how-blocks-are-implemented-and.html Updates golang/go#12590 Change-Id: Ia7ae9f4bbd8df6e6e79949de54b3e6c48148c700 Reviewed-on: https://go-review.googlesource.com/14549 Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>