open_spiel: Julia: Assertion `i < (((jl_array_t*)(a))->length)' failed.

I followed the steps 1, 2 and 3 at https://openspiel.readthedocs.io/en/latest/julia.html without complications.

But when I enter julia console and type using OpenSpiel_jll I get following error:

[ Info: Precompiling OpenSpiel_jll [7e5d8dc8-489f-4be6-9273-f4c3010e6ec1]
julia: /workspace/srcdir/julia/include/julia/julia.h:784: jl_value_t* jl_array_ptr_ref(void*, size_t): Assertion `i < (((jl_array_t*)(a))->length)' failed.

signal (6): Aborted
in expression starting at /mnt/d/open_spiel/open_spiel/julia/src/OpenSpiel_jll.jl:10
gsignal at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
abort at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
unknown function (ip: 0x7f3b70a50399)
__assert_fail at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
_ZN5jlcxx6Module14bind_constantsENS_8ArrayRefIP11_jl_value_tLi1EEES4_ at /home/mono/.julia/packages/CxxWrap/lDNAy/deps/usr/lib/libcxxwrap_julia.so (unknown line)
bind_module_constants at /home/mono/.julia/packages/CxxWrap/lDNAy/deps/usr/lib/libcxxwrap_julia.so (unknown line)
bind_constants at /home/mono/.julia/packages/CxxWrap/lDNAy/src/CxxWrap.jl:379 [inlined]
wraptypes at /home/mono/.julia/packages/CxxWrap/lDNAy/src/CxxWrap.jl:643
wrapmodule at /home/mono/.julia/packages/CxxWrap/lDNAy/src/CxxWrap.jl:671
_jl_invoke at /buildworker/worker/package_linux64/build/src/gf.c:2141 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2305
jl_apply at /buildworker/worker/package_linux64/build/src/julia.h:1631 [inlined]
do_call at /buildworker/worker/package_linux64/build/src/interpreter.c:328
eval_value at /buildworker/worker/package_linux64/build/src/interpreter.c:417
eval_stmt_value at /buildworker/worker/package_linux64/build/src/interpreter.c:368 [inlined]
eval_body at /buildworker/worker/package_linux64/build/src/interpreter.c:778
jl_interpret_toplevel_thunk_callback at /buildworker/worker/package_linux64/build/src/interpreter.c:888
unknown function (ip: 0xfffffffffffffffe)
unknown function (ip: 0x7f3b4d23400f)
unknown function (ip: 0xffffffffffffffff)
jl_interpret_toplevel_thunk at /buildworker/worker/package_linux64/build/src/interpreter.c:897
jl_toplevel_eval_flex at /buildworker/worker/package_linux64/build/src/toplevel.c:814
jl_eval_module_expr at /buildworker/worker/package_linux64/build/src/toplevel.c:181
jl_toplevel_eval_flex at /buildworker/worker/package_linux64/build/src/toplevel.c:640
jl_parse_eval_all at /buildworker/worker/package_linux64/build/src/ast.c:873
jl_load at /buildworker/worker/package_linux64/build/src/toplevel.c:878
include at ./boot.jl:328 [inlined]
include_relative at ./loading.jl:1105
include at ./Base.jl:31
_jl_invoke at /buildworker/worker/package_linux64/build/src/gf.c:2135 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2305
jl_apply at /buildworker/worker/package_linux64/build/src/julia.h:1631 [inlined]
do_call at /buildworker/worker/package_linux64/build/src/interpreter.c:328
eval_value at /buildworker/worker/package_linux64/build/src/interpreter.c:417
eval_stmt_value at /buildworker/worker/package_linux64/build/src/interpreter.c:368 [inlined]
eval_body at /buildworker/worker/package_linux64/build/src/interpreter.c:778
eval_body at /buildworker/worker/package_linux64/build/src/interpreter.c:705
jl_interpret_toplevel_thunk_callback at /buildworker/worker/package_linux64/build/src/interpreter.c:888
unknown function (ip: 0xfffffffffffffffe)
unknown function (ip: 0x7f3b5facca0f)
unknown function (ip: 0x2)
jl_interpret_toplevel_thunk at /buildworker/worker/package_linux64/build/src/interpreter.c:897
jl_toplevel_eval_flex at /buildworker/worker/package_linux64/build/src/toplevel.c:814
jl_toplevel_eval_in at /buildworker/worker/package_linux64/build/src/toplevel.c:843
eval at ./boot.jl:330 [inlined]
eval at ./client.jl:425
_jl_invoke at /buildworker/worker/package_linux64/build/src/gf.c:2135 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2305
top-level scope at ./none:3
jl_toplevel_eval_flex at /buildworker/worker/package_linux64/build/src/toplevel.c:808
jl_toplevel_eval_flex at /buildworker/worker/package_linux64/build/src/toplevel.c:764
jl_toplevel_eval_in at /buildworker/worker/package_linux64/build/src/toplevel.c:843
eval at ./boot.jl:330
_jl_invoke at /buildworker/worker/package_linux64/build/src/gf.c:2135 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2305
exec_options at ./client.jl:263
_start at ./client.jl:460
jfptr__start_2084.clone_1 at /mnt/e/Linux/julia-1.3.1/lib/julia/sys.so (unknown line)
_jl_invoke at /buildworker/worker/package_linux64/build/src/gf.c:2135 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2305
jl_apply at /buildworker/worker/package_linux64/build/ui/../src/julia.h:1631 [inlined]
true_main at /buildworker/worker/package_linux64/build/ui/repl.c:96
main at /buildworker/worker/package_linux64/build/ui/repl.c:217
__libc_start_main at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
_start at /mnt/e/Linux/julia-1.3.1/bin/julia (unknown line)
Allocations: 2412748 (Pool: 2412426; Big: 322); GC: 2
ERROR: Failed to precompile OpenSpiel_jll [7e5d8dc8-489f-4be6-9273-f4c3010e6ec1] to /home/mono/.julia/compiled/v1.3/OpenSpiel_jll/pEQx0_oseUb.ji.
Stacktrace:
 [1] error(::String) at ./error.jl:33
 [2] compilecache(::Base.PkgId, ::String) at ./loading.jl:1283
 [3] _require(::Base.PkgId) at ./loading.jl:1024
 [4] require(::Base.PkgId) at ./loading.jl:922
 [5] require(::Module, ::Symbol) at ./loading.jl:917

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 15

Most upvoted comments

Hi @Josef-Vonasek ,

Thanks for providing the information.

Now I know where the error comes from. Sorry that I didn’t notice it before.

The quick solution is to run ]add CxxWrap#0c82e3e383ddf2db1face8ece22d0a552f0ca11a in the Julia REPL to make sure that it is the same with the one built the Julia wrapper.

TL;DR

The reason is that, the Julia wrapper used to depend on an unreleased version of CxxWrapper@v0.9. When ]dev ./open_spiel/julia, the specific commit is ignored and will install CxxWrap@v0.9 by default, which will cause the error above. (I had installed the specific version in the global environment before so didn’t notice this error). The reason that ]add OpenSpiel will not have this error is that I used the stable version of CxxWrap@v0.9.0 to generate the wrapper. I’ll fix them all together after the next patch release. Thanks again for reporting this error ❤️.

Great thanks again for the continued support.

Also we are making progress on getting OpenSpiel entirely compliant with TF 2.2 (will still support TF 1 code) in time for Ubuntu 20.04. Once done, we plan to tag a release right after that. Will keep you posted.

julia> versioninfo()
Julia Version 1.3.1
Commit 2d5741174c (2019-12-30 21:36 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
  CPU: AMD Ryzen 3 2200G with Radeon Vega Graphics    
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-6.0.1 (ORCJIT, znver1)
(v1.3) pkg> st
    Status `~/.julia/environments/v1.3/Project.toml`
  [7e5d8dc8] OpenSpiel_jll v0.1.0 [`../../../../../mnt/d/open_spiel/open_spiel/julia`]

are those instructions out of date now?

I think they are still up-to-date. But it requires users to have a basic understanding of what’s happening when ]dev ./open_spiel/julia

(Since you are suggestion adding it via the registration method)

Yeah, this method is more user-friendly but it has some restrictions

  1. requires Julia v1.3 or above
  2. works only on Linux
  3. some new features/bugfixes in the last two months are not included
  4. can’t be precompiled

That’s the main reason why I didn’t include it in the docs.

I would still like to have the ones with the manual build up somewhere just so we keep track of it as an option.

Yeah, I totally agree. I was going to make a PR after fixing #(2,3,4). However, I’m still waiting for a patch release of CxxWrap.jl.

No, you don’t need to clone the repo. It will be installed just like many other Julia packages.