-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
HTTP::Client.post crashes on arm when inside a Kemal route #6954
Comments
Maybe tweaking the CPU/FPU with For a RapsberryPi 2 target, you may specify I think the issue is the context-switch assembly must save/restore FPU registers, but each ARM CPU comes with a different FPU with a specific instruction set... |
That doesn't seem to help: it still crashes with the same message, just with a different address. I tried compiling with just adding |
Sadly there is something with armhf and LLVM. I still haven't figured out what's happening. Maybe we should link the executable with a similar set of arguments (but adapted for C). |
I've tried running the same code on a RPi3 (which uses aarch64) which does work better, so I'll use that for now. With respect to the RPi2, I wanted to try a different route: maybe it is just stupid, maybe it highlights the issue: what if we compiled to IR on the host machine and do the rest on the target? Then I get the following commands: This gave a spectacular amount of linking errors: https://gist.github.com/helaan/2cde67f7bd7fecd57e98b24ac68b0daf . Maybe I'm doing something stupid? Adding |
Oh, that's interesting, and you're doing nothing stupid. AFAIK the errors are unsupported assembly instructions (vmov) related to the FPU (NEON registers / VFP extension registers)... again. This confirms all ARM errors are related to the FPU and hard/soft float. I recently had VFP issues on Scaleway's ARMv7 server (that I failed to overcome) and the Alpine Linux armhf port is blocked because of it, too. |
Still is strange for me: according to I'm still not entirely convinced by this new route: the errors are severe enough and I wondered whether my variant that worked also suffered from this issue. So I commented out the Kemal stuff, leaving just the Net::HTTP call that I confirmed working earlier and sent it down the same route. I received the same set of errors. Either all of the code that errors out is not reachable, which would be worthy of a seperate bug, or my route is broken. For now, I'm going for the latter. I'm not ruling out FPU issues, but I think the llvm-ir route is a red herring |
The code is crosscompiled from an amd64 device to arm-linux-gnueabihf using the compiler flags
--cross-compile --target armv7a-unknown-linux-gnueabihf
. Running the code natively on amd64 works fine, as does removing the Kemal block. I'm not sure what happens exactly what changes when you put it in a route block, I believe it should be possible to generate a crash that does not require Kemal. I've repeated the situation multiple times: each time the program crashes immediately and with the same error message.Host machine: Gentoo GNU/Linux, Amd64 laptop, LLVM 6.0.1, Crystal 0.26.1
Target machine: Gentoo GNU/Linux, Raspberry Pi 2 (armv7a-hardfloat-linux-gnueabi), LLVM 6.0.1, Crystal source code v0.26.1, make deps ran (needed for libcrystal.a).
Reproduction steps:
crystal build crpostcrash.cr --cross-compile --target=armv7a-unknown-linux-gnueabihf
curl localhost:3000
Result:
The compiled binary exits with code 7 and the following is printed on stdout/err:
Additionally, running the program through gdb shows the following:
Code:
The text was updated successfully, but these errors were encountered: