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

world age validation for certain generated functions #6

Open
jrevels opened this issue Sep 5, 2017 · 6 comments
Open

world age validation for certain generated functions #6

jrevels opened this issue Sep 5, 2017 · 6 comments
Labels

Comments

@jrevels
Copy link
Collaborator

jrevels commented Sep 5, 2017

There's not an actual upstream issue for this yet.

Cassette relies very heavily on @generated functions, which currently have lots of issues w.r.t. world age validation and precompilation. For Cassette's specific use case, many of these issues can be fixed if:

  1. CodeInfo objects retrieved from the method table contained their valid world age bounds
  2. Generators could return their forward edge set along with the CodeInfo
@jrevels jrevels changed the title upstream issue: world age validation for certain generated functions world age validation for certain generated functions Oct 11, 2017
@jrevels
Copy link
Collaborator Author

jrevels commented May 12, 2018

didn't mean to close this with my commit message

@jrevels
Copy link
Collaborator Author

jrevels commented Jun 14, 2018

Note that this is essentially no longer fundamentally needed for Cassette to basically work. I'm going to leave it open, though, since it would still be nice to have in the future to make things more robust

@jrevels
Copy link
Collaborator Author

jrevels commented Jun 29, 2018

Just to be clear since I was asked, this issue was originally about two separate things:

  1. 265-like behavior for Cassette primitives (e.g. cassette method overloads not respected #44)
  2. 265-like behavior for overdubbed functions (e.g. define a function, run it overdubbed, then redefine the function; the overdubbed execution will not update for the redefinition)

1 was just a compiler bug which we fixed.

2, however, is more complicated and requires something akin to JuliaLang/julia#27073.

@jrevels
Copy link
Collaborator Author

jrevels commented Aug 8, 2018

From #70 (thanks goes to @maleadt):

$ git clone https://github.com/JuliaLang/julia julia

$ cd julia

$ make -j10 LLVM_ASSERTIONS=1 FORCE_ASSERTIONS=1

$ JULIA_DEPOT_PATH=$(mktemp -d) ./julia
               _
   _       _ _(_)_     |  A fresh approach to technical computing
  (_)     | (_) (_)    |  Documentation: https://docs.julialang.org
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.0.0-rc1.5 (2018-08-07 20:49 UTC)
 _/ |\__'_|_|_|\__'_|  |  Commit d038f2f499 (0 days old master)
|__/                   |  x86_64-linux-gnu

(v1.0) pkg> add https://github.com/jrevels/Cassette.jl
   Cloning git-repo `https://github.com/jrevels/Cassette.jl`
  Updating git-repo `https://github.com/jrevels/Cassette.jl`
[ Info: Assigning UUID 59fb9612-49be-509a-8654-f972bbc0bdb2 to Cassette
 Resolving package versions...
  Updating `/tmp/tmp.WrMAkxtd5A/environments/v1.0/Project.toml`
  [59fb9612] + Cassette v0.0.0 #master (https://github.com/jrevels/Cassette.jl)
  Updating `/tmp/tmp.WrMAkxtd5A/environments/v1.0/Manifest.toml`
  [59fb9612] + Cassette v0.0.0 #master (https://github.com/jrevels/Cassette.jl)
  [2a0f44e3] + Base64 
  [8ba89e20] + Distributed 
  [b77e0a4c] + InteractiveUtils 
  [8f399da3] + Libdl 
  [37e2e46d] + LinearAlgebra 
  [56ddb016] + Logging 
  [d6f4376e] + Markdown 
  [9a3f8284] + Random 
  [9e88b42a] + Serialization 
  [6462fe0b] + Sockets 
  [8dfed614] + Test 

julia> using Cassette
[ Info: Precompiling Cassette [59fb9612-49be-509a-8654-f972bbc0bdb2]

julia> Cassette.@context Ctx
Cassette.Context{nametype(Ctx),M,P,T,B} where B<:Union{Nothing, IdDict{Module,Dict{Symbol,BindingMeta}}} where P<:Cassette.AbstractPass where T<:Union{Nothing, Tag} where M

julia> Cassette.overdub(Ctx(), /, 1, 2)
julia: julia/src/gf.c:1431: jl_method_instance_add_backedge: Assertion `callee->def.method->min_world <= caller->min_world && callee->max_world >= caller->max_world' failed.

signal (6): Aborted
in expression starting at no file:0
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: 0x7fd2a25d2e66)
__assert_fail at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
jl_method_instance_add_backedge at julia/src/gf.c:1431
store_backedges at ./compiler/typeinfer.jl:197
typeinf at ./compiler/typeinfer.jl:72
typeinf_edge at ./compiler/typeinfer.jl:492
abstract_call_method at ./compiler/abstractinterpretation.jl:315
abstract_call_gf_by_type at ./compiler/abstractinterpretation.jl:79
abstract_call at ./compiler/abstractinterpretation.jl:763
abstract_eval_call at ./compiler/abstractinterpretation.jl:792
abstract_eval at ./compiler/abstractinterpretation.jl:877
typeinf_local at ./compiler/abstractinterpretation.jl:1101
typeinf_nocycle at ./compiler/abstractinterpretation.jl:1157
typeinf at ./compiler/typeinfer.jl:15
typeinf_edge at ./compiler/typeinfer.jl:492
abstract_call_method at ./compiler/abstractinterpretation.jl:315
abstract_call_gf_by_type at ./compiler/abstractinterpretation.jl:79
abstract_call at ./compiler/abstractinterpretation.jl:763
abstract_eval_call at ./compiler/abstractinterpretation.jl:792
abstract_eval at ./compiler/abstractinterpretation.jl:877
typeinf_local at ./compiler/abstractinterpretation.jl:1101
typeinf_nocycle at ./compiler/abstractinterpretation.jl:1157
typeinf at ./compiler/typeinfer.jl:15
typeinf_edge at ./compiler/typeinfer.jl:492
abstract_call_method at ./compiler/abstractinterpretation.jl:315
abstract_call_gf_by_type at ./compiler/abstractinterpretation.jl:79
abstract_call at ./compiler/abstractinterpretation.jl:763
abstract_eval_call at ./compiler/abstractinterpretation.jl:792
abstract_eval at ./compiler/abstractinterpretation.jl:877
typeinf_local at ./compiler/abstractinterpretation.jl:1101
typeinf_nocycle at ./compiler/abstractinterpretation.jl:1157
typeinf at ./compiler/typeinfer.jl:15
typeinf_edge at ./compiler/typeinfer.jl:492
abstract_call_method at ./compiler/abstractinterpretation.jl:315
abstract_call_gf_by_type at ./compiler/abstractinterpretation.jl:79
abstract_call at ./compiler/abstractinterpretation.jl:763
abstract_eval_call at ./compiler/abstractinterpretation.jl:792
abstract_eval at ./compiler/abstractinterpretation.jl:877
typeinf_local at ./compiler/abstractinterpretation.jl:1101
typeinf_nocycle at ./compiler/abstractinterpretation.jl:1157
typeinf at ./compiler/typeinfer.jl:15
typeinf_ext at ./compiler/typeinfer.jl:567
typeinf_ext at ./compiler/typeinfer.jl:604
jfptr_typeinf_ext_1 at julia/usr/lib/julia/sys.so (unknown line)
jl_apply_generic at julia/src/gf.c:2182
jl_apply at julia/src/julia.h:1536 [inlined]
jl_apply_with_saved_exception_state at julia/src/rtutils.c:257
jl_type_infer at julia/src/gf.c:275
jl_fptr_trampoline at julia/src/gf.c:1784
jl_apply_generic at julia/src/gf.c:2182
jl_apply_2va at julia/src/rtutils.c:296
GeneratedFunctionStub at ./boot.jl:506
jl_apply_generic at julia/src/gf.c:2182
jl_apply at julia/src/julia.h:1536 [inlined]
jl_call_staged at julia/src/method.c:376
jl_code_for_staged at julia/src/method.c:409
get_staged at ./compiler/utilities.jl:91
retrieve_code_info at ./compiler/utilities.jl:112
Type at ./compiler/inferencestate.jl:117 [inlined]
typeinf_ext at ./compiler/typeinfer.jl:565
typeinf_ext at ./compiler/typeinfer.jl:604
jfptr_typeinf_ext_1 at julia/usr/lib/julia/sys.so (unknown line)
jl_apply_generic at julia/src/gf.c:2182
jl_apply at julia/src/julia.h:1536 [inlined]
jl_apply_with_saved_exception_state at julia/src/rtutils.c:257
jl_type_infer at julia/src/gf.c:275
jl_fptr_trampoline at julia/src/gf.c:1784
jl_apply_generic at julia/src/gf.c:2182
do_call at julia/src/interpreter.c:324
eval_value at julia/src/interpreter.c:428
eval_stmt_value at julia/src/interpreter.c:363 [inlined]
eval_body at julia/src/interpreter.c:686
jl_interpret_toplevel_thunk_callback at julia/src/interpreter.c:799
unknown function (ip: 0xfffffffffffffffe)
unknown function (ip: 0x7fd292f0d09f)
unknown function (ip: 0x1)
jl_interpret_toplevel_thunk at julia/src/interpreter.c:808
jl_toplevel_eval_flex at julia/src/toplevel.c:785
jl_toplevel_eval_in at julia/src/builtins.c:622
eval at ./boot.jl:319
jl_apply_generic at julia/src/gf.c:2182
eval_user_input at julia/usr/share/julia/stdlib/v1.0/REPL/src/REPL.jl:85
macro expansion at julia/usr/share/julia/stdlib/v1.0/REPL/src/REPL.jl:117 [inlined]
#28 at ./task.jl:259
jl_apply_generic at julia/src/gf.c:2182
jl_apply at julia/src/julia.h:1536 [inlined]
start_task at julia/src/task.c:268
unknown function (ip: 0xffffffffffffffff)
Allocations: 9302501 (Pool: 9300888; Big: 1613); GC: 18

@maleadt
Copy link
Contributor

maleadt commented Aug 8, 2018

Some debugging dump:

(rr) bt
#0  0x00007fef9c2d886b in raise () from /usr/lib/libc.so.6
#1  0x00007fef9c2c340e in abort () from /usr/lib/libc.so.6
#2  0x00007fef9c2c32e0 in __assert_fail_base.cold.0 () from /usr/lib/libc.so.6
#3  0x00007fef9c2d1112 in __assert_fail () from /usr/lib/libc.so.6
#4  0x00007fef9ccce680 in jl_method_instance_add_backedge (callee=0x7fef8a1b4a90, caller=0x7fef898b9a10) at julia/src/gf.c:1431
#5  0x00007fef8d700104 in japi1_store_backedges_2246 (frame=...) at compiler/typeinfer.jl:197
#6  0x00007fef8d70b5f0 in julia_typeinf_149 (frame=...) at compiler/typeinfer.jl:72
#7  0x00007fef8d630b44 in japi1_typeinf_edge_485 (method=..., atypes=0x7fef88d7c790, sparams=0x0, caller=...) at compiler/typeinfer.jl:492
#8  0x00007fef8d631ac8 in japi1_abstract_call_method_470 (method=..., sig=0x7fef88d7c790, sparams=0x0, sv=...) at compiler/abstractinterpretation.jl:315
#9  0x00007fef8d634e10 in japi1_abstract_call_gf_by_type_456 (f=0x0, argtypes=0x7fef8906f000, atype=0x7fef88d7c790, sv=...) at compiler/abstractinterpretation.jl:79
#10 0x00007fef8d646019 in japi1_abstract_call_320 (f=0x0, fargs=0x7fef8b707bd0, argtypes=0x7fef8906f000, vtypes=0x7fef8946bf50, sv=...) at compiler/abstractinterpretation.jl:763
#11 0x00007fef8d64763e in japi1_abstract_eval_call_318 (fargs=0x7fef8b707bd0, argtypes=0x7fef8906f000, vtypes=0x7fef8946bf50, sv=...) at compiler/abstractinterpretation.jl:792
#12 0x00007fef8d648f1a in japi1_abstract_eval_306 (e=0x7fef88a7f4e0, vtypes=0x7fef8946bf50, sv=...) at compiler/abstractinterpretation.jl:877
#13 0x00007fef8d64b962 in japi1_typeinf_local_153 (frame=...) at compiler/abstractinterpretation.jl:1101
#14 0x00007fef8d64f3a3 in julia_typeinf_nocycle_151 (frame=...) at compiler/abstractinterpretation.jl:1157
#15 0x00007fef8d70a82e in julia_typeinf_149 (frame=...) at compiler/typeinfer.jl:15
#16 0x00007fef8d630b44 in japi1_typeinf_edge_485 (method=..., atypes=0x7fef88d7c790, sparams=0x0, caller=...) at compiler/typeinfer.jl:492
#17 0x00007fef8d631ac8 in japi1_abstract_call_method_470 (method=..., sig=0x7fef88d7c790, sparams=0x0, sv=...) at compiler/abstractinterpretation.jl:315
#18 0x00007fef8d634e10 in japi1_abstract_call_gf_by_type_456 (f=0x7fef8901ebd0, argtypes=0x7fef8b707770, atype=0x7fef88d7c790, sv=...) at compiler/abstractinterpretation.jl:79
#19 0x00007fef8d646019 in japi1_abstract_call_320 (f=0x7fef8901ebd0, fargs=0x7fef8b705e80, argtypes=0x7fef8b707770, vtypes=0x7fef8b6c68d0, sv=...) at compiler/abstractinterpretation.jl:763
#20 0x00007fef8d64763e in japi1_abstract_eval_call_318 (fargs=0x7fef8b705e80, argtypes=0x7fef8b707770, vtypes=0x7fef8b6c68d0, sv=...) at compiler/abstractinterpretation.jl:792
#21 0x00007fef8d648f1a in japi1_abstract_eval_306 (e=0x7fef88a7f4e0, vtypes=0x7fef8b6c68d0, sv=...) at compiler/abstractinterpretation.jl:877
#22 0x00007fef8d64b962 in japi1_typeinf_local_153 (frame=...) at compiler/abstractinterpretation.jl:1101
#23 0x00007fef8d64f3a3 in julia_typeinf_nocycle_151 (frame=...) at compiler/abstractinterpretation.jl:1157
#24 0x00007fef8d70a82e in julia_typeinf_149 (frame=...) at compiler/typeinfer.jl:15
#25 0x00007fef8d630b44 in japi1_typeinf_edge_485 (method=..., atypes=0x7fef88d7c790, sparams=0x0, caller=...) at compiler/typeinfer.jl:492
#26 0x00007fef8d631ac8 in japi1_abstract_call_method_470 (method=..., sig=0x7fef88d7c790, sparams=0x0, sv=...) at compiler/abstractinterpretation.jl:315
#27 0x00007fef8d634e10 in japi1_abstract_call_gf_by_type_456 (f=0x7fef8901ebd0, argtypes=0x7fef8b705a90, atype=0x7fef88d7c790, sv=...) at compiler/abstractinterpretation.jl:79
#28 0x00007fef8d646019 in japi1_abstract_call_320 (f=0x7fef8901ebd0, fargs=0x7fef89dea820, argtypes=0x7fef8b705a90, vtypes=0x7fef8b724610, sv=...) at compiler/abstractinterpretation.jl:763
#29 0x00007fef8d64763e in japi1_abstract_eval_call_318 (fargs=0x7fef89dea820, argtypes=0x7fef8b705a90, vtypes=0x7fef8b724610, sv=...) at compiler/abstractinterpretation.jl:792
#30 0x00007fef8d648f1a in japi1_abstract_eval_306 (e=0x7fef88a7f4e0, vtypes=0x7fef8b724610, sv=...) at compiler/abstractinterpretation.jl:877
#31 0x00007fef8d64b962 in japi1_typeinf_local_153 (frame=...) at compiler/abstractinterpretation.jl:1101
#32 0x00007fef8d64f3a3 in julia_typeinf_nocycle_151 (frame=...) at compiler/abstractinterpretation.jl:1157
#33 0x00007fef8d70a82e in julia_typeinf_149 (frame=...) at compiler/typeinfer.jl:15
#34 0x00007fef8d630b44 in japi1_typeinf_edge_485 (method=..., atypes=0x7fef88d7c790, sparams=0x0, caller=...) at compiler/typeinfer.jl:492
#35 0x00007fef8d631ac8 in japi1_abstract_call_method_470 (method=..., sig=0x7fef88d7c790, sparams=0x0, sv=...) at compiler/abstractinterpretation.jl:315
#36 0x00007fef8d634e10 in japi1_abstract_call_gf_by_type_456 (f=0x7fef8901f180, argtypes=0x7fef89de8280, atype=0x7fef88d7c790, sv=...) at compiler/abstractinterpretation.jl:79
#37 0x00007fef8d646019 in japi1_abstract_call_320 (f=0x7fef8901f180, fargs=0x7fef89bdd240, argtypes=0x7fef89de8280, vtypes=0x7fef89beefc0, sv=...) at compiler/abstractinterpretation.jl:763
#38 0x00007fef8d64763e in japi1_abstract_eval_call_318 (fargs=0x7fef89bdd240, argtypes=0x7fef89de8280, vtypes=0x7fef89beefc0, sv=...) at compiler/abstractinterpretation.jl:792
#39 0x00007fef8d648f1a in japi1_abstract_eval_306 (e=0x7fef88a7f4e0, vtypes=0x7fef89beefc0, sv=...) at compiler/abstractinterpretation.jl:877
#40 0x00007fef8d64b962 in japi1_typeinf_local_153 (frame=...) at compiler/abstractinterpretation.jl:1101
#41 0x00007fef8d64f3a3 in julia_typeinf_nocycle_151 (frame=...) at compiler/abstractinterpretation.jl:1157
#42 0x00007fef8d70a82e in julia_typeinf_149 (frame=...) at compiler/typeinfer.jl:15
#43 0x00007fef8d70bd78 in japi1_typeinf_ext_17 (linfo=..., params=...) at compiler/typeinfer.jl:567
#44 0x00007fef8d70c8ee in julia_typeinf_ext_0 (linfo=..., world=25006) at compiler/typeinfer.jl:604
#45 0x00007fef8d70ced7 in jfptr_typeinf_ext_1 () from julia/build/debug/usr/lib/julia/sys-debug.so
#46 0x00007fef9ccd4657 in jl_apply_generic (args=0x7ffe487a8830, nargs=3) at julia/src/gf.c:2182
#47 0x00007fef9cd74f48 in jl_apply (args=0x7ffe487a8830, nargs=3) at julia/src/julia.h:1536
#48 0x00007fef9cd74d77 in jl_apply_with_saved_exception_state (args=0x7ffe487a8830, nargs=3, drop_exceptions=0) at julia/src/rtutils.c:257
#49 0x00007fef9cccc6f7 in jl_type_infer (pli=0x7ffe487a89b0, world=25006, force=0) at julia/src/gf.c:275
#50 0x00007fef9ccd1a4c in jl_compile_method_internal (pli=0x7ffe487a89b0, world=25006) at julia/src/gf.c:1784
#51 0x00007fef9cccb27a in jl_fptr_trampoline (m=0x7fef89b33490, args=0x7ffe487a8a30, nargs=5) at julia/src/gf.c:1828
#52 0x00007fef9ccd4657 in jl_apply_generic (args=0x7ffe487a8a30, nargs=5) at julia/src/gf.c:2182
#53 0x00007fef9cd7519b in jl_apply_2va (f=0x7fef88d88260, args=0x7ffe487a8c88, nargs=5) at julia/src/rtutils.c:296
#54 0x00007fef8d71d3ae in japi1_GeneratedFunctionStub_2436 (g=..., args...=<optimized out>) at boot.jl:506
#55 0x00007fef9cccc4ab in jl_fptr_args (m=0x7fef8e465400 <jl_system_image_data+4133696>, args=0x7ffe487a8c80, nargs=5) at julia/src/gf.c:1839
#56 0x00007fef9ccd4657 in jl_apply_generic (args=0x7ffe487a8c80, nargs=5) at julia/src/gf.c:2182
#57 0x00007fef9cd5be98 in jl_apply (args=0x7ffe487a8c80, nargs=5) at julia/src/julia.h:1536
#58 0x00007fef9cd5a2c6 in jl_call_staged (def=0x7fef890326d0, generator=0x7fef89044c10, sparam_vals=0x7fef89bd3410, args=0x7fef89b4fa98, nargs=5) at julia/src/method.c:376
#59 0x00007fef9cd59e42 in jl_code_for_staged (linfo=0x7fef89b33410) at julia/src/method.c:409
#60 0x00007fef8d61d5d5 in japi1_get_staged_98 (li=...) at compiler/utilities.jl:91
#61 0x00007fef8d61e6f1 in japi1_retrieve_code_info_96 (linfo=...) at compiler/utilities.jl:115
#62 0x00007fef8d70bc8e in Type () at compiler/inferencestate.jl:117
#63 japi1_typeinf_ext_17 (linfo=..., params=...) at compiler/typeinfer.jl:565
#64 0x00007fef8d70c8ee in julia_typeinf_ext_0 (linfo=..., world=25033) at compiler/typeinfer.jl:604
#65 0x00007fef8d70ced7 in jfptr_typeinf_ext_1 () from julia/build/debug/usr/lib/julia/sys-debug.so
#66 0x00007fef9ccd4657 in jl_apply_generic (args=0x7ffe487a9640, nargs=3) at julia/src/gf.c:2182
#67 0x00007fef9cd74f48 in jl_apply (args=0x7ffe487a9640, nargs=3) at julia/src/julia.h:1536
#68 0x00007fef9cd74d77 in jl_apply_with_saved_exception_state (args=0x7ffe487a9640, nargs=3, drop_exceptions=0) at julia/src/rtutils.c:257
#69 0x00007fef9cccc6f7 in jl_type_infer (pli=0x7ffe487a97c0, world=25033, force=0) at julia/src/gf.c:275
#70 0x00007fef9ccd1a4c in jl_compile_method_internal (pli=0x7ffe487a97c0, world=25033) at julia/src/gf.c:1784
#71 0x00007fef9cccb27a in jl_fptr_trampoline (m=0x7fef89b33410, args=0x7ffe487a9840, nargs=5) at julia/src/gf.c:1828
#72 0x00007fef9ccd4657 in jl_apply_generic (args=0x7ffe487a9840, nargs=5) at julia/src/gf.c:2182
#73 0x00007fef9cffa5e4 in do_call (args=0x7fef89b30a50, nargs=5, s=0x7ffe487a9db0) at julia/src/interpreter.c:324
#74 0x00007fef9cff9333 in eval_value (e=0x7fef89b41d10, s=0x7ffe487a9db0) at julia/src/interpreter.c:428
#75 0x00007fef9cff9cea in eval_stmt_value (stmt=0x7fef89b41d10, s=0x7ffe487a9db0) at julia/src/interpreter.c:363
#76 0x00007fef9cff8672 in eval_body (stmts=0x7fef89b58be0, s=0x7ffe487a9db0, start=0, toplevel=1) at julia/src/interpreter.c:682
#77 0x00007fef9cff8b15 in jl_interpret_toplevel_thunk_callback (s=0x7ffe487a9db0, vargs=0x7ffe487a9e18) at julia/src/interpreter.c:799
#78 0x00007fef9ccee32c in Lenter_interpreter_frame_start_val () from julia/build/debug/usr/bin/../lib/libjulia-debug.so.1
#79 0x00007fef9cff8bbd in jl_interpret_toplevel_thunk (m=0x7fef8e077500 <jl_system_image_data+13376>, src=0x7fef89b2e8b0) at julia/src/interpreter.c:808
#80 0x00007fef9cd19924 in jl_toplevel_eval_flex (m=0x7fef8e077500 <jl_system_image_data+13376>, e=0x7fef89b41db0, fast=1, expanded=1) at julia/src/toplevel.c:785
#81 0x00007fef9ccddd08 in jl_parse_eval_all (fname=0x7fef88d947d8 "/home/tbesard/Julia/Cassette/wip.jl", content=0x0, contentlen=0, inmodule=0x7fef8e077500 <jl_system_image_data+13376>) at julia/src/ast.c:838
#82 0x00007fef9cd1ae16 in jl_load (module=0x7fef8e077500 <jl_system_image_data+13376>, fname=0x7fef88d947d8 "/home/tbesard/Julia/Cassette/wip.jl") at julia/src/toplevel.c:819
#83 0x00007fef9cd1ae81 in jl_load_ (module=0x7fef8e077500 <jl_system_image_data+13376>, str=0x7fef88d947d0) at julia/src/toplevel.c:826
#84 0x00007fef8d731118 in include () at boot.jl:317
#85 japi1_include_relative_2785 (mod=..., _path=0x6) at loading.jl:1038
#86 0x00007fef8d7664a5 in japi1_include_3828 (mod=..., path=0x6) at sysimg.jl:29
#87 0x00007fef9cccc4ab in jl_fptr_args (m=0x7fef8e402ab0 <jl_system_image_data+3729904>, args=0x7ffe487ab1a0, nargs=3) at julia/src/gf.c:1839
#88 0x00007fef9ccd4657 in jl_apply_generic (args=0x7ffe487ab1a0, nargs=3) at julia/src/gf.c:2182
#89 0x00007fef8d7656e3 in julia_exec_options_2553 (opts=...) at client.jl:229
#90 0x00007fef8d765f1d in japi1__start_2508 () at client.jl:421
#91 0x00007fef9cccc4ab in jl_fptr_args (m=0x7fef8e9463e0 <jl_system_image_data+9249568>, args=0x7ffe487ab650, nargs=1) at julia/src/gf.c:1839
#92 0x00007fef9ccd4657 in jl_apply_generic (args=0x7ffe487ab650, nargs=1) at julia/src/gf.c:2182
#93 0x0000001a3030fe28 in jl_apply (args=0x7ffe487ab650, nargs=1) at julia/ui/../src/julia.h:1536
#94 0x0000001a3030f9ff in true_main (argc=1, argv=0x7ffe487ab9c0) at julia/ui/repl.c:112
#95 0x0000001a3030f88a in main (argc=1, argv=0x7ffe487ab9c0) at julia/ui/repl.c:233


(rr) f 4
#4  0x00007fef9ccce680 in jl_method_instance_add_backedge (callee=0x7fef8a1b4a90, caller=0x7fef898b9a10) at julia/src/gf.c:1431
1431        assert(callee->def.method->min_world <= caller->min_world && callee->max_world >= caller->max_world);

(rr) call jl_(caller)
setindex!(Base.SubArray{T, N, P, I, L} where L where I where P where N where T, Expr, Any)
(rr) p caller->min_world
$3 = 9970
(rr) p caller->max_world
$4 = 18446744073709551615

(rr) call jl_(callee)
_setindex!(Base.IndexLinear, Base.SubArray{T, N, P, I, L} where L where I where P where N where T, Expr, Int64)
(rr) p callee->def.method->min_world
$5 = 5549
(rr) p callee->max_world
$6 = 25006


(rr) f 49
#49 0x00007fef9cccc6f7 in jl_type_infer (pli=0x7ffe487a89b0, world=25006, force=0) at julia/src/gf.c:275
275         jl_svec_t *linfo_src = (jl_svec_t*)jl_apply_with_saved_exception_state(fargs, 3, 0);
(rr) call jl_(*pli)
overdub_generator(Type{T} where T, Type{T} where T, Type{T} where T, Tuple{DataType, DataType, DataType})

@jrevels
Copy link
Collaborator Author

jrevels commented Aug 8, 2018

If this whole bug just ended up being due to miscompile of the generator itself, that sounds like a way easier bug to fix than attaching world ages to CodeInfo objects 😛

bors bot added a commit to FluxML/Flux.jl that referenced this issue Sep 11, 2019
669: using Zygote r=MikeInnes a=MikeInnes

Otherwise known as "break all the things". This will be a huge change so I'm beginning to prepare now, even though Zygote is still a couple of months off from being really ready. **Do not try this at home** (yet) – this branch is eventually aimed at beta testers, but isn't even ready for that yet.

The idea is to break as little code as possible, which means supporting the current `Params` API; but I also want to start prototyping the nicer things discussed in #628 and other issues.

Blocking issues:

* [x] Get the tests passing.
* [x] Check tests on GPU.
* [x] Rewrite all the docs.
* [x] Cache invalidation (JuliaLabs/Cassette.jl#6).
* [x] Moving over adjoints (FluxML/Zygote.jl#81).
* [x] General Zygote robustness.

Nice to have:

* [ ] Robust nested AD (may not be a blocker if one can still use Tracker with Flux).
* [x] Zygote support for modules / globals as discussed in #628, along with #637.
* [x] Better train/test mode as in #643.

If you're the kind of person who ignores triangular road signs, you can try this with

```julia
]add Flux#zygote Zygote#master
```

Co-authored-by: Mike J Innes <mike.j.innes@gmail.com>
Co-authored-by: Elliot Saba <staticfloat@gmail.com>
Co-authored-by: thebhatman <manjunathbhat9920@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants