[PATCH] libelf: Fix some 32bit offset/size issues that break updating 4G+ files.

Mark Wielaard mark@klomp.org
Wed Jun 19 23:10:00 GMT 2019

On Wed, 2019-06-19 at 02:04 +0200, Mark Wielaard wrote:
> The patch also contains a testcase. But since it is necessary to create
> and process a 4GB+ file it is guarded by some checks to make sure the
> machine has enough disk and memory. Do these checks look reasonable?
> They probably prevent (make the test SKIP) on all buildbot CI workers.

We discussed this a bit on irc and it was pointed out that the machine
also really needs to have a somewhat fast disk. After a bit of
experimenting I found the following the be a good indicator of the
testcase being able to run in reasonable time:

diff --git a/tests/run-large-elf-file.sh b/tests/run-large-elf-file.sh
index 3d1bdb6..d97eec9 100755
--- a/tests/run-large-elf-file.sh
+++ b/tests/run-large-elf-file.sh
@@ -35,6 +35,15 @@ if test $space_available -lt 10; then
   exit 77
+# Make sure the disk is reasonably fast, should be able to write 100MB/s
+timeout -s9 10s dd conv=fsync if=/dev/urandom of=tempfile bs=1M count=1K \
+  || fast_disk=0; rm tempfile
+if test $fast_disk -eq 0; then
+  echo "Disk not fast enough, need at least 100MB/s"
+  exit 77
 # Make sure the files fit into memory, assume 6GB needed (2.5 * 2 + 1 extra).
 mem_available=$(free -g | grep ^Mem: | awk -F ' +' '{print $7}')
 echo "mem_available: $mem_available"

More information about the Elfutils-devel mailing list