baldurk / renderdoc

RenderDoc is a stand-alone graphics debugging tool.
https://renderdoc.org
MIT License
9.03k stars 1.35k forks source link

qrenderdoc crashes loading capture #2545

Closed yshui closed 2 years ago

yshui commented 2 years ago

Description

qrenderdoc segfaults when loading a capture

Steps to reproduce

This is a capture of my own Unity project:

https://drive.google.com/file/d/1Bnoc8B8l7x2BA-Ct70d602Hoe8lBrZ2x/view?usp=sharing

Environment

Stack trace

#0  WrappedVulkan::Serialise_vkGetDeviceQueue<ReadSerialiser> (this=0x7fd72c00b2b0, ser=..., device=0x0,
    queueFamilyIndex=0, queueIndex=0, pQueue=0x0)
    at /home/shui/programs/renderdoc/renderdoc/driver/vulkan/wrappers/vk_queue_funcs.cpp:48
#1  0x00007fd81fe420cd in WrappedVulkan::ProcessChunk (this=0x7fd72c00b2b0, ser=...,
    chunk=VulkanChunk::vkGetDeviceQueue) at /home/shui/programs/renderdoc/renderdoc/driver/vulkan/vk_core.cpp:3145
#2  0x00007fd81fe3f385 in WrappedVulkan::ReadLogInitialisation (this=0x7fd72c00b2b0, rdc=0x7fd72c0047a0,
    storeStructuredBuffers=false) at /home/shui/programs/renderdoc/renderdoc/driver/vulkan/vk_core.cpp:2581
#3  0x00007fd81ffd0a99 in VulkanReplay::ReadLogInitialisation (this=0x7fd72c00e4a0, rdc=0x7fd72c0047a0,
    storeStructuredBuffers=false) at /home/shui/programs/renderdoc/renderdoc/driver/vulkan/vk_replay.cpp:224
#4  0x00007fd820bc4afd in ReplayController::PostCreateInit (this=0x7fd72c005a50, device=0x7fd72c00e4a0,
    rdc=0x7fd72c0047a0) at /home/shui/programs/renderdoc/renderdoc/replay/replay_controller.cpp:2150
#5  0x00007fd820bc43b8 in ReplayController::CreateDevice (this=0x7fd72c005a50, rdc=0x7fd72c0047a0, opts=...)
    at /home/shui/programs/renderdoc/renderdoc/replay/replay_controller.cpp:2117
#6  0x00007fd820b98518 in CaptureFile::OpenCapture(ReplayOptions const&, std::function<void (float)>) (
    this=0x7fd72c004610, opts=..., progress=...)
    at /home/shui/programs/renderdoc/renderdoc/replay/capture_file.cpp:364
#7  0x000055838cbc5ac2 in ReplayManager::run(int, QString const&, ReplayOptions const&, std::function<void (float)>) (
    this=0x7ffc1a2c0130, proxyRenderer=-1, capturefile=..., opts=..., progress=...)
    at ../../qrenderdoc/Code/ReplayManager.cpp:453
#8  0x000055838cbc2960 in operator() (__closure=0x7fd734003410) at ../../qrenderdoc/Code/ReplayManager.cpp:57
#9  0x000055838cbc8b10 in std::__invoke_impl<void, ReplayManager::OpenCapture(const QString&, const ReplayOptions&, RENDERDOC_ProgressCallback)::<lambda()>&>(std::__invoke_other, struct {...} &) (__f=...)
    at /usr/include/c++/11.2.0/bits/invoke.h:61
#10 0x000055838cbc782f in std::__invoke_r<void, ReplayManager::OpenCapture(const QString&, const ReplayOptions&, RENDERDOC_ProgressCallback)::<lambda()>&>(struct {...} &) (__fn=...) at /usr/include/c++/11.2.0/bits/invoke.h:154
#11 0x000055838cbc6a50 in std::_Function_handler<void(), ReplayManager::OpenCapture(const QString&, const ReplayOptions&, RENDERDOC_ProgressCallback)::<lambda()> >::_M_invoke(const std::_Any_data &) (__functor=...)
    at /usr/include/c++/11.2.0/bits/std_function.h:291
#12 0x000055838cb7d712 in std::function<void ()>::operator()() const (this=0x7fd734001f40)
    at /usr/include/c++/11.2.0/bits/std_function.h:560
#13 0x000055838cbc9b93 in LambdaThread::process (this=0x7fd734001f30) at ../../qrenderdoc/Code/QRDUtils.h:351
#14 0x000055838cbcb400 in QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, void (LambdaThread::*)()>::call(void (LambdaThread::*)(), LambdaThread*, void**) (
    f=(void (LambdaThread::*)(LambdaThread * const)) 0x55838cbc9b54 <LambdaThread::process()>, o=0x7fd734001f30,
    arg=0x7fd75f7fdce0) at /usr/include/qt/QtCore/qobjectdefs_impl.h:152
#15 0x000055838cbcb12b in QtPrivate::FunctionPointer<void (LambdaThread::*)()>::call<QtPrivate::List<>, void>(void (LambdaThread::*)(), LambdaThread*, void**) (
    f=(void (LambdaThread::*)(LambdaThread * const)) 0x55838cbc9b54 <LambdaThread::process()>, o=0x7fd734001f30,
    arg=0x7fd75f7fdce0) at /usr/include/qt/QtCore/qobjectdefs_impl.h:185
#16 0x000055838cbcac4d in QtPrivate::QSlotObject<void (LambdaThread::*)(), QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) (which=1, this_=0x7fd73400b6b0, r=0x7fd734001f30, a=0x7fd75f7fdce0,
    ret=0x0) at /usr/include/qt/QtCore/qobjectdefs_impl.h:418
#17 0x00007fd81e7d8463 in ?? () from /usr/lib/libQt5Core.so.5
#18 0x00007fd81e5fd9cf in QThread::started(QThread::QPrivateSignal) () from /usr/lib/libQt5Core.so.5
#19 0x00007fd81e5ff8b2 in ?? () from /usr/lib/libQt5Core.so.5
#20 0x00007fd81dfed5c2 in start_thread () from /usr/lib/libc.so.6
#21 0x00007fd81e072584 in clone () from /usr/lib/libc.so.6
baldurk commented 2 years ago

From this capture it looks like your application creates multiple VkDevice objects simultaneously, which is not supported.

If your application can be refactored to only use a single VkDevice then that should work, if you have trouble with that please open a new issue and I can investigate.

yshui commented 2 years ago

@baldurk is it possible to have renderdoc ignore the other devices?

baldurk commented 2 years ago

No it's not. If you created the devices in separate instances then you could choose which instance to capture from, but within an instance there's no way to select a particular device and no support for filtering only to that device and its children.