rfd icon indicating copy to clipboard operation
rfd copied to clipboard

Dragging and dropping file from file dialog to winit window causes memory corruption on windows.

Open Kl4rry opened this issue 3 years ago • 6 comments

When a file is dragged from an open rfd dialog and dropped in a winit window the program crashes with the error:

(exit code: 0xc0000374, STATUS_HEAP_CORRUPTION)

Kl4rry avatar Jun 04 '22 21:06 Kl4rry

Hi!

  1. Is this async dialog or sync one?
  2. If it is sync, is there any threading involved?
  3. Could you perhaps provide a full rust-gdb backtrace? That would be helpful.

PolyMeilex avatar Jun 04 '22 21:06 PolyMeilex

What OS?

Be-ing avatar Jun 04 '22 21:06 Be-ing

STATUS_HEAP_CORRUPTION looks like Microsoft COM error, so I assume windows. Winit uses COM to handle it's drag and drop so we are probably having some races related to that. I remember having the same problems with cpal audio + winit drag and drop

PolyMeilex avatar Jun 04 '22 21:06 PolyMeilex

  1. The sync dialog was used
  2. The dialog was spawned from a second thread to avoid blocking the winit main thread I would provid a rust-gdb backtrace if i knew how to create one.

Kl4rry avatar Jun 04 '22 22:06 Kl4rry

rust-gdb should be available out of the box in rust toolchain.

1. rust-gdb ./path/to/binary
2. type in `run` (or `r` for short)
3. reproduce the crash
4. type in `backtrace`

PolyMeilex avatar Jun 04 '22 22:06 PolyMeilex

It does not seem to be avaliable by default. I ran in to this isssue while trying to run it rust-lang/rustup#2838. Both using the gnu and msvc toolchains.

Kl4rry avatar Jun 04 '22 22:06 Kl4rry