Re: [go-nuts] Re: Cross-compiled program for Raspberry Pi crashes

2018-08-14 Thread Dan Kortschak
Yes, that's understood. I'm just responding to the notion that it's a bug for a package author to expect the compiler to do the right thing. On Tue, 2018-08-14 at 15:56 -0700, Ian Lance Taylor wrote: > On Tue, Aug 14, 2018 at 3:49 PM, Dan Kortschak > wrote: > > > > > > This ignores the possibil

Re: [go-nuts] Re: Cross-compiled program for Raspberry Pi crashes

2018-08-14 Thread Ian Lance Taylor
On Tue, Aug 14, 2018 at 3:49 PM, Dan Kortschak wrote: > > This ignores the possibility that more than one alignment-sensitive > field might be needed. Requiring that they all be up front, potentially > degrading readability flies in the face of the design principles of the > language. This kind fo

Re: [go-nuts] Re: Cross-compiled program for Raspberry Pi crashes

2018-08-14 Thread Dan Kortschak
This ignores the possibility that more than one alignment-sensitive field might be needed. Requiring that they all be up front, potentially degrading readability flies in the face of the design principles of the language. This kind foot-gun in other languages is why many people choose Go. On Tue,

Re: [go-nuts] Re: Cross-compiled program for Raspberry Pi crashes

2018-08-13 Thread Jakob Borg
It’s a bug in the library if it uses 64 bit atomic operations without ensuring 64 bit alignment. Putting the alignment-required field at the top of the struct is the traditional method. //jb On 14 Aug 2018, at 08:45, Stephan Mühlstrasser mailto:stephan.muehlstras...@gmail.com>> wrote: Am Mont

[go-nuts] Re: Cross-compiled program for Raspberry Pi crashes

2018-08-13 Thread Stephan Mühlstrasser
Am Montag, 13. August 2018 23:47:11 UTC+2 schrieb Dave Cheney: > > I don’t think that will help. The problem is not cross compilation. The > problem is when run in a 32bit environment the offset of that field is not > guaranteed to be aligned to 8 bytes. You’ve got a 50/50 chance that each > all

[go-nuts] Re: Cross-compiled program for Raspberry Pi crashes

2018-08-13 Thread Dave Cheney
I don’t think that will help. The problem is not cross compilation. The problem is when run in a 32bit environment the offset of that field is not guaranteed to be aligned to 8 bytes. You’ve got a 50/50 chance that each allocation will be properly aligned. -- You received this message because

Re: [go-nuts] Re: Cross-compiled program for Raspberry Pi crashes

2018-08-13 Thread Philip Chapman
Another option may be to run 32 bit raspberian OS and compile in a virtual machine and compile it there, perhaps. VirtualBox comes to mind. On Mon, Aug 13, 2018 at 1:52 PM, Stephan Mühlstrasser < stephan.muehlstras...@gmail.com> wrote: > > Am Montag, 13. August 2018 22:36:56 UTC+2 schrieb Dave C

[go-nuts] Re: Cross-compiled program for Raspberry Pi crashes

2018-08-13 Thread Stephan Mühlstrasser
Am Montag, 13. August 2018 22:36:56 UTC+2 schrieb Dave Cheney: > > No, it’s not a cross compilation issue. Well, yes and no, the rpi is a 32 > bit platform so some structures have a different size causing the offset of > the field to be 32 but aligned, not the required 64 bit aligned. > > The p

[go-nuts] Re: Cross-compiled program for Raspberry Pi crashes

2018-08-13 Thread Dave Cheney
No, it’s not a cross compilation issue. Well, yes and no, the rpi is a 32 bit platform so some structures have a different size causing the offset of the field to be 32 but aligned, not the required 64 bit aligned. The play example shows the address of the field is not aligned on a 8 byte boun

[go-nuts] Re: Cross-compiled program for Raspberry Pi crashes

2018-08-13 Thread Stephan Mühlstrasser
Am Sonntag, 12. August 2018 23:30:22 UTC+2 schrieb Dave Cheney: > > This is likely to be issue https://github.com/golang/go/issues/599 > > , https://play.golang.o

[go-nuts] Re: Cross-compiled program for Raspberry Pi crashes

2018-08-12 Thread Dave Cheney
This is likely to be issue https://github.com/golang/go/issues/599, https://play.golang.org/p/zZm-6zWwFoi On Monday, 13 August 2018 01:29:43 UTC+10, Stephan Mühlstrasser wrote: > > Hi, > > I'm developing my first Go program that is supposed to upload files into a > Google Cloud Storage bucket f