Skip to content

fs: preadv failing on armv7 #4532

@santigimeno

Description

@santigimeno

This is a strange issue. When running on the Node.js armv7 build bots, the preadv tests are failing. In fact preadv returns EINVAL even though the arguments are correct. I was adding some debug statements to the uv__preadv_or_pwritev() method when suddenly with this specific modifications it started working. At the moment I cannot add more info as I cannot run strace nor a debugger in that specific environment

diff --git a/deps/uv/src/unix/fs.c b/deps/uv/src/unix/fs.c
index 4a4e2e3ad85..2fa80733293 100644
--- a/deps/uv/src/unix/fs.c
+++ b/deps/uv/src/unix/fs.c
@@ -477,13 +477,17 @@ static ssize_t uv__preadv_or_pwritev(int fd,
     p = dlsym(RTLD_DEFAULT, is_pread ? "preadv" : "pwritev");
     dlerror();  /* Clear errors. */
 #endif  /* RTLD_DEFAULT */
+    fprintf(stderr, "p: %p\n", p);
     if (p == NULL)
       p = is_pread ? uv__preadv_emul : uv__pwritev_emul;
     atomic_store_explicit(cache, (uintptr_t) p, memory_order_relaxed);
   }
 
   f = p;
-  return f(fd, bufs, nbufs, off);
+  ssize_t r = f(fd, bufs, nbufs, off);
+  fprintf(stderr, "fd: %d. r: %d\n", fd, r);
+  return r;
+  //return f(fd, bufs, nbufs, off);
 }

It looks like a compiler optimization going wrong but I don't know what to look at next. Any ideas? /cc @bnoordhuis

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions