encounter / objdiff

A local diffing tool for decompilation projects
Apache License 2.0
77 stars 13 forks source link

[Bug] GUI version is crashing with WSL(2) #66

Closed Yanis42 closed 1 month ago

Yanis42 commented 1 month ago

currently the case for the latest release, steps to reproduce:

I tried the CLI version to see if there was a similar issue and it worked, and the GUI version worked when I moved the project's folder to my Windows desktop

TakaRikka commented 1 month ago

also getting this with tp decomp. crashes immediately upon selecting the project folder, which is under WSL2

AetiasHax commented 1 month ago

It seems to work when running from source, so the release build might be broken

AetiasHax commented 1 month ago

I looked into this a bit further, it seems the crash is caused when trying to use notify to watch a directory for file changes. The Windows implementation in notify does this by calling the Win32 API function ReadDirectoryChangesW which presumably doesn't work with \\wsl.localhost\<distro> paths.

As for why notify crashes... it's got something to do with their unsafe error handling when ReadDirectoryChangesW returns false. Disabling LTO (lto = "off") fixes the crash, but the watching functionality is still not there.

Unfortunately, notify only builds for one target OS at a time, so it seems we can't access both the Linux and Windows implementations in a single build. The best we can do is disable directory watching when opening WSL projects, I think.

Yanis42 commented 1 month ago

which presumably doesn't work with \\wsl.localhost\<distro> paths

I also tried using Z:/path/to/project instead of \\wsl.localhost/distro/path/to/project and it was crashing too