merryhime/dynarmic

Asserts can't be disabled

vladkosi opened this issue · 4 comments

After the migration to mcl 78b4ba1 asserts are always used and can't be disabled.

Old code - https://github.com/merryhime/dynarmic/blob/ed9955891f4b276888fa91ef1b0933a47fcae155/src/dynarmic/common/assert.h
New code - https://github.com/merryhime/dynarmic/blob/master/externals/mcl/include/mcl/assert.hpp

This is the reason yuzu is crashing on Windows 7 and old versions of Windows 10 since mainline 991.

Related yuzu bugs:
yuzu-emu/yuzu#8247
yuzu-emu/yuzu#8386
yuzu-emu/yuzu#8323

This is the reason yuzu is crashing on Windows 7 and old versions of Windows 10 since mainline 991.

I will not be allowing the ignoring of assertions unless there are performance concerns. An assertion failure is a bug that should not be ignored. Do you know the specific assertion causing this?

My assumption was the issue referenced was related to aligned memory allocation hence only being compatible with newer Windows APIs, but I would be happy to know otherwise.

Do you know the specific assertion causing this?

Seems like this one - https://github.com/merryhime/dynarmic/blob/master/src/dynarmic/backend/x64/emit_x64_memory.cpp.inc#L333

1

2

This is yuzu manline 1127. Crashes on Windows 10 version 1511 and 1803.

Local build with completely removed asserts:

#define UNREACHABLE() __assume(0)
#define ASSERT(expr)
#define ASSERT_MSG(expr, ...)
#define ASSERT_FALSE(...) UNREACHABLE()
#define DEBUG_ASSERT(expr)
#define DEBUG_ASSERT_MSG(expr, ...)

works on both.

Thank you, reaching that point would mean that in the configuration provided to dynarmic, fastmem_exclusive_access was set to true in the configuration, but fastmem_pointer or global_monitor was nullptr, which is not a valid state to be in.

It would likely work by chance when the assertion is ignored because fastmem recompilation would happen by chance with those addresses, but if an emulator VAddr happens to correspond to a valid host virtual address, this leads to Badness.