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

MethodError upon using check_allocs on a non-existent method #21

Closed
topolarity opened this issue Oct 23, 2023 · 1 comment · Fixed by #33
Closed

MethodError upon using check_allocs on a non-existent method #21

topolarity opened this issue Oct 23, 2023 · 1 comment · Fixed by #33
Milestone

Comments

@topolarity
Copy link
Member

julia> using AllocCheck

julia> function alloc_in_catch(x)
          try
              Base.inferencebarrier(nothing) # Prevent catch from being elided
          catch
              return Any[] # in catch block: filtered by `ignore_throw=true`
          end
          return Int64[]
       end
alloc_in_catch (generic function with 1 method)

julia> length(check_allocs(alloc_in_catch, (); ignore_throw=false))
ERROR: MethodError: no method matching alloc_in_catch()
<snip> ...

julia> function alloc_in_catch()
          return Int64[]
       end
alloc_in_catch (generic function with 2 methods)

julia> length(check_allocs(alloc_in_catch, (); ignore_throw=false))
ERROR: MethodError: no method matching alloc_in_catch()
The applicable method may be too new: running in world age 25448, while current world is 25449.
<snip> ...

The first MethodError is expected, but the second one is a surprise.

@topolarity topolarity added this to the Public MVP milestone Oct 23, 2023
@topolarity
Copy link
Member Author

Upstream issue: JuliaGPU/GPUCompiler.jl#530

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.

1 participant