bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug gold/23517] New: fileread: Fails to handle short reads with vector


From: d.c.ddcc at gmail dot com
Subject: [Bug gold/23517] New: fileread: Fails to handle short reads with vector I/O
Date: Mon, 13 Aug 2018 00:04:08 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=23517

            Bug ID: 23517
           Summary: fileread: Fails to handle short reads with vector I/O
           Product: binutils
           Version: 2.29
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: gold
          Assignee: ccoutant at gmail dot com
          Reporter: d.c.ddcc at gmail dot com
                CC: ian at airs dot com
  Target Milestone: ---

On an armhf system running Ubuntu 18.04 with binutils 2.30, I occasionally
receive some variant of the following error when linking code over an NFSv4
filesystem:

/usr/bin/arm-linux-gnueabihf-ld.gold: fatal error:
build/opt/mongo/db/fts/fts_element_iterator.o: file too short: read only 18202
of 26977 bytes at 137446

This appears to be generated by File_read::do_readv() inside gold/fileread.cc,
when the return value of readv() is smaller than expected.

ssize_t got = ::readv(this->descriptor_, iov, iov_index);
if (got != want)
  gold_fatal(_("%s: file too short: read only %zd of %zd bytes at %lld"),
               this->filename().c_str(),
               got, want, static_cast<long long>(base + first_offset));

According to the documentation of readv(), this is not necessarily an error:

Note that it is not an error for a successful call to transfer fewer bytes than
requested (see read(2) and write(2)).

As background, this situation can occur when some sort of complex page is
encountered within the Linux kernel, while performing vector I/O. In fact, I
receive a warning from the kernel:

WARNING: CPU: 6 PID: 937 at lib/iov_iter.c:695 copy_page_to_iter+0x2c4/0x4c4
Modules linked in: rpcsec_gss_krb5 lzo lzo_compress zram binfmt_misc spidev
evdev spi_s3c64xx uio_pdrv_genirq uio exynos_gpiomem gpio_keys sch_fq_codel
nfsd sit tunnel4 ip_tunnel ip_tables ipv6 extcon_usb_gpio
CPU: 6 PID: 937 Comm: arm-linux-gnuea Tainted: G        W       4.14.47-132 #1
Hardware name: ODROID-XU4
[<c0110b14>] (unwind_backtrace) from [<c010ce98>] (show_stack+0x10/0x14)
[<c010ce98>] (show_stack) from [<c08a8854>] (dump_stack+0x84/0x98)
[<c08a8854>] (dump_stack) from [<c01242cc>] (__warn+0xec/0x104)
[<c01242cc>] (__warn) from [<c0124394>] (warn_slowpath_null+0x20/0x28)
[<c0124394>] (warn_slowpath_null) from [<c046ae88>]
(copy_page_to_iter+0x2c4/0x4c4)
[<c046ae88>] (copy_page_to_iter) from [<c021ebc8>]
(generic_file_read_iter+0x2ac/0x8e8)
[<c021ebc8>] (generic_file_read_iter) from [<c038fb80>]
(nfs_file_read+0x60/0x98)
[<c038fb80>] (nfs_file_read) from [<c0283324>]
(do_iter_readv_writev+0x104/0x158)
[<c0283324>] (do_iter_readv_writev) from [<c02846a0>] (do_iter_read+0xe0/0x1a0)
[<c02846a0>] (do_iter_read) from [<c0285d58>] (vfs_readv+0x50/0x68)
[<c0285d58>] (vfs_readv) from [<c0285dc4>] (do_readv+0x54/0xdc)
[<c0285dc4>] (do_readv) from [<c010893c>] (__sys_trace_return+0x0/0x10)
---[ end trace 31bb0ea7bbe390aa ]---

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]