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

build failure aarch64 #7293

Open
silmanduin66 opened this Issue Jan 10, 2019 · 10 comments

Comments

Projects
None yet
4 participants
@silmanduin66
Copy link
Contributor

silmanduin66 commented Jan 10, 2019

I am trying to build and run a simple HelloWorld.cr
arch : aarch64
OS : ArchLinux
Device : Raspberry pi 3 ( ArmV8)
LLVM : 6.0.1
Crystal: 0.27.0

this is the error:

Invalid memory access (signal 11) at address 0xaaaac1cf0000
[0xaaaabc56cb88] ???
[0xaaaabbded850] __crystal_sigfault_handler +208
[0xaaaabc5700e8] sigfault_handler +40
[0xffffbc27c66c] ???
[0xffffb81b8300] memset +256
[0xaaaabc10edf8] ???
[0xaaaabc10dfe8] ???
[0xaaaabc14507c] ???
[0xaaaabc18b604] ???
[0xaaaabc1445d0] ???
[0xaaaabc141998] ???
[0xaaaabc13f444] ???
[0xaaaabc4f8f5c] ???
[0xaaaabbe01488] ???
[0xaaaabbdd1e9c] __crystal_main +10728
[0xaaaabbdd5534] main +44
[0xffffb815a2a4] _libc_start_main +228
[0xaaaabbdce3e4] ???

I crossed-compiled crystal from my ArchLinux PC with LLVM 6.0.1 and crystal 0.27.0, transfered the crystal.o to my aarch64 based device and compiled there. Everything worked fine.
I installed all the necessary libs.

the command crystal -v gives me :

Crystal 0.27.0 (2019-01-10)
LLVM: 6.0.1
Default target: aarch64-unknown-linux-gnu
@Sija

This comment has been minimized.

Copy link
Contributor

Sija commented Jan 10, 2019

just for the record, what's inside of hello.cr?

@silmanduin66

This comment has been minimized.

Copy link
Contributor

silmanduin66 commented Jan 10, 2019

puts "Hello World!"

@RX14

This comment has been minimized.

Copy link
Member

RX14 commented Jan 10, 2019

if you run crystal in gdb and use backtrace when it gets SIGSEGV, does it print a better backtrace?

gdb crystal
(gdb) run build hello.cr
Program received signal SIGSEGV, Segmentation fault.
(gdb) backtrace
...

and show output

@silmanduin66

This comment has been minimized.

Copy link
Contributor

silmanduin66 commented Jan 10, 2019

i get this output:

#0  0x0000ffffbb639300 in memset () from /usr/lib/libc.so.6
#1  0x0000aaaaaadf7df8 in clear () at /src/crystal/src/pointer.cr:505
#2  delete () at /src/crystal/src/array.cr:931
#3  add_target_path () at /src/crystal/src/compiler/crystal/crystal_path.cr:21
#4  initialize () at /src/crystal/src/compiler/crystal/crystal_path.cr:16
#5  0x0000aaaaaadf6fe8 in initialize:target_triple ()
    at /src/crystal/src/compiler/crystal/crystal_path.cr:14
#6  new:target_triple () at /src/crystal/src/compiler/crystal/crystal_path.cr:14
#7  crystal_path () at /src/crystal/src/compiler/crystal/program.cr:236
#8  find_in_path () at /src/crystal/src/compiler/crystal/program.cr:440
#9  0x0000aaaaaae2e07c in visit ()
    at /src/crystal/src/compiler/crystal/semantic/semantic_visitor.cr:47
#10 accept () at /src/crystal/src/compiler/crystal/syntax/visitor.cr:27
#11 0x0000aaaaaae74604 in visit ()
    at /src/crystal/src/compiler/crystal/semantic/top_level_visitor.cr:707
#12 0x0000aaaaaae2d5d0 in accept ()
    at /src/crystal/src/compiler/crystal/syntax/visitor.cr:27
#13 0x0000aaaaaae2a998 in top_level_semantic ()
    at /src/crystal/src/compiler/crystal/semantic.cr:62
#14 0x0000aaaaaae28444 in semantic ()
    at /src/crystal/src/compiler/crystal/semantic.cr:22
#15 0x0000aaaaab1e1f5c in compile ()
    at /src/crystal/src/compiler/crystal/compiler.cr:152
#16 0x0000aaaaaaaea488 in compile ()
    at /src/crystal/src/compiler/crystal/command.cr:258
#17 compile () at /src/crystal/src/compiler/crystal/command.cr:256
#18 build () at /src/crystal/src/compiler/crystal/command.cr:158
#19 run () at /src/crystal/src/compiler/crystal/command.cr:67
#20 0x0000aaaaaaabae9c in __crystal_main ()
    at /src/crystal/src/compiler/crystal/command.cr:46
#21 0x0000aaaaaaabe534 in main_user_code () at /src/crystal/src/crystal/main.cr:97
#22 main () at /src/crystal/src/crystal/main.cr:86
#23 main () at /src/crystal/src/crystal/main.cr:106
@Sija

This comment has been minimized.

Copy link
Contributor

Sija commented Jan 10, 2019

Please, use triple backticks when embedding code/traces.

@RX14

This comment has been minimized.

Copy link
Member

RX14 commented Jan 10, 2019

That's very helpful, thanks! Very weird backtrace though...

@ysbaddaden

This comment has been minimized.

Copy link
Member

ysbaddaden commented Jan 10, 2019

An invalid pointer or memset is going out of bounds. Most probably a AArch64 codegen issue.

@RX14

This comment has been minimized.

Copy link
Member

RX14 commented Jan 10, 2019

Most probably a AArch64 codegen issue

yes, which would be weird since LLVM handles nearly all of the platform-specific codegen and it's very unlikely crystal broke the ABI code. It needs a bisect either way - through Crystal or LLVM.

@silmanduin66

This comment has been minimized.

Copy link
Contributor

silmanduin66 commented Jan 10, 2019

i don't really understand where and what is the problem ( and i know almost nothing about LLVM ). Does it come from the cross-compilation ?

@RX14

This comment has been minimized.

Copy link
Member

RX14 commented Jan 10, 2019

@silmanduin66 we don't know either, unfortunately

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment