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

unsafe_store! in Ptr{Void} asserts #29929

Closed
Keno opened this issue Nov 4, 2018 · 2 comments
Closed

unsafe_store! in Ptr{Void} asserts #29929

Keno opened this issue Nov 4, 2018 · 2 comments
Labels
compiler:codegen Generation of LLVM IR and native code kind:bug Indicates an unexpected problem or unintended behavior

Comments

@Keno
Copy link
Member

Keno commented Nov 4, 2018

We should either give a proper error for this or make it silently work:

julia> unsafe_store!(Ptr{Nothing}(C_NULL), nothing)
julia: /home/keno/julia-1.0/deps/srccache/llvm-6.0.1/lib/IR/Type.cpp:619: static llvm::PointerType* llvm::PointerType::get(llvm::Type*, unsigned int): Assertion `isValidElementType(EltTy) && "Invalid type for pointer element!"' failed.

signal (6): Aborted
in expression starting at no file:0
__libc_signal_restore_set at /build/glibc-itYbWN/glibc-2.26/signal/../sysdeps/unix/sysv/linux/nptl-signals.h:80 [inlined]
raise at /build/glibc-itYbWN/glibc-2.26/signal/../sysdeps/unix/sysv/linux/raise.c:48
abort at /build/glibc-itYbWN/glibc-2.26/stdlib/abort.c:90
__assert_fail_base at /build/glibc-itYbWN/glibc-2.26/assert/assert.c:92
__assert_fail at /build/glibc-itYbWN/glibc-2.26/assert/assert.c:101
_ZN4llvm11PointerType3getEPNS_4TypeEj at /home/keno/julia-1.0/usr/bin/../lib/libLLVM-6.0.so (unknown line)
emit_pointerset at /home/keno/julia-1.0/src/intrinsics.cpp:666 [inlined]
emit_intrinsic at /home/keno/julia-1.0/src/intrinsics.cpp:882
emit_call at /home/keno/julia-1.0/src/codegen.cpp:3136
emit_expr at /home/keno/julia-1.0/src/codegen.cpp:3908
emit_ssaval_assign at /home/keno/julia-1.0/src/codegen.cpp:3613
emit_stmtpos at /home/keno/julia-1.0/src/codegen.cpp:3805 [inlined]
emit_function at /home/keno/julia-1.0/src/codegen.cpp:6235
jl_compile_linfo at /home/keno/julia-1.0/src/codegen.cpp:1144
jl_fptr_trampoline at /home/keno/julia-1.0/src/gf.c:1819
jl_apply_generic at /home/keno/julia-1.0/src/gf.c:2209
do_call at /home/keno/julia-1.0/src/interpreter.c:323
eval_value at /home/keno/julia-1.0/src/interpreter.c:411
eval_stmt_value at /home/keno/julia-1.0/src/interpreter.c:362 [inlined]
eval_body at /home/keno/julia-1.0/src/interpreter.c:771
jl_interpret_toplevel_thunk_callback at /home/keno/julia-1.0/src/interpreter.c:883
unknown function (ip: 0xfffffffffffffffe)
unknown function (ip: 0x7f1a5151725f)
unknown function (ip: 0x1)
jl_interpret_toplevel_thunk at /home/keno/julia-1.0/src/interpreter.c:892
jl_toplevel_eval_flex at /home/keno/julia-1.0/src/toplevel.c:764
jl_toplevel_eval_in at /home/keno/julia-1.0/src/toplevel.c:793
eval at ./boot.jl:319
jl_apply_generic at /home/keno/julia-1.0/src/gf.c:2209
eval_user_input at /home/keno/julia-1.0/usr/share/julia/stdlib/v1.1/REPL/src/REPL.jl:85
macro expansion at /home/keno/julia-1.0/usr/share/julia/stdlib/v1.1/REPL/src/REPL.jl:117 [inlined]
#26 at ./task.jl:259
jl_apply_generic at /home/keno/julia-1.0/src/gf.c:2209
jl_apply at /home/keno/julia-1.0/src/julia.h:1571 [inlined]
start_task at /home/keno/julia-1.0/src/task.c:572
unknown function (ip: 0xffffffffffffffff)
Allocations: 2348689 (Pool: 2348226; Big: 463); GC: 4
Aborted
@Keno
Copy link
Member Author

Keno commented Nov 4, 2018

This comes up when trying to @threadcall a function that returns Cvoid.

Keno added a commit that referenced this issue Nov 5, 2018
@JeffBezanson JeffBezanson added kind:bug Indicates an unexpected problem or unintended behavior compiler:codegen Generation of LLVM IR and native code labels Nov 5, 2018
staticfloat pushed a commit that referenced this issue Dec 13, 2018
NHDaly added a commit to NHDaly/julia that referenced this issue Mar 22, 2019
@JeffBezanson
Copy link
Sponsor Member

Fixed by #31431.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler:codegen Generation of LLVM IR and native code kind:bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

2 participants