This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH][BZ #13601] Retry read in ld.so if the entire ELF headeris not read in
- From: Rich Felker <dalias at aerifal dot cx>
- To: libc-alpha at sourceware dot org
- Date: Fri, 19 Oct 2012 14:02:33 -0400
- Subject: Re: [PATCH][BZ #13601] Retry read in ld.so if the entire ELF headeris not read in
- References: <20121019201444.06c09192@spoyarek>
On Fri, Oct 19, 2012 at 08:14:44PM +0530, Siddhesh Poyarekar wrote:
> Hi,
>
> We currently assume that the operation to read in the DSO in
> open_verify always reads in the entire ELF header. This assumption is
> wrong since the read syscall is free to return smaller chunks of data
> and we ought to continue reading if that happens. Attached patch does
> exactly that. I have verified that there are no regressions resulting
> from this patch on x86_64 F-16, but I don't have a way to verify that
> the split read works. OK to commit?
In reality, I don't think this ever happens. Reads on ordinary files
do not "block" and are not subject to interruption by signals or any
other conditions that could cause an early return. If you want to test
it you could try having it read from a pipe instead, but the
subsequent mmap will of course fail so all you could test is that the
split reading works.
Rich