encounter / objdiff

A local diffing tool for decompilation projects
Apache License 2.0
125 stars 21 forks source link

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

Closed Yanis002 closed 6 months ago

Yanis002 commented 6 months 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 6 months ago

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

AetiasHax commented 6 months ago

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

AetiasHax commented 6 months 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.

Yanis002 commented 6 months 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