-
Notifications
You must be signed in to change notification settings - Fork 237
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
read.c fails to handle views of more than 2,147,479,552 bytes #32
Comments
While I'm fine with fixing this, I need to check: is this a problem that actually occurs, or is this purely theoretical? The file read.c should never be used on a GNU/Linux system. |
@ianlancetaylor: This actually occured - see rust-lang/rust#69151. |
Again, though, read.c should never be used on a GNU/Linux system. Are you sure you've diagnosed the problem correctly? |
@ianlancetaylor: Yes - I stepped through with It looks like Is |
I see. Thanks for the info. Yes, mmapio.c is more efficient. I see they are also using alloc.c rather than mmap.c, which means that that version won't work correctly if invoked from a signal handler. Odd. |
Well, this triggers #29. |
@Aaron1011 Could you show the |
On Linux, the
read
syscall will transfer at most 2,147,479,552 bytes (~2.147 GB). This means thatread
will return2,147,479,552
even if the file being read from has more data available.read.c
interprets this condition as the file being too short, resulting in an error:libbacktrace/read.c
Lines 81 to 86 in 559ab7c
If a file's debuginfo sections add up to more than 2,147,479,552 bytes, this will cause a spurious failure:
libbacktrace/elf.c
Lines 3162 to 3165 in 559ab7c
I recognize that it's unusual for a file to have such a large amount of debug info. However, it would be very useful if libbacktrace could handle this case by using multiple
read
calls, as this issue makes it impossible to generate backtraces for such files.The text was updated successfully, but these errors were encountered: