Grasscutters / Cultivation

A custom launcher designed to make it as easy as possible to proxy anime game traffic to private servers.
Apache License 2.0
974 stars 160 forks source link

Crash #39

Closed YuuLuo closed 2 years ago

YuuLuo commented 2 years ago

Followed the steps to build,but crashed soon when clicked "Launch". When using yarn start:dev, the terminal showed: Failed to parse response: missing field bg_file at line 1 column 279321 Failed to parse response: missing field bg_file at line 1 column 279321 Patching metadata file: C:\Users\1111\AppData\Roaming\cultivation\metadata\global-metadata-unpatched.dat Successfully decrypted global-metadata Replacing password key Replacing dispatch key fatal runtime error: Rust cannot catch foreign exceptions error Command failed with exit code 4294967295. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. error Command failed with exit code 3221226505. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Seeker14491 commented 2 years ago

I reproduced this issue on my PC, and using a debugger I saw the crash happen on this line:

https://github.com/Grasscutters/Cultivation/blob/6ff1ef932c3a8e254239de0902a6286180208ad2/src-tauri/mhycrypto/metadatastringdec.cpp#L116

This is C++ code that Rust calls. Rust can't catch C++ exceptions, so we shouldn't be throwing exceptions unless we catch them on the C++ side.

As for why the exeption is thrown to begin with, I'm not sure. I'm not familiar with this part of the code, but it seems like something's wrong with the metadata.