Skip to content
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

segfault using full screen vulkan #173

Open
agiera opened this issue Sep 15, 2020 · 1 comment
Open

segfault using full screen vulkan #173

agiera opened this issue Sep 15, 2020 · 1 comment

Comments

@agiera
Copy link

agiera commented Sep 15, 2020

program aborts ~1sec after entering full screen while using vulkan backend
running pop os 20.04 with nvidia-450 vulkan 1.2.148 on a gtx 970m

stack trace:

Thread 1 (Thread 0x7fccf37fe700 (LWP 11693)):
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
        set = {__val = {1024, 140518235290912, 2505628, 1145044993, 10921804596590213251, 10700172839009257639, 3, 261993005056, 4294967310, 94614839236704, 0, 0, 0, 0, 0, 4458766951310848768}}
        pid = <optimized out>
        tid = <optimized out>
#1  0x00007fcd0280b859 in __GI_abort () at abort.c:79
        save_stage = 1
        act = {__sigaction_handler = {sa_handler = 0x7fccf37fbb80, sa_sigaction = 0x7fccf37fbb80}, sa_mask = {__val = {94562026071808, 140518235290496, 94562005406728, 140517923635440, 94562026071808, 140518235290528, 94562006011261, 94562026071808, 140518235290560, 140518235290576, 94562007941462, 140518235290608, 25483701028, 94562026071808, 4458766951310848768, 140518235290608}}, sa_flags = -288695431, sa_restorer = 0x7fccd4c7d000}
        sigs = {__val = {32, 0 <repeats 15 times>}}
#2  0x00005600ef276f72 in wxFatalSignalHandler(int) () at /home/agiera/dolphins/ishiiruka/Externals/wxWidgets3/src/unix/utilsunx.cpp:1399
#3  0x00005600eed3dcea in EMM::sigsegv_handler(int, siginfo_t*, void*) (sig=11, info=0x7fccf37fbdb0, raw_context=0x7fccf37fbc80) at /home/agiera/dolphins/ishiiruka/Source/Core/Core/MemTools.cpp:301
        old_sa = 0x5600efebc9a0 <EMM::old_sa_segv>
        context = 0x7fccf37fbc80
        sicode = 1
        bad_address = 0
        ctx = 0x7fccf37fbca8
#4  0x00007fcd04dc13c0 in <signal handler called> () at /lib/x86_64-linux-gnu/libpthread.so.0
#5  0x00007fccbddff929 in  () at /lib/x86_64-linux-gnu/libnvidia-glcore.so.450.66
#6  0x00007fccbde005e9 in  () at /lib/x86_64-linux-gnu/libnvidia-glcore.so.450.66
#7  0x00007fccbdea10a7 in  () at /lib/x86_64-linux-gnu/libnvidia-glcore.so.450.66
#8  0x00005600ef5ebdb9 in Vulkan::UtilityShaderDraw::BindPipeline() (this=0x7fccf37fc6d0) at /home/agiera/dolphins/ishiiruka/Source/Core/VideoBackends/Vulkan/Util.cpp:766
        pipeline = 0x7fcce0ec40f0
#9  0x00005600ef5eaa52 in Vulkan::UtilityShaderDraw::Draw() (this=0x7fccf37fc6d0) at /home/agiera/dolphins/ishiiruka/Source/Core/VideoBackends/Vulkan/Util.cpp:503
#10 0x00005600ef5eb0cb in Vulkan::UtilityShaderDraw::DrawQuad(int, int, int, int, int, int, int, int, int, int, int, float) (this=0x7fccf37fc6d0, dst_x=304, dst_y=0, dst_width=1312, dst_height=1080, src_x=0, src_y=0, src_layer=0, src_width=640, src_height=480, src_full_width=640, src_full_height=528, z=0) at /home/agiera/dolphins/ishiiruka/Source/Core/VideoBackends/Vulkan/Util.cpp:556
        u0 = 0
        v0 = 0
        u1 = 1
        v1 = 0.909090936
        w = 0
        vertices = {{Position = {-1, 1, 0, 1}, TexCoord = {0, 0.909090936, 0, 0}, Color = 4294967295}, {Position = {1, 1, 0, 1}, TexCoord = {1, 0.909090936, 0, 0}, Color = 4294967295}, {Position = {-1, -1, 0, 1}, TexCoord = {0, 0, 0, 0}, Color = 4294967295}, {Position = {1, -1, 0, 1}, TexCoord = {1, 0, 0, 0}, Color = 4294967295}}
#11 0x00005600ef5fae82 in Vulkan::VulkanPostProcessingShader::Draw(PostProcessor*, TargetRectangle const&, TargetSize const&, unsigned long, TargetRectangle const&, TargetSize const&, unsigned long, unsigned long, int, float) (this=0x7fcce0c63b80, p=0x7fcce0c92a80, dst_rect=..., dst_size=..., dst_tex=140517922021984, src_rect=..., src_size=..., src_tex=140517921393248, src_depth_tex=0, src_layer=0, gamma=1) at /home/agiera/dolphins/ishiiruka/Source/Core/VideoBackends/Vulkan/PostProcessing.cpp:332

The full stack trace is attached here.

I tried to link the vulkan sdk to get more info, but wasn't able to manage it. Is there a guide for that?

Let me know if I can provide more info or if there's any methodology for debugging I could try. Thanks!

@agiera
Copy link
Author

agiera commented Sep 29, 2020

I was able to get the validation layer hooked up. I've attached the output
vulkan.log

VUID-vkCmdBindPipeline-commandBuffer-recording(ERROR / SPEC): msgNum: -365328357 - Validation Error: [ VUID-vkCmdBindPipeline-commandBuffer-recording ] Object 0: handle = 0x7f6c90da52b0, type = VK_OBJECT_TYPE_COMMAND_BUFFER; | MessageID = 0xea39881b | You must call vkBeginCommandBuffer() before this call to vkCmdBindPipeline(). The Vulkan spec states: commandBuffer must be in the recording state (https://vulkan.lunarg.com/doc/view/1.2.148.0/linux/1.2-extensions/vkspec.html#VUID-vkCmdBindPipeline-commandBuffer-recording)

So it seems the command buffers aren't activated when they should be. Not sure if more concurrency control is needed? Maybe merging mainline dolphin's CommandBufferManager would fix it?

I also found that this was the latest commit on CommandBufferManager.cpp and it says vulkan is broken because post processing is not finished yet. Am I wasting my time trying to debug this or is that statement outdated?
@Tinob

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant