Skip to content
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

Optimized build fails for ARM architecture #945

Open
abhi18av opened this issue May 30, 2019 · 16 comments
Open

Optimized build fails for ARM architecture #945

abhi18av opened this issue May 30, 2019 · 16 comments
Assignees

Comments

@abhi18av
Copy link

Hi @mfikes

I really love using planck on my machine which is a traditional x86_64 but recently I was curious whether planck would build on my AArch64 / ARMv8 server and tested it out today.

I can confirm that the fast build finishes but running script/test ends up in a segmentation fault and the normal script/build fails to complete with the following message

0 error(s), 2 warning(s)
........
### Building 1st stage Planck binary
### AOT compiling macro namespaces
### Bundling ClojureScript artifacts for 2nd stage
### Optimizing bundled JavaScript with Closure Optimizations: SIMPLE
..........script/bundle: line 97: 11627 Segmentation fault      (core dumped) ../../planck-c/build/planck ../script/decode.cljs $file > $file.aot
Build Failed.

It'd be great if planck could work with this architecture as this would mean a good functionality on the Raspberry Pi as well - which I plan on using for the educational purpose.

Could you please help me out a bit?

@mfikes
Copy link
Member

mfikes commented May 30, 2019

Hi @abhi18av I'm wondering if I'll be able to reproduce this. I suppose I'd need to get some ARM hardware.

Without that, one thing to try is to set things to produce a debug build. See https://github.com/planck-repl/planck/blob/master/planck-c/CMakeLists.txt#L4

Then with a debug build (using --fast which avoids using the planck binary to optimize its own bundled files), you might be able to see where the problem occurs (by running it using a debugger like gdb or some such).

@abhi18av
Copy link
Author

Hi @mfikes, well I could give you the access to my server so that you could test things out :)

My email id is mentioned on my profile [email protected] and you could let me know the instructions about how I could enable you to access it.

I'm just relying on the scaleway armv8 server. https://www.scaleway.com/en/pricing/#virtual-instances

@pyrmont
Copy link
Contributor

pyrmont commented May 30, 2019

@abhi18av I just ran the following against the master branch on my Pi running Raspbian 9:

$ ./script/clean
$ ./script/build --fast
$ ./script/test

I had some of the tests fail for what look like unrelated reasons but no segmentation fault. My Pi has an ARMv7 chip so maybe it's something to do with ARMv8 or AArch64?

@mfikes
Copy link
Member

mfikes commented May 31, 2019

@abhi18av I've created a Scaleway account, but I can't figure out how to create ARM instances via their web UI. I'm assuming that they don't have any currently to sell, unless I'm missing something obvious.

@mfikes
Copy link
Member

mfikes commented May 31, 2019

I created an ARM-based Ubuntu 18.04 instance in AWS, and Planck built there without issue and all unit tests passed.

AMI description:
Canonical, Ubuntu, 18.04 LTS, ARM64 bionic image build on 2018-11-20

uname -a output:
Linux ip-172-31-90-138 4.15.0-1028-aws #29+nutmeg8-Ubuntu SMP Tue Nov 20 02:59:41 UTC 2018 aarch64 aarch64 aarch64 GNU/Linux

I wonder if there is an AMI that more closely matches that Scaleway box...

@abhi18av
Copy link
Author

@pyrmont and @mfikes hmm, interesting!

On the Scaleway server the uname -a output is

root@pup:~# uname -a
Linux pup 4.9.93-mainline-rev1 #1 SMP Tue Apr 10 09:54:46 UTC 2018 aarch64 aarch64 aarch64 GNU/Linux

Well, if this turns out to be a peculiar bug then let's not spend so much time at this - I'd rather just use the compiled binary on the AWS image :)

@mfikes would it be possible for you to mail the zipped version on my email please?

@mfikes
Copy link
Member

mfikes commented May 31, 2019

@abhi18av I'll make the binary available to you.

I'd like to actually get to the root of the bug. Could you tell me which choices you make in the Scaleway UI to create an ARM instance? (Or otherwise confirm that you see that this is no longer offered?)

@mfikes
Copy link
Member

mfikes commented May 31, 2019

@abhi18av There is now an Ubuntu aarch64 binary on https://planck-repl.org/binaries/

@abhi18av
Copy link
Author

Thanks @mfikes , I truly appreciate you going the extra mile here! I confirm that the new binary works just fine on the server.

Here are some screenshots, I took to document the process. This is right from where you land after logging in

Screen Shot 2019-05-31 at 20 47 17

Screen Shot 2019-05-31 at 20 41 40

Screen Shot 2019-05-31 at 20 41 53

Screen Shot 2019-05-31 at 20 42 00

Screen Shot 2019-05-31 at 20 42 05

Screen Shot 2019-05-31 at 20 42 18

Let me know if this helps :)

Also, please feel free to close the issue as it seems that this is a cloud-provider specific issue and we could only truly confirm by having a latest RPi with us.

@mfikes
Copy link
Member

mfikes commented May 31, 2019

@abhi18av Thanks!

I'll follow up with Scaleway. Your pictures above are helpful. Here is what I see:

Napkin 05-31-19, 11 38 42 AM

@abhi18av
Copy link
Author

abhi18av commented May 31, 2019 via email

@mfikes
Copy link
Member

mfikes commented Jun 2, 2019

It turns out I evidently can't yet create ARM instances owing to quotas. I have a support ticket open with Scaleway.

image

@abhi18av
Copy link
Author

abhi18av commented Jun 2, 2019

Hmm, I see! Well, my invitation still stands if you wish to ssh into my own instance and please feel free to use it for the process.

@mfikes
Copy link
Member

mfikes commented Jun 2, 2019

I think this repros on the 64-bit ARM boxes available for CI at Drone.io:

### AOT compiling macro namespaces
--
1269 | script/build: line 159: 17634 Segmentation fault (core dumped) planck-c/build/planck -sk planck-cljs/out/macros-tmp -e"(require 'cljs.analyzer)" -e"(do (set! cljs.analyzer/*cljs-warnings* (assoc cljs.analyzer/*cljs-warnings* :undeclared-var false)) nil)" -e "(require-macros 'planck.repl 'planck.core 'planck.shell 'planck.from.io.aviso.ansi 'clojure.template 'cljs.spec.alpha 'cljs.spec.test.alpha 'cljs.spec.gen.alpha 'cljs.test 'cljs.pprint 'cljs.analyzer.macros 'cljs.compiler.macros 'cljs.env.macros)"

@mfikes mfikes mentioned this issue Jun 2, 2019
@mfikes mfikes self-assigned this Jun 2, 2019
@mfikes
Copy link
Member

mfikes commented Jun 5, 2019

I got a reply from Scaleway that quotas for ARM hosts are not instantly available because they have a limited stock of our ARM instances and, for the moment we don't have plans to continue developing them.

@abhi18av
Copy link
Author

abhi18av commented Jun 5, 2019

Oh, that's really going to be inconvenient in future for sure!

The only other provider which offer ARM servers, which I know of, is packet.net but those are not economical. I'd like the students to have their own tiny inexpensive boxes in the cloud. Well, I'll figure something out, thanks for the update @mfikes !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants