Citra crashes immediately when loading ROM

Issue:
I just downloaded Citra today and am trying to play Dai Gyakuten Saiban 1. However, whenever I double click on the ROM to open it, Citra crashes within a second. Occasionally after the crash, I will get an error message from Citra saying that it crashed unexpectedly.

System Information

  • Operating System: macOS Catalina
  • CPU: 1.1 GHz Quad-Core Intel Core i5
  • GPU: Intel Iris Plus Graphics 1536 MB
  • Citra Version (found in title bar):
  • Game: Dai Gyakuten Saiban 1
  • Screenshot of Issue (include the full Citra window including titlebar):

Diagnostic Log
Upload your log file as an attachment by dragging & dropping.
citra_log.txt (12.0 KB)
In order to save a copy of the log, follow this guide:
https://community.citra-emu.org/t/how-to-upload-the-log-file/296

1 Like

System Information for Support

Client Version                                Nightly 1588 HEAD-f4e727c
Operating System                              macOS 10.15
CPU                                           Intel(R) Core(TM) i5-1030NG7 CPU @ 1.10GHz
Graphics API                                  OpenGL ?
Graphics Renderer                             Intel(R) Iris(TM) Plus Graphics OpenGL Engine
CPU JIT                                       [x]
Hardware Renderer                             [x]
Hardware Shader                               [x]
Hardware Shader, Accurate Multiplication      [x]
Shader JIT                                    [x]
System Region                                 -1
Shader Disk Cache                             [x]

I did not find anything wrong in your log file. Please wait for a moderator to assist.

I believe this is a regression caused by something in this series of recent changes to RasterizerOpenGL: https://github.com/citra-emu/citra/pull/5420

DGS1 works on the nightly just prior to commit cae4b7a, 1583/commit c4a4b40 (although I had to disable the disk shader cache as well). The full traceback of the segfault:

Thread 22 Crashed:: EmuThread
0   ???                               000000000000000000 0 + 0
1   com.citra-emu.citra               0x0000000110269e99 OpenGL::RasterizerOpenGL::Draw(bool, bool) + 4409
2   com.citra-emu.citra               0x00000001102549c0 0x10fd60000 + 5196224
3   com.citra-emu.citra               0x00000001102539ee Pica::CommandProcessor::ProcessCommandList(unsigned int, unsigned int) + 206
4   com.citra-emu.citra               0x00000001101e0749 void GPU::Write<unsigned int>(unsigned int, unsigned int) + 633
5   com.citra-emu.citra               0x00000001100f8bef Service::GSP::GSP_GPU::TriggerCmdReqQueue(Kernel::HLERequestContext&) + 1439
6   com.citra-emu.citra               0x000000010ffe882e Kernel::ServerSession::HandleSyncRequest(std::__1::shared_ptr<Kernel::Thread>) + 382
7   com.citra-emu.citra               0x000000010ff9bf75 Kernel::ClientSession::SendSyncRequest(std::__1::shared_ptr<Kernel::Thread>) + 133
8   com.citra-emu.citra               0x000000010fff4b22 Kernel::SVC::SendSyncRequest(unsigned int) + 354
9   com.citra-emu.citra               0x000000010fffd55a void Kernel::SVCWrapper<Kernel::SVC>::Wrap<&(Kernel::SVC::SendSyncRequest(unsigned int))>() + 42
10  com.citra-emu.citra               0x000000010fffe4c1 Kernel::SVC::CallSVC(unsigned int) + 193
11  ???                               0x00000001784e508a 0 + 6313365642

