CxxWrap.jl
CxxWrap.jl copied to clipboard
Segfault with 0.11.1 on julia 1.3
After switching from 0.11.0 to 0.11.1 julia 1.3 crashes when loading Polymake.jl, both in our CI and locally:
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 9 5900X 12-Core Processor
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-6.0.1 (ORCJIT, generic)
Environment:
JULIA_DEPOT_PATH = /tmp/julia13dep
(julia13proj) pkg> st
Status `/tmp/julia13proj/Project.toml`
[1f15a43c] CxxWrap v0.11.1
[d720cf60] Polymake v0.5.4
julia> using Polymake
Thread 1 "julia" received signal SIGABRT, Aborted.
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:49
49 ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:49
#1 0x00007ffff764a538 in __GI_abort () at abort.c:79
#2 0x00007ffff788c7ef in jl_intref (idx=<optimized out>, arr=<optimized out>) at /buildworker/worker/package_linux64/build/src/typemap.c:194
#3 mtcache_hash_lookup (offs=<optimized out>, tparam=<optimized out>, ty=<optimized out>, a=<optimized out>) at /buildworker/worker/package_linux64/build/src/typemap.c:255
#4 jl_typemap_intersection_visitor (map=<optimized out>, offs=offs@entry=0, closure=closure@entry=0x7fffcc4abe30) at /buildworker/worker/package_linux64/build/src/typemap.c:545
#5 0x00007ffff7884daa in jl_method_table_insert (mt=<optimized out>, method=method@entry=0x7fffc834ef80, simpletype=simpletype@entry=0x7fffeb4a1700 <jl_system_image_data+17472>)
at /buildworker/worker/package_linux64/build/src/gf.c:1683
#6 0x00007ffff78b0319 in jl_insert_methods (list=0x7fffe6888e20, list=0x7fffe6888e20) at /buildworker/worker/package_linux64/build/src/dump.c:2225
#7 _jl_restore_incremental (f=f@entry=0x7fffcc4ac130, mod_array=mod_array@entry=0x7fffca812230) at /buildworker/worker/package_linux64/build/src/dump.c:3227
#8 0x00007ffff78b32c5 in jl_restore_incremental (fname=0x7fffe60d46a8 "/tmp/julia13dep/compiled/v1.3/Polymake/QizyK_tSM6m.ji", mod_array=0x7fffca812230)
at /buildworker/worker/package_linux64/build/src/dump.c:3272
#9 0x00007fffea0a50d6 in japi1__include_from_serialized_3216 () at loading.jl:676
#10 0x00007fffea0a70c3 in japi1__require_search_from_serialized_2786 () at loading.jl:776
#11 0x00007fffea0b1782 in japi1__require_2174 () at loading.jl:1001
#12 0x00007fffea0b370d in japi1_require_2161 () at loading.jl:922
#13 0x00007fffea0f4c5c in japi1_require_4817 () at loading.jl:917
#14 0x00007ffff788779c in _jl_invoke (world=26767, mfunc=<optimized out>, nargs=2, args=0x7fffcc4ad6b8, F=0x7fffeeac1260 <jl_system_image_data+56770464>)
at /buildworker/worker/package_linux64/build/src/gf.c:2135
#15 jl_apply_generic (F=0x7fffeeac1260 <jl_system_image_data+56770464>, args=args@entry=0x7fffcc4ad6b8, nargs=nargs@entry=2)
at /buildworker/worker/package_linux64/build/src/gf.c:2305
#16 0x00007ffff78ba5ab in jl_apply (nargs=3, args=0x7fffcc4ad6b0) at /buildworker/worker/package_linux64/build/src/julia.h:1631
#17 call_require (var=0x7fffe5d956e8, mod=0x7fffeb4eac10 <jl_system_image_data+317776>) at /buildworker/worker/package_linux64/build/src/toplevel.c:399
#18 eval_import_path (where=where@entry=0x7fffeb4eac10 <jl_system_image_data+317776>, from=from@entry=0x0, name=name@entry=0x7fffcc4ad768,
keyword=keyword@entry=0x7ffff7a03a69 "using", args=<optimized out>, args=<optimized out>) at /buildworker/worker/package_linux64/build/src/toplevel.c:436
#19 0x00007ffff78bb9ea in jl_toplevel_eval_flex (m=m@entry=0x7fffeb4eac10 <jl_system_image_data+317776>, e=<optimized out>, fast=fast@entry=1, expanded=expanded@entry=0)
at /buildworker/worker/package_linux64/build/src/toplevel.c:656
#20 0x00007ffff78bb77a in jl_toplevel_eval_flex (m=m@entry=0x7fffeb4eac10 <jl_system_image_data+317776>, e=e@entry=0x7fffe64102f0, fast=fast@entry=1, expanded=expanded@entry=0)
at /buildworker/worker/package_linux64/build/src/toplevel.c:764
#21 0x00007ffff78bc82c in jl_toplevel_eval (m=m@entry=0x7fffeb4eac10 <jl_system_image_data+317776>, v=v@entry=0x7fffe64102f0)
at /buildworker/worker/package_linux64/build/src/toplevel.c:823
#22 0x00007ffff78bc8b5 in jl_toplevel_eval_in (m=0x7fffeb4eac10 <jl_system_image_data+317776>, ex=0x7fffe64102f0) at /buildworker/worker/package_linux64/build/src/toplevel.c:843
#23 0x00007fffea0bcfd5 in japi1_eval_3749 () at boot.jl:330
#24 0x00007ffff788779c in _jl_invoke (world=26767, mfunc=<optimized out>, nargs=2, args=0x7fffcc4adab8, F=0x7fffed224310 <jl_system_image_data+30961744>)
at /buildworker/worker/package_linux64/build/src/gf.c:2135
#25 jl_apply_generic (F=0x7fffed224310 <jl_system_image_data+30961744>, args=0x7fffcc4adab8, nargs=<optimized out>) at /buildworker/worker/package_linux64/build/src/gf.c:2305
#26 0x00007fffea2aa9ca in japi1_eval_user_input_11803 () at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.3/REPL/src/REPL.jl:86
#27 0x00007fffea2aacc5 in macro expansion () at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.3/REPL/src/REPL.jl:118
#28 japi1_#26_11801 () at task.jl:333
#29 0x00007ffff788779c in _jl_invoke (world=26767, mfunc=<optimized out>, nargs=0, args=0x7fffe8766eb0, F=0x7fffe879a9d0) at /buildworker/worker/package_linux64/build/src/gf.c:2135
#30 jl_apply_generic (F=0x7fffe879a9d0, args=args@entry=0x7fffe8766eb0, nargs=nargs@entry=0) at /buildworker/worker/package_linux64/build/src/gf.c:2305
#31 0x00007ffff78a2e79 in jl_apply (nargs=1, args=0x7fffe8766ea8) at /buildworker/worker/package_linux64/build/src/julia.h:1631
#32 start_task () at /buildworker/worker/package_linux64/build/src/task.c:659
#33 0x0000000000000000 in ?? ()
It works fine again when I switch back to 0.11.0.
I am having a hard time understanding that backtrace, bisecting points to a6be4ba40. Any suggestions how to debug this further?
By chance we noticed that this also happens with 1.4.0 and 1.4.1, but not in 1.4.2. Looking at the very few changes between 1.4.1 and 1.4.2 I found this julia bug: https://github.com/JuliaLang/julia/issues/29859 with a very similar backtrace that was fixed with https://github.com/JuliaLang/julia/pull/35378 and backported for 1.4.2.
OK, so anything in CxxWrap we can do about this, then? I don't see an obvious workaround.
I don't really know any details why this happens and was hoping for someone else to have an idea. Somehow the cxxdereference change in a6be4ba407129dbc91c57dd67cec3e64ab0ec1c6 triggers that julia bug and I wanted to dig in further to find the code from Polymake.jl where this happens but didn't have time for that so far.
Can this be closed now? Julia 1.3 is obsolete.