-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Error: unsigned int convert_struct_offset(llvm::Type*, unsigned int): Assertion `SL->getElementOffset(idx) == byte_offset' failed #45460
Comments
A similar issue (fixed) here: #34288 |
Are you familiar enough with GDB that you could print out the value of the type that is failing there (e.g. |
Unfortunately, no. But I have reduced the example to something that does not need using Hop
tm = Hop.SharedTBModel(Hop.Zoo.getBN())
Hop.Optics.get_shift_cond(tm, 2, 2, [3.2], -6.0, [5, 5, 1], ϵ=0.1) It seems the problem comes from I also tried to obtain an rr trace here: But I am not sure I ran |
Looks like the rr file is empty. Thread 1 "julia" received signal SIGABRT, Aborted.
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
50 ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) up
#1 0x00007ffff7da9859 in __GI_abort () at abort.c:79
79 abort.c: No such file or directory.
(gdb)
#2 0x00007ffff7da9729 in __assert_fail_base (fmt=0x7ffff7f3f588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x7ffff77498a0 "SL->getElementOffset(idx) == byte_offset",
file=0x7ffff7748930 "/data/vtjnash/julia17/src/cgutils.cpp", line=480, function=<optimized out>) at assert.c:92
92 assert.c: No such file or directory.
(gdb)
#3 0x00007ffff7dbb006 in __GI___assert_fail (assertion=assertion@entry=0x7ffff77498a0 "SL->getElementOffset(idx) == byte_offset",
file=file@entry=0x7ffff7748930 "/data/vtjnash/julia17/src/cgutils.cpp", line=line@entry=480,
function=function@entry=0x7ffff7749860 "unsigned int convert_struct_offset(llvm::Type*, unsigned int)") at assert.c:101
101 in assert.c
(gdb)
#4 0x00007ffff756bc46 in convert_struct_offset (lty=<optimized out>, byte_offset=<optimized out>) at /data/vtjnash/julia17/src/cgutils.cpp:475
475 static unsigned convert_struct_offset(Type *lty, unsigned byte_offset)
(gdb)
#5 convert_struct_offset (lty=<optimized out>, byte_offset=<optimized out>) at /data/vtjnash/julia17/src/cgutils.cpp:475
475 static unsigned convert_struct_offset(Type *lty, unsigned byte_offset)
(gdb)
#6 0x00007ffff759aae8 in convert_struct_offset (ctx=..., byte_offset=208, lty=0x55555767e8e0) at /data/vtjnash/julia17/src/cgutils.cpp:486
486 return convert_struct_offset(lty, byte_offset);
(gdb) p lty
$1 = (llvm::Type *) 0x55555767e8e0
(gdb) p jl_dump_llvm_type(lty)
{ double, { i64, i8, [1 x [9 x double]], [1 x [9 x double]], {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*, {} addrspace(10)*, [1 x [3 x {} addrspace(10)*]] }, i64, i64, i64, {} addrspace(10)*, double, {} addrspace(10)* }
$2 = void
(gdb) up
#7 emit_new_struct (ctx=..., ty=0x7fff8e55e720, nargs=8, argv=<optimized out>) at /data/vtjnash/julia17/src/cgutils.cpp:3439
3439 unsigned llvm_idx = (i > 0 && isa<StructType>(lt)) ? convert_struct_offset(ctx, lt, offs) : i;
(gdb) list -
3434 Type *fty = julia_type_to_llvm(ctx, jtype);
3435 if (type_is_ghost(fty))
3436 continue;
3437 Value *dest = NULL;
3438 unsigned offs = jl_field_offset(sty, i);
3439 unsigned llvm_idx = (i > 0 && isa<StructType>(lt)) ? convert_struct_offset(ctx, lt, offs) : i;
3440 if (!init_as_value) {
3441 // avoid unboxing the argument explicitly
3442 // and use memcpy instead
3443 dest = ctx.builder.CreateConstInBoundsGEP2_32(lt, strct, 0, llvm_idx);
(gdb) p jl_(sty)
Hop.Optics.var"#11#13"{Float64, Hop.SharedTBModel{Base.Complex{Float64}}, Int64, Int64, Int64, Array{Float64, 1}, Float64, Array{SharedArrays.SharedArray{Float64, 1}, 1}}
$3 = void
(gdb) p jl_(sty->types)
svec(Float64, Hop.SharedTBModel{Base.Complex{Float64}}, Int64, Int64, Int64, Array{Float64, 1}, Float64, Array{SharedArrays.SharedArray{Float64, 1}, 1})
$4 = void
(gdb) p offs
$5 = 208
(gdb) p i
$6 = 2 This appears to be fixed on master.
|
I believe this will not be fixed as there is not a plan for another v1.7 release, given that v1.8.0 is about to be available. |
Fair enough. Thank you. |
I don't have a MWE yet but here it is in my package CI for Julia 1.7:
https://github.com/Hop-developers/Hop.jl/runs/6604926044
This issue doesn't happen on Julia 1.6.
If anyone tries to look into this, to test
Hop.jl
(not registered yet), one needs to put all the data inhttps://github.com/Hop-developers/HopTestData
into thetest/data
folder inHop.jl
and then runruntests.jl
.The text was updated successfully, but these errors were encountered: