[Bug 1792647] Re: libuv1 calls readlink() with buffer size zero for /proc/self (nodejs test-case failure on s390x and LXD)

Mauricio Faria de Oliveira mfo at canonical.com
Mon Sep 17 11:11:44 UTC 2018


** Summary changed:

- fix nodejs test-case failure on s390x and LXD
+ libuv1 calls readlink() with buffer size zero for /proc/self (nodejs test-case failure on s390x and LXD)

-- 
You received this bug notification because you are a member of Ubuntu
Sponsors Team, which is subscribed to the bug report.
https://bugs.launchpad.net/bugs/1792647

Title:
  libuv1 calls readlink() with buffer size zero for /proc/self (nodejs
  test-case failure on s390x and LXD)

Status in libuv1 package in Ubuntu:
  New

Bug description:
  The Debian patch 'path_max' causes failures when
  readlink'ing symlinks that involve /proc/self
  (and potentially other symlinks in /proc)
  which report st_size == 0.

  It uses st_size as a buffer size for readlink(),
  which then fails with EINVAL.

  This breaks the nodejs test-case test-fs-realpath-pipe.js
  on s390x and LXD containers (which symlink /dev/stdin
  to /proc/self/fd/0 vs. fd/0 as in amd64 non-container):

      $ strace -E LD_LIBRARY_PATH=/usr/local/lib/ -f -e lstat,readlink \
        node test/parallel/test-fs-realpath-pipe.js 

      [pid 17785] lstat("/dev", {st_mode=S_IFDIR|0755, st_size=480, ...}) = 0
      [pid 17786] lstat("/dev/stdin", {st_mode=S_IFLNK|0777, st_size=15, ...}) = 0
      [pid 17788] lstat("/dev/stdin", {st_mode=S_IFLNK|0777, st_size=15, ...}) = 0
      [pid 17788] readlink("/dev/stdin", "/proc/self/fd/0", 15) = 15

      [pid 17785] lstat("/proc", {st_mode=S_IFDIR|0555, st_size=0, ...}) = 0
      [pid 17786] lstat("/proc/self", {st_mode=S_IFLNK|0777, st_size=0, ...}) = 0
      [pid 17788] lstat("/proc/self", {st_mode=S_IFLNK|0777, st_size=0, ...}) = 0
      [pid 17788] readlink("/proc/self", 0x7f2a6c000b40, 0) = -1 EINVAL (Invalid argument)

  I'll submit a patch shortly.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/libuv1/+bug/1792647/+subscriptions



More information about the Ubuntu-sponsors mailing list