Skip to content

access violation when accessing the output of split #57

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

Open
heliosdrm opened this issue Feb 28, 2025 · 3 comments
Open

access violation when accessing the output of split #57

heliosdrm opened this issue Feb 28, 2025 · 3 comments
Labels
bug Something isn't working

Comments

@heliosdrm
Copy link

Hi. I have repeated this with and without --checkbounds=yes as recommended, in JuliaLang/julia#45124.
In both cases I get the same errors - the only difference being in the addresses of the "unknown functions" in the error messages.

Julia Version 1.10.8
Commit 4c16ff44be (2025-01-22 10:06 UTC)
Build Info:
Official https://julialang.org/ release
Platform Info:
OS: Windows (x86_64-w64-mingw32)
CPU: 20 × 12th Gen Intel(R) Core(TM) i7-12700H
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-15.0.7 (ORCJIT, alderlake)
Threads: 1 default, 0 interactive, 1 GC (on 20 virtual cores)
Environment:
JULIA_DEPOT_PATH = D:.julia

Environment:
[5ae59095] Colors v0.13.0
[5789e2e9] FileIO v1.17.0
[a09fc81d] ImageCore v0.10.5
[82e4d734] ImageIO v0.6.9
[f878e3a2] OpenCV v4.6.1

Steps to reproduce the error (the output of this example is with --checkbounds=yes.

julia> using OpenCV, FileIO, ImageCore

julia> image = load("testimage.png");

julia> typeof(image)
Matrix{RGB{N0f8}} (alias for Array{RGB{Normed{UInt8, 8}}, 2})

julia> size(image)
(4096, 4096)

julia> imageraw = collect(rawview(channelview(image)));

julia> typeof(imageraw)
Array{UInt8, 3}

julia> size(image)
(4096, 4096)

julia> size(imageraw)
(3, 4096, 4096)

julia> channels = OpenCV.split(imageraw);

julia> typeof(imageraw)
Array{UInt8, 3}

julia> typeof(channels)
Vector{Mat} (alias for Array{OpenCV.Mat, 1})

julia> size(channels)
(3,)

julia> channels[1]
1×4096×4096 OpenCV.Mat{UInt8}:
[:, :, 1] =

Please submit a bug report with steps to reproduce this fault, and any error messages that follow (in their entirety). Thanks.
Exception: EXCEPTION_ACCESS_VIOLATION at 0x23889026196 -- getindex at .\essentials.jl:14
in expression starting at none:0
getindex at .\essentials.jl:14
unknown function (ip: 0000023889026221)
getindex at D:\.julia\artifacts\ca7a8cea18e4e4448959e8e169004bad36338b4f\OpenCV\src\Mat.jl:41 [inlined]
isassigned at .\multidimensional.jl:1587
isassigned at .\subarray.jl:362
unknown function (ip: 0000023889025b19)
alignment at .\arrayshow.jl:68
_print_matrix at .\arrayshow.jl:207
print_matrix at .\arrayshow.jl:171
print_matrix at .\arrayshow.jl:171
unknown function (ip: 00000238890254bf)
_show_nd at .\arrayshow.jl:322
unknown function (ip: 0000023889023fab)
show_nd at .\arrayshow.jl:277
print_array at .\arrayshow.jl:359 [inlined]
show at .\arrayshow.jl:399
unknown function (ip: 0000023889021adf)
#55 at C:\workdir\usr\share\julia\stdlib\v1.10\REPL\src\REPL.jl:273
jfptr_YY.55_95749.1 at C:\Users\hedero\.julia\juliaup\julia-1.10.8+0.x64.w64.mingw32\lib\julia\sys.dll (unknown line)
with_repl_linfo at C:\workdir\usr\share\julia\stdlib\v1.10\REPL\src\REPL.jl:569
jfptr_with_repl_linfo_95854.1 at C:\Users\hedero\.julia\juliaup\julia-1.10.8+0.x64.w64.mingw32\lib\julia\sys.dll (unknown line)
display at C:\workdir\usr\share\julia\stdlib\v1.10\REPL\src\REPL.jl:259
display at C:\workdir\usr\share\julia\stdlib\v1.10\REPL\src\REPL.jl:278 [inlined]
display at .\multimedia.jl:340
jfptr_display_68780.1 at C:\Users\hedero\.julia\juliaup\julia-1.10.8+0.x64.w64.mingw32\lib\julia\sys.dll (unknown line)
jl_apply at C:/workdir/src\julia.h:1982 [inlined]
jl_f__call_latest at C:/workdir/src\builtins.c:812
#invokelatest#2 at .\essentials.jl:892 [inlined]
invokelatest at .\essentials.jl:889 [inlined]
print_response at C:\workdir\usr\share\julia\stdlib\v1.10\REPL\src\REPL.jl:315
#57 at C:\workdir\usr\share\julia\stdlib\v1.10\REPL\src\REPL.jl:284
jfptr_YY.57_95779.1 at C:\Users\hedero\.julia\juliaup\julia-1.10.8+0.x64.w64.mingw32\lib\julia\sys.dll (unknown line)
with_repl_linfo at C:\workdir\usr\share\julia\stdlib\v1.10\REPL\src\REPL.jl:569
jfptr_with_repl_linfo_95854.1 at C:\Users\hedero\.julia\juliaup\julia-1.10.8+0.x64.w64.mingw32\lib\julia\sys.dll (unknown line)
print_response at C:\workdir\usr\share\julia\stdlib\v1.10\REPL\src\REPL.jl:282
do_respond at C:\workdir\usr\share\julia\stdlib\v1.10\REPL\src\REPL.jl:911
jfptr_do_respond_95928.1 at C:\Users\hedero\.julia\juliaup\julia-1.10.8+0.x64.w64.mingw32\lib\julia\sys.dll (unknown line)
jl_apply at C:/workdir/src\julia.h:1982 [inlined]
jl_f__call_latest at C:/workdir/src\builtins.c:812
#invokelatest#2 at .\essentials.jl:892 [inlined]
invokelatest at .\essentials.jl:889 [inlined]
run_interface at C:\workdir\usr\share\julia\stdlib\v1.10\REPL\src\LineEdit.jl:2656
jfptr_run_interface_94667.1 at C:\Users\hedero\.julia\juliaup\julia-1.10.8+0.x64.w64.mingw32\lib\julia\sys.dll (unknown line)
run_frontend at C:\workdir\usr\share\julia\stdlib\v1.10\REPL\src\REPL.jl:1312
#62 at C:\workdir\usr\share\julia\stdlib\v1.10\REPL\src\REPL.jl:386
jfptr_YY.62_95830.1 at C:\Users\hedero\.julia\juliaup\julia-1.10.8+0.x64.w64.mingw32\lib\julia\sys.dll (unknown line)
jl_apply at C:/workdir/src\julia.h:1982 [inlined]
start_task at C:/workdir/src\task.c:1256
Allocations: 10306056 (Pool: 10298699; Big: 7357); GC: 16
@rakeshksr
Copy link
Member

@heliosdrm Tried with Julia 1.10.8 and 1.11.3 unable to reproduce error.

Following steps may solve error

  1. Try in a new environment.
  2. Try with different image.

FYI, you can load image without using ImageIO.jl and ImageCore.jl. More information can found here Reading and Writing of Images

@rakeshksr rakeshksr added the bug Something isn't working label Mar 1, 2025
@heliosdrm
Copy link
Author

heliosdrm commented Mar 1, 2025

Thank you. Tried in another machine (Ubuntu), in an environment with only OpenCV, and loading with OpenCV.imread (so that I can apply OpenCV.split directly on its output, thank you). But still the same error:

[5223] signal (11.1): Segmentation fault
in expression starting at none:0
getindex at ./essentials.jl:14
unknown function (ip: 0x7fb0f5f0e5fe)
_jl_invoke at /cache/build/builder-amdci4-6/julialang/julia-release-1-dot-10/src/gf.c:2894 [inlined]
ijl_apply_generic at /cache/build/builder-amdci4-6/julialang/julia-release-1-dot-10/src/gf.c:3076
getindex at /home/meliana/.julia/artifacts/e6d2113fc1fdb1ab1c73fa80f55773671adea089/OpenCV/src/Mat.jl:41 [inlined]

[snip]

I tried with different images. The error didn't occur on smaller ones, but it did with different images of larger size (4096x4096, as in the previous example). Might the size have something to do with it?

@rakeshksr
Copy link
Member

rakeshksr commented Mar 2, 2025

I am able to reproduce this error with the following code.

using OpenCV

img = OpenCV.Mat(ones(UInt8, (3, 4000, 4000)))
ch = OpenCV.split(img)

ch[1] # If no error, run this line multiple times

Using this image with Original (4003 x 2719) resolution also produce error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants