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

Collection has multiple elements, expected exactly 1 element #14

Closed
baggepinnen opened this issue Oct 18, 2023 · 0 comments · Fixed by #23
Closed

Collection has multiple elements, expected exactly 1 element #14

baggepinnen opened this issue Oct 18, 2023 · 0 comments · Fixed by #23
Milestone

Comments

@baggepinnen
Copy link
Contributor

I might have stumbled upon a little bug

julia> using AllocCheck
[ Info: Precompiling AllocCheck [9b6a8646-10ed-4001-bbdc-1d2f46dfbb1a]

julia> function controller(verbose::Bool)
                  a = 0.0
                  for i = 1:100
                      a = a + i
                      verbose && @info "a = $a"
                      Libc.systemsleep(0.01)
                  end
              end
controller (generic function with 1 method)

julia> check_allocs(controller, (Bool,))

ERROR: ArgumentError: Collection has multiple elements, must contain exactly 1 element
Stacktrace:
 [1] only
   @ AllocCheck ./iterators.jl:1527 [inlined]
 [2] rename_calls_and_throws!(f::LLVM.Function, job::GPUCompiler.CompilerJob{GPUCompiler.NativeCompilerTarget, AllocCheck.NativeParams})
   @ AllocCheck ~/.julia/dev/AllocCheck/src/AllocCheck.jl:193
 [3] (::AllocCheck.var"#15#16"{Bool, Vector{AllocCheck.AllocInstance}, GPUCompiler.CompilerJob{GPUCompiler.NativeCompilerTarget, AllocCheck.NativeParams}})(ctx::LLVM.Context)
   @ AllocCheck ~/.julia/dev/AllocCheck/src/AllocCheck.jl:258
 [4] JuliaContext(f::AllocCheck.var"#15#16"{Bool, Vector{AllocCheck.AllocInstance}, GPUCompiler.CompilerJob{GPUCompiler.NativeCompilerTarget, AllocCheck.NativeParams}})
   @ GPUCompiler ~/.julia/packages/GPUCompiler/2mJjc/src/driver.jl:47
 [5] #check_allocs#14
   @ AllocCheck ~/.julia/dev/AllocCheck/src/AllocCheck.jl:246 [inlined]
 [6] check_allocs(func::Any, types::Any)
   @ AllocCheck ~/.julia/dev/AllocCheck/src/AllocCheck.jl:243
 [7] top-level scope
   @ REPL[4]:1
topolarity added a commit that referenced this issue Oct 23, 2023
It turns out that optimization passes can cause this usage to get split
downstream, so we should mark all of these paths as entering the catch
block.

Resolves #14.
topolarity added a commit that referenced this issue Oct 23, 2023
It turns out that optimization passes can cause this usage to get split
downstream, so we should mark all of these paths as entering the catch
block.

Resolves #14.
topolarity added a commit that referenced this issue Oct 23, 2023
It turns out that optimization passes can cause this usage to get split
downstream, so we should mark all of these paths as entering the catch
block.

Resolves #14.
@topolarity topolarity added this to the Public MVP milestone Oct 23, 2023
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.

2 participants