Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make fs::dir::open return false on failed metadata instead of crashing #4138

Merged
merged 3 commits into from Feb 3, 2018

Conversation

Projects
None yet
2 participants
@zekesonxx
Copy link
Contributor

commented Feb 2, 2018

I have a bunch of symlinks in $rpcs3/dev_hdd0/disc to my network drive. If I don't have that drive mounted, I get:

$ ./bin/rpcs3
terminate called after throwing an instance of 'std::runtime_error'
 what():  Verification failed (e=2): dir::read
(in file /home/zekesonxx/bullshit/rpcs3/Utilities/File.cpp:1261)
[1]    14339 abort (core dumped)  ./bin/rpcs3

which is less than pleasant.

Now rpcs3 will fail gracefully on broken symlinks.

Q. Why doesn't this log or something when it fails to get metadata?

  1. File.cpp doesn't have Log.h included, feels like a waste just for this
  2. It already doesn't log if it fails to readdir
  3. If fs::dir::open fails, and it matters, whatever is calling it will log a more useful error anyways.
  4. [8:11 PM] Megamouse: then just ignore it.

addendum: [8:22 PM] Megamouse: (don't quote me so neko knows possible culprits)

@Nekotekina

This comment has been minimized.

Copy link
Member

commented Feb 2, 2018

Thanks but needs also set set g_tls_error when returning false.

@zekesonxx

This comment has been minimized.

Copy link
Contributor Author

commented Feb 2, 2018

How's that?

@Nekotekina

This comment has been minimized.

Copy link
Member

commented Feb 2, 2018

Sorry, it seems the correct solution would be returning next directory instead. False indicates the end of the directory list, and the TLS error is not applicable here as well.

@zekesonxx zekesonxx force-pushed the zekesonxx:fsopenfix branch from fb80544 to f8bca40 Feb 3, 2018

@zekesonxx

This comment has been minimized.

Copy link
Contributor Author

commented Feb 3, 2018

Third try's the charm?

@Nekotekina Nekotekina merged commit c21fa2d into RPCS3:master Feb 3, 2018

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@zekesonxx zekesonxx deleted the zekesonxx:fsopenfix branch Feb 7, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.