I didn’t have the patience to build it from source to get line number info, but the disassembly from lldb suggests it’s something wrong between here https://github.com/citra-emu/citra/blob/master/src/video_core/renderer_opengl/gl_rasterizer.cpp#L791 and L813:

    0x100509e24 <+4292>: leaq   0x8aa8295(%rip), %r14     ; glad_glCopyImageSubData
    0x100509e2b <+4299>: nopl   (%rax,%rax)
    0x100509e30 <+4304>: incq   %rbx
    0x100509e33 <+4307>: movzwl 0x18(%rsi), %eax
    0x100509e37 <+4311>: movl   0xc(%rsi), %edx
    0x100509e3a <+4314>: imull  %eax, %edx
    0x100509e3d <+4317>: movl   %ebx, %ecx
    0x100509e3f <+4319>: shrl   %cl, %edx
    0x100509e41 <+4321>: movq   (%r14), %r10
    0x100509e44 <+4324>: movl   0x60(%rsi), %edi
    0x100509e47 <+4327>: imull  0x10(%rsi), %eax
    0x100509e4b <+4331>: movl   -0x40(%rbp), %esi
    0x100509e4e <+4334>: shrl   %cl, %eax
    0x100509e50 <+4336>: movl   %eax, 0x38(%rsp)
    0x100509e54 <+4340>: movl   %edx, 0x30(%rsp)
    0x100509e58 <+4344>: movl   %ebx, 0x10(%rsp)
    0x100509e5c <+4348>: movl   %esi, (%rsp)
    0x100509e5f <+4351>: movl   $0x1, 0x40(%rsp)
    0x100509e67 <+4359>: movl   $0x0, 0x28(%rsp)
    0x100509e6f <+4367>: movl   $0x0, 0x20(%rsp)
    0x100509e77 <+4375>: movl   $0x0, 0x18(%rsp)
    0x100509e7f <+4383>: movl   $0xde1, 0x8(%rsp)         ; imm = 0xDE1 
    0x100509e87 <+4391>: movl   $0xde1, %esi              ; imm = 0xDE1 
    0x100509e8c <+4396>: xorl   %ecx, %ecx
    0x100509e8e <+4398>: xorl   %r8d, %r8d
    0x100509e91 <+4401>: xorl   %r9d, %r9d
    0x100509e94 <+4404>: movl   %ebx, %edx
    0x100509e96 <+4406>: callq  *%r10
    0x100509e99 <+4409>: movq   -0x80(%rbp), %rsi         ; Where it segfaults
    0x100509e9d <+4413>: movl   0x64(%rsi), %eax
    0x100509ea0 <+4416>: cmpq   %rax, %rbx
    0x100509ea3 <+4419>: jb     0x100509e30               ; <+4304>
    0x100509ea5 <+4421>: movl   0x60(%rsi), %ecx
    0x100509ea8 <+4424>: movl   -0x40(%rbp), %eax
    0x100509eab <+4427>: cmpl   %ecx, 0x78(%r12)
    0x100509eb0 <+4432>: jne    0x10050a010               ; <+4784>
    0x100509eb6 <+4438>: movl   %eax, 0x78(%r12)
    0x100509ebb <+4443>: cmpl   %ecx, 0x80(%r12)
    0x100509ec3 <+4451>: je     0x10050a01e               ; <+4798>
    0x100509ec9 <+4457>: cmpl   %ecx, 0x88(%r12)
    0x100509ed1 <+4465>: jne    0x10050a034               ; <+4820>
    0x100509ed7 <+4471>: movl   %eax, 0x88(%r12)
    0x100509edf <+4479>: cmpl   %ecx, 0xa8(%r12)
    0x100509ee7 <+4487>: je     0x10050a042               ; <+4834>
    0x100509eed <+4493>: cmpl   %ecx, 0xb0(%r12)
    0x100509ef5 <+4501>: jne    0x10050a05b               ; <+4859>
    0x100509efb <+4507>: movl   %eax, 0xb0(%r12)
    0x100509f03 <+4515>: movl   0x60(%rsi), %ecx
    0x100509f06 <+4518>: cmpl   %ecx, 0xb8(%r12)
    0x100509f0e <+4526>: je     0x10050a069               ; <+4873>
    0x100509f14 <+4532>: cmpl   %ecx, 0xa4(%r12)
    0x100509f1c <+4540>: jne    0x10050a082               ; <+4898>
    0x100509f22 <+4546>: movl   %eax, 0xa4(%r12)
    0x100509f2a <+4554>: movl   0x60(%rsi), %ecx
    0x100509f2d <+4557>: cmpl   %ecx, 0xac(%r12)
    0x100509f35 <+4565>: je     0x10050a090               ; <+4912>
    0x100509f3b <+4571>: cmpl   %ecx, 0xb4(%r12)
    0x100509f43 <+4579>: jne    0x100509f4d               ; <+4589>
    0x100509f45 <+4581>: movl   %eax, 0xb4(%r12)
    0x100509f4d <+4589>: cmpb   $0x0, 0x1c8(%r12)
    0x100509f56 <+4598>: je     0x100509f75               ; <+4629>
    0x100509f58 <+4600>: movq   0x6e0(%r12), %rdi
    0x100509f60 <+4608>: leaq   0x8a8e939(%rip), %rsi     ; Pica::g_state
    0x100509f67 <+4615>: callq  0x1005465c0               ; OpenGL::ShaderProgramManager::UseFragmentShader(Pica::Regs const&)
    0x100509f6c <+4620>: movb   $0x0, 0x1c8(%r12)
    0x100509f75 <+4629>: movq   %r12, %rdi
    0x100509f78 <+4632>: callq  0x10050ab10               ; OpenGL::RasterizerOpenGL::SyncAndUploadLUTs()

(I’m assuming the call to SetShader got inlined which makes it a bit more confusing to look at.)

This was also on Mojave with an AMD GPU, which is different from the OP’s Catalina + Intel GPU so I really don’t think it’s anything GPU specific. I have no idea what any of these changes did (first time using this emulator…) but hopefully this is enough to debug it if you set some breakpoints in ::Draw.

1 Like