Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use of DEBUG_NV2A can lead to assert in mttcg_cpu_thread_fn #687

Open
abaire opened this issue Jan 28, 2022 · 0 comments
Open

Use of DEBUG_NV2A can lead to assert in mttcg_cpu_thread_fn #687

abaire opened this issue Jan 28, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@abaire
Copy link
Contributor

abaire commented Jan 28, 2022

Bug Description

While starting to debug #686 I enabled some additional debug output (DEBUG_NV2A, DEBUG_NV2A_REG, DEBUG_NV2A_GL) and was surprised to see that the game started crashing before running the intro FMV.

Disabling the debug output allows the game to run correctly (it can get all the way into a level).

Adding a usleep to the NV2A_DPRINTF macro exacerbates the behavior and will make the game crash consistently on my machine before even getting to the initial splash screen. With this sleep I can also repro on Halo (I haven't tested any other games, but suspect that it'll affect everything).
For clarity:

# define NV2A_DPRINTF(format, ...)       do { printf("nv2a: " format, ## __VA_ARGS__); usleep(100); } while (0)

This assert fails, causing a halt of the emulated guest.

I'm guessing that there's some synchronization missing between some of the emulator threads, but haven't dug into it at all.

Expected Behavior

I'd expect that slowing down functions that include nv2a printf's would just result in slower emulation overall and not lead to assertions.

xemu Version

Mostly the current master branch, with the patch to intentionally slow down NV2A_DPRINTF to make it 100% reproducible.

Version: 0.6.2-55-gcaf84884c4
Branch: master
Commit: caf8488
Date: Fri Jan 28 06:10:46 PM UTC 2022

System Information

OS: Kubuntu 21.04 - 5.11.0-38-generic
CPU: Core i7-6700K @ 4GHz
GPU: NVIDIA GeForce GTX 1070
GPU Driver: 4.6.0 NVIDIA 470.74

Additional Context

No response

@abaire abaire added the bug Something isn't working label Jan 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant