Project

General

Profile

Actions

Emulator Issues #13521

open

Code View Widget: m_stepping_lock not acquired on destructor causing unlocking of already unlocked mutex

Added by ElectrifiedStrawberry 7 months ago. Updated 5 months ago.

Status:
New
Priority:
Normal
Assignee:
-
% Done:

0%

Operating system:
N/A
Issue type:
Bug
Milestone:
Regression:
No
Relates to usability:
No
Relates to performance:
No
Easy:
No
Relates to maintainability:
No
Regression start:
Fixed in:

Description

Game Name/ID/Hash?

N/A

What's the problem? Describe what went wrong.

m_stepping_lock not acquired and CPUThreadGuard::~CPUThreadGuard attempts to unlock an unlocked mutex.

What steps will reproduce the problem?

  1. Run with Dolphin debugger enabled.
  2. Open the code tab and add a symbol definition.
  3. Stop Dolphin.
  4. Set a breakpoint at CPUManager::PauseAndLock right before m_stepping_lock.unlock()
  5. Start Dolphin with a debugger attached (Visual Studio debugger works fine).
  6. Make sure the debugging UI is open.
  7. Start a game.
  8. Observe the mutex is unlocked. (In Debug builds the CRT seems to decide to want to jump into the debugger if you let it run.)

Is the issue present in the latest development version? For future reference, please also write down the version number of the latest development version.

Yes; git commit hash 3527d97.

Is the issue present in the latest stable version?

I have no clue.

If the issue isn't present in the latest stable version, which is the first broken version? (You can find the first broken version by bisecting. Windows users can use the tool https://forums.dolphin-emu.org/Thread-green-notice-development-thread-unofficial-dolphin-bisection-tool-for-finding-broken-builds and anyone who is building Dolphin on their own can use git bisect.)

Not sure; the last change to the line was just renaming the s_ prefix to a m_ prefix a little over a year ago.

What are your PC specifications? (CPU, GPU, Operating System, more)

Windows 10/i7/RTX 3080 Laptop

Is there anything else that can help developers narrow down the issue? (e.g. logs, screenshots,
configuration files, savefiles, savestates)

Callstack:
CPU::CPUManager::PauseAndLock(do_lock: false, unpause_on_unlock: true, control_adjacent: true)
Core::PauseAndLock(system: [...], do_lock: false, unpause_on_unlock: false)
CPUThreadGuard::~CPUThreadGuard() (m_was_cpu_thread is false)
CodeViewWidget::Update() L275
...

Actions

Also available in: Atom PDF