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

Handle ExceptionStack in code_typed(err) #558

Open
vchuravy opened this issue Apr 4, 2024 · 0 comments
Open

Handle ExceptionStack in code_typed(err) #558

vchuravy opened this issue Apr 4, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@vchuravy
Copy link
Member

vchuravy commented Apr 4, 2024

julia> @cuda demo(A)
ERROR: InvalidIRError: compiling MethodInstance for demo(::CuDeviceVector{Float32, 1}) resulted in invalid LLVM IR
Reason: unsupported call to an unknown function (call to julia.new_gc_frame)
Reason: unsupported call to an unknown function (call to julia.push_gc_frame)
Reason: unsupported call to an unknown function (call to julia.get_gc_frame_slot)
Reason: unsupported call to an unknown function (call to julia.pop_gc_frame)
Hint: catch this exception as `err` and call `code_typed(err; interactive = true)` to introspect the erronous code with Cthulhu.j

Nowadays in the REPL the last error is in err (Not sure when that was added)

julia> err
1-element ExceptionStack:
InvalidIRError: compiling MethodInstance for demo(::CuDeviceVector{Float32, 1}) resulted in invalid LLVM IR
julia> code_typed(err; interactive = true)
ERROR: MethodError: no method matching code_typed_by_type(::Type{Tuple{Base.ExceptionStack, Vararg{Any}}}; interactive::Bool)

Closest candidates are:
  code_typed_by_type(::Type; optimize, debuginfo, world, interp) got unsupported keyword argument "interactive"
   @ Base reflection.jl:1381

Works:

code_typed(first(err.stack).exception; interactive = true)
@vchuravy vchuravy added the enhancement New feature or request label Apr 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant