Access violation during rendering for AMD graphics
kongr45gpen opened this issue · comments
CasparCG crashes whenever any type of media (image/video) is played. Only a black screen is shown on the output.
Program output:
Type "q" to close application.
Logging [info] or higher severity to log/
[2023-03-06 23:10:59.980] [info] ############################################################################
[2023-03-06 23:10:59.981] [info] CasparCG Server is distributed by the Swedish Broadcasting Corporation (SVT)
[2023-03-06 23:10:59.981] [info] under the GNU General Public License GPLv3 or higher.
[2023-03-06 23:10:59.981] [info] Please see LICENSE.TXT for details.
[2023-03-06 23:10:59.981] [info] http://www.casparcg.com/
[2023-03-06 23:10:59.981] [info] ############################################################################
[2023-03-06 23:10:59.981] [info] Starting CasparCG Video and Graphics Playout Server 2.4.0 435921f55 Dev
[2023-03-06 23:10:59.983] [info] "F:/Users\kongr45gpen\Documents\casparcg-server-master\build2\shell\Debug\casparcg.config":
[2023-03-06 23:10:59.983] [info] -----------------------------------------
[2023-03-06 23:10:59.983] [info] <?xml version="1.0" encoding="utf-8"?>
[2023-03-06 23:10:59.983] [info] <configuration>
[2023-03-06 23:10:59.983] [info] <paths>
[2023-03-06 23:10:59.983] [info] <media-path>D:\Downloads\casparcg-server-v2.3.3-lts-stable\media</media-path>
[2023-03-06 23:10:59.983] [info] <log-path>log/</log-path>
[2023-03-06 23:10:59.983] [info] <data-path>data/</data-path>
[2023-03-06 23:10:59.983] [info] <template-path>template/</template-path>
[2023-03-06 23:10:59.983] [info] </paths>
[2023-03-06 23:10:59.983] [info] <lock-clear-phrase>secret</lock-clear-phrase>
[2023-03-06 23:10:59.983] [info] <channels>
[2023-03-06 23:10:59.983] [info] <channel>
[2023-03-06 23:10:59.983] [info] <video-mode>720p5000</video-mode>
[2023-03-06 23:10:59.983] [info] <consumers>
[2023-03-06 23:10:59.983] [info] <screen/>
[2023-03-06 23:10:59.983] [info] <system-audio/>
[2023-03-06 23:10:59.983] [info] </consumers>
[2023-03-06 23:10:59.983] [info] </channel>
[2023-03-06 23:10:59.983] [info] </channels>
[2023-03-06 23:10:59.983] [info] <controllers>
[2023-03-06 23:10:59.983] [info] <tcp>
[2023-03-06 23:10:59.983] [info] <port>5250</port>
[2023-03-06 23:10:59.983] [info] <protocol>AMCP</protocol>
[2023-03-06 23:10:59.983] [info] </tcp>
[2023-03-06 23:10:59.983] [info] </controllers>
[2023-03-06 23:10:59.983] [info] <amcp>
[2023-03-06 23:10:59.983] [info] <media-server>
[2023-03-06 23:10:59.983] [info] <host>localhost</host>
[2023-03-06 23:10:59.983] [info] <port>8000</port>
[2023-03-06 23:10:59.983] [info] </media-server>
[2023-03-06 23:10:59.983] [info] </amcp>
[2023-03-06 23:10:59.983] [info] </configuration>
[2023-03-06 23:10:59.983] [info] -----------------------------------------
[2023-03-06 23:10:59.983] [info] Initialized video modes.
[2023-03-06 23:11:00.184] [info] Initializing OpenGL Device.
[2023-03-06 23:11:00.191] [info] Initialized OpenGL 4.5.0 Core Profile Context 23.2.2.230217 ATI Technologies Inc.
[2023-03-06 23:11:00.280] [info] Initialized OpenGL Accelerated GPU Image Mixer for channel 1
[2023-03-06 23:11:00.281] [info] video_channel[1|720p5000] Successfully Initialized.
[2023-03-06 23:11:00.281] [info] Initialized channels.
[2023-03-06 23:11:00.291] [info] Initialized command repository.
[2023-03-06 23:11:00.292] [info] Initialized image module.
[2023-03-06 23:11:00.293] [info] Initialized ffmpeg module.
[2023-03-06 23:11:00.293] [info] Initialized oal module.
[2023-03-06 23:11:00.293] [info] Initialized decklink module.
[2023-03-06 23:11:00.293] [info] Initialized screen module.
[2023-03-06 23:11:00.293] [info] Initialized newtek module.
[2023-03-06 23:11:00.413] [info] Initialized html module.
[2023-03-06 23:11:00.413] [info] Flash support is disabled
[2023-03-06 23:11:00.413] [info] Initialized flash module.
[2023-03-06 23:11:00.421] [info] Initialized bluefish module.
[2023-03-06 23:11:00.421] [info] Initialized modules.
[2023-03-06 23:11:00.425] [info] Screen consumer [1|720p5000] Initialized.
[2023-03-06 23:11:00.463] [info] oal[1|720p5000] Initialized.
[2023-03-06 23:11:00.463] [info] Initialized startup producers.
[2023-03-06 23:11:00.464] [info] Initialized controllers.
[2023-03-06 23:11:00.464] [info] Initialized osc.
[2023-03-06 23:11:00.930] [info] async_event_server[:5250] Accepted connection from 127.0.0.1 (1 connections).
[2023-03-06 23:11:00.931] [info] Received message from 127.0.0.1: VERSION SERVER\r\n
[2023-03-06 23:11:00.931] [info] Sent message to 127.0.0.1:201 VERSION OK\r\n2.4.0 435921f55 Dev\r\n
[2023-03-06 23:11:00.933] [info] Received message from 127.0.0.1: INFO\r\n
[2023-03-06 23:11:00.933] [info] Sent message to 127.0.0.1:200 INFO OK\r\n1 720p5000 PLAYING\r\n\r\n
[2023-03-06 23:11:00.934] [info] Received message from 127.0.0.1: CLS\r\n
[2023-03-06 23:11:00.936] [info] Received message from 127.0.0.1: TLS\r\n
[2023-03-06 23:11:00.937] [info] Received message from 127.0.0.1: DATA LIST\r\n
[2023-03-06 23:11:00.939] [info] Received message from 127.0.0.1: THUMBNAIL LIST\r\n
[2023-03-06 23:11:00.950] [info] Sent message to 127.0.0.1:200 CLS OK\r\n"IMG_20190111_204645" STILL 301960 20230306210915 NaN 0/0\r\n"IMG_20191002_101327" STILL 9581747 20230306210915 NaN 0/0\r\n"IMG_9801" STILL 460579 20230306210915 NaN 0/0\r\n"P9081928" STILL 138499 20230306210915 NaN 0/0\r\n\r\n
[2023-03-06 23:11:00.953] [info] Sent message to 127.0.0.1:200 TLS OK\r\n\r\n
[2023-03-06 23:11:00.953] [info] Sent message to 127.0.0.1:200 DATA LIST OK\r\n\r\n
[2023-03-06 23:11:00.966] [info] Sent message to 127.0.0.1:200 THUMBNAIL LIST OK\r\n"IMG_20190111_204645" 20230306T210915 119942\r\n"IMG_20191002_101327" 20230306T210915 120826\r\n"IMG_9801" 20230306T210915 103154\r\n"P9081928" 20230306T210915 95117\r\n\r\n
[2023-03-06 23:11:06.126] [info] Received message from 127.0.0.1: PLAY 1-10 "P9081928" CUT 0 Linear RIGHT\r\n
[2023-03-06 23:11:06.159] [info] image_producer[D:\Downloads\casparcg-server-v2.3.3-lts-stable\media/P9081928.jpg] Initialized
[2023-03-06 23:11:06.163] [info] Sent message to 127.0.0.1:202 PLAY OK\r\n
[2023-03-06 23:11:06.195] [error] Exception: No diagnostic information available.
[2023-03-06 23:11:06.195] [error] 0# boost::stacktrace::basic_stacktrace<std::allocator<boost::stacktrace::frame> >::init at F:\Users\kongr45gpen\Documents\casparcg-server-master\build2\packages\boost.1.66.0.0\lib\native\include\boost\stacktrace\stacktrace.hpp:81
[2023-03-06 23:11:06.195] [error] 1# boost::stacktrace::basic_stacktrace<std::allocator<boost::stacktrace::frame> >::basic_stacktrace<std::allocator<boost::stacktrace::frame> > at F:\Users\kongr45gpen\Documents\casparcg-server-master\build2\packages\boost.1.66.0.0\lib\native\include\boost\stacktrace\stacktrace.hpp:130
[2023-03-06 23:11:06.195] [error] 2# caspar::log::get_stack_trace at F:\Users\kongr45gpen\Documents\casparcg-server-master\src\common\log.h:70
[2023-03-06 23:11:06.195] [error] 3# `<lambda_6fd6cfcb15ba4a876d28eb54d7959cea>::operator()'::`1'::catch$39 at F:\Users\kongr45gpen\Documents\casparcg-server-master\src\core\video_channel.cpp:184
[2023-03-06 23:11:06.195] [error] 4# 0x00007FFFC8601080 in VCRUNTIME140_1D
[2023-03-06 23:11:06.195] [error] 5# _NLG_Return2 in VCRUNTIME140_1D
[2023-03-06 23:11:06.195] [error] 6# RtlCaptureContext2 in ntdll
[2023-03-06 23:11:06.195] [error] 7# <lambda_6fd6cfcb15ba4a876d28eb54d7959cea>::operator() at F:\Users\kongr45gpen\Documents\casparcg-server-master\src\core\video_channel.cpp:157
[2023-03-06 23:11:06.195] [error] 8# std::invoke<<lambda_6fd6cfcb15ba4a876d28eb54d7959cea> > at F:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\include\type_traits:1565
[2023-03-06 23:11:06.195] [error] 9# std::thread::_Invoke<std::tuple<<lambda_6fd6cfcb15ba4a876d28eb54d7959cea> >,0> at F:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\include\thread:56
[2023-03-06 23:11:06.195] [error] 10# register_onexit_function in ucrtbased
[2023-03-06 23:11:06.195] [error] 11# BaseThreadInitThunk in KERNEL32
[2023-03-06 23:11:06.195] [error] 12# RtlUserThreadStart in ntdll
[2023-03-06 23:11:06.195] [error]
[2023-03-06 23:11:09.663] [error] Exception: Dynamic exception type: class std::future_error
[2023-03-06 23:11:09.663] [error] std::exception::what: no state
[2023-03-06 23:11:09.663] [error]
[2023-03-06 23:11:09.663] [error] 0# boost::stacktrace::basic_stacktrace<std::allocator<boost::stacktrace::frame> >::init at F:\Users\kongr45gpen\Documents\casparcg-server-master\build2\packages\boost.1.66.0.0\lib\native\include\boost\stacktrace\stacktrace.hpp:81
[2023-03-06 23:11:09.663] [error] 1# boost::stacktrace::basic_stacktrace<std::allocator<boost::stacktrace::frame> >::basic_stacktrace<std::allocator<boost::stacktrace::frame> > at F:\Users\kongr45gpen\Documents\casparcg-server-master\build2\packages\boost.1.66.0.0\lib\native\include\boost\stacktrace\stacktrace.hpp:130
[2023-03-06 23:11:09.663] [error] 2# caspar::log::get_stack_trace at F:\Users\kongr45gpen\Documents\casparcg-server-master\src\common\log.h:70
[2023-03-06 23:11:09.663] [error] 3# `<lambda_6fd6cfcb15ba4a876d28eb54d7959cea>::operator()'::`1'::catch$39 at F:\Users\kongr45gpen\Documents\casparcg-server-master\src\core\video_channel.cpp:184
[2023-03-06 23:11:09.663] [error] 4# 0x00007FFFC8601080 in VCRUNTIME140_1D
[2023-03-06 23:11:09.663] [error] 5# _NLG_Return2 in VCRUNTIME140_1D
[2023-03-06 23:11:09.663] [error] 6# RtlCaptureContext2 in ntdll
[2023-03-06 23:11:09.663] [error] 7# <lambda_6fd6cfcb15ba4a876d28eb54d7959cea>::operator() at F:\Users\kongr45gpen\Documents\casparcg-server-master\src\core\video_channel.cpp:157
[2023-03-06 23:11:09.663] [error] 8# std::invoke<<lambda_6fd6cfcb15ba4a876d28eb54d7959cea> > at F:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\include\type_traits:1565
[2023-03-06 23:11:09.663] [error] 9# std::thread::_Invoke<std::tuple<<lambda_6fd6cfcb15ba4a876d28eb54d7959cea> >,0> at F:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\include\thread:56
[2023-03-06 23:11:09.663] [error] 10# register_onexit_function in ucrtbased
[2023-03-06 23:11:09.663] [error] 11# BaseThreadInitThunk in KERNEL32
[2023-03-06 23:11:09.663] [error] 12# RtlUserThreadStart in ntdll
[2023-03-06 23:11:09.663] [error]
... std::future_error repeats forever ...
When debugging from inside VC++, the following exception is caught:
Exception thrown at 0x00007FFF464EABD7 (atio6axx.dll) in casparcg.exe: 0xC0000005: Access violation writing location 0x000001D82DFEFE20.
atio6axx.dll!00007fff464eabd7()
atio6axx.dll!00007fff45e16372()
atio6axx.dll!00007fff45e103d1()
atio6axx.dll!00007fff45dd62f7()
atio6axx.dll!00007fff45d56397()
atio6axx.dll!00007fff45d67b51()
atio6axx.dll!00007fff4502536e()
atio6axx.dll!00007fff44e26782()
atio6axx.dll!00007fff44e26eec()
atio6axx.dll!00007fff44e23520()
atio6axx.dll!00007fff44e25991()
atio6axx.dll!00007fff44d4ea59()
atio6axx.dll!00007fff44d4ebe1()
atio6axx.dll!00007fff44d89e2a()
atio6axx.dll!00007fff44bcb129()
casparcg.exe!caspar::accelerator::ogl::texture::impl::copy_to(caspar::accelerator::ogl::buffer & dst) Line 103
at F:\Users\kongr45gpen\Documents\casparcg-server-master\src\accelerator\ogl\util\texture.cpp(103)
casparcg.exe!caspar::accelerator::ogl::texture::copy_to(caspar::accelerator::ogl::buffer & dest) Line 130
at F:\Users\kongr45gpen\Documents\casparcg-server-master\src\accelerator\ogl\util\texture.cpp(130)
casparcg.exe!caspar::accelerator::ogl::device::impl::copy_async::__l2::<lambda>(boost::asio::basic_yield_context<boost::asio::executor_binder<void (__cdecl*)(void),boost::asio::executor>> yield) Line 270
at F:\Users\kongr45gpen\Documents\casparcg-server-master\src\accelerator\ogl\util\device.cpp(270)
[External Code]
casparcg.exe!boost::asio::detail::coro_entry_point<boost::asio::executor_binder<void (__cdecl*)(void),boost::asio::strand<boost::asio::io_context::executor_type>>,std::packaged_task<caspar::array<unsigned char const> __cdecl(boost::asio::basic_yield_context<boost::asio::executor_binder<void (__cdecl*)(void),boost::asio::executor>>)>>::operator()(boost::coroutines::pull_coroutine<void> & ca) Line 382
at F:\Users\kongr45gpen\Documents\casparcg-server-master\build2\packages\boost.1.66.0.0\lib\native\include\boost\asio\impl\spawn.hpp(382)
casparcg.exe!boost::coroutines::detail::push_coroutine_object<boost::coroutines::pull_coroutine<void>,void,boost::asio::detail::coro_entry_point<boost::asio::executor_binder<void (__cdecl*)(void),boost::asio::strand<boost::asio::io_context::executor_type>>,std::packaged_task<caspar::array<unsigned char const> __cdecl(boost::asio::basic_yield_context<boost::asio::executor_binder<void (__cdecl*)(void),boost::asio::executor>>)>> &,boost::coroutines::basic_standard_stack_allocator<boost::coroutines::stack_traits>>::run() Line 293
at F:\Users\kongr45gpen\Documents\casparcg-server-master\build2\packages\boost.1.66.0.0\lib\native\include\boost\coroutine\detail\push_coroutine_object.hpp(293)
casparcg.exe!boost::coroutines::detail::trampoline_push_void<boost::coroutines::detail::push_coroutine_object<boost::coroutines::pull_coroutine<void>,void,boost::asio::detail::coro_entry_point<boost::asio::executor_binder<void (__cdecl*)(void),boost::asio::strand<boost::asio::io_context::executor_type>>,std::packaged_task<caspar::array<unsigned char const> __cdecl(boost::asio::basic_yield_context<boost::asio::executor_binder<void (__cdecl*)(void),boost::asio::executor>>)>> &,boost::coroutines::basic_standard_stack_allocator<boost::coroutines::stack_traits>>>(boost::context::detail::transfer_t t) Line 71
at F:\Users\kongr45gpen\Documents\casparcg-server-master\build2\packages\boost.1.66.0.0\lib\native\include\boost\coroutine\detail\trampoline_push.hpp(71)
casparcg.exe!make_fcontext() Line 158
at D:\ReleaseBuild\boost_1_66_0\libs\context\src\asm\make_x86_64_ms_pe_masm.asm(158)
[External Code]
The error seems to be happening in this function from accelerator/ogl/texture.cpp
:
void copy_to(buffer& dst)
{
dst.bind();
GL(glGetTextureImage(id_, 0, FORMAT[stride_], TYPE[stride_], size_, nullptr));
dst.unbind();
}
where the arguments are id_ = 3
, stride_ = 4
and size_ = 3686400
.
Steps to reproduce
- Start CasparCG server and client
- Play a video file from the client
Given the stack trace, this seems to be a specific error for my AMD graphics card.
Environment
- Configuration: Default CasparCG config file
- Commit: 435921f (compiled with MSVC++)
- Server version: v2.4
- Operating system: Windows 10
- CPU: AMD Ryzen 7 5800X + 16 GB RAM
- Graphics Card: AMD Radeon RX 570 Series, XFX 8GB, driver version 23.2.2
Duplicate of #1450