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

Internal error when overdubbing HTTP.request #174

Open
christopher-dG opened this issue May 24, 2020 · 1 comment
Open

Internal error when overdubbing HTTP.request #174

christopher-dG opened this issue May 24, 2020 · 1 comment

Comments

@christopher-dG
Copy link
Contributor

christopher-dG commented May 24, 2020

I don't really know if this is a Cassette issue or a Julia issue, but the thing that's weirdest about it to me is that this big error gets thrown but it doesn't actually interrupt the function call. You can see at the bottom that a Response was returned just fine.
It also only happens on the first call, i.e. when compiling.

(test) pkg> st
Status `~/scratch/test/Project.toml`
  [7057c7e9] Cassette v0.3.3
  [cd3eb016] HTTP v0.8.14

julia> VERSION
v"1.4.1"

julia> using Cassette: Cassette

julia> using HTTP: HTTP

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

julia> c = C()
Cassette.Context{nametype(C),Nothing,Nothing,Cassette.var"##PassType#255",Nothing,Nothing}(nametype(C)(), nothing, nothing, Cassette.var"##PassType#255"(), nothing, nothing)

julia> Cassette.overdub(c, () -> HTTP.get("https://httpbin.org/anything"))
Internal error: encountered unexpected error in runtime:
AssertionError(msg="argextype only works on argument-position values")
argextype at ./compiler/utilities.jl:169
argextype at ./compiler/utilities.jl:161 [inlined]
call_sig at ./compiler/ssair/inlining.jl:875
process_simple! at ./compiler/ssair/inlining.jl:949
assemble_inline_todo! at ./compiler/ssair/inlining.jl:995
ssa_inlining_pass! at ./compiler/ssair/inlining.jl:71 [inlined]
run_passes at ./compiler/ssair/driver.jl:116
optimize at ./compiler/optimize.jl:169
typeinf at ./compiler/typeinfer.jl:33
typeinf_edge at ./compiler/typeinfer.jl:488
abstract_call_method at ./compiler/abstractinterpretation.jl:404
abstract_call_gf_by_type at ./compiler/abstractinterpretation.jl:101
abstract_call_known at ./compiler/abstractinterpretation.jl:873
abstract_call at ./compiler/abstractinterpretation.jl:895
abstract_call at ./compiler/abstractinterpretation.jl:880
abstract_eval at ./compiler/abstractinterpretation.jl:974
typeinf_local at ./compiler/abstractinterpretation.jl:1227
typeinf_nocycle at ./compiler/abstractinterpretation.jl:1283
typeinf at ./compiler/typeinfer.jl:12
typeinf_edge at ./compiler/typeinfer.jl:488
abstract_call_method at ./compiler/abstractinterpretation.jl:404
abstract_call_gf_by_type at ./compiler/abstractinterpretation.jl:101
abstract_call_known at ./compiler/abstractinterpretation.jl:873
abstract_call at ./compiler/abstractinterpretation.jl:895
abstract_call at ./compiler/abstractinterpretation.jl:880
abstract_eval at ./compiler/abstractinterpretation.jl:974
typeinf_local at ./compiler/abstractinterpretation.jl:1227
typeinf_nocycle at ./compiler/abstractinterpretation.jl:1283
typeinf at ./compiler/typeinfer.jl:12
typeinf_edge at ./compiler/typeinfer.jl:488
abstract_call_method at ./compiler/abstractinterpretation.jl:404
abstract_call_gf_by_type at ./compiler/abstractinterpretation.jl:101
abstract_call_known at ./compiler/abstractinterpretation.jl:873
abstract_call at ./compiler/abstractinterpretation.jl:895
abstract_call at ./compiler/abstractinterpretation.jl:880
abstract_eval at ./compiler/abstractinterpretation.jl:974
typeinf_local at ./compiler/abstractinterpretation.jl:1227
typeinf_nocycle at ./compiler/abstractinterpretation.jl:1283
typeinf at ./compiler/typeinfer.jl:12
typeinf_edge at ./compiler/typeinfer.jl:488
abstract_call_method at ./compiler/abstractinterpretation.jl:404
abstract_call_gf_by_type at ./compiler/abstractinterpretation.jl:101
abstract_call_known at ./compiler/abstractinterpretation.jl:873
abstract_call at ./compiler/abstractinterpretation.jl:895
abstract_call at ./compiler/abstractinterpretation.jl:880
abstract_eval at ./compiler/abstractinterpretation.jl:974
typeinf_local at ./compiler/abstractinterpretation.jl:1227
typeinf_nocycle at ./compiler/abstractinterpretation.jl:1283
typeinf at ./compiler/typeinfer.jl:12
typeinf_edge at ./compiler/typeinfer.jl:488
abstract_call_method at ./compiler/abstractinterpretation.jl:404
abstract_call_gf_by_type at ./compiler/abstractinterpretation.jl:101
abstract_call_known at ./compiler/abstractinterpretation.jl:873
abstract_call at ./compiler/abstractinterpretation.jl:895
abstract_call at ./compiler/abstractinterpretation.jl:880
abstract_eval at ./compiler/abstractinterpretation.jl:974
typeinf_local at ./compiler/abstractinterpretation.jl:1227
typeinf_nocycle at ./compiler/abstractinterpretation.jl:1283
typeinf at ./compiler/typeinfer.jl:12
typeinf_edge at ./compiler/typeinfer.jl:488
abstract_call_method at ./compiler/abstractinterpretation.jl:404
abstract_call_gf_by_type at ./compiler/abstractinterpretation.jl:101
abstract_call_known at ./compiler/abstractinterpretation.jl:873
abstract_call at ./compiler/abstractinterpretation.jl:895
abstract_call at ./compiler/abstractinterpretation.jl:880
abstract_eval at ./compiler/abstractinterpretation.jl:974
typeinf_local at ./compiler/abstractinterpretation.jl:1227
typeinf_nocycle at ./compiler/abstractinterpretation.jl:1283
typeinf at ./compiler/typeinfer.jl:12
typeinf_ext at ./compiler/typeinfer.jl:574
typeinf_ext at ./compiler/typeinfer.jl:605
jfptr_typeinf_ext_1.clone_1 at /home/degraafc/.local/share/asdf/installs/julia/1.4.1/julia/lib/julia/sys.so (unknown line)
_jl_invoke at /buildworker/worker/package_linux64/build/src/gf.c:2144 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2322
jl_apply at /buildworker/worker/package_linux64/build/src/julia.h:1700 [inlined]
jl_type_infer at /buildworker/worker/package_linux64/build/src/gf.c:213
jl_compile_method_internal at /buildworker/worker/package_linux64/build/src/gf.c:1887
_jl_invoke at /buildworker/worker/package_linux64/build/src/gf.c:2153 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2322
#getconnection#29 at /home/degraafc/.local/share/julia/packages/HTTP/GkPBm/src/ConnectionPool.jl:669 [inlined]
recurse at /home/degraafc/.local/share/julia/packages/Cassette/158rp/src/overdub.jl:0
getconnection##kw at /home/degraafc/.local/share/julia/packages/HTTP/GkPBm/src/ConnectionPool.jl:666 [inlined]
#newconnection#25 at /home/degraafc/.local/share/julia/packages/HTTP/GkPBm/src/ConnectionPool.jl:583 [inlined]
recurse at /home/degraafc/.local/share/julia/packages/Cassette/158rp/src/overdub.jl:0
newconnection##kw at /home/degraafc/.local/share/julia/packages/HTTP/GkPBm/src/ConnectionPool.jl:583 [inlined]
#getconnection#22 at /home/degraafc/.local/share/julia/packages/HTTP/GkPBm/src/ConnectionPool.jl:527 [inlined]
recurse at /home/degraafc/.local/share/julia/packages/Cassette/158rp/src/overdub.jl:0
getconnection##kw at /home/degraafc/.local/share/julia/packages/HTTP/GkPBm/src/ConnectionPool.jl:513 [inlined]
#request#1 at /home/degraafc/.local/share/julia/packages/HTTP/GkPBm/src/ConnectionRequest.jl:73 [inlined]
recurse at /home/degraafc/.local/share/julia/packages/Cassette/158rp/src/overdub.jl:0
request##kw at /home/degraafc/.local/share/julia/packages/HTTP/GkPBm/src/ConnectionRequest.jl:62 [inlined]
#request#1 at /home/degraafc/.local/share/julia/packages/HTTP/GkPBm/src/ExceptionRequest.jl:19 [inlined]
recurse at /home/degraafc/.local/share/julia/packages/Cassette/158rp/src/overdub.jl:0
recurse at /home/degraafc/.local/share/julia/packages/Cassette/158rp/src/overdub.jl:580 [inlined]
request##kw at /home/degraafc/.local/share/julia/packages/HTTP/GkPBm/src/ExceptionRequest.jl:19 [inlined]
#58#59 at ./error.jl:288 [inlined]
recurse at /home/degraafc/.local/share/julia/packages/Cassette/158rp/src/overdub.jl:0
recurse at /home/degraafc/.local/share/julia/packages/Cassette/158rp/src/overdub.jl:580 [inlined]
58#60##kw at ./error.jl:284 [inlined]
#request#1 at /home/degraafc/.local/share/julia/packages/HTTP/GkPBm/src/RetryRequest.jl:44 [inlined]
request##kw at /home/degraafc/.local/share/julia/packages/HTTP/GkPBm/src/RetryRequest.jl:31 [inlined]
#request#1 at /home/degraafc/.local/share/julia/packages/HTTP/GkPBm/src/MessageRequest.jl:51 [inlined]
overdub at /home/degraafc/.local/share/julia/packages/Cassette/158rp/src/overdub.jl:0
_jl_invoke at /buildworker/worker/package_linux64/build/src/gf.c:2158 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2322
request at /home/degraafc/.local/share/julia/packages/HTTP/GkPBm/src/MessageRequest.jl:28 [inlined]
overdub at /home/degraafc/.local/share/julia/packages/Cassette/158rp/src/overdub.jl:0
#request#1 at /home/degraafc/.local/share/julia/packages/HTTP/GkPBm/src/BasicAuthRequest.jl:28 [inlined]
overdub at /home/degraafc/.local/share/julia/packages/Cassette/158rp/src/overdub.jl:0
request at /home/degraafc/.local/share/julia/packages/HTTP/GkPBm/src/BasicAuthRequest.jl:21 [inlined]
overdub at /home/degraafc/.local/share/julia/packages/Cassette/158rp/src/overdub.jl:0
_jl_invoke at /buildworker/worker/package_linux64/build/src/gf.c:2158 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2322
#request#1 at /home/degraafc/.local/share/julia/packages/HTTP/GkPBm/src/RedirectRequest.jl:24 [inlined]
overdub at /home/degraafc/.local/share/julia/packages/Cassette/158rp/src/overdub.jl:0
request at /home/degraafc/.local/share/julia/packages/HTTP/GkPBm/src/RedirectRequest.jl:21 [inlined]
overdub at /home/degraafc/.local/share/julia/packages/Cassette/158rp/src/overdub.jl:0
_jl_invoke at /buildworker/worker/package_linux64/build/src/gf.c:2158 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2322
#request#4 at /home/degraafc/.local/share/julia/packages/HTTP/GkPBm/src/HTTP.jl:314 [inlined]
overdub at /home/degraafc/.local/share/julia/packages/Cassette/158rp/src/overdub.jl:0
request at /home/degraafc/.local/share/julia/packages/HTTP/GkPBm/src/HTTP.jl:314 [inlined]
request at /home/degraafc/.local/share/julia/packages/HTTP/GkPBm/src/HTTP.jl:314 [inlined]
#get#12 at /home/degraafc/.local/share/julia/packages/HTTP/GkPBm/src/HTTP.jl:389 [inlined]
get at /home/degraafc/.local/share/julia/packages/HTTP/GkPBm/src/HTTP.jl:389 [inlined]
#4 at ./REPL[5]:1 [inlined]
overdub at /home/degraafc/.local/share/julia/packages/Cassette/158rp/src/overdub.jl:0
unknown function (ip: 0x7fad21392bdc)
_jl_invoke at /buildworker/worker/package_linux64/build/src/gf.c:2158 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2322
jl_apply at /buildworker/worker/package_linux64/build/src/julia.h:1700 [inlined]
do_call at /buildworker/worker/package_linux64/build/src/interpreter.c:369
eval_value at /buildworker/worker/package_linux64/build/src/interpreter.c:458
eval_stmt_value at /buildworker/worker/package_linux64/build/src/interpreter.c:409 [inlined]
eval_body at /buildworker/worker/package_linux64/build/src/interpreter.c:817
jl_interpret_toplevel_thunk at /buildworker/worker/package_linux64/build/src/interpreter.c:911
top-level scope at REPL[5]:1
jl_toplevel_eval_flex at /buildworker/worker/package_linux64/build/src/toplevel.c:814
jl_toplevel_eval_flex at /buildworker/worker/package_linux64/build/src/toplevel.c:764
jl_toplevel_eval_in at /buildworker/worker/package_linux64/build/src/toplevel.c:843
eval at ./boot.jl:331
_jl_invoke at /buildworker/worker/package_linux64/build/src/gf.c:2144 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2322
eval_user_input at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.4/REPL/src/REPL.jl:86
run_backend at /home/degraafc/.local/share/julia/packages/Revise/jVsKo/src/Revise.jl:1023
_jl_invoke at /buildworker/worker/package_linux64/build/src/gf.c:2158 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2322
jl_apply at /buildworker/worker/package_linux64/build/src/julia.h:1700 [inlined]
do_call at /buildworker/worker/package_linux64/build/src/interpreter.c:369
eval_value at /buildworker/worker/package_linux64/build/src/interpreter.c:458
eval_stmt_value at /buildworker/worker/package_linux64/build/src/interpreter.c:409 [inlined]
eval_body at /buildworker/worker/package_linux64/build/src/interpreter.c:817
jl_interpret_toplevel_thunk at /buildworker/worker/package_linux64/build/src/interpreter.c:911
top-level scope at REPL[1]:0
jl_toplevel_eval_flex at /buildworker/worker/package_linux64/build/src/toplevel.c:814
jl_toplevel_eval_in at /buildworker/worker/package_linux64/build/src/toplevel.c:843
eval at ./boot.jl:331
_jl_invoke at /buildworker/worker/package_linux64/build/src/gf.c:2144 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2322
eval_user_input at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.4/REPL/src/REPL.jl:86
macro expansion at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.4/REPL/src/REPL.jl:118 [inlined]
#26 at ./task.jl:358
_jl_invoke at /buildworker/worker/package_linux64/build/src/gf.c:2144 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2322
jl_apply at /buildworker/worker/package_linux64/build/src/julia.h:1700 [inlined]
start_task at /buildworker/worker/package_linux64/build/src/task.c:687
unknown function (ip: (nil))
HTTP.Messages.Response:
"""
HTTP/1.1 200 OK
Date: Sun, 24 May 2020 05:38:26 GMT
Content-Type: application/json
Content-Length: 351
Connection: keep-alive
Server: gunicorn/19.9.0
Access-Control-Allow-Origin: *
Access-Control-Allow-Credentials: true

{
  "args": {},
  "data": "",
  "files": {},
  "form": {},
  "headers": {
    "Content-Length": "0",
    "Host": "httpbin.org",
    "User-Agent": "HTTP.jl/1.4.1",
    "X-Amzn-Trace-Id": "Root=1-5eca0852-4fb79fbe0e06a7ec4a68c82c"
  },
  "json": null,
  "method": "GET",
  "origin": "redacted",
  "url": "https://httpbin.org/anything"
}
"""
@vchuravy
Copy link
Member

Interesting either Cassette generated invalid IR or we hit an internal bug (or both) ;)

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

No branches or pull requests

2 participants