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

Assertion failure when redefining invoke'd method #46503

Closed
Keno opened this issue Aug 27, 2022 · 2 comments · Fixed by #46538
Closed

Assertion failure when redefining invoke'd method #46503

Keno opened this issue Aug 27, 2022 · 2 comments · Fixed by #46538
Assignees
Milestone

Comments

@Keno
Copy link
Member

Keno commented Aug 27, 2022

               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.9.0-DEV.1189 (2022-08-26)
 _/ |\__'_|_|_|\__'_|  |  Commit 293031b4a5* (0 days old master)
|__/                   |

julia> function foo(@nospecialize(a), b::Union{Vector{Any}, Float64, Nothing})
           ccall(:jl_, Cvoid, (Any,), (a, b))
       end
foo (generic function with 1 method)

julia> foo(a::Int, b::Nothing) = @invoke foo(a::Any, b)
foo (generic function with 2 methods)

julia> foo(1, nothing)
(1, nothing)

julia> function foo(@nospecialize(a), b::Union{Nothing, Float64})
           ccall(:jl_, Cvoid, (Any,), (a, b, 2))
       end
julia: /home/keno/julia/src/gf.c:1870: ijl_method_table_insert: Assertion `oldentry' failed.

[1550886] signal (6): Aborted
in expression starting at REPL[4]:1
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: 0x7fe2c5e34728)
__assert_fail at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
ijl_method_table_insert at /home/keno/julia/src/gf.c:1870
ijl_method_def at /home/keno/julia/src/method.c:1056
eval_methoddef at /home/keno/julia/src/interpreter.c:111
eval_body at /home/keno/julia/src/interpreter.c:554
jl_interpret_toplevel_thunk at /home/keno/julia/src/interpreter.c:751
jl_toplevel_eval_flex at /home/keno/julia/src/toplevel.c:912
jl_toplevel_eval_flex at /home/keno/julia/src/toplevel.c:856
ijl_toplevel_eval at /home/keno/julia/src/toplevel.c:921
ijl_toplevel_eval_in at /home/keno/julia/src/toplevel.c:971
eval at ./boot.jl:370 [inlined]
eval_user_input at /home/keno/julia/usr/share/julia/stdlib/v1.9/REPL/src/REPL.jl:152
repl_backend_loop at /home/keno/julia/usr/share/julia/stdlib/v1.9/REPL/src/REPL.jl:248
#start_repl_backend#46 at /home/keno/julia/usr/share/julia/stdlib/v1.9/REPL/src/REPL.jl:233
start_repl_backend##kw at /home/keno/julia/usr/share/julia/stdlib/v1.9/REPL/src/REPL.jl:230 [inlined]
#run_repl#59 at /home/keno/julia/usr/share/julia/stdlib/v1.9/REPL/src/REPL.jl:372
run_repl at /home/keno/julia/usr/share/julia/stdlib/v1.9/REPL/src/REPL.jl:357
jfptr_run_repl_56747 at /home/keno/julia/usr/lib/julia/sys-debug.so (unknown line)
_jl_invoke at /home/keno/julia/src/gf.c:2428
ijl_apply_generic at /home/keno/julia/src/gf.c:2629
#1007 at ./client.jl:413
jfptr_YY.1007_35886 at /home/keno/julia/usr/lib/julia/sys-debug.so (unknown line)
_jl_invoke at /home/keno/julia/src/gf.c:2428
ijl_apply_generic at /home/keno/julia/src/gf.c:2629
jl_apply at /home/keno/julia/src/julia.h:1855
jl_f__call_latest at /home/keno/julia/src/builtins.c:774
#invokelatest#2 at ./essentials.jl:804 [inlined]
invokelatest at ./essentials.jl:801 [inlined]
run_main_repl at ./client.jl:397
exec_options at ./client.jl:314
_start at ./client.jl:514
jfptr__start_42685 at /home/keno/julia/usr/lib/julia/sys-debug.so (unknown line)
_jl_invoke at /home/keno/julia/src/gf.c:2428
ijl_apply_generic at /home/keno/julia/src/gf.c:2629
jl_apply at /home/keno/julia/src/julia.h:1855
true_main at /home/keno/julia/src/jlapi.c:567
jl_repl_entrypoint at /home/keno/julia/src/jlapi.c:711
jl_load_repl at /home/keno/julia/cli/loader_lib.c:277
main at /home/keno/julia/cli/loader_exe.c:59
__libc_start_main at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
_start at ./julia (unknown line)
Allocations: 2955 (Pool: 2941; Big: 14); GC: 0
Aborted

@Keno
Copy link
Member Author

Keno commented Aug 27, 2022

This was introduced by #46010. @timholy Could you take a look?

@timholy
Copy link
Member

timholy commented Aug 29, 2022

Thanks for the clean test case!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants