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

Crayons.Crayon() causes a bus error on riscv64 #57019

Open
giordano opened this issue Jan 11, 2025 · 0 comments
Open

Crayons.Crayon() causes a bus error on riscv64 #57019

giordano opened this issue Jan 11, 2025 · 0 comments
Labels
bug Indicates an unexpected problem or unintended behavior system:riscv Support for Risc-V cpus

Comments

@giordano
Copy link
Contributor

giordano commented Jan 11, 2025

julia> versioninfo()
Julia Version 1.12.0-DEV.1869
Commit d3964b600a* (2025-01-10 09:00 UTC)
Platform Info:
  OS: Linux (riscv64-linux-gnu)
  CPU: 8 × Spacemit(R) X60
  WORD_SIZE: 64
  LLVM: libLLVM-19.1.1 (ORCJIT, generic-rv64)
  GC: Built with stock GC
Threads: 1 default, 0 interactive, 1 GC (on 8 virtual cores)

julia> using Crayons

julia> Crayon()

[4021596] signal 7 (1): Bus error
in expression starting at REPL[2]:1
Crayon at /home/mose/.julia/packages/Crayons/u3AH8/src/crayon.jl:79
.Lpcrel_hi107 at /home/mose/.julia/compiled/v1.12/Crayons/TXPcU_EDYRp.so (unknown line)
jl_apply at /home/mose/repo/julia/src/julia.h:2248 [inlined]
jl_f__call_in_world_total at /home/mose/repo/julia/src/builtins.c:921
jl_apply at /home/mose/repo/julia/src/julia.h:2248 [inlined]
do_apply at /home/mose/repo/julia/src/builtins.c:839
concrete_eval_call at ./../usr/share/julia/Compiler/src/abstractinterpretation.jl:1019
abstract_call_method_with_const_args at ./../usr/share/julia/Compiler/src/abstractinterpretation.jl:885
abstract_call_method_with_const_args at ./../usr/share/julia/Compiler/src/abstractinterpretation.jl:879 [inlined]
handle1 at ./../usr/share/julia/Compiler/src/abstractinterpretation.jl:178
infercalls at ./../usr/share/julia/Compiler/src/abstractinterpretation.jl:251
abstract_call_gf_by_type at ./../usr/share/julia/Compiler/src/abstractinterpretation.jl:344
abstract_call_known at ./../usr/share/julia/Compiler/src/abstractinterpretation.jl:2750
abstract_call at ./../usr/share/julia/Compiler/src/abstractinterpretation.jl:2855
abstract_call at ./../usr/share/julia/Compiler/src/abstractinterpretation.jl:2848 [inlined]
abstract_call at ./../usr/share/julia/Compiler/src/abstractinterpretation.jl:3007
abstract_eval_call at ./../usr/share/julia/Compiler/src/abstractinterpretation.jl:3025 [inlined]
abstract_eval_statement_expr at ./../usr/share/julia/Compiler/src/abstractinterpretation.jl:3334
typeinf_local at ./../usr/share/julia/Compiler/src/abstractinterpretation.jl:4089
jfptr_typeinf_local_117219 at /home/mose/repo/julia/usr/lib/julia/sys.so (unknown line)
typeinf at ./../usr/share/julia/Compiler/src/abstractinterpretation.jl:4281
typeinf_ext at ./../usr/share/julia/Compiler/src/typeinfer.jl:1151
typeinf_ext_toplevel at ./../usr/share/julia/Compiler/src/typeinfer.jl:1225
jfptr_typeinf_ext_toplevel_117145 at /home/mose/repo/julia/usr/lib/julia/sys.so (unknown line)
jl_apply at /home/mose/repo/julia/src/julia.h:2248 [inlined]
jl_type_infer at /home/mose/repo/julia/src/gf.c:452
jl_compile_method_internal at /home/mose/repo/julia/src/gf.c:2971
_jl_invoke at /home/mose/repo/julia/src/gf.c:3465 [inlined]
ijl_apply_generic at /home/mose/repo/julia/src/gf.c:3673
jl_apply at /home/mose/repo/julia/src/julia.h:2248 [inlined]
do_call at /home/mose/repo/julia/src/interpreter.c:125
eval_value at /home/mose/repo/julia/src/interpreter.c:243
eval_stmt_value at /home/mose/repo/julia/src/interpreter.c:194 [inlined]
eval_body at /home/mose/repo/julia/src/interpreter.c:698
jl_interpret_toplevel_thunk at /home/mose/repo/julia/src/interpreter.c:889
jl_toplevel_eval_flex at /home/mose/repo/julia/src/toplevel.c:1069
__repl_entry_eval_expanded_with_loc at /home/mose/repo/julia/usr/share/julia/stdlib/v1.12/REPL/src/REPL.jl:341
jl_apply at /home/mose/repo/julia/src/julia.h:2248 [inlined]
jl_f__call_latest at /home/mose/repo/julia/src/builtins.c:883
#invokelatest#1 at ./essentials.jl:1056 [inlined]
invokelatest at ./essentials.jl:1052 [inlined]
toplevel_eval_with_hooks at /home/mose/repo/julia/usr/share/julia/stdlib/v1.12/REPL/src/REPL.jl:348
toplevel_eval_with_hooks at /home/mose/repo/julia/usr/share/julia/stdlib/v1.12/REPL/src/REPL.jl:352
toplevel_eval_with_hooks at /home/mose/repo/julia/usr/share/julia/stdlib/v1.12/REPL/src/REPL.jl:345 [inlined]
eval_user_input at /home/mose/repo/julia/usr/share/julia/stdlib/v1.12/REPL/src/REPL.jl:370
repl_backend_loop at /home/mose/repo/julia/usr/share/julia/stdlib/v1.12/REPL/src/REPL.jl:482
#start_repl_backend#41 at /home/mose/repo/julia/usr/share/julia/stdlib/v1.12/REPL/src/REPL.jl:467
start_repl_backend at /home/mose/repo/julia/usr/share/julia/stdlib/v1.12/REPL/src/REPL.jl:464 [inlined]
#run_repl#48 at /home/mose/repo/julia/usr/share/julia/stdlib/v1.12/REPL/src/REPL.jl:690
run_repl at /home/mose/repo/julia/usr/share/julia/stdlib/v1.12/REPL/src/REPL.jl:676
.Lpcrel_hi981 at /home/mose/repo/julia/usr/share/julia/compiled/v1.12/REPL/u0gqU_taLtY.so (unknown line)
run_std_repl at ./client.jl:490
jfptr_run_std_repl_58120 at /home/mose/repo/julia/usr/lib/julia/sys.so (unknown line)
jl_apply at /home/mose/repo/julia/src/julia.h:2248 [inlined]
jl_f__call_latest at /home/mose/repo/julia/src/builtins.c:883
#invokelatest#1 at ./essentials.jl:1056 [inlined]
invokelatest at ./essentials.jl:1052 [inlined]
run_main_repl at ./client.jl:511
repl_main at ./client.jl:593 [inlined]
_start at ./client.jl:568
jfptr__start_57346 at /home/mose/repo/julia/usr/lib/julia/sys.so (unknown line)
jl_apply at /home/mose/repo/julia/src/julia.h:2248 [inlined]
true_main at /home/mose/repo/julia/src/jlapi.c:922
jl_repl_entrypoint at /home/mose/repo/julia/src/jlapi.c:1081
main at /home/mose/repo/julia/cli/loader_exe.c:58
unknown function (ip: 0x3fad9ae91b) at /lib/riscv64-linux-gnu/libc.so.6
__libc_start_main at /lib/riscv64-linux-gnu/libc.so.6 (unknown line)
_start at ./julia (unknown line)
Allocations: 1 (Pool: 1; Big: 0); GC: 0
Bus error

