-
-
Notifications
You must be signed in to change notification settings - Fork 465
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
xrCore: Fix spurious assertion failures in FS::FileDownload
for linux
#1512
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AMS21
force-pushed
the
fix/fs_file_download
branch
from
November 10, 2023 12:49
2a4f6e1
to
eee69be
Compare
AMS21
changed the title
xrCore: Fix spurious assertion failures in
xrCore: Fix spurious assertion failures in Nov 10, 2023
FS::FileDownload
FS::FileDownload
for linux
This was caused by a misuse of the `read` function which was called only once and expected to read the entire `file_size` this is however not correct. To quote the man page (https://man7.org/linux/man-pages/man2/read.2.html) > RETURN VALUE > > On success, the number of bytes read is returned (zero indicates > end of file), and the file position is advanced by this number. > It is not an error if this number is smaller than the number of > bytes requested; this may happen for example because fewer bytes > are actually available right now (maybe because we were close to > end-of-file, or because we are reading from a pipe, or from a > terminal), or because read() was interrupted by a signal. Note all other platforms we support do guarantee to read the entire buffer. - apple: https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/read.2.html - bsd: https://man.freebsd.org/cgi/man.cgi?read(2) - windows: https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/read
AMS21
force-pushed
the
fix/fs_file_download
branch
from
November 10, 2023 12:51
eee69be
to
d681fb9
Compare
Xottab-DUTY
reviewed
Nov 12, 2023
Xottab-DUTY
reviewed
Nov 12, 2023
Xottab-DUTY
approved these changes
Nov 12, 2023
AMS21
added a commit
to AMS21/xray-16
that referenced
this pull request
Nov 14, 2023
AMS21
added a commit
to AMS21/xray-16
that referenced
this pull request
Nov 14, 2023
AMS21
added a commit
to AMS21/xray-16
that referenced
this pull request
Nov 14, 2023
AMS21
added a commit
to AMS21/xray-16
that referenced
this pull request
Nov 17, 2023
AMS21
added a commit
to AMS21/xray-16
that referenced
this pull request
Nov 25, 2023
Xottab-DUTY
pushed a commit
that referenced
this pull request
Nov 29, 2023
Xottab-DUTY
added a commit
that referenced
this pull request
Feb 15, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This was caused by a misuse of the
read
function which was called only once and expected to read the entirefile_size
this is however not correct.To quote the man page
Note all other platforms we support do guarantee to read the entire buffer.