-
Notifications
You must be signed in to change notification settings - Fork 811
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
customtype test failures on 32-bit (and Big Endian) architectures #164
Comments
Ok so it seems to all be problems with customtype when the Unmarshal method is not generated, so at least its isolated, but I'll keep looking. |
I think I should log this as a Known Issue. I would like to fix it, but that unsafe code is quite hard fix without being able to run the tests over and over. And since I don't have 32bit big endian machine I don't know how to do that. Do you have any suggestions? |
You should be able to reproduce on i386 a/k/a x86_32. A VM or container or chroot should do. As for ppc64 we can see whether your corrections work on next upload... I suppose skipping tests will do as well but fixing the problem will be preferable. :) Thanks. |
So if I start a 32bit ubuntu in a vm that should reproduce the problem? |
Yes, though I'd recommend Debian... |
Ha ha fair enough :) |
Fixed: 4f262e4 |
Do you want me to add another tag or something? |
Thank you. I've applied 4f262e4 on top of v0.2 and it is much better: armel and i386 are fixed but armhf FTBFS (ppc64 did not build yet). Could you have a look please? |
Ok so it looks like TestInt32Int64Compatibility breaks when the unsafemarshaler or unsafeunmarshaler is used. |
Any ideas on how I can reproduce this? |
I don't know how, sorry... |
Ok cool, just checking :) |
I'll take another look at this asap. |
Thanks. As for armhf I know it is possible to run it in qemu through virt-manager but I can't recall the details... It may be tricky to set-up VM without bootable images... |
I think I'll first try to spot the mistake and then try to fix it on a branch which I can then ask you to test? |
Let's do that. :) |
Ok so its not just the TestInt32Int64Compatibility that breaks. |
Is it possible to check the processor with some go call and then simply make sure than unsafe marshalers and unmarshalers are not generated for this processor? |
I don't have access to build server but I may be able to revive old armhf VM if I'll manage to update it to current "unstable"... It'll take time though... |
Yes all this is taking a lot of time, but the previous one was worth it, since it found a real bug. This does not mean that this one will find a real bug though. I don't there is a way to tell whether this is worth the effort. |
I don't know for sure but I think it is used in many mini-boards, robots, embedded devices, appliances, thin clients and small/portable computers like Raspberry Pi. |
This could be useful to help and detect the architecture. I could then revert unsafe code generation to normal code generation, giving exactly the same behaviour, just a little bit slower. |
https://en.wikipedia.org/wiki/Ppc64 |
ppc64 is big-endian; armhf is little-endian. |
Aaah, sorry I got confused :( my bad |
I think the solution here is to say unsafe_marshaler and unsafe_unmarshaler are not supported for the armhf architecture and then to skip those tests when the architecture is detected. |
That'll fix FTBFS. I don't really have my own preference regarding solution to this problem... Thanks. |
Do you know which one of these constants would refer to armhf? |
Really sorry for the super long delay :( |
I think the failures are caused by unaligned accesses. I guess that means that the unsafe stuff is not supported on armhf. If you want to skip these tests on arm, just check for runtime.GOARCH=="arm". (I'm not sure how to only skip when GOARM=6 or higher, which I think is the issue here). |
I guess I don't entirely understand how this package is used (hey, I just package things!) but it also presumably would be a good idea to avoid the use of unsafe_{un,}marhsaler at all on arm. I guess the generated code could use build tags to use the regular {un,}marshaler code on arm? |
The code generator could also check the GOARCH and decide to generate the non unsafe code. |
But are you sure that the code will be run on the same system it is generated on? (see comment about not knowing how this is used) If so, then sure, that works. |
Thats why I would rather just skip the test, since I cannot know. I don't want to skip all arm processors, right? |
The point I am trying and apparently failing to make is that it seems to me like it ought to be possible to generate code that is safe on arm, by using build tags in the generated source.
That might be OK.
I really (really!) doubt the unsafe unmarshaling code is faster when GOARM=5. So I think skipping on all ARM processors would be fine.
It is, but I'm not sure that it's worth it, and there's no guarantee that the value at runtime matches the value at compile time. |
I cannot know that the computer generating the code is the computer running the code. Someone might just be pulling in a dependency. I can expect that someone will run the tests on the architecture they are compiling it on. unsafe is faster for certain cases. |
Any news here? |
I think I am kind of stuck. |
Duplicate of #195 |
As reported in https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=819994
See full build logs on armel, armhf, i386 and ppc64.
Tests do not fail only on amd64, arm64 and ppc64el.
The text was updated successfully, but these errors were encountered: