Open narodnik opened 6 hours ago
I managed to grab a backtrace:
[0x0] mesadrv!stw_unbind_context+0x1cef6 0xae340ebd40 0x7ffd2f0b900d
[0x1] mesadrv!stw_unbind_context+0x1d1ad 0xae340ebe00 0x7ffd2f265fb4
[0x2] mesadrv!st_screen_destroy+0x83e24 0xae340ebeb0 0x7ff6ac0b3750
[0x3] darkwallet!miniquad::native::gl::glBufferSubData+0x70 [C:\Users\a\.cargo\git\checkouts\miniquad-e9b2a2fb4d6640d7\5a9a76b\src\native\gl.rs @ 324] 0xae340ebf00 0x7ff6ac0c767e
[0x4] darkwallet!miniquad::graphics::gl::impl$11::new_buffer+0x2fe [C:\Users\a\.cargo\git\checkouts\miniquad-e9b2a2fb4d6640d7\5a9a76b\src\graphics\gl.rs @ 1299] 0xae340ebf60 0x7ff6ac015e1e
[0x5] darkwallet!darkwallet::impl$3::update+0x5fe [C:\Users\a\darkfi\bin\darkwallet\src\main.rs @ 317] 0xae340ec080 0x7ff6ac09cf8f
[0x6] darkwallet!miniquad::native::windows::win32_wndproc+0x108f [C:\Users\a\.cargo\git\checkouts\miniquad-e9b2a2fb4d6640d7\5a9a76b\src\native\windows.rs @ 493] 0xae340ec820 0x7ffd892eef5c
[0x7] user32!UserCallWinProcCheckWow+0x50c 0xae340ecd10 0x7ffd892ee9de
[0x8] user32!CallWindowProcW+0x8e 0xae340ecea0 0x7ffd520ef1f0
...
Seems it's related to this code in new_buffer()
:
if let BufferSource::Slice(data) = data {
debug_assert!(data.is_slice);
glBufferSubData(gl_target, 0, size as _, data.ptr as _);
}
I tried changing it to this:
if let BufferSource::Slice(data) = data {
debug_assert!(data.is_slice);
glBufferData(gl_target, size as _, data.ptr as *const _, gl_usage);
} else {
glBufferData(gl_target, size as _, std::ptr::null() as *const _, gl_usage);
}
but it now crashes on glBufferData()
instead.
Miniquad is running on a backend thread and received requests to create and delete buffers using a queue. On Linux it runs fine with no issues, but on Windows, the program crashes with:
error: process didn't exit successfully: ... (exit code: 0xc00000005, STATUS_ACCESS_VIOLATION)
.Here's the output log:
This is windows 10. Strangely if I remove the sleep from the code then it works fine.
I've uploaded the project here for easy checkout and run: https://github.com/narodnik/miniquad-bug-win10