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

process_cov throws BoundsError: attempt to access 8-codeunit String at index [1:9] #70

Open
nickrobinson251 opened this issue Apr 21, 2023 · 2 comments

Comments

@nickrobinson251
Copy link

BoundsError: attempt to access 8-codeunit String at index [1:9]
Stacktrace:
  [1] checkbounds
    @ ./strings/basic.jl:216 [inlined]
  [2] getindex
    @ ./strings/string.jl:265 [inlined]
  [3] process_cov(filename::String, folder::String)
    @ CoverageTools ~/.julia/packages/CoverageTools/JSYpL/src/CoverageTools.jl:133
  [4] process_file(filename::String, folder::String)
    @ CoverageTools ~/.julia/packages/CoverageTools/JSYpL/src/CoverageTools.jl:232
  [5] process_folder(folder::String)
    @ CoverageTools ~/.julia/packages/CoverageTools/JSYpL/src/CoverageTools.jl:258
  [6] process_folder(folder::String) (repeats 2 times)
    @ CoverageTools ~/.julia/packages/CoverageTools/JSYpL/src/CoverageTools.jl:264
  [7] (::var"#3#4")()
    @ Main ~/test_retestitems.jl:39
  [8] with_logstate(f::Function, logstate::Any)
    @ Base.CoreLogging ./logging.jl:511
  [9] with_logger(f::Function, logger::Logging.ConsoleLogger)
    @ Base.CoreLogging ./logging.jl:623
 [10] top-level scope
    @ ~/script.jl:38

cov_segment = line[1:9]

Where ~/script.jl:38 looks like:

    Logging.with_logger(Logging.ConsoleLogger(stderr, Logging.Warn)) do
        src_coverage = Coverage.process_folder("src")
        LCOV.writefile("lcov.info", src_coverage)
    end
@nickrobinson251
Copy link
Author

also seen this when using julia-actions/julia-processcoverage@v1 with ReTestItems.jl CI
Example: https://github.com/JuliaTesting/ReTestItems.jl/actions/runs/6830744028/job/18579153092?pr=117
Logs:

Run julia-actions/julia-processcoverage@v1
  with:
    directories: src,ext
  env:
    JULIA_NUM_THREADS: 2
    JULIA_PKG_SERVER_REGISTRY_PREFERENCE: eager

Run julia --color=yes "$GITHUB_ACTION_PATH"/main.jl
  julia --color=yes "$GITHUB_ACTION_PATH"/main.jl
  shell: /bin/bash --noprofile --norc -e -o pipefail {0}
  env:
    JULIA_NUM_THREADS: 2
    JULIA_PKG_SERVER_REGISTRY_PREFERENCE: eager
    INPUT_DIRECTORIES: src,ext
  Activating new project at `~/.julia/environments/coveragetempenv`
    Updating registry at `~/.julia/registries/General.toml`
   Resolving package versions...
   Installed CoverageTools ─ v1.3.0
    Updating `~/.julia/environments/coveragetempenv/Project.toml`
  [c36e975a] + CoverageTools v1.3.0
    Updating `~/.julia/environments/coveragetempenv/Manifest.toml`
  [c36e975a] + CoverageTools v1.3.0
Precompiling project...
  ✓ CoverageTools
  1 dependency successfully precompiled in 1 seconds
[ Info: CoverageTools.process_folder: Searching src for .jl files...
[ Info: CoverageTools.process_file: Detecting coverage for src/ReTestItems.jl
[ Info: CoverageTools.process_cov: processing src/ReTestItems.jl.6082.cov
[ Info: CoverageTools.process_cov: processing src/ReTestItems.jl.6089.cov
...
...
[ Info: CoverageTools.process_cov: processing src/macros.jl.6509.cov
[ Info: CoverageTools.process_cov: processing src/macros.jl.6518.cov
[ Info: CoverageTools.process_cov: processing src/macros.jl.6522.cov
ERROR: LoadError: BoundsError: attempt to access 6-codeunit String at index [1:9]
Stacktrace:
  [1] checkbounds
    @ ./strings/basic.jl:216 [inlined]
  [2] getindex
    @ ./strings/string.jl:276 [inlined]
  [3] process_cov(filename::String, folder::SubString{String})
    @ CoverageTools ~/.julia/packages/CoverageTools/JSYpL/src/CoverageTools.jl:133
  [4] process_file(filename::String, folder::SubString{String})
    @ CoverageTools ~/.julia/packages/CoverageTools/JSYpL/src/CoverageTools.jl:232
  [5] process_folder(folder::SubString{String})
    @ CoverageTools ~/.julia/packages/CoverageTools/JSYpL/src/CoverageTools.jl:258
  [6] mapreduce_first
    @ ./reduce.jl:419 [inlined]
  [7] _mapreduce(f::typeof(process_folder), op::typeof(vcat), #unused#::IndexLinear, A::Vector{SubString{String}})
    @ Base ./reduce.jl:430
  [8] _mapreduce_dim(f::Function, op::Function, #unused#::Base._InitialValue, A::Vector{SubString{String}}, #unused#::Colon)
    @ Base ./reducedim.jl:365
  [9] #mapreduce#800
    @ ./reducedim.jl:357 [inlined]
 [10] mapreduce(f::Function, op::Function, A::Vector{SubString{String}})
    @ Base ./reducedim.jl:357
 [11] top-level scope
    @ ~/work/_actions/julia-actions/julia-processcoverage/v1/main.jl:19
in expression starting at /Users/runner/work/_actions/julia-actions/julia-processcoverage/v1/main.jl:19
Error: Process completed with exit code 1.

@pxl-th
Copy link

pxl-th commented Dec 27, 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

No branches or pull requests

2 participants