Closed matrosov-nikita closed 4 years ago
From what I can tell, it seems to be a linker issue (see unknown pc 0x1004333
). It is logged here https://github.com/golang/go/blob/9ee6ba089dc9dd2402bccd9ed28b07140f76de15/src/runtime/traceback.go#L167 My guess is, that somehow, when go switches the PC register over to the C, side it ends up at an invalid address.
These issues are most probably related: https://github.com/golang/go/issues/30186 https://github.com/golang/go/issues/28541
Basically, this seems to be either a bug in the Go compiler or in the linker provided by MXE. Try switching the MXE version in use and filing a Go bug, if that fails. From personal experience, cross compilation is too much of a hassle and compiling inside a Windows VM has less problems.
@bakape, thanks for your quick response.
Building MXE from source with build-2019-06-02
and build-2019-03-04
releases didn't help.
One thing I'm concerning about is build failure on this line
For MXE_TARGET=i686-w64-mingw32.static
, got error cannot use _Ctype_ulong(img.size) (type _Ctype_ulong) as type _Ctype_uint in field value
For MXE_TARGET=x86_64-w64-mingw32.static
, got error cannot use _Ctype_ulong(img.size) (type _Ctype_ulong) as type _Ctype_ulonglong in field value
The only way to solve this error I've found is to explicitly rewrite a type in the file before compilation: https://github.com/matrosov-nikita/thumbtest/blob/master/Dockerfile#L29 What do you make of it?
Building MXE from source with build-2019-06-02 and build-2019-03-04 releases didn't help.
I've worked my share with MXE. If things don't work out, I still suggest compiling in a Win10 VM. Unless it actually is a Go compiler bug.
One thing I'm concerning about is build failure on this line For MXE_TARGET=i686-w64-mingw32.static, got error cannot use _Ctype_ulong(img.size) (type _Ctype_ulong) as type _Ctype_uint in field value For MXE_TARGET=x86_64-w64-mingw32.static, got error cannot use _Ctype_ulong(img.size) (type _Ctype_ulong) as type _Ctype_ulonglong in field value
That's a bug. Should be fixed now.
I'm using MXE cross-compilation to build thumbnailer for windows OS. Got exception when call
Thumbnail
method.I created test project to easily reproduce this issue: https://github.com/matrosov-nikita/thumbtest
Steps to reproduce: 1)
git clone https://github.com/matrosov-nikita/thumbtest
2)make build-win
- it produces thumbtest.exe 3)thumbtest.exe --image=<path_to_image>
By some reason, this issue occurs only with image size over ~70Kb
Let me know, if I need to provide more information. Thanks. @bakape