Can also reproduce with @maleadt's build on aa05c98.

The error happens on the constructor of Crayons.Crayon(). It also happens with @code_llvm Crayon() or @code_typed, without actually running the code. A debug+asserts build of Julia didn't give any extra information.

Edit: note, I get this only on this BananaPi BPI-F3 board:

$ uname -a
Linux cfarm95 6.6.36-cfarm #1 SMP PREEMPT Sun Oct  6 18:27:25 UTC 2024 riscv64 GNU/Linux
$ head -n8 /proc/cpuinfo
processor       : 0
hart            : 0
model name      : Spacemit(R) X60
isa             : rv64imafdcv_zicbom_zicboz_zicntr_zicond_zicsr_zifencei_zihintpause_zihpm_zfh_zfhmin_zca_zcd_zba_zbb_zbc_zbs_zkt_zve32f_zve32x_zve64d_zve64f_zve64x_zvfh_zvfhmin_zvkt_sscofpmf_sstc_svinval_svnapot_svpbmt
mmu             : sv39
mvendorid       : 0x710
marchid         : 0x8000000058000001
mimpid          : 0x1000000049772200

I couldn't reproduce the bus error on other machines.

@giordano giordano added bug Indicates an unexpected problem or unintended behavior system:riscv Support for Risc-V cpus labels Jan 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior system:riscv Support for Risc-V cpus
Projects
None yet
Development

No branches or pull requests

1 participant