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
Bus error on armhf during t/moar/02-qast-references.t test #431
Comments
Note: build is fine on armel arch which is an arch quite close to armhf |
Has it always been like that? Can it be bisected? |
Unfortunately, I cannot say if it ever worked: nqp has not been built on armhf since it was switched from parrot to moarvm back in 2015 |
I've tried in a buster chroot on armhf: the test also fails iwth nqp and moar 2017.06:
|
Same problem with nqp and moar 2016.12:
I can't go back further. |
It's OK. I was just wondering if it's a very recent regression or not. Thank you for your help! |
Unfortunately, this issue blocks the transition of nqp from Debian unstable to Debian testing. And yesterday, rakudo and nqp were removed from Debian/testing because of the build issues on mips and armhf :-( |
could this be related? MoarVM/MoarVM#762 |
A guess would be https://github.com/MoarVM/MoarVM/blob/f2937f594f86060f23983f77bc91ae71715281e5/build/probe.pm#L235 is incorrect in how it configures unaligned access |
Build of moarvm on armhf shows:
|
some playing with this (on armhf machine): I got nqp ga62cef7 and moar gd322741. I can reduce the problematic test case to this:
which results in:
I also fudged build/probe.pm to think it's an "other" arch:
but this does not appear to affect the behavior |
with debug symbols:
If I understand it correctly, then what happens is that bump allocator in the nursery just hands out blocks of memory without alignment. doubles do need to be aligned on armhf, but in this case an earlier allocation was for an odd number of bytes, making the block of the double in question non-aligned... |
this fixes the problem for me on armhf, obviously wasting memory:
the change is without effect on at least x86_64, due to the auto-detected CAN_UNALIGNED macros |
Unfortunately, this does not fix the bus error occurring with:
|
even worse than that: the modified moar now fails to build NQP, just takes forever. I can't understand why, if anyone who knows this better then I would be very interested. perhaps the analysis is still useful... an alternative route would be to make the path through to the allocation able to pass on alignment requirements, and then adhere to them in the allocator. but that seems quite structural, and given the weird effects that I get from the change I made I clearly do not understand some of the interactions... |
dude I am learning a lot about GC here! updated patch:
This seems to solve the problem we had previously, and should not have any effect on x86_64. Whether it is the right thing to do, I don't know. A wild idea for an alternative would be to make MVMP6numBody bigger and change get_num and set_num to read within this space on an aligned boundary... |
and more generally: shouldn't allocations in the nursery adhere to MVMStorageSpec.align? |
Can you please test this patch? It does the same but the changes to the program text are a bit less intrusive and it's a bit more generic. The smallest possible allocation is 8 bytes + a pointer size, so I guess we'd not lose all that much there. And aligned pointers ought to be good for performance, so we may even want to do that in general.
|
ping @dod38fr |
I tried that patch instead of the earlier one on a armhf box, and it does work and pass the rakudo test suite a couple of times, as well as the golfed test above. I have been unable to reproduce the problem without the patch however... |
Builds on Debian are fine now on all architectures. Thanks for the help |
Hello
nqp tests always fail with bus error on armhf:
See also https://buildd.debian.org/status/fetch.php?pkg=nqp&arch=armhf&ver=2018.02%2Bdfsg-1&stamp=1521332696&raw=0
All the best
The text was updated successfully, but these errors were encountered: