wgpu: Segfault/hang related to gpu-alloc (macOS 11, metal)
After updating to latest version of wgpu-rs, I’ve gotten a consistent crash issue in my code. If I roll back to the version of wgpu-rs before gpu-alloc replaced gfx-memory, then the app runs fine. The crash isn’t immediate, but does happen consistently after the app renders enough frames.
I’ll see what I can do to reproduce in some smaller codebase, but the problem I’m having now is that I’ve only gotten a segfault once - every other time it just locks up the computer, forcing me to reboot. That’s making it more than a little difficult to track down.
The best I’ve got so far is that it’s happening in queue.rs queue_write_buffer when it calls:
stage.memory.write_bytes(&device.raw, 0, data)?;
MemoryBlock::write_bytes has some unsafe code calling into gpu-alloc that is presumably where things go bad.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 1
- Comments: 21 (19 by maintainers)
Weird, I was able to replay your trace without
entered unreachable code
, and I don’t see anyEmpty
used in it. Anyway, machine just totally went nuts upon replaying, unfortunately. The driver doesn’t catch writing outside of bounds, and we are stomping on some driver userland data.trace.zip
Trace attached. No stack trace on this one, as it never got written to the log. Looks like WindowServer died.
To help repro this issue, it might be helpful to have a wgpu trace created with the offending version. https://github.com/gfx-rs/wgpu/wiki/Debugging-wgpu-Applications#tracing-infrastructure are instructions on how to record one.