[Bug 1871129] Re: htop is blank when using in focal in wsl1

Launchpad Bug Tracker 1871129 at bugs.launchpad.net
Tue Sep 22 15:30:18 UTC 2020


This bug was fixed in the package glibc - 2.31-0ubuntu9.1

---------------
glibc (2.31-0ubuntu9.1) focal; urgency=medium

  [ Michael Hudson-Doyle ]
  * Mark tst-getpw as XFAIL on arm64. (LP: #1869364)

  [ Matthias Klose ]
  * Copy the fully conditionalized x86 variant for math-vector-fortran.h
    to /usr/include/finclude. On all architectures. (LP: #1879092)

  [ Balint Reczey ]
  * debian/gbp.conf: Add initial configuration
  * debian/control.in/main: Add Vcs-* pointing to Ubuntu packaging repository
  * debian/debhelper.in/libc.preinst: Fix setting LDCONFIG_NOTRIGGER
    (LP: #1889190)
  * Fall back to calling nanosleep syscall when __clock_nanosleep returns
    EINVAL due to CLOCK_REALTIME not being supported (LP: #1871129)
  * debian/testsuite-xfail-debian.mk: XFAIL tst-getpw on armhf, too
    (LP: #1869364)
  * XFAIL stdlib/tst-getrandom (LP: #1891403)

  [ Dimitri John Ledkov ]
  * debian/patches/powerpc: Cherrypick upstream patches to support POWER10
    optimized library loading. LP: #1887989

 -- Balint Reczey <rbalint at ubuntu.com>  Mon, 17 Aug 2020 22:02:52 +0200

** Changed in: glibc (Ubuntu Focal)
       Status: Fix Committed => Fix Released

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to glibc in Ubuntu.
https://bugs.launchpad.net/bugs/1871129

Title:
  htop is blank when using in focal in wsl1

Status in Ubuntu WSL:
  In Progress
Status in glibc package in Ubuntu:
  Fix Released
Status in htop package in Ubuntu:
  Invalid
Status in glibc source package in Focal:
  Fix Released

Bug description:
  [Impact]

  Programs previously using nanosleep syscall and with glibc 31's update
  being switched to use clock_nanosleep broke due to clock_nanosleep
  using CLOCK_REALTIME returns EINVAL in wsl1.

  [Test Case]

  Run sleep in WSL1 on Windows 10 2004 or older version.
  The fixed version works correctly, the not fixed version breaks in Focal.

  Run the following program under in WSL1 and on a real kernel with
  strace and observe that the fallback is applied only when it is
  needed:

  #include <time.h>
  #include <stdio.h>

  int main (int argc, char ** argv) {
   struct timespec ts, rem;
         clock_gettime(CLOCK_REALTIME, &ts);
   printf("Sleep 1.5s with TIMER_ABSTIME\n");
   ts.tv_nsec += 500000000L;
   if (ts.tv_nsec > 1000000000L) {
    ts.tv_nsec -= 1000000000L;
      ts.tv_sec += 1;
   }
   ts.tv_sec += 1;
   clock_nanosleep(CLOCK_REALTIME, TIMER_ABSTIME, &ts, &rem);

   printf("sleep 1.2s\n");
   ts.tv_sec = 1;
   ts.tv_nsec = 200000000L;
   clock_nanosleep(CLOCK_REALTIME, 0, &ts, &rem);

   printf("sleep 1.2s with CLOCK_MONOTONIC\n");
   ts.tv_sec = 1;
   ts.tv_nsec = 200000000L;
   clock_nanosleep(CLOCK_MONOTONIC, 0, &ts, &rem);

   printf("invalid sleep -1s (+200ms)\n");
   ts.tv_nsec = 200000000L;
   ts.tv_sec = -1;
   clock_nanosleep(CLOCK_REALTIME, 0, &ts, &rem);

   printf("invalid sleep 1s (-200ms)\n");
   ts.tv_nsec = -200000000L;
   ts.tv_sec = 1;
   clock_nanosleep(CLOCK_REALTIME, 0, &ts, &rem);

   printf("invalid sleep 0s (+1.200ms as nsec)\n");
   ts.tv_nsec = 1200000000L;
   ts.tv_sec = 1;
   clock_nanosleep(CLOCK_REALTIME, 0, &ts, &rem);

  }

  [Regression Potential]

  The fix is falling back to using monotonic time and also converts the clock_nanosleep call to not use TIMER_ABSTIME in the fallback.
  If the calculation from absolute to relative time is not correct then it may result in a very long sleep effectively hanging the calling process.
  Also the checks in the callback can crash the calling program if a mistake is made.
  The program in the [Test] section aims to cover all branches of the fix.

  [Original Bug Text]

  Right now I am trying Ubuntu 20.04 on WSL and I noticed that when I
  run htop in WSL 1st generation, it is completely blank:

  https://user-images.githubusercontent.com/15316889/78563857-31697b00
  -784e-11ea-9f21-338a6cf8cb23.gif

  The previous version (htop 2.1.0) works without any issue.

  I am using htop 2.2.0-2build1 on Ubuntu 20.04 on WSL1 on Windows 10
  build 19592.1001.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntuwsl/+bug/1871129/+subscriptions



More information about the foundations-bugs mailing list