mirror of
https://github.com/RPCS3/rpcs3.git
synced 2026-06-07 07:35:02 -06:00
Fix ASan fatal-report access during emulator teardown
This commit is contained in:
parent
7168cd566a
commit
f463c128e3
@ -70,6 +70,8 @@ LOG_CHANNEL(sys_log, "SYS");
|
|||||||
// Preallocate 32 MiB
|
// Preallocate 32 MiB
|
||||||
stx::manual_typemap<void, 0x20'00000, 128> g_fixed_typemap;
|
stx::manual_typemap<void, 0x20'00000, 128> g_fixed_typemap;
|
||||||
|
|
||||||
|
static constinit atomic_t<bool> s_emulator_available{false};
|
||||||
|
|
||||||
std::string g_cfg_defaults;
|
std::string g_cfg_defaults;
|
||||||
|
|
||||||
atomic_t<u64> g_watchdog_hold_ctr{0};
|
atomic_t<u64> g_watchdog_hold_ctr{0};
|
||||||
@ -118,6 +120,21 @@ namespace rsx
|
|||||||
void set_native_ui_flip();
|
void set_native_ui_flip();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Emulator::Emulator() noexcept
|
||||||
|
{
|
||||||
|
s_emulator_available = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
Emulator::~Emulator() noexcept
|
||||||
|
{
|
||||||
|
s_emulator_available = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Emulator::IsAvailable() noexcept
|
||||||
|
{
|
||||||
|
return s_emulator_available.load();
|
||||||
|
}
|
||||||
|
|
||||||
template<>
|
template<>
|
||||||
void fmt_class_string<game_boot_result>::format(std::string& out, u64 arg)
|
void fmt_class_string<game_boot_result>::format(std::string& out, u64 arg)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -201,8 +201,10 @@ public:
|
|||||||
static constexpr std::string_view game_id_boot_prefix = "%RPCS3_GAMEID%:";
|
static constexpr std::string_view game_id_boot_prefix = "%RPCS3_GAMEID%:";
|
||||||
static constexpr std::string_view vfs_boot_prefix = "%RPCS3_VFS%:";
|
static constexpr std::string_view vfs_boot_prefix = "%RPCS3_VFS%:";
|
||||||
|
|
||||||
Emulator() noexcept = default;
|
Emulator() noexcept;
|
||||||
~Emulator() noexcept = default;
|
~Emulator() noexcept;
|
||||||
|
|
||||||
|
static bool IsAvailable() noexcept;
|
||||||
|
|
||||||
void SetCallbacks(EmuCallbacks&& cb)
|
void SetCallbacks(EmuCallbacks&& cb)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -185,16 +185,23 @@ std::set<std::string> get_one_drive_paths()
|
|||||||
fmt::append(buf, "\nSerialized Object: %s", g_tls_serialize_name);
|
fmt::append(buf, "\nSerialized Object: %s", g_tls_serialize_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
const system_state state = Emu.GetStatus(false);
|
if (Emulator::IsAvailable())
|
||||||
|
|
||||||
if (state == system_state::stopped)
|
|
||||||
{
|
{
|
||||||
fmt::append(buf, "\nEmulation is stopped");
|
const system_state state = Emu.GetStatus(false);
|
||||||
|
|
||||||
|
if (state == system_state::stopped)
|
||||||
|
{
|
||||||
|
fmt::append(buf, "\nEmulation is stopped");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
const std::string name = Emu.GetTitleAndTitleID();
|
||||||
|
fmt::append(buf, "\nTitle: \"%s\" (emulation is %s)", name.empty() ? "N/A" : name.c_str(), state == system_state::stopping ? "stopping" : "running");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
const std::string& name = Emu.GetTitleAndTitleID();
|
fmt::append(buf, "\nEmulation object is unavailable (process teardown)");
|
||||||
fmt::append(buf, "\nTitle: \"%s\" (emulation is %s)", name.empty() ? "N/A" : name.data(), state == system_state::stopping ? "stopping" : "running");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt::append(buf, "\nBuild: \"%s\"", rpcs3::get_verbose_version());
|
fmt::append(buf, "\nBuild: \"%s\"", rpcs3::get_verbose_version());
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user