JuliaIO/VideoIO.jl

Test failures on 1.8.0-rc3 and nightly

IanButterworth opened this issue · 3 comments

@galenlynch any ideas with this?

Encoding Gray{N6f10} imagestack, scanline_major = true, size = 100: Error During Test at /home/runner/work/VideoIO.jl/VideoIO.jl/test/writing.jl:22
  Got exception outside of a @test
  BoundsError: attempt to access Tuple{} at index [1]
  Stacktrace:
    [1] getindex(t::Tuple, i::Int64)
    @Base./tuple.jl:29
    [2] (::Base.var"#51#52")(t::Tuple{})
    @Base./tuple.jl:313
    [3] map(f::Base.var"#51#52", t::Tuple{Tuple{Int64}, Tuple{}, Tuple{Int64}})
    @Base./tuple.jl:275
    [4] heads(::Tuple{Int64}, ::Vararg{Tuple})
    @Base./tuple.jl:313
    [5] argtail
    @./essentials.jl:309 [inlined]
    [6] tail
    @./essentials.jl:327 [inlined]
    [7] map
    @./tuple.jl:275 [inlined]
    [8] tails
    @./tuple.jl:314 [inlined]
    [9] map
    @./tuple.jl:318 [inlined]
   [10] _memory_offset(x::ReinterpretArray{UInt8, 2, N6f10, ReinterpretArray{N6f10, 2, Gray{N6f10}, Matrix{Gray{N6f10}}, true}, false}, I::Int64)
    @Base./abstractarray.jl:1220
   [11] pointer
    @./abstractarray.jl:1213 [inlined]
   [12] transfer_img_bytes_to_frame_plane!(data_ptr::Ptr{UInt8}, img::ReinterpretArray{UInt8, 2, N6f10, ReinterpretArray{N6f10, 2, Gray{N6f10}, Matrix{Gray{N6f10}}, true}, false}, px_width::Int32, px_height::Int32, data_linesize::Int32, bytes_per_sample::Int64)
    @VideoIO~/work/VideoIO.jl/VideoIO.jl/src/avframe_transfer.jl:196
   [13] transfer_img_buf_to_frame!(frame::NestedCStruct{VideoIO.libffmpeg.AVFrame}, img::ReinterpretArray{UInt16, 2, N6f10, ReinterpretArray{N6f10, 2, Gray{N6f10}, Matrix{Gray{N6f10}}, true}, false}, scanline_major::Bool)
    @VideoIO~/work/VideoIO.jl/VideoIO.jl/src/avframe_transfer.jl:272
   [14] transfer_img_buf_to_frame!
    @~/work/VideoIO.jl/VideoIO.jl/src/avframe_transfer.jl:289 [inlined]
   [15] transfer_img_buf_to_frame!
    @~/work/VideoIO.jl/VideoIO.jl/src/avframe_transfer.jl:292 [inlined]
   [16] prepare_video_frame!
    @~/work/VideoIO.jl/VideoIO.jl/src/encoding.jl:71 [inlined]
   [17] write
    @~/work/VideoIO.jl/VideoIO.jl/src/encoding.jl:88 [inlined]
   [18] write
    @~/work/VideoIO.jl/VideoIO.jl/src/encoding.jl:92 [inlined]
   [19] (::VideoIO.var"#50#51"{Vector{Matrix{Gray{N6f10}}}})(writer::VideoIO.VideoWriter{NestedCStruct{VideoIO.libffmpeg.AVFrame}})
    @VideoIO~/work/VideoIO.jl/VideoIO.jl/src/encoding.jl:503
   [20] open_video_out(f::VideoIO.var"#50#51"{Vector{Matrix{Gray{N6f10}}}}, s::String, args::Matrix{Gray{N6f10}}; kwargs::Base.Pairs{Symbol, Any, NTuple{5, Symbol}, NamedTuple{(:codec_name, :encoder_private_options, :encoder_options, :container_private_options, :scanline_major), Tuple{String, NamedTuple{(:crf, :preset), Tuple{Int64, String}}, NamedTuple{(:color_range,), Tuple{Int64}}, NamedTuple{(:movflags,), Tuple{String}}, Bool}}})
    @VideoIO~/work/VideoIO.jl/VideoIO.jl/src/encoding.jl:478
   [21] #save#49
    @~/work/VideoIO.jl/VideoIO.jl/src/encoding.jl:501 [inlined]
   [22] macro expansion
    @~/work/VideoIO.jl/VideoIO.jl/test/writing.jl:25 [inlined]
   [23] macro expansion
    @/opt/hostedtoolcache/julia/nightly/x64/share/julia/stdlib/v1.9/Test/src/Test.jl:1388 [inlined]
   [24] macro expansion
    @~/work/VideoIO.jl/VideoIO.jl/test/writing.jl:23 [inlined]
   [25] macro expansion
    @/opt/hostedtoolcache/julia/nightly/x64/share/julia/stdlib/v1.9/Test/src/Test.jl:1388 [inlined]
   [26] top-level scope
    @~/work/VideoIO.jl/VideoIO.jl/test/writing.jl:15
   [27] include(fname::String)
    @Base.MainInclude./client.jl:470
   [28] top-level scope
    @~/work/VideoIO.jl/VideoIO.jl/test/runtests.jl:23
   [29] include(fname::String)
    @Base.MainInclude./client.jl:470
   [30] top-level scope
    @none:6
   [31] eval
    @./boot.jl:370 [inlined]
   [32] exec_options(opts::Base.JLOptions)
    @Base./client.jl:272
   [33] _start()
    @Base./client.jl:514

The offending line

img_line_ptr = pointer(img, img_line_nbytes * (r - 1) + 1)

Seems like an indexing error that @inbounds is ignoring?

It's repeatable but doesn't happen on all tests

Screen Shot 2022-07-20 at 12 35 32 AM

Seems like an indexing error that @inbounds is ignoring?

Removing @inbounds leaves the same error

Turns out to be an upstream bug that'll be fixed

JuliaLang/julia#46113

Fixed upstream