We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 5330 - Blit_3or4_to_3or4__inversed_rgb crashes to terminal on win10
Summary: Blit_3or4_to_3or4__inversed_rgb crashes to terminal on win10
Status: NEW
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: don't know
Hardware: x86_64 Windows 10
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-10-26 22:19 UTC by Dustin T Irwin
Modified: 2020-10-27 09:03 UTC (History)
1 user (show)

See Also:


Attachments
testcase (1.25 KB, text/x-csrc)
2020-10-27 09:03 UTC, Sylvain
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dustin T Irwin 2020-10-26 22:19:38 UTC
Hello! I am new to game development and experimenting using Julia and https://github.com/jonathanBieler/SimpleDirectMediaLayer.jl. I am encountering a regular crash when my game engine (GameZero.jl) tries to render a SDL Texture using Blit_3or4_to_3or4__inversed_rgb.

Error message:


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 0x3b9f6a59 -- Blit_3or4_to_3or4__inversed_rgb at /workspace/srcdir/SDL2-2.0.12\src/video\SDL_blit_N.c:3173
in expression starting at C:\Users\dusty\Documents\Active_Projects\Karn.jl\start_karn.jl:6
Blit_3or4_to_3or4__inversed_rgb at /workspace/srcdir/SDL2-2.0.12\src/video\SDL_blit_N.c:3173
SDL_SoftBlit at /workspace/srcdir/SDL2-2.0.12\src/video\SDL_blit.c:88
SDL_LowerBlit_REAL at /workspace/srcdir/SDL2-2.0.12\src/video\SDL_surface.c:620 [inlined]
SDL_ConvertSurface_REAL at /workspace/srcdir/SDL2-2.0.12\src/video\SDL_surface.c:1074
SDL_CreateTextureFromSurface_REAL at /workspace/srcdir/SDL2-2.0.12\src/render\SDL_render.c:1255
CreateTextureFromSurface at C:\Users\dusty\.julia\packages\SimpleDirectMediaLayer\WmGZl\src\lib\SDL.jl:3645
unknown function (ip: 0000000060CA77DF)
#9 at .\none:0
iterate at .\generator.jl:47 [inlined]
collect at .\array.jl:686
unknown function (ip: 0000000060CA7F00)
draw at C:\Users\dusty\Documents\Active_Projects\Karn.jl\dev\GameZero\src\actor.jl:102
_broadcast_getindex_evalf at .\broadcast.jl:648 [inlined]
_broadcast_getindex at .\broadcast.jl:621 [inlined]
getindex at .\broadcast.jl:575 [inlined]
macro expansion at .\broadcast.jl:932 [inlined]
macro expansion at .\simdloop.jl:77 [inlined]
copyto! at .\broadcast.jl:931 [inlined]
copyto! at .\broadcast.jl:886 [inlined]
copy at .\broadcast.jl:862 [inlined]
materialize at .\broadcast.jl:837
unknown function (ip: 0000000060CA7760)
draw at C:\Users\dusty\Documents\Active_Projects\Karn.jl\Karn.jl:293
jl_apply at /cygdrive/d/buildbot/worker/package_win64/build/src\julia.h:1690 [inlined]
do_apply at /cygdrive/d/buildbot/worker/package_win64/build/src\builtins.c:655
jl_f__apply at /cygdrive/d/buildbot/worker/package_win64/build/src\builtins.c:669 [inlined]
jl_f__apply_latest at /cygdrive/d/buildbot/worker/package_win64/build/src\builtins.c:705
#invokelatest#1 at .\essentials.jl:710 [inlined]
invokelatest at .\essentials.jl:709 [inlined]
mainloop at C:\Users\dusty\Documents\Active_Projects\Karn.jl\dev\GameZero\src\GameZero.jl:103
rungame at C:\Users\dusty\Documents\Active_Projects\Karn.jl\dev\GameZero\src\GameZero.jl:184
jl_apply at /cygdrive/d/buildbot/worker/package_win64/build/src\julia.h:1690 [inlined]
do_call at /cygdrive/d/buildbot/worker/package_win64/build/src\interpreter.c:117   
eval_value at /cygdrive/d/buildbot/worker/package_win64/build/src\interpreter.c:206eval_stmt_value at /cygdrive/d/buildbot/worker/package_win64/build/src\interpreter.c:157 [inlined]
eval_body at /cygdrive/d/buildbot/worker/package_win64/build/src\interpreter.c:548
jl_interpret_toplevel_thunk at /cygdrive/d/buildbot/worker/package_win64/build/src\interpreter.c:660
jl_toplevel_eval_flex at /cygdrive/d/buildbot/worker/package_win64/build/src\toplevel.c:840
jl_parse_eval_all at /cygdrive/d/buildbot/worker/package_win64/build/src\ast.c:913 
jl_load_rewrite at /cygdrive/d/buildbot/worker/package_win64/build/src\toplevel.c:914 [inlined]
jl_load at /cygdrive/d/buildbot/worker/package_win64/build/src\toplevel.c:919      
do_call at /cygdrive/d/buildbot/worker/package_win64/build/src\interpreter.c:117   
eval_value at /cygdrive/d/buildbot/worker/package_win64/build/src\interpreter.c:206eval_stmt_value at /cygdrive/d/buildbot/worker/package_win64/build/src\interpreter.c:157 [inlined]
eval_body at /cygdrive/d/buildbot/worker/package_win64/build/src\interpreter.c:548 
jl_interpret_toplevel_thunk at /cygdrive/d/buildbot/worker/package_win64/build/src\interpreter.c:660
jl_toplevel_eval_flex at /cygdrive/d/buildbot/worker/package_win64/build/src\toplevel.c:840
jl_toplevel_eval_flex at /cygdrive/d/buildbot/worker/package_win64/build/src\toplevel.c:790
jl_toplevel_eval at /cygdrive/d/buildbot/worker/package_win64/build/src\toplevel.c:849 [inlined]
jl_toplevel_eval_in at /cygdrive/d/buildbot/worker/package_win64/build/src\toplevel.c:883
eval at .\boot.jl:331
eval_user_input at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\REPL\src\REPL.jl:134
repl_backend_loop at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\REPL\src\REPL.jl:195
start_repl_backend at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\REPL\src\REPL.jl:180
#run_repl#37 at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\REPL\src\REPL.jl:292
run_repl at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\REPL\src\REPL.jl:288
#807 at .\client.jl:399
jfptr_YY.807_44712.clone_1 at C:\Users\dusty\AppData\Local\Programs\Julia 1.5.2\lib\julia\sys.dll (unknown line)
jl_apply at /cygdrive/d/buildbot/worker/package_win64/build/src\julia.h:1690 [inlined]
do_apply at /cygdrive/d/buildbot/worker/package_win64/build/src\builtins.c:655     
jl_f__apply at /cygdrive/d/buildbot/worker/package_win64/build/src\builtins.c:669 [inlined]
jl_f__apply_latest at /cygdrive/d/buildbot/worker/package_win64/build/src\builtins.c:705
#invokelatest#1 at .\essentials.jl:710 [inlined]
invokelatest at .\essentials.jl:709 [inlined]
run_main_repl at .\client.jl:383
exec_options at .\client.jl:313
_start at .\client.jl:506
jfptr__start_46405.clone_1 at C:\Users\dusty\AppData\Local\Programs\Julia 1.5.2\lib\julia\sys.dll (unknown line)
jl_apply at /cygdrive/d/buildbot/worker/package_win64/build/src\julia.h:1690 [inlined]
true_main at /cygdrive/d/buildbot/worker/package_win64/build/ui\repl.c:106
wmain at /cygdrive/d/buildbot/worker/package_win64/build/ui\repl.c:227
__tmainCRTStartup at /usr/src/debug/mingw64-x86_64-runtime-7.0.0-1/crt\crtexe.c:334mainCRTStartup at /usr/src/debug/mingw64-x86_64-runtime-7.0.0-1/crt\crtexe.c:223   
BaseThreadInitThunk at C:\Windows\System32\KERNEL32.DLL (unknown line)
RtlUserThreadStart at C:\Windows\SYSTEM32\ntdll.dll (unknown line)
Allocations: 60673981 (Pool: 60655160; Big: 18821); GC: 55
Comment 1 Sylvain 2020-10-27 08:26:52 UTC
Hello,

The best to investigate would be a small test-case. (even in Julia).
and/or the image that cause the image the issue.
Comment 2 Sylvain 2020-10-27 08:28:34 UTC
maybe you can log some info in your code.

before calling:
SDL_CreateTextureFromSurface()

add something like:

SDL_Log("image w=%d h=%d pitch=%d", surface->w, surface->h, surface->pitch);
Comment 3 Sylvain 2020-10-27 09:03:23 UTC
Created attachment 4488 [details]
testcase

here's my test-case and it converts the surface with no invalid memory access.

maybe you can translate it to Julia and test it.