hrydgard / ppsspp

A PSP emulator for Android, Windows, Mac and Linux, written in C++. Want to contribute? Join us on Discord at https://discord.gg/5NJB6dD or just send pull requests / issues. For discussion use the forums at forums.ppsspp.org.
https://www.ppsspp.org
Other
11.45k stars 2.19k forks source link

WebSocketMemoryRead crash #16724

Closed Nemoumbra closed 1 year ago

Nemoumbra commented 1 year ago

Game or games this happens in

Not game-specific

What area of the game / PPSSPP

The Allegrex plugin for Ghidra has got some beta Remote Debugging support. I've decided to test it on my latest build and observed PPSSPP crashing. It turns out that the plugin calls memory.read(address = 65536, size = 4096, replacements = false). Stack trace: Memory::MemoryInitedLock::~MemoryInitedLock() (Line 403) AutoDisabledReplacements::~AutoDisabledReplacements() (Line 88) WebSocketMemoryRead(DebuggerRequest & req) (Line 212)

What should happen

If the range is valid, why do we crash? Looks like use-after-free or something like that... Needs to be fixed.

Logs

No response

Platform

Windows

Mobile phone model or graphics card

AMD Radeon(TM) Graphics

PPSSPP version affected

Self-built version (one of the lastest)

Last working version

No response

Graphics backend (3D API)

Direct3D 11

Checklist

Nemoumbra commented 1 year ago

Oh, by the way, the game is Patapon 3 and the plugin called the method when I ran the said game. Bear in mind that I keep the setting "break on load" enabled - maybe it's related to the crash.

unknownbrackets commented 1 year ago

What's the actual error? There's nothing wrong with destructing that object at the end. That lock is meant to make sure memory is not deleted while it's running - did you shut down while reading or something?

-[Unknown]

Nemoumbra commented 1 year ago

image It just dies. image