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

TypeError: in cglobal, expected Symbol, got JuliaInterpreter.SSAValue #354

Closed
fredrikekre opened this issue Dec 9, 2019 · 3 comments · Fixed by #459
Closed

TypeError: in cglobal, expected Symbol, got JuliaInterpreter.SSAValue #354

fredrikekre opened this issue Dec 9, 2019 · 3 comments · Fixed by #459
Labels
bug Something isn't working

Comments

@fredrikekre
Copy link
Contributor

fredrikekre commented Dec 9, 2019

The following code only interprets after running it in compiled mode once:

using HTTP, JuliaInterpreter
method = "GET"
url = "https://api.github.com/"
headers = Dict("User-Agent" => "Debugger.jl")
julia> @interpret HTTP.request(method, url, headers)
ERROR: TypeError: in cglobal, expected Symbol, got JuliaInterpreter.SSAValue
Stacktrace:
 [1] #evaluate_call_recurse!#48(::Bool, ::typeof(JuliaInterpreter.evaluate_call_recurse!), ::Any, ::Frame, ::Expr) at /home/fredrik/.julia/packages/JuliaInterpreter/ATirK/src/interpret.jl:213
 [2] evaluate_call_recurse! at /home/fredrik/.julia/packages/JuliaInterpreter/ATirK/src/interpret.jl:202 [inlined]
 [3] eval_rhs(::Any, ::Frame, ::Expr) at /home/fredrik/.julia/packages/JuliaInterpreter/ATirK/src/interpret.jl:379
 [4] step_expr!(::Any, ::Frame, ::Any, ::Bool) at /home/fredrik/.julia/packages/JuliaInterpreter/ATirK/src/interpret.jl:519
 [5] step_expr!(::Any, ::Frame, ::Bool) at /home/fredrik/.julia/packages/JuliaInterpreter/ATirK/src/interpret.jl:558
 [6] finish!(::Any, ::Frame, ::Bool) at /home/fredrik/.julia/packages/JuliaInterpreter/ATirK/src/commands.jl:14
 [7] finish_and_return! at /home/fredrik/.julia/packages/JuliaInterpreter/ATirK/src/commands.jl:29 [inlined]
 [8] #evaluate_call_recurse!#48(::Bool, ::typeof(JuliaInterpreter.evaluate_call_recurse!), ::Any, ::Frame, ::Expr) at /home/fredrik/.julia/packages/JuliaInterpreter/ATirK/src/interpret.jl:240
 ... (the last 7 lines are repeated 7 more times)
 [58] evaluate_call_recurse! at /home/fredrik/.julia/packages/JuliaInterpreter/ATirK/src/interpret.jl:202 [inlined]
 [59] eval_rhs(::Any, ::Frame, ::Expr) at /home/fredrik/.julia/packages/JuliaInterpreter/ATirK/src/interpret.jl:379
 [60] step_expr!(::Any, ::Frame, ::Any, ::Bool) at /home/fredrik/.julia/packages/JuliaInterpreter/ATirK/src/interpret.jl:435
 [61] step_expr!(::Any, ::Frame, ::Bool) at /home/fredrik/.julia/packages/JuliaInterpreter/ATirK/src/interpret.jl:558
 [62] finish!(::Any, ::Frame, ::Bool) at /home/fredrik/.julia/packages/JuliaInterpreter/ATirK/src/commands.jl:14
 [63] finish_and_return! at /home/fredrik/.julia/packages/JuliaInterpreter/ATirK/src/commands.jl:29 [inlined]
 [64] #evaluate_call_recurse!#48(::Bool, ::typeof(JuliaInterpreter.evaluate_call_recurse!), ::Any, ::Frame, ::Expr) at /home/fredrik/.julia/packages/JuliaInterpreter/ATirK/src/interpret.jl:240
 [65] evaluate_call_recurse! at /home/fredrik/.julia/packages/JuliaInterpreter/ATirK/src/interpret.jl:202 [inlined]
 [66] eval_rhs(::Any, ::Frame, ::Expr) at /home/fredrik/.julia/packages/JuliaInterpreter/ATirK/src/interpret.jl:379
 [67] step_expr!(::Any, ::Frame, ::Any, ::Bool) at /home/fredrik/.julia/packages/JuliaInterpreter/ATirK/src/interpret.jl:519
 ... (the last 7 lines are repeated 3 more times)
 [89] step_expr!(::Any, ::Frame, ::Bool) at /home/fredrik/.julia/packages/JuliaInterpreter/ATirK/src/interpret.jl:558
 [90] finish!(::Any, ::Frame, ::Bool) at /home/fredrik/.julia/packages/JuliaInterpreter/ATirK/src/commands.jl:14
 [91] finish_and_return! at /home/fredrik/.julia/packages/JuliaInterpreter/ATirK/src/commands.jl:29 [inlined]
 [92] finish_and_return! at /home/fredrik/.julia/packages/JuliaInterpreter/ATirK/src/commands.jl:33 [inlined] (repeats 2 times)

But running it once in compiled mode fixes the intepreted run:

HTTP.request(method, url, headers) # -> 200 OK
@interpret HTTP.request(method, url, headers) # -> 200 OK

Edit:
JuliaInterpreter: 8578fc0
HTTP: JuliaWeb/HTTP.jl@33261a6

@KristofferC
Copy link
Member

But running it once in compiled mode fixes the intepreted run:

Hmm... that's odd.

@thudjx
Copy link

thudjx commented Jul 14, 2020

I got the same error when debugging using Juno, but it disappears if I run the whole script by command line.

@KristofferC KristofferC added the bug Something isn't working label Jul 14, 2020
timholy added a commit that referenced this issue Dec 16, 2020
This supports SSAValue args for cglobal while also fixing a bug
in which a GotoIfNot ended up going to the wrong statement.
The latter was a consequence of incorrect :call unnesting.

Fixes #455
Fixes #454
Fixes #415
Fixes JuliaDebug/Debugger.jl#275
Improves #354
@timholy
Copy link
Member

timholy commented Dec 16, 2020

This is almost fixed by #456, and I know what needs to be done for the rest.

timholy added a commit that referenced this issue Dec 17, 2020
This supports SSAValue args for cglobal while also fixing a bug
in which a GotoIfNot ended up going to the wrong statement.
The latter was a consequence of incorrect :call unnesting.

Fixes #455
Fixes #454
Fixes #415
Fixes JuliaDebug/Debugger.jl#275
Improves #354
timholy added a commit that referenced this issue Dec 17, 2020
This has an llvmcall doing an atomic operation...just avoid the hassle
and call it directly.

Fixes #354
timholy added a commit that referenced this issue Dec 17, 2020
This has an llvmcall doing an atomic operation...just avoid the hassle
and call it directly.

Fixes #354
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants