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

Deadlock with render_mutex and fifo_mutex #386

Open
Vort opened this issue Nov 15, 2024 · 0 comments
Open

Deadlock with render_mutex and fifo_mutex #386

Vort opened this issue Nov 15, 2024 · 0 comments

Comments

@Vort
Copy link
Contributor

Vort commented Nov 15, 2024

While watching how my GlideTest_v3.zip program spins triangle (Windows 95 + Voodoo 3), I noticed Bochs hang. This most likely happens as side effect of #264 fix. Hang is random because it is caused by race condition.

It is possible to get deadlock with render_mutex and fifo_mutex. Here are stack traces:

Main thread:
>	bochs.exe!bx_voodoo_base_c::update() Line 575	C++
 	bochs.exe!bx_banshee_c::update() Line 971	C++
 	bochs.exe!bx_vgacore_c::vga_timer_handler(void * this_ptr) Line 2410	C++
 	bochs.exe!bx_virt_timer_c::periodic(unsigned __int64 time_passed, bool mode) Line 149	C++
 	bochs.exe!bx_virt_timer_c::timer_handler(bool mode) Line 435	C++
 	bochs.exe!bx_pc_system_c::countdownEvent() Line 382	C++
 	[Inline Frame] bochs.exe!bx_pc_system_c::tickn(unsigned int n) Line 115	C++
 	bochs.exe!BX_CPU_C::cpu_loop() Line 123	C++
 	bochs.exe!bx_begin_simulation(int argc, char * * argv) Line 1051	C++
 	bochs.exe!win32_ci_callback(void * userdata, ci_command_t command) Line 798	C++
 	bochs.exe!bx_real_sim_c::configuration_interface(const char * ignore, ci_command_t command) Line 940	C++
 	bochs.exe!bxmain() Line 337	C++
FIFO thread:
>	bochs.exe!swap_buffers(_voodoo_state * v) Line 1135	C++
 	bochs.exe!swapbuffer(_voodoo_state * v, unsigned int data) Line 1162	C++
 	bochs.exe!register_w(unsigned int offset, unsigned int data, bool log) Line 2101	C++
 	bochs.exe!cmdfifo_process(_cmdfifo_info * f) Line 3139	C++
 	bochs.exe!fifo_thread(void * indata) Line 235	C++
  1. Main thread: bx_voodoo_base_c::update locks render_mutex;
  2. FIFO thread: swapbuffer locks fifo_mutex;
  3. Main thread: bx_voodoo_base_c::update locks fifo_mutex;
  4. FIFO thread: swap_buffers locks render_mutex.

Version: 35e9350

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant