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

Robie Basak 1871129 at bugs.launchpad.net
Wed Sep 2 14:36:47 UTC 2020


Hello Patrick, or anyone else affected,

Accepted glibc into focal-proposed. The package will build now and be
available at https://launchpad.net/ubuntu/+source/glibc/2.31-0ubuntu9.1
in a few hours, and then in the -proposed repository.

Please help us by testing this new package.  See
https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how
to enable and use -proposed.  Your feedback will aid us getting this
update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug,
mentioning the version of the package you tested, what testing has been
performed on the package and change the tag from verification-needed-
focal to verification-done-focal. If it does not fix the bug for you,
please add a comment stating that, and change the tag to verification-
failed-focal. In either case, without details of your testing we will
not be able to proceed.

Further information regarding the verification process can be found at
https://wiki.ubuntu.com/QATeam/PerformingSRUVerification .  Thank you in
advance for helping!

N.B. The updated package will be released to -updates after the bug(s)
fixed by this package have been verified and the package has been in
-proposed for a minimum of 7 days.

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

** Tags added: verification-needed verification-needed-focal

-- 
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 Committed
Status in htop package in Ubuntu:
  Invalid
Status in glibc source package in Focal:
  Fix Committed

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