[WSL1] [glibc] sleep: cannot read realtime clock: Invalid argument

Windows build number: Microsoft Windows [Version 10.0.18362.592]
WSL version: 1
Linux distro: Arch WSL
Description:
I'm using Arch WSL in WSL 1 and after an update which bumped glibc from 2.30.3 to 2.31.1 the sleep command stopped working throwing out the error: sleep: cannot read realtime clock: Invalid argument
This affects namely as Ansible, as ansible runs sleep commands in multiple modules. In this issue, on the Arch WSL github (https://github.com/yuk7/ArchWSL/issues/108) , some problems with rust packages were also identified.
Downgrading to the previous version solves the issue. Now, I know that Arch WSL is not an official WSL implementation but this may actually happen when Ubuntu, etc, reach the aforementioned version of glibc

I can confirm upgrading glibc from 2.30.3 to 2.31.1 on Arch on WSL breaks sleep.

I used the Arch rootfs from the ArchWSL project: https://github.com/yuk7/ArchWSL/releases/download/<IP_ADDRESS>/Arch.zip
Imported it.
Confirmed 2.20.3 installed:
$ pacman -Q --info glibc
In /etc/pacman.conf changed SigLevel= to Never.
Ran updates:
$ pacman -Syu
Confirmed new version:
$ pacman -Q --info glibc
Tried $ sleep 10. Got came error.
We are on track to land glibc 2.30 in Focal but this could affect Ubuntu down the line on 20.10.
strace attached.
sleep10.txt

It looks like sleep used to call:
nanosleep({tv_sec=10, tv_nsec=0}, NULL) = 0

sleep10-glibc2.30-3.txt
Appears that support for nanosleep was added in 14915.
But now calls:
clock_nanosleep(CLOCK_REALTIME, 0, {tv_sec=10, tv_nsec=0}, NULL)

sleep10-glibc2.31-1.txt
The line in sleep is here: https://github.com/coreutils/coreutils/blob/master/src/sleep.c#L142
if (xnanosleep (seconds))

But xnanosleep.c hasn't changed in gnulib: https://fossies.org/diffs/coreutils/8.30_vs_8.31/lib/xnanosleep.c-diff.html
Here are the release notes for glibc 2.31.1, they mention some changes related to clock issues but nothing jumps out as directly related: https://sourceware.org/ml/libc-announce/2020/msg00001.html
That is as far down this rabbit hole I have gone.
Also this may all technically be a duplicate of https://github.com/microsoft/WSL/issues/2503

Also this may all technically be a duplicate of #2503

Most def. Apologies I saw this submission and knew it was dupe #2503 earlier in the afternoon, but got pulled away before I could hit the button. Thanks for going down the rabbit hole.
I'll forward-dupe #2503 as a (probably bad precedent) bump. If this is in glibc it'll hit distros in the store soon enough. [It is a most unfortunate change; there isn't anything real time about the standard C library. But I digress.] Presumably eating CLOCK_REALTIME but providing CLOCK_MONOTONIC semantics in the WSL1 driver would be a pretty small change.

Between glibc 2.30 and 2.31 they add the following to /posix/nanosleep.c:
{
  int ret = __clock_nanosleep (CLOCK_REALTIME, 0, requested_time, remaining);
  if (ret != 0)
    {
      __set_errno (ret);
      return -1;
    }
  return 0;
}

``

Right, this.

Here is the email thread.
Interesting:
POSIX.1 specifies that nanosleep() should measure time against the
   CLOCK_REALTIME clock.

Yeah. Ref.

I was wondering would issues like these get backported to with cumulative updates, or I would I have to wait till the next window version.

I spoke with one of the senior engineers on our foundations team and they do plan to land glibc 2.31, with the problematic change, in Ubuntu Focal 20.04, our next release in April.
This one would be a useful to have backported unless it can be fixed upstream.

sorry for commenting again I was wondering if there were going to have wait till the next window version to get it fixed?

As @therealkenc surmised, the issue is the lack of CLOCK_REALTIME support in WSL1's clock_nanosleep. We have a fix working internally, which will make its way to insiders. We will also look into backporting this to older Windows versions, but I can't make any promises or provide a timeline for this, unfortunately.

I believe this is the problem that caused 100% CPU utilization on a single core for the cron process on my system. It used to run well until a few days ago the cron daemon process suddenly always on 100% CPU core usage. I checked my system it indeed has glibc upgraded to 2.31 on Feb 20. Then I straced cron process, it keeps calling clock_nanosleep(CLOCK_REALTIME, ...) indefinitely, might be the problem that caused high CPU utilization.

I've gotten 2.31 to work fine on my Arch install by recompiling the package with a patch to __clock_nanosleep replacing CLOCK_REALTIME with CLOCK_MONOTONIC:
diff -ruN glibc-2.31/sysdeps/unix/sysv/linux/clock_nanosleep.c glibc-2.31-b/sysdeps/unix/sysv/linux/clock_nanosleep.c
--- glibc-2.31/sysdeps/unix/sysv/linux/clock_nanosleep.c	2020-02-01 12:52:50.000000000 +0100
+++ glibc-2.31-b/sysdeps/unix/sysv/linux/clock_nanosleep.c	2020-03-05 23:51:05.856886500 +0100
@@ -31,7 +31,8 @@
                           struct __timespec64 *rem)
 {
   int r;
-
+  if (clock_id == CLOCK_REALTIME)
+	  clock_id = CLOCK_MONOTONIC;
   if (clock_id == CLOCK_THREAD_CPUTIME_ID)
     return EINVAL;
   if (clock_id == CLOCK_PROCESS_CPUTIME_ID)

If anyone's feeling adventurous, feel free to try this out.

I've gotten 2.31 to work fine on my Arch install by recompiling the package with a patch

Close. You've got to be careful about TIMER_ABSTIME in flags. A straight-up swap of CLOCK_REALTIME for CLOCK_MONOTONIC probably isn't (quite) enough. [This is possibly academic for the quick fix; no one sane uses TIME_ABSTIME. It might not even matter IRL, it would take some test cases to confirm.]

I've gotten 2.31 to work fine on my Arch install by recompiling the package with a patch

Close. You've got to be careful about TIMER_ABSTIME in flags. A straight-up swap of CLOCK_REALTIME for CLOCK_MONOTONIC probably isn't (quite) enough. [This is possibly academic for the quick fix; no one sane uses TIMER_ABSTIME. It might not even matter IRL, it would take some test cases to confirm.]

That's a valid point, but clock_nanosleep(CLOCK_REALTIME, ...) has always been broken on WSL, and that includes with TIMER_ABSTIME. It's easily fixable by subtracting the current CLOCK_REALTIME value from the absolute timestamp and dropping the TIMER_ABSTIME flag. I've expanded the patch to that end, but I really doubt this has any practical impact or use. I've uploaded the patch as a Gist.

This breaks Ubuntu Focal also.
# uname -a
Linux [redacted] 4.4.0-18362-Microsoft #476-Microsoft Fri Nov 01 16:53:00 PST 2019 x86_64 x86_64 x86_64 GNU/Linux

# wslsys
Release Install Date: 0x5ceea999
Branch: 19h1_release
Build: 18363
Full Build: 18362.1.amd64fre.19h1_release.190318-1202
Uptime: 6d 4h 6m
Linux Release: Ubuntu Focal Fossa (development branch)
Linux Kernel: Linux 4.4.0-18362-Microsoft
Packages Count: 1367

# apt upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 libc-bin : Depends: libc6 (< 2.31) but 2.31-0ubuntu5 is installed
 libc-dev-bin : Depends: libc6 (< 2.31) but 2.31-0ubuntu5 is installed
 libc6-dev : Depends: libc6 (= 2.30-0ubuntu3) but 2.31-0ubuntu5 is installed
 locales : Depends: libc-bin (> 2.31) but 2.30-0ubuntu3 is installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

# apt --fix-broken install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following additional packages will be installed:
  libc-bin libc-dev-bin libc6-dev libcrypt-dev
Suggested packages:
  glibc-doc
The following NEW packages will be installed:
  libcrypt-dev
The following packages will be upgraded:
  libc-bin libc-dev-bin libc6-dev
3 upgraded, 1 newly installed, 0 to remove and 131 not upgraded.
2 not fully installed or removed.
Need to get 0 B/3331 kB of archives.
After this operation, 44.0 kB disk space will be freed.
Do you want to continue? [Y/n]
Setting up libc6:amd64 (2.31-0ubuntu5) ...
Checking for services that may need to be restarted...
Checking init scripts...
Nothing to restart.
sleep: cannot read realtime clock: Invalid argument
dpkg: error processing package libc6:amd64 (--configure):
 installed libc6:amd64 package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 libc6:amd64
E: Sub-process /usr/bin/dpkg returned an error code (1)

Ubuntu Focal Fossa (20.04) also broken
After this operation, 8192 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up libc6:amd64 (2.31-0ubuntu6) ...
Checking for services that may need to be restarted...
Checking init scripts...
Nothing to restart.
sleep: cannot read realtime clock: Invalid argument
dpkg: error processing package libc6:amd64 (--configure):
 installed libc6:amd64 package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 libc6:amd64
E: Sub-process /usr/bin/dpkg returned an error code (1)

I've run into this as well on Ubuntu 20.04, and I'm currently using
sudo apt-mark hold libc6

to prevent libc from being updated to the version that breaks in WSL 1.

This breaks Ubuntu Focal also.
# uname -a
Linux [redacted] 4.4.0-18362-Microsoft #476-Microsoft Fri Nov 01 16:53:00 PST 2019 x86_64 x86_64 x86_64 GNU/Linux

# wslsys
Release Install Date: 0x5ceea999
Branch: 19h1_release
Build: 18363
Full Build: 18362.1.amd64fre.19h1_release.190318-1202
Uptime: 6d 4h 6m
Linux Release: Ubuntu Focal Fossa (development branch)
Linux Kernel: Linux 4.4.0-18362-Microsoft
Packages Count: 1367

# apt upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 libc-bin : Depends: libc6 (< 2.31) but 2.31-0ubuntu5 is installed
 libc-dev-bin : Depends: libc6 (< 2.31) but 2.31-0ubuntu5 is installed
 libc6-dev : Depends: libc6 (= 2.30-0ubuntu3) but 2.31-0ubuntu5 is installed
 locales : Depends: libc-bin (> 2.31) but 2.30-0ubuntu3 is installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

# apt --fix-broken install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following additional packages will be installed:
  libc-bin libc-dev-bin libc6-dev libcrypt-dev
Suggested packages:
  glibc-doc
The following NEW packages will be installed:
  libcrypt-dev
The following packages will be upgraded:
  libc-bin libc-dev-bin libc6-dev
3 upgraded, 1 newly installed, 0 to remove and 131 not upgraded.
2 not fully installed or removed.
Need to get 0 B/3331 kB of archives.
After this operation, 44.0 kB disk space will be freed.
Do you want to continue? [Y/n]
Setting up libc6:amd64 (2.31-0ubuntu5) ...
Checking for services that may need to be restarted...
Checking init scripts...
Nothing to restart.
sleep: cannot read realtime clock: Invalid argument
dpkg: error processing package libc6:amd64 (--configure):
 installed libc6:amd64 package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 libc6:amd64
E: Sub-process /usr/bin/dpkg returned an error code (1)

I "fixed" it somehow on my install. Because the error is in the postinstall script of libc6 package, I simply edited /var/lib/dpkg/info/libc6:amd64.postinst  and transformed "sleep 1" in "echo sleep 1".
Then I run, as advised,  'apt --fix-broken install' and it managed to fix the dependencies. I removed then my change to the postinstall script. "apt update" and "apt full-upgrade" seems to be working fine after that.
Of course this is not a fix and I think I did it worse: all calls to sleep will fail. But it was fun and Ubuntu WSL1 is not my main driver so I had nothing to lose ;)

Will this be fixed for WSL1 or we can only count on WSL2?

The latest build of Ubuntu 20.04 seems to be working fine without any issue in WSL 1.

@kraml A fix is coming to WSL1, and we're looking into backporting it to currently released Windows versions.

Thank you @SvenGroot.

The latest build of Ubuntu 20.04 seems to be working fine without any issue in WSL1.

That's not my experience. On a clean install that might work, but upgrading from 19.10 to 20.04 will not work due to
sudo do-release-upgrade -d
...
sleep: cannot read realtime clock: Invalid argument

and would revert to the old install. I worked around this by replacing /bin/sleep with /bin/echo instead (I know this is not OK) which would allow the upgrade to succeed. Reinstalling coreutils or reverting that replacement is an issue still and sleep 1 will return sleep: cannot read realtime clock: Invalid argument

That's not my experience. On a clean install that might work,

I actually did a clean install, maybe that is why it worked for me.

While the installation might succeed, the actual library is nonfunctional. Attempting to build certain libraries fails because the WSL instruction to sleep, as noted above, is absent.
I too have done a clean install of 20.04 and while it is fresh on updates, glibc is not functional. I had to do a clean install of 19.10 to get the latest working version. Until the team can patch this, reverting the package is the only way to ensure a fully functional distribution.

sudo mv /bin/sleep /bin/sleep~
touch /bin/sleep
chmod +x /bin/sleep

Symlink to busybox sleep seems to be the best workaround.
mv /bin/sleep /bin/sleep~
ln -s /usr/bin/busybox /bin/sleep

Continue as usual

WSL1 Ubuntu 20.04 related bug: https://bugs.launchpad.net/bugs/1871129

For anyone that attempts an upgrade (from latest LTS bionic) and is struggling to recover the system after libc gets b0rked (libcrypt.so.1 errors), try this:
curl -kLO http://mirrors.kernel.org/ubuntu/pool/main/g/glibc/libc6_2.27-3ubuntu1_amd64.deb # download latest libc6 for your release
ar x libc6_2.27-3ubuntu1_amd64.deb # upack the release
tar -xf data.tar.xz -C / # extract the libc6 over your partially upgraded libc6
apt install libc6/bionic # do a reinstall using the actual libc6 for your release
apt-mark hold libc6 # hold the package until wsl fixes this issue
apt update # update the apt database
apt upgrade # upgrade your packages to the latest version (except for held packages)
apt --fix-install # repair any broken installs
apt autoremove # cleanup

tar -xf data.tar.xz -C /
as soon as I did that, my WSL broke completely

tar -xf data.tar.xz -C /

as soon as I did that, my WSL broke completely

Did you try to go in via powershell?
Use wsl -u root to get a root bash shell. If that won't run, then you probably want to look at getting busybox-static installed to recover the environment.

For Ubuntu Users.. I have create a PPA:
https://launchpad.net/~rafaeldtinoco/+archive/ubuntu/lp1871129
(just uploaded, might take sometime to build the pkg)
with @ChrisTX's patch... but I'm not considering this as an Ubuntu final fix for the issue as it appears to me it should be fixed/mitigated by WSL layer. The WSL1 syscall interception layer could do the clock type change instead of changing glibc for this corner case.
Nevertheless, anyone facing the issue can add that PPA before upgrading to focal and clock_nanosleep() calls shouldn't case issues.
A testcase: To run "htop" and check if it works =).

rafaeldtinoco@wsl1:~$ sudo apt-mark hold libc6
libc6 set on hold.
rafaeldtinoco@wsl1:~$ dpkg -l libc6
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name           Version                   Architecture Description
+++-==============-=========================-============-=================================
hi  libc6:amd64    2.31-0ubuntu8+lp1871129~1 amd64        GNU C Library: Shared libraries
Not sure how much time this bug will take so make sure to mark libc6 as "hold" so it does not get upgraded. The version I'm using: 2.31-0ubuntu8+lp1871129~1 will be the latest for today but not if some other glibc stable release lands in the archive.
I confirm "htop" works good with this mitigation.
o/

I installed today libc6_2.31-0ubuntu7_amd64.deb and it seems to had been installed with no realtime clock issues.

Not sure how much time this bug will take
it seems to had been installed with no realtime clock issues.

Another workaround:
sudo vi /var/lib/dpkg/info/libc6:amd64.postinst

- telinit u 2>/dev/null || true ; sleep 1
+ telinit u 2>/dev/null || true ; # sleep 1

sudo dpkg --configure -a

Which insider build is this fixed in? Will it land in 2004 release?

Which insider build is this fixed in? Will it land in 2004 release?

I'm runnings WSL1 on 19608.1006(lastest insider build in fast ring), seems sleep 1 works ok.

Symlink to busybox sleep seems to be the best workaround.

htop still does not work.

Symlink to busybox sleep seems to be the best workaround.

htop still does not work.

I'm runnings WSL1 on 19608.1006(lastest insider build in fast ring), seems htop works ok 😄

(lastest insider build in fast ring)

yeah the patch is live on insider builds, but I like to sit on the stable version as Windows 10 is my daily driver.

htop works fine for me (stable version) after https://github.com/microsoft/WSL/issues/5125#issuecomment-619350931

confirming, also imposible to complete sudo apt install mysql-server
seems now the default is 8.0 🗡

confirming, also imposible to complete sudo apt install mysql-server
seems now the default is 8.0 🗡

Did you try using aptitude instead of apt?

confirming, also imposible to complete sudo apt install mysql-server
seems now the default is 8.0 🗡

Did you try using aptitude instead of apt?

Why would you do that, i ended up installing the ubuntu 18.04 from the windows store, until the may update comes to release.
The best workaround was @5p0ng3b0b fix with the busybox sleep

confirming, also imposible to complete sudo apt install mysql-server
seems now the default is 8.0 🗡

Did you try using aptitude instead of apt?

Why would you do that, i ended up installing the ubuntu 18.04 from the windows store, until the may update comes to release.
The best workaround was @5p0ng3b0b fix with the busybox sleep

Because aptitude has the feature of offering multiple ways of how to install stuff without breaking dependencies (e.g. holding packages back and stuff).

@5p0ng3b0b 's busybox workaround works for me. And theoretically this would be the best workaround.

@TurnOffNOD just curious, where is the busybox come from? I am in the middle of the br0ken and did not see any busybox binaries.

I found this workaround (with sudo):
mv /bin/sleep /bin/sleep~  # timestamp about 2018
touch /bin/sleep
chmod +x /bin/sleep

apt update
apt upgrade

but I had to apply it 2 times because after the first time it failed with another package in the same manner. Indeed the empty /bin/sleep' file was substituted by another (timestamp Sept. 05 2019). Now I have this as sleep` command. After this all seems to work and (I am on WSL1, W10 Pro 64 10.0.18363.778)
lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04 LTS
Release:        20.04
Codename:       focal

Really will it work?...
Suppose I want to reinstall from scratch (I have the list of packages I installed) what should I do? Just uninstalling Ubuntu (from Windows Apps settings)? Would it remove the rootfs directory too? or what else?
Note that about four months ago I moved the Ubuntu installation with the wsl --export.. and friends tools. Now it is installed under Users\utente\Ubuntu
Thanks.

I solved it by downloading and manually installing the patched package:
https://launchpadlibrarian.net/474302949/libc6_2.31-0ubuntu8+lp1871129~1_amd64.deb
Other files from the same repository can be found here: https://launchpad.net/~rafaeldtinoco/+archive/ubuntu/lp1871129/+build/19152555
It's still @rafaeldtinoco 's PPA after all but saves some mess adding APT repositories or so.
wget "https://launchpadlibrarian.net/474302949/libc6_2.31-0ubuntu8+lp1871129~1_amd64.deb"
sudo dpkg -i libc6_2.31-0ubuntu8+lp1871129~1_amd64.deb

@iBug That solution worked for me (for a while) until I tried install something else:
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 libc6-dev : Depends: libc6 (= 2.31-0ubuntu9) but 2.31-0ubuntu8+lp1871129~1 is to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

@denormalizer Download this package and install it instead, then mark both libc6 and libc6-dev as on hold:
https://launchpad.net/~rafaeldtinoco/+archive/ubuntu/lp1871129/+build/19152555/+files/libc6-dev_2.31-0ubuntu8+lp1871129~1_amd64.deb

@denormalizer Download this package and install it instead, then mark both libc6 and libc6-dev as on hold:
https://launchpad.net/~rafaeldtinoco/+archive/ubuntu/lp1871129/+build/19152555/+files/libc6-dev_2.31-0ubuntu8+lp1871129~1_amd64.deb

It'd be enough to just mark libc6 as on hold, that'd hold the development package, as well.

@denormalizer Download this package and install it instead, then mark both libc6 and libc6-dev as on hold:
https://launchpad.net/~rafaeldtinoco/+archive/ubuntu/lp1871129/+build/19152555/+files/libc6-dev_2.31-0ubuntu8+lp1871129~1_amd64.deb

It'd be enough to just mark libc6 as on hold, that'd hold the development package, as well.

apt-get install libc-dev-bin=2.31-0ubuntu8+lp1871129~1
dpkg -i libc6-dev_2.31-0ubuntu8+lp1871129~1_amd64.deb libc6_2.31-0ubuntu8+lp1871129~1_amd64.deb
apt-mark hold libc6 libc6-dev

The libc and libc-dev downgrade packages break g++, libc-dev-bin and a lot of other dev tools.

Essentially build-essential is broken apart from basic gcc.

it also breaks bashtop amongst other things.

@slavitch If you use the tool aptitude and it's "solution" system (it offers various ways around breaking dependencies such as leaving stuff at older versions and the like), there may be  a way.

I created workaround that's not breaking dependencies. Yes, it is quite dirty solution, but it works (changed version number to same as the ubuntu's latest one). Should work (rust working).
Download libc6_2.31-0ubuntu9_amd64.deb.zip
Because of limitation of github's loading, remove zip extension and install by dpkg.
$ mv libc6_2.31-0ubuntu9_amd64.deb.zip [libc6_2.31-0ubuntu9_amd64.deb
$ sudo dpkg -i [libc6_2.31-0ubuntu9_amd64.deb

For me, the busybox workaround didn't work with busybox installed with apt. Instead, I downloaded the binary from https://frippery.org/busybox/. Then replaced /usr/bin/sleep with
#!/bin/bash
busybox.exe sleep $@

and sudo chmod +x /usr/bin/sleep

Confirmin issue at WSL 1 Ubuntu 20.04.
It seems like optimal workaround for user is can be switching from WSL 1 to WSL 2 wich worked best for myself, all problems resolved.
Useful link for updating WSL:
Article with useful instructions for updating your windows machine to required by WSL build
https://docs.microsoft.com/en-us/windows/wsl/wsl2-install
After update you need to update your WSL 2 Linux kernel
https://docs.microsoft.com/en-us/windows/wsl/wsl2-kernel
After that you will be up and running on WSL 2, no inner system upgrade needed.

@oksoft-git's dpkg resolved it for me. After installing the libc6, a sudo apt --fixed-broken install and sudo apt-get upgrade fixed things for me.

WSL2 is not a valid workaround until the memory usage issues are fixed.

WSL 2 is no option for our company, because we use VMware Workstation and they can't coexist.

glibc 2.31 is wrong for wsl 1
wget https://launchpadlibrarian.net/442988556/libc6_2.30-0ubuntu2_amd64.deb
dpkg -i libc6_2.30-0ubuntu2_amd64.deb

In case someone wonders: KB4556799 (cumulative update 2020 05) does not fix the issue.

It would be great if this issue was solved before the next release cycle.
BTW, wsl2 is not a replacement for wsl1. We know wsl1 is not the easiest path at all, but was one of the best ideas Microsoft could ever had. 👍
I hope Microsoft decides to keep investing on wsl1, even if they decide to also invest wsl2.

Just tested under major Windows 10 May 2020 Update (Windows Version 2004): unfortunately still not fixed.

This issue is fixed in Insider builds. We are working on getting it serviced to existing Windows versions, which includes the May 2020 update.

@SvenGroot Thanks for the feedback.
I have in the release preview channel. Is my build already fixed?
Can you please let us know when it is released for regular builds?

I believe it is only in the Fast channel right now. I unfortunately don't have any insight as to when exactly it will be serviced.

it's a little bit surprising to me, given that wsl was released in conjunction with Ubuntu, that the latest release of Ubuntu breaks wsl. i also hope that this doesn't represent an abandonment of wsl1 on microsoft's part as wsl2 is definitely unworkable for us here given the memory and virtualization issues.

We are NOT abandoning WSL1. This particular fix just came at an inopportune time (COVID-19 + relatively close to a new release) that makes it harder to get the fix out in a timely manner.
I does however demonstrate pretty clearly some of the difficulties we face with WSL1 which made us decide to introduce WSL2. WSL1 doesn't support everything Linux does (and Linux keeps adding new stuff all the time), so if a user-mode binary suddenly takes a dependency on something that we don't support (as happened here), it will be painful both for us and our users, unfortunately.

@SvenGroot thanks for the clarification! Until now I refrained from switching to WSL2 but it seems to be about time to reconsider.?

This is also causing PHP-FPM to be extremely slow. Downgrading to libc6_2.31-0ubuntu9_amd64.deb seems to work.

More details.
 ERESTARTSYS (To be restarted if SA_RESTART is set)
--- SIGQUIT {si_signo=SIGQUIT, si_code=SI_USER, si_pid=6908, si_uid=0} ---
close(6)                                = 0
socket(AF_UNIX, SOCK_STREAM, 0)         = 4
rt_sigreturn({mask=[]})                 = -1 EINTR (Interrupted system call)
sendto(5, "\1\0\0\0\1", 5, MSG_DONTWAIT, NULL, 0) = 5
close(5)                                = 0
munmap(0x7f17d1900000, 28880)           = 0
munmap(0x7f17d1910000, 20720)           = 0
munmap(0x7f17d1920000, 16592)           = 0
munmap(0x7f17d1930000, 24784)           = 0
munmap(0x7f17d1940000, 102736)          = 0
munmap(0x7f17d1960000, 16600)           = 0
munmap(0x7f17d1a00000, 41288)           = 0
munmap(0x7f17d19c0000, 225376)          = 0
munmap(0x7f17d1990000, 194944)          = 0
munmap(0x7f17d1970000, 102768)          = 0
munmap(0x7f17d1a10000, 45264)           = 0
munmap(0x7f17d1a20000, 283808)          = 0
munmap(0x7f17d1a70000, 37080)           = 0
munmap(0x7f17d1a80000, 149896)          = 0
munmap(0x7f17d2260000, 94520)           = 0
munmap(0x7f17d1c50000, 49392)           = 0
munmap(0x7f17d1c60000, 53496)           = 0
munmap(0x7f17d1c70000, 20688)           = 0
munmap(0x7f17d1c80000, 69840)           = 0
munmap(0x7f17d1ca0000, 5747848)         = 0
munmap(0x7f17d2230000, 166152)          = 0
munmap(0x7f17d2220000, 46632)           = 0
munmap(0x7f17d1b40000, 1055960)         = 0
munmap(0x7f17d1ab0000, 583752)          = 0
munmap(0x7f17d2800000, 16592)           = 0
munmap(0x7f17d2810000, 45264)           = 0
munmap(0x7f17d2820000, 115880)          = 0
munmap(0x7f17d2840000, 268640)          = 0
munmap(0x7f17d18a0000, 196608)          = 0
munmap(0x7f17c7800000, 2097152)         = 0
munmap(0x7f17c6e00000, 2097152)         = 0
munmap(0x7f17c7c00000, 2097152)         = 0
munmap(0x7f17c8a00000, 2097152)         = 0
munmap(0x7f17c8600000, 2097152)         = 0
munmap(0x7f17c8200000, 2097152)         = 0
munmap(0x7f17c9200000, 2097152)         = 0
munmap(0x7f17c8800000, 2097152)         = 0
munmap(0x7f17c8c00000, 2097152)         = 0
munmap(0x7f17c9400000, 2097152)         = 0
munmap(0x7f17c7e00000, 2097152)         = 0
munmap(0x7f17c7000000, 2097152)         = 0
munmap(0x7f17d2600000, 2097152)         = 0
munmap(0x7f17d1840000, 331776)          = 0
munmap(0x7f17c9840000, 134217728)       = 0
close(3)                                = 0
munmap(0x7f17d2890000, 135168)          = 0
exit_group(0)                           = ?
+++ exited with 0 +++

This trace took a while to complete and the thread ended up timing out with nginx throwing a 500 error.
I currently believe this issue is present on any builds of php-fpm where glibc was >=2.31 at the time of compile.

I do believe this is a very critical  and terrible issue.  Currently Window Store by default provides Ubuntu 20.04 if users install Ubuntu without specifying the version.
https://www.microsoft.com/en-us/p/ubuntu/9nblggh4msv6?activetab=pivot:overviewtab
Due to this issue, Ubuntu 20.04 LTS cannot be installed. Even using the patched lib mentioned above, users still cannot install any dev tools/libs successfully in further.
WLS2 is promising but users who haven't join insider programs cannot upgrade to WSL2 currently.

I created workaround that's not breaking dependencies. Yes, it is quite dirty solution, but it works (changed version number to same as the ubuntu's latest one). Should work (rust working).
Download libc6_2.31-0ubuntu9_amd64.deb.zip
Because of limitation of github's loading, remove zip extension and install by dpkg.
$ mv libc6_2.31-0ubuntu9_amd64.deb.zip [libc6_2.31-0ubuntu9_amd64.deb
$ sudo dpkg -i [libc6_2.31-0ubuntu9_amd64.deb

This works for me. Thanks!

@slgu I can confirm that your workaround fix above works for me. I am running WSL2 on Windows 10 Home (Version 1909 OS Build 18363.836). With this patch I was able to get past rustup #2245

Just directly installing the zip seems to work. Doesn't seem to be any need to actually change the extension.
I used:
sudo dpkg -i /mnt/c/Users/user1/Downloads/libc6_2.31-0ubuntu9_amd64.deb.zip

Afterwards, things like build-essential and gdb installed just fine for me.

@JadedEvan Did you perhaps mean WSL1? Based on my current understanding, I believe that WSL2 is not available in 1909 / 18363.836. I think that WSL2 was first shipped in build18917 only available to the Insiders program (fast or slow ring at this point).

@slgu. Where exactly does this binary come from? Did you build it?

@iBug Downloading the .deb file, installing it and holding libc6 worked. But now I cannot install any new package that is probably dependent on the original libc6. For example, I cannot even install the GCC C++ compiler:

$ sudo apt install g++
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 g++ : Depends: g++-9 (>= 9.3.0-3~) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

Any solution to workaround this?

@ashwin Use aptitude, it might help (if a package has unmet dependencies, it tries to find a way around it that doesn't break dependencies).

@arisboch Sadly, using aptitude did not help either.

@arisboch Sadly, using aptitude did not help either.

Didn't it suggest you a solution that'd allow you to install g++?

This did it for me:
mv /bin/sleep /bin/sleep.dist
ln -s /bin/true /bin/sleep
apt install -f
rm /bin/sleep
mv /bin/sleep.dist /bin/sleep

@TurnOffNOD just curious, where is the busybox come from? I am in the middle of the br0ken and did not see any busybox binaries.

It is a dependency of some other software packages so it has been installed automatically.
Now that we need it, we should not wait for automatically installing, instead we can install it manually.

@pwang2

@TurnOffNOD just curious, where is the busybox come from? I am in the middle of the br0ken and did not see any busybox binaries.

It is a dependency of some other software packages so it has been installed automatically.
Now that we need it, we should not wait for automatically installing, instead we can install it manually.

@SvenGroot

This issue is fixed in Insider builds. We are working on getting it serviced to existing Windows versions, which includes the May 2020 update. The ability to fix non-security bugs closes months before a Windows version is actually released, so unfortunately we could not get this fix into the initial May 2020 update release, but it will get serviced as soon as we can.

Does this mean the bug in wsl1 will be fixed?

Thanks @ccsalvesen . That trick worked and I was able to install whatever I wanted before I swapped back the sleep tool. 👍

Just for reference, here's what I did on Arch WSL to downgrade glibc for now.
I was getting horrendous CPU usage in VSCode's remote WSL due to sleep not working beforehand.
wget 'https://archive.archlinux.org/packages/g/glibc/glibc-2.30-3-x86_64.pkg.tar.xz'
pacman -U glibc-2.30-3-x86_64.pkg.tar.xz

Then in /etc/pacman.conf:
HoldPkg     = glibc

This work for me
`wget https://launchpad.net/~rafaeldtinoco/+archive/ubuntu/lp1871129/+files/libc6_2.31-0ubuntu8+lp1871129~1_amd64.deb
sudo dpkg --install libc6_2.31-0ubuntu8+lp1871129~1_amd64.deb
sudo apt-mark hold libc6
sudo apt --fix-broken install
sudo apt full-upgrade`

Just out of curiosity, can I revert to 10.04 which works just fine?
TIA

Worked so far, thanks @gabarchinco ! <3

The fix  by @gabarchinco seems to stop working if you do an apt-get update at any point. I wanted to install a package from Ubuntu, but in the process it decided to uninstall libc6-dev, which couldn't be reinstalled:
user@Cuboid:~$ sudo apt install libc6-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 libc6-dev : Depends: libc6 (= 2.31-0ubuntu9) but 2.31-0ubuntu8+lp1871129~1 is to be installed
E: Unable to correct problems, you have held broken packages.
user@Cuboid:~$

Just FYI:
$ sudo apt install build-essential
$ gcc --version
gcc (Ubuntu 9.3.0-10ubuntu2) 9.3.0
$ wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add -
gpg: can't connect to the agent: IPC connect call failed
$ sleep 10
sleep: cannot read realtime clock: Invalid argument

otherwise clean WSL 1 Ubuntu 20.04 on Windows 2004 no insider
only build-essential package installed

This work for me
wget https://launchpad.net/~rafaeldtinoco/+archive/ubuntu/lp1871129/+files/libc6_2.31-0ubuntu8+lp1871129~1_amd64.deb
sudo dpkg --install libc6_2.31-0ubuntu8+lp1871129~1_amd64.deb
sudo apt-mark hold libc6
sudo apt --fix-broken install
sudo apt full-upgrade

This almost works.. but if you try installing or updating more packages, it will complain (in different ways) about not being able to satisfy the dependency tree.
What I did was make a backup, grab that working (older) libc-2.31.so, shut down WSL, and replace (from Windows) the newer version at %LocalAppData%\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\LocalState\rootfs\lib\x86_64-linux-gnu\libc-2.31.so with it. When you restart WSL, it thinks it's using the newer library, package installations can proceed, the system will sleep properly, and everyone is happy (until the fix arrives)

I wrote a simple version of the ‘sleep’ program in Golang. After replacing /bin/sleep with it, everything was OK.
package main

import (
	"os"
	"strconv"
	"strings"
	"time"
)

func main() {
	if len(os.Args) <= 1 {
		return
	}
	s := os.Args[1][0 : len(os.Args[1])-1]
	f0, err0 := strconv.ParseFloat(os.Args[1], 32)
	if len(s) < 1 && err0 != nil {
		return
	}
	var f1 float64
	var err2 error
	if err0 != nil {
		f1, err2 = strconv.ParseFloat(s, 32)
		if err2 != nil {
			return
		}
	}
	if strings.HasSuffix(os.Args[1], "s") {
		time.Sleep(time.Duration(int(f1*1000)) * time.Millisecond)
	} else if strings.HasSuffix(os.Args[1], "m") {
		time.Sleep(time.Duration(int(f1*1000*60)) * time.Millisecond)
	} else if strings.HasSuffix(os.Args[1], "h") {
		time.Sleep(time.Duration(int(f1*1000*60*60)) * time.Millisecond)
	} else if err0 == nil {
		time.Sleep(time.Duration(int(f0*1000)) * time.Millisecond)
	}
}

Compile the code as follows and replace (/bin/sleep):
go build -o sleep
mv /bin/sleep /bin/sleep.old
cp sleep /bin/sleep
chmod +x /bin/sleep

Link:  https://github.com/protang/sleep_cannot_read_realtime_clock

Thanks @protang for the idea. I've made a C++ version:
#include <cstdlib>
#include <string_view>
#include <time.h>

using namespace std;

int main(int argc, char **argv) {
  if (argc != 2)
    return -1;

  auto num = strtod(argv[1], nullptr);

  switch (string_view(argv[1]).back()) {
  case '0': case '1': case '2': case '3': case '4':
  case '5': case '6': case '7': case '8': case '9':
  case 's': break;
  case 'm': num = num * 60; break;
  case 'h': num = num * 60 * 60; break;
  default:
    return -1;
  }

  timespec time = { (time_t)num, (long)(num *<PHONE_NUMBER>) %<PHONE_NUMBER>L };
  clock_nanosleep(CLOCK_MONOTONIC, 0, &time, nullptr);

  return 0;
}

Compile with:
g++ -std=c++17 -O2 -o sleep sleep.cpp

Anybody know if any entity (Microsoft, glibc, Canonical, anybody else...?) is working on fixing this in any way? Or is this how it's going to be for the foreseeable future?

Anybody know if any entity (Microsoft, glibc, Canonical, anybody else...?) is working on fixing this in any way? Or is this how it's going to be for the foreseeable future?

very good question. apparently a fix for this 5-month-old issue is coming down the pipeline. anyone remember the good old days when you could get a KB article with a patch msi?

@mehrdadn Apparently, this is already fixed on Insiders and should get fixed for everybody in one of the next Windows Updates but we don't know yet when exactly. Probably at the latest in the September update but I think they are working on getting it in sooner.
I don't think there is any hope for a fix in glibc. This is the response from Canonical.

Not wanting to be smarta.. but needless to say, this problem wouldn't have been here if MS had developed a POSIX compliant C11 library as a foundation on WSL to start with. I guess the Microsoft C library will be getting towards the C11 standard eventually but that problem is really due to old sins (or what it was). The POSIX part would be great to have in MSC as well.

@BeErikk That is not how WSL works: WSL supplies an implementation of the Linux kernel interfaces, allowing distributions to bring their own C library, unmodified compared to running on standalone Linux. If Microsoft had mandated the use of a custom C library on WSL, it would be a very different product, and would lose its flagship feature of being able to run most unmodified Linux binaries.

@BeErikk That is not how WSL works: WSL supplies an implementation of the Linux kernel interfaces, allowing distributions to bring their own C library, unmodified compared to running on standalone Linux. If Microsoft had mandated the use of a custom C library on WSL, it would be a very different product, and would lose its flagship feature of being able to run most unmodified Linux binaries.

Yes, but I believe the issue is lacking implementations for CLOCK_REALTIME and CLOCK_MONOTONIC and the POSIX part of the functions in time.h. At some point there needs to be a translation into the NT kernel for these functions regardless the need comes from a Linux C-library or a Windows POSIX complaint C-library. How these translations are done exactly is beyond me but the natural and logical way would be to implement the lacking functionality according to standard, wouldn't you say?

@BeErikk I'm not sure what you're describing. WSL1 is entirely kernel code, it doesn't (and cannot) use any C standard library.

@SvenGroot OK sorry, I said I really didn't want to come out as a smartass, I regret saying anything already. Of course none of us outside MS know how you implement WSL and speculating about its details wasn't what I meant. It's perfectly clear WSL is kernel code. My point was simply if the POSIX part of the C-library had been ready at your hands as it is in BSD and Linux, its groundwork implementation would have been there and this problem would likely not been raised.

@BeErikk Maybe but it's questionable how much easier that would really make the fix and it doesn't look like it was actually very hard to implement. The fix has been in Insiders for at least 2 months already. The problem rather seems to be that it just takes a long time until it is distributed to all users, especially since it was fixed right after the cut off for a major update.

I prefer this solution, it seems less invasive than installing a patched glibc.
Create this file called nanosleep.c
#define _GNU_SOURCE
#include <time.h>
#include <stdio.h>

// This restores the old behaviour of nanosleep() to use CLOCK_MONOTONIC.
//
// "POSIX.1 specifies that nanosleep() should measure time against the
// CLOCK_REALTIME clock. However, Linux measures the time using the
// CLOCK_MONOTONIC clock.  This probably does not matter [...]"
int nanosleep(const struct timespec *req, struct timespec *rem)
{
    return clock_nanosleep(CLOCK_MONOTONIC, 0, req, rem);
}

# gcc -shared -fPIC -o /lib/libnanosleep.so nanosleep.c
# echo /lib/libnanosleep.so >> /etc/ld.so.preload

I verified this fixes sleep and htop for me.

I prefer this solution, it seems less invasive than installing a patched glibc.
Create this file called nanosleep.c
#include <time.h>

// This restores the old behaviour of nanosleep() to use CLOCK_MONOTONIC.
//
// "POSIX.1 specifies that nanosleep() should measure time against the
// CLOCK_REALTIME clock. However, Linux measures the time using the
// CLOCK_MONOTONIC clock.  This probably does not matter [...]"
int nanosleep(const struct timespec *req, struct timespec *rem)
{
    return clock_nanosleep(CLOCK_MONOTONIC, 0, req, rem);
}

# gcc -shared -fPIC -o /lib/libnanosleep.so nanosleep.c
# echo /lib/libnanosleep.so >> /etc/ld.so.preload

I verified this fixes sleep and htop for me.

Thanks!  For some reason this still doesn't fix the 100% CPU usage of VS Code's node process :/

Thanks! For some reason this still doesn't fix the 100% CPU usage of VS Code's node process :/

@nunoplopes I think I can guess the problem, it's probably using the old usleep() try this one instead:
#include <time.h>
#include <unistd.h>

// This restores the old behaviour of nanosleep() to use CLOCK_MONOTONIC.
//
// "POSIX.1 specifies that nanosleep() should measure time against the
// CLOCK_REALTIME clock. However, Linux measures the time using the
// CLOCK_MONOTONIC clock.  This probably does not matter [...]"
//
// # gcc -shared -fPIC -o /lib/libnanosleep.so nanosleep.c
// # echo /lib/libnanosleep.so >> /etc/ld.so.preload
//
int nanosleep(const struct timespec *req, struct timespec *rem)
{
    return clock_nanosleep(CLOCK_MONOTONIC, 0, req, rem);
}

int usleep(useconds_t usec)
{
    struct timespec req = {
        .tv_sec     = (usec / 1000000),
        .tv_nsec    = (usec % 1000000) * 1000,
    };
    return nanosleep(&req, NULL);
}

Thanks! For some reason this still doesn't fix the 100% CPU usage of VS Code's node process :/

@nunoplopes I think I can guess the problem, it's probably using the old usleep() , I updated the comment with a new version that also fixes that.
Try it again, and see if that fixes it!

I'm afraid not. I guess they are using something else :/

node is using epoll_pwait through libuv. This one is a bit trickier to intercept 😟

This seems to help:
static int min(int a, int b) { return a < b ? a : b; }

static int (*waitfn)(int fd, struct epoll_event *events, int maxevents,
                     int timeout, const __sigset_t *ss) = 0;

int epoll_pwait(int fd, struct epoll_event *events, int maxevents,
                int timeout, const __sigset_t *ss) {
  if (!waitfn)
    waitfn = (int (*)(int fd, struct epoll_event *events, int maxevents,
                      int timeout, const __sigset_t *ss))
           dlsym(RTLD_NEXT, "epoll_pwait");

  while (1) {
    int r = waitfn(fd, events, maxevents, 0, ss);
    if (r > 0 || timeout == 0)
      return r;
    if (timeout < 0)
      usleep(100 * 10000);
    else {
      int s = min(1000, timeout);
      timeout -= s;
      usleep(s * 1000);
    }
  }

  return -1;
}

The only problem is that it seems that clock_nanosleep(CLOCK_MONOTONIC,..) does busy waiting for < 1s values. Hence I used 1s there. This is not great as then switching between files in VS code becomes slow..

This work for me
wget https://launchpad.net/~rafaeldtinoco/+archive/ubuntu/lp1871129/+files/libc6_2.31-0ubuntu8+lp1871129~1_amd64.deb
sudo dpkg --install libc6_2.31-0ubuntu8+lp1871129~1_amd64.deb
sudo apt-mark hold libc6
sudo apt --fix-broken install
sudo apt full-upgrade

This almost works.. but if you try installing or updating more packages, it will complain (in different ways) about not being able to satisfy the dependency tree.
What I did was make a backup of both versions, reinstall the newer libc6, shut down WSL, and replace (from Windows) the newer version at %LocalAppData%\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\LocalState\rootfs\lib\x86_64-linux-gnu\libc-2.31.so with the older libc-2.31.so. When you restart WSL, it thinks it's using the newer library, package installations can proceed, the system will sleep properly, and everyone is happy (until the fix arrives)

FWIW, this method works 100% even if you install more packages or updates, and the fix is way simpler

Does anyone know what Insider build this fix is in? I'm on Beta Channel/Slow Ring and don't see a fix, just wondering when to expect it!

@redoverture It was fixed in build 19603. Beta Channel is in 19042.

hi folks, i create php replacement for this :
<?php sleep((int)$argv[1]);

but you need to install php, and call php /path/to/script.php 250 (time in second), awesome right ?, you welcome

Conclusion: you have three solutions for this WSL1 problem

update your windows to build 19603, this require fast channel preview
mask your glibc version for package manager, keep it in version 2.30. it's different in different distribution, for arch linux, add glibc to IgnorePkg in /etc/pacman.conf
write a nanosleep and compile it and preload it, see https://github.com/microsoft/WSL/issues/4898#issuecomment-646790723 , your can use /etc/ld.so.preload or just envirenment variable LD_PRELOAD

Here's a copy of libnanosleep.so if you're having trouble compiling it due to a catch-22 like I was: https://mpen.xyz/share/2020/07/libnanosleep.so
(per taviso's tip)

Here's a copy of libnanosleep.so if you're having trouble compiling it due to a catch-22 like I was: https://mpen.xyz/share/2020/07/libnanosleep.so
(per taviso's tip)

Thanks! Could not compile myself due to no gcc installed and apt errors, had to do the following to make it work:
mv  ./libnanosleep.so /lib/libnanosleep.so
echo /lib/libnanosleep.so >> /etc/ld.so.preload

In Powershell terminal:
C:\WINDOWS\system32> wsl --shutdown
Then restart WSL and try apt --fix-broken install again

I found this Replace sleep binary with python script solved the problem temporarily until a permanent fix arrived. Backup the sleep binary first.

Any plans to backport the fix to 1809?

Just for reference, here's what I did on Arch WSL to downgrade glibc for now.
I was getting horrendous CPU usage in VSCode's remote WSL due to sleep not working beforehand.
wget 'https://archive.archlinux.org/packages/g/glibc/glibc-2.30-3-x86_64.pkg.tar.xz'
pacman -U glibc-2.30-3-x86_64.pkg.tar.xz

Then in /etc/pacman.conf:
HoldPkg     = glibc

Do you mean IgnorePkg = glibc ?
P.S. There should also be a default value fakeroot put by its side.

Do you mean IgnorePkg = glibc ?
P.S. There should also be a default value fakeroot put by its side.

I think I glanced at the wrong line when I added my comment, but I can't remember which was one already in there. Here's what those lines are currently set to in my pacman.conf. I updated my original comment to clarify. Thanks.
HoldPkg     = pacman glibc
IgnorePkg   = fakeroot glibc

https://stackoverflow.com/questions/60944370/stuck-with-apt-fix-broken-install-libc6amd64-package-post-installation

how can i fix the bug of sleep cannot read real time clock invalid argument? im using the latest version of ubuntu

how can i fix the bug of sleep cannot read real time clock invalid argument? im using the latest version of ubuntu .
i then tried apt --fix-broken install but then Could not open lock file /var/lib/dpkg/lock-frontend - open (13: Permission denied) showed up! , please help how to fix this

I am using this solution https://github.com/microsoft/WSL/issues/4898#issuecomment-646790723 for a month. No trouble and much easier/secure.

I prefer this solution, it seems less invasive than installing a patched glibc.
Create this file called nanosleep.c
#include <time.h>
#include <unistd.h>

# gcc -shared -fPIC -o /usr/local/lib/libnanosleep.so nanosleep.c
# echo /usr/local/lib/libnanosleep.so >> /etc/ld.so.preload

I verified this fixes sleep and htop for me.

Could you suggest how to solve the compile errors under WSL1 Ubuntu 20.04 shown below ?
$ sudo gcc -shared -fPIC -o /usr/local/lib/libnanosleep.so nanosleep.c
nanosleep.c:1:10: fatal error: time.h: No such file or directory
    1 | #include <time.h>
      |          ^~~~~~~~
compilation terminated.

If the includes are changed to
#include <linux/time.h>
#include <linux/unistd.h>

, then the error becomes
$ sudo gcc -shared -fPIC -o /usr/local/lib/libnanosleep.so nanosleep.c
nanosleep.c: In function ‘nanosleep’:
nanosleep.c:15:12: warning: implicit declaration of function ‘clock_nanosleep’ [-Wimplicit-function-declaration]
   15 |     return clock_nanosleep(CLOCK_MONOTONIC, 0, req, rem);
      |            ^~~~~~~~~~~~~~~
nanosleep.c: At top level:
nanosleep.c:18:12: error: unknown type name ‘useconds_t’
   18 | int usleep(useconds_t usec)
      |

The search list is shown below
$ LC_ALL=C gcc -v -xc -E /dev/null 2>&1 |      sed -ne '/search starts here/,/End of search list/p'
#include "..." search starts here:
#include <...> search starts here:
 /usr/lib/gcc/x86_64-linux-gnu/9/include
 /usr/local/include
 /usr/include/x86_64-linux-gnu
 /usr/include
End of search list.

@jiucenglou so you have libc6-dev installed?

@jiucenglou If you want to compile some C or C++, them install at least the "build-essential" ubuntu/debian meta package. Save this hint in your knowledge base.
build-essential is sufficient to compile nanosleep.c tiny C code.
$ sudo apt-cache policy build-essential
build-essential:
  Installed: 12.8ubuntu1
  Candidate: 12.8ubuntu1
  Version table:
 *** 12.8ubuntu1 500
        500 http://archive.ubuntu.com/ubuntu focal/main amd64 Packages
        100 /var/lib/dpkg/status

@SuperSandro2000  @juliomaranhao  Many thanks ! I failed to install build-essential because sleep was broken. The problem was then solved by using another fresh Ubuntu 20.04 instance.

So, what's the best solution to make htop work?

Will this be fixed for WSL1 or we can only count on WSL2?

What is the meaning of tag fixed-in-wsl2 ? I think it is necessary to fix this problem for WSL 1
thanks

Will this be fixed for WSL1 or we can only count on WSL2?

What is the meaning of tag fixed-in-wsl2 ? I think it is necessary to fix this problem for WSL 1
thanks

https://github.com/microsoft/WSL/issues/4898#issuecomment-648418310

it is already fixed in last dev insider preview, but if you want to get it
in semi ann release, maybe you need to wait several month
Escape0707<EMAIL_ADDRESS>于2020年8月7日周五 下午11:20写道：

Will this be fixed for WSL1 or we can only count on WSL2?
What is the meaning of tag fixed-in-wsl2 ? I think it is necessary to fix
this problem for WSL 1
thanks
#4898 (comment)
https://eur04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FWSL%2Fissues%2F4898%23issuecomment-648418310&data=02|01||f26f7d17ff004bc1610608d83ae5691b|84df9e7fe9f640afb435aaaaaaaaaaaa|1|0|637324104264069507&sdata=Y7c2iYtlPZeOq5OGcfLq3B4KxygkeiI8%2BWtrIKYzGqI%3D&reserved=0
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://eur04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FWSL%2Fissues%2F4898%23issuecomment-670569630&data=02|01||f26f7d17ff004bc1610608d83ae5691b|84df9e7fe9f640afb435aaaaaaaaaaaa|1|0|637324104264069507&sdata=TAQENOw1Cc%2B4xNaB%2F9BTjhaYrp8R2OFosd6UQzqd9uI%3D&reserved=0,
or unsubscribe
https://eur04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FACYVYF5ZPLS7NPAF4Q6NQMDR7QLTRANCNFSM4KVP4DVQ&data=02|01||f26f7d17ff004bc1610608d83ae5691b|84df9e7fe9f640afb435aaaaaaaaaaaa|1|0|637324104264079503&sdata=t7IGvlRPEnVYsbtXHbiVQ9g3M4GQHaxCbUsHWuriSaE%3D&reserved=0
.

This breaks Ubuntu Focal also.
# uname -a
Linux [redacted] 4.4.0-18362-Microsoft #476-Microsoft Fri Nov 01 16:53:00 PST 2019 x86_64 x86_64 x86_64 GNU/Linux

# wslsys
Release Install Date: 0x5ceea999
Branch: 19h1_release
Build: 18363
Full Build: 18362.1.amd64fre.19h1_release.190318-1202
Uptime: 6d 4h 6m
Linux Release: Ubuntu Focal Fossa (development branch)
Linux Kernel: Linux 4.4.0-18362-Microsoft
Packages Count: 1367

# apt upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 libc-bin : Depends: libc6 (< 2.31) but 2.31-0ubuntu5 is installed
 libc-dev-bin : Depends: libc6 (< 2.31) but 2.31-0ubuntu5 is installed
 libc6-dev : Depends: libc6 (= 2.30-0ubuntu3) but 2.31-0ubuntu5 is installed
 locales : Depends: libc-bin (> 2.31) but 2.30-0ubuntu3 is installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

# apt --fix-broken install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following additional packages will be installed:
  libc-bin libc-dev-bin libc6-dev libcrypt-dev
Suggested packages:
  glibc-doc
The following NEW packages will be installed:
  libcrypt-dev
The following packages will be upgraded:
  libc-bin libc-dev-bin libc6-dev
3 upgraded, 1 newly installed, 0 to remove and 131 not upgraded.
2 not fully installed or removed.
Need to get 0 B/3331 kB of archives.
After this operation, 44.0 kB disk space will be freed.
Do you want to continue? [Y/n]
Setting up libc6:amd64 (2.31-0ubuntu5) ...
Checking for services that may need to be restarted...
Checking init scripts...
Nothing to restart.
sleep: cannot read realtime clock: Invalid argument
dpkg: error processing package libc6:amd64 (--configure):
 installed libc6:amd64 package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 libc6:amd64
E: Sub-process /usr/bin/dpkg returned an error code (1)

I "fixed" it somehow on my install. Because the error is in the postinstall script of libc6 package, I simply edited /var/lib/dpkg/info/libc6:amd64.postinst and transformed "sleep 1" in "echo sleep 1".
Then I run, as advised, 'apt --fix-broken install' and it managed to fix the dependencies. I removed then my change to the post-install script. "apt update" and "apt full-upgrade" seems to be working fine after that.
Of course this is not a fix and I think I did it worse: all calls to sleep will fail. But it was fun and Ubuntu WSL1 is not my main driver so I had nothing to lose ;)

Worked fine but it stops package manager to upgrade 3 packages to their previous state. But glad it worked...

This also effects Kali, any chance you will have this fixed anytime soon?
 lsb_release -a
No LSB modules are available.
Distributor ID:	Kali
Description:	Kali GNU/Linux Rolling
Release:	2020.2
Codename:	kali-rolling

$ sudo apt-cache madison libc6 libc-bin
     libc6 |     2.31-2 | http://http.kali.org/kali kali-rolling/main amd64 Packages
     glibc |     2.31-2 | http://http.kali.org/kali kali-rolling/main Sources
  libc-bin |     2.31-2 | http://http.kali.org/kali kali-rolling/main amd64 Packages
     glibc |     2.31-2 | http://http.kali.org/kali kali-rolling/main Sourc

$ sudo aptitude upgrade libc-bin
Resolving dependencies...
The following NEW packages will be installed:
  libpython3.8-minimal{a} libpython3.8-stdlib{a} python3.8{a} python3.8-minimal{a}
The following packages will be upgraded:
  libc-bin libpython3-stdlib python3 python3-coverage python3-minimal python3-psutil
The following partially installed packages will be configured:
  libc-dev-bin libc6 libc6-dbg libc6-dev libc6-i386 libcbor0 libfido2-1 openssh-client openssh-server openssh-sftp-server
6 packages upgraded, 4 newly installed, 0 to remove and 634 not upgraded.
Need to get 0 B/6,020 kB of archives. After unpacking 19.0 MB will be used.
Do you want to continue? [Y/n/?] y
Setting up libc6:amd64 (2.31-2) ...
Checking for services that may need to be restarted...
Checking init scripts...

Restarting services possibly affected by the upgrade:
  sendmail: restarting...done.

Services restarted successfully.
sleep: cannot read realtime clock: Invalid argument
dpkg: error processing package libc6:amd64 (--configure):
 installed libc6:amd64 package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 libc6:amd64
E: Sub-process /usr/bin/dpkg returned an error code (1)
Setting up libc6:amd64 (2.31-2) ...
Checking for services that may need to be restarted...
Checking init scripts...

Restarting services possibly affected by the upgrade:
  sendmail: restarting...done.

Services restarted successfully.
sleep: cannot read realtime clock: Invalid argument
dpkg: error processing package libc6:amd64 (--configure):
 installed libc6:amd64 package post-installation script subprocess returned error exit status 1
dpkg: dependency problems prevent configuration of libc6-i386:
 libc6-i386 depends on libc6 (= 2.31-2); however:
  Package libc6:amd64 is not configured yet.

dpkg: error processing package libc6-i386 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of libc6-dev:amd64:
 libc6-dev:amd64 depends on libc6 (= 2.31-2); however:
  Package libc6:amd64 is not configured yet.

dpkg: error processing package libc6-dev:amd64 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of libfido2-1:amd64:
 libfido2-1:amd64 depends on libc6 (>= 2.25); however:
  Package libc6:amd64 is not configured yet.

dpkg: error processing package libfido2-1:amd64 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of libc-dev-bin:
 libc-dev-bin depends on libc6 (>> 2.31); however:
  Package libc6:amd64 is not configured yet.
 libc-dev-bin depends on libc6 (<< 2.32); however:
  Package libc6:amd64 is not configured yet.

dpkg: error processing package libc-dev-bin (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of openssh-sftp-server:
 openssh-sftp-server depends on libc6 (>= 2.26); however:
  Package libc6:amd64 is not configured yet.

dpkg: error processing package openssh-sftp-server (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of openssh-server:
 openssh-server depends on openssh-sftp-server; however:
  Package openssh-sftp-server is not configured yet.
 openssh-server depends on libc6 (>= 2.26); however:
  Package libc6:amd64 is not configured yet.

dpkg: error processing package openssh-server (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of openssh-client:
 openssh-client depends on libc6 (>= 2.26); however:
  Package libc6:amd64 is not configured yet.
 openssh-client depends on libfido2-1 (>= 1.3.0); however:
  Package libfido2-1:amd64 is not configured yet.

dpkg: error processing package openssh-client (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of libcbor0:amd64:
 libcbor0:amd64 depends on libc6 (>= 2.14); however:
  Package libc6:amd64 is not configured yet.

dpkg: error processing package libcbor0:amd64 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of libc6-dbg:amd64:
 libc6-dbg:amd64 depends on libc6 (= 2.31-2); however:
  Package libc6:amd64 is not configured yet.

dpkg: error processing package libc6-dbg:amd64 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent processing triggers for libc-bin:
 libc-bin depends on libc6 (>> 2.29); however:
  Package libc6:amd64 is not configured yet.
 libc-bin depends on libc6 (<< 2.30); however:
  Version of libc6:amd64 on system is 2.31-2.

dpkg: error processing package libc-bin (--configure):
 dependency problems - leaving triggers unprocessed
dpkg: dependency problems prevent processing triggers for systemd:
 systemd depends on libc6 (>= 2.28); however:
  Package libc6:amd64 is not configured yet.

dpkg: error processing package systemd (--configure):
 dependency problems - leaving triggers unprocessed
dpkg: dependency problems prevent processing triggers for man-db:
 man-db depends on libc6 (>= 2.28); however:
  Package libc6:amd64 is not configured yet.

dpkg: error processing package man-db (--configure):
 dependency problems - leaving triggers unprocessed
dpkg: dependency problems prevent processing triggers for desktop-file-utils:
 desktop-file-utils depends on libc6 (>= 2.7); however:
  Package libc6:amd64 is not configured yet.

dpkg: error processing package desktop-file-utils (--configure):
 dependency problems - leaving triggers unprocessed
Errors were encountered while processing:
 libc6:amd64
 libc6-i386
 libc6-dev:amd64
 libfido2-1:amd64
 libc-dev-bin
 openssh-sftp-server
 openssh-server
 openssh-client
 libcbor0:amd64
 libc6-dbg:amd64
 libc-bin
 systemd
 man-db
 desktop-file-utils

This breaks Ubuntu Focal also.
# uname -a
Linux [redacted] 4.4.0-18362-Microsoft #476-Microsoft Fri Nov 01 16:53:00 PST 2019 x86_64 x86_64 x86_64 GNU/Linux

# wslsys
Release Install Date: 0x5ceea999
Branch: 19h1_release
Build: 18363
Full Build: 18362.1.amd64fre.19h1_release.190318-1202
Uptime: 6d 4h 6m
Linux Release: Ubuntu Focal Fossa (development branch)
Linux Kernel: Linux 4.4.0-18362-Microsoft
Packages Count: 1367

# apt upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 libc-bin : Depends: libc6 (< 2.31) but 2.31-0ubuntu5 is installed
 libc-dev-bin : Depends: libc6 (< 2.31) but 2.31-0ubuntu5 is installed
 libc6-dev : Depends: libc6 (= 2.30-0ubuntu3) but 2.31-0ubuntu5 is installed
 locales : Depends: libc-bin (> 2.31) but 2.30-0ubuntu3 is installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

# apt --fix-broken install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following additional packages will be installed:
  libc-bin libc-dev-bin libc6-dev libcrypt-dev
Suggested packages:
  glibc-doc
The following NEW packages will be installed:
  libcrypt-dev
The following packages will be upgraded:
  libc-bin libc-dev-bin libc6-dev
3 upgraded, 1 newly installed, 0 to remove and 131 not upgraded.
2 not fully installed or removed.
Need to get 0 B/3331 kB of archives.
After this operation, 44.0 kB disk space will be freed.
Do you want to continue? [Y/n]
Setting up libc6:amd64 (2.31-0ubuntu5) ...
Checking for services that may need to be restarted...
Checking init scripts...
Nothing to restart.
sleep: cannot read realtime clock: Invalid argument
dpkg: error processing package libc6:amd64 (--configure):
 installed libc6:amd64 package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 libc6:amd64
E: Sub-process /usr/bin/dpkg returned an error code (1)

I "fixed" it somehow on my install. Because the error is in the postinstall script of libc6 package, I simply edited /var/lib/dpkg/info/libc6:amd64.postinst and transformed "sleep 1" in "echo sleep 1".
Then I run, as advised, 'apt --fix-broken install' and it managed to fix the dependencies. I removed then my change to the post-install script. "apt update" and "apt full-upgrade" seems to be working fine after that.
Of course this is not a fix and I think I did it worse: all calls to sleep will fail. But it was fun and Ubuntu WSL1 is not my main driver so I had nothing to lose ;)

Worked fine but it stops package manager to upgrade 3 packages to their previous state. But glad it worked...

@hellohackie : Thanks for your workaround, now let me expand on that.. You can work around this even more by installing busybox and using:
alias sleep='busybox sleep '

I prefer this solution, it seems less invasive than installing a patched glibc.
Create this file called nanosleep.c
#include <time.h>
#include <unistd.h>

// This restores the old behaviour of nanosleep() to use CLOCK_MONOTONIC.
//
// "POSIX.1 specifies that nanosleep() should measure time against the
// CLOCK_REALTIME clock. However, Linux measures the time using the
// CLOCK_MONOTONIC clock.  This probably does not matter [...]"
//
// # gcc -shared -fPIC -o /usr/local/lib/libnanosleep.so nanosleep.c
// # echo /usr/local/lib/libnanosleep.so >> /etc/ld.so.preload
//
int nanosleep(const struct timespec *req, struct timespec *rem)
{
    return clock_nanosleep(CLOCK_MONOTONIC, 0, req, rem);
}

int usleep(useconds_t usec)
{
    struct timespec req = {
        .tv_sec     = (usec / 1000000),
        .tv_nsec    = (usec % 1000000) * 1000,
    };
    return nanosleep(&req, NULL);
}

# gcc -shared -fPIC -o /usr/local/lib/libnanosleep.so nanosleep.c
# echo /usr/local/lib/libnanosleep.so >> /etc/ld.so.preload

I verified this fixes sleep and htop for me.

last line didn't work for me, but changing the command a bit, and worked!
here it is:
sudo sh -c  "echo /usr/local/lib/libnanosleep.so >> /etc/ld.so.preload"

This issue is fixed for Insiders in the Beta channel and the Release Preview channel with 20H2 Build 19042.487 (KB4571744). I would recommend reversing any custom changes to your WSL once you've updated.


Add Xml Doc back to Nuget

Fix Issue #863.

[x] I ran Unit Tests locally.

Do we need the same for other repositories as well? Like logging, aspnetcore and dotnet-server?

build failed, You need to condition this task for windows only

Yep, just pushed.


In franklin, running check_name_availability.php a second time causes timeouts for every name

Run check_name_availability.php. It should work fine the first time (though it takes hours)
Run check_name_availability.php again. Every name times out with

Failed to get response from server within timeout of 30 in /home/grin/franklin/vendor/lbryio/php-api/src/BaseApi.php:50

I suspect DHT issues

@kaykurokawa did you fix this? i seem to remember you working on this

Wrong repo?


County hovers + no circle sort = better category switch performance

Now all mouseovers and clicks are based on the county polygons, which are loaded from the start. Circles highlight when the county is hovered over, but they actually don't have pointer events on. Colors for states, counties, and highlights need work. You can also see all county boundaries when zoomed in. It currently displays all of them, but we can work on trying a clip to show which counties are in view and which aren't. This was already a lot of change and I didn't want to go too crazy. I think having all the counties on zoom helps with the cutoff circles a little bit.

Category switching is much faster now that we turned off sorting. Unfortunately, the full load time for the page has increased because all counties are loading at the national view. The time to be able to see circles on the map is slightly quicker than before (because no sorting is needed), but there's just a slight lag before you can start hovering on counties.
Performance results:
Page load times
BEFORE: Load times to view=USA&category=total (milliseconds):

total
scripts (all the yellow)
rendering (all the purple)
painting (all the green)
'load' handler took __ms

1990
1178
44
8
--

1991
1193
44
8
--

1173
970
42
5
--

2039
1231
45
9
--

1196
994
37
5
--

AFTER: Load times to finish loading everything (so the county polygons)

total
scripts (all the yellow)
rendering (all the purple)
painting (all the green)
'load' handler took __ms

2446
1969
84
8
--

2467
2056
70
8
--

2541
2060
104
12
--

2492
2084
77
8
--

2797
2369
74
9
--

AFTER: Load times to see the map w/ circles

total
scripts (all the yellow)
rendering (all the purple)
painting (all the green)
'load' handler took __ms

1037
899
46
5
--

1129
882
36
5
--

1217
950
41
8
--

1181
928
41
5
--

1200
925
40
6
--

Times for first transition from Total to Pie view
As expected, these didn't really change much since the sorting was happening within the regular circles and I don't think that affected pies.
BEFORE

total
scripts (all the yellow)
rendering (all the purple)
painting (all the green)
'mouseover' handler

--
291
216
23
291

--
366
200
24
294

--
402
228
26
258

--
358
218
26
308

--
357
196
24
279

AFTER

total
scripts (all the yellow)
rendering (all the purple)
painting (all the green)
'mouseover' handler

--
364
195
25
332

--
319
200
27
260

--
377
200
28
317

--
476
210
27
442

--
354
197
26
321

Times for subsequent transitions from Total to Pie view
As expected, these didn't really change much since the sorting was happening within the regular circles and I don't think that affected pies.
BEFORE

total
scripts (all the yellow)
rendering (all the purple)
painting (all the green)
'mouseover' handler

--
211
165
23
129

--
131
169
26
131

--
139
171
24
139

--
161
179
27
161

--
136
166
22
136

AFTER

total
scripts (all the yellow)
rendering (all the purple)
painting (all the green)
'mouseover' handler

--
149
169
24
149

--
136
166
25
134

--
144
177
33
144

--
134
178
26
131

--
148
199
30
146

Times for transitions among circle categories (mouseovers)
BEFORE

total
scripts (yellow)
rendering (purple)
painting (green)
'mouseover' handler
from what to what

--
126
24
4
112
from blue to blue!

--
57
34
2
56
blue to yellow

--
88
42
6
86
blue to red

--
73
30
5
72
blue to green

--
60
35
4
60
blue to grey

AFTER

total
scripts (yellow)
rendering (purple)
painting (green)
'mouseover' handler
from what to what

--
23
20
6
22
from blue to blue!

--
25
29
3
23
blue to yellow

--
27
35
4
25
blue to red

--
25
33
5
24
blue to green

--
24
30
3
24
blue to grey

Times for transitions among circle categories (mouseouts)
BEFORE

total
scripts (yellow)
rendering (purple)
painting (green)
'mouseout' handler
from what to what

--
70
26
4
70
blue to blue

--
102
40
5
102
yellow to blue

--
107
33
4
100
red to blue

--
86
34
4
85
green to blue

--
87
32
4
86
grey to blue

AFTER

total
scripts (yellow)
rendering (purple)
painting (green)
'mouseout' handler
from what to what

--
15
21
5
14
blue to blue

--
23
51
24
22
yellow to blue

--
17
33
4
16
red to blue

--
23
30
4
23
green to blue

--
23
47
4
22
grey to blue

I'm thinking there will be quite a few conflicts with #105!

Also, this touched #78 (not exactly the same fix that this requested, but tooltips added to counties and removed from points), #97 (category switching excluding pies are much faster), and #92 (not exactly the desired behavior listed here, but mousing over a county and clicking it will zoom you to the state).

I agree that the diagnostic tables could be presented in a different way. For sake of comparison, I continued with what was added in #97. I know these have a lot more information than they probably need, but that's mostly because I'm still learning which of these things we can affect and which we can't.
I'm 98% sure that transition improvement is due to no sorting and re-sorting between categories. That sorting function took up a lot of time when we were looking at performance yesterday which is what made us decide to try it out.
The only other thing that changed for the circles was removing their mouseover and mouseout attributes. This might of had a small effect on the initial circle load, because it was only being added in the initial circle enter. But since we didn't remove the mouse event, just moved them to a different element (the county boundaries), I don't think that actually saved any time.


rocSOLVER and hipSOLVER examples (part I)

This pull request contains the new hipSOLVER and rocSOLVER examples. It is based on #30, so that should be merged first (notice the target branch). This is to make reviewing easier.
New examples:

hipSOLVER: singular value decomposition
hipSOLVER: linear least squares
hipSOLVER: qr decomposition
hipSOLVER: syevd
hipSOLVER: sygvd
rocSOLVER: matrix inversion

cc @tfalders

@Snektron please resolve conflicts

@tfalders added some fixes

@saadrahim are you okay with the state of this PR?


Version 6.0.2 not customizable in Angular 6.0.x

Hi,
It is not possible to customize the directive, like this:
<cookie-law>Hallo Chris Cookie</cookie-law>
Effect you can see under your own demo page as well (using Chrome or Firefox)
https://stackblitz.com/edit/angular2-cookie-law
Can reproduce it with fresh Angular Cli 6.0.8 project:
brings the same result like demo Page.
package.json in my demo project:
{
"name": "testcookie",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"@angular/animations": "^6.0.4",
"@angular/common": "^6.0.3",
"@angular/compiler": "^6.0.3",
"@angular/core": "^6.0.3",
"@angular/forms": "^6.0.3",
"@angular/http": "^6.0.3",
"@angular/platform-browser": "^6.0.3",
"@angular/platform-browser-dynamic": "^6.0.3",
"@angular/router": "^6.0.3",
"angular2-cookie-law": "^6.0.2",
"core-js": "^2.5.4",
"rxjs": "^6.0.0",
"zone.js": "^0.8.26"
},
"devDependencies": {
"@angular/compiler-cli": "^6.0.3",
"@angular-devkit/build-angular": "~0.6.8",
"typescript": "~2.7.2",
"@angular/cli": "~6.0.8",
"@angular/language-service": "^6.0.3",
"@types/jasmine": "~2.8.6",
"@types/jasminewd2": "~2.0.3",
"@types/node": "~8.9.4",
"codelyzer": "~4.2.1",
"jasmine-core": "~2.99.1",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~1.7.1",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "~2.0.0",
"karma-jasmine": "~1.1.1",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~5.3.0",
"ts-node": "~5.0.1",
"tslint": "~5.9.1"
}
}

Same problem, the custom templete option does not work. I'm using Angular cli 6.0.8

Closing this as duplicate of #25


VOTE: Who am I?

This is a comment vote issue. Please vote on the question below by leaving a comment with the text ^^^^<yourvotehere>^^^^. You can add any additional commentary you like.
Please note that your vote will not be case sensitive, but spelling does matter. If you try to vote multiple times, only your first vote will be counted. You may edit your vote as long as the vote is still open. This vote will end when there are 1 total votes.
Additional guidance: blah blah blah
QUESTION: Who am I?

I am ^^^^Jean Valjean^^^^!

This vote is now closed. You may continue commenting, but it will not affect the result.
The result was:
jean valjean: 1
People voting:

This vote is now closed. You may continue commenting, but it will not affect the result.
The result was:
jean valjean: 1
People voting:


Cannot regenerate server file like described in the docs

Observed result
Following the steps in the Dart quickstart, I am geting an error message on the attempt to re-generate the server.dart file.
$ dart run build_runner build --delete-conflicting-outputs
Could not find the implicit file to run: bin/hello.dart.

Expected result
It should be possible to follow the example command in the project documentation without running into errors.
 Curious if you still see this...

@kevmoo ,
I have upgraded to Dart 2.12 on Ubuntu and there the requests are working as described in the README.
I assume that for Mac it will also work, but I won't test this right now because of projects which are not migrated to null safety, yet.

@jmewes Apologies for delayed response here. We just updated the Dart Functions Framework, along with all the examples, and Dart ^2.12.0 is now required (Changelog).

@subfuzion ,
Thanks for the feedback!

I am trying to generate the server file and I keep getting no output.
Dart SDK version: 2.13.3 (stable) (Wed Jun 9 12:44:44 2021 +0200) on "macos_x64"
[INFO] Generating build script completed, took 715ms
[INFO] Reading cached asset graph completed, took 79ms
[INFO] Checking for updates since last build completed, took 656ms
[INFO] Running build completed, took 24ms
[INFO] Caching finalized dependency graph completed, took 52ms
[INFO] Succeeded after 95ms with 0 outputs (0 actions)
I feel like I must be missing something obvious.

So you have no file at bin/server.dart?
What does your 'lib/functions.dart` file look like?
On Thu, Jun 17, 2021 at 9:43 PM Larry McKenzie @.***>
wrote:

I am trying to generate the server file and I keep getting no output.
Dart SDK version: 2.13.3 (stable) (Wed Jun 9 12:44:44 2021 +0200) on
"macos_x64"
[INFO] Generating build script completed, took 715ms
[INFO] Reading cached asset graph completed, took 79ms
[INFO] Checking for updates since last build completed, took 656ms
[INFO] Running build completed, took 24ms
[INFO] Caching finalized dependency graph completed, took 52ms
[INFO] Succeeded after 95ms with 0 outputs (0 actions)
I feel like I must be missing something obvious.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/GoogleCloudPlatform/functions-framework-dart/issues/178#issuecomment-863750948,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAAEFCQALAIZPXHMZR4ENSTTTLFG7ANCNFSM4X6D52DQ
.

Correct, no bin/server.dart is generated.
lib/functions.dart <- I renamed this file in my project. I thought the annotation would be enough to generate the code. Is this filename a requirement?

It is!
https://github.com/GoogleCloudPlatform/functions-framework-dart/blob/5c6990befd824806ffe03517f2fd9108313e2487/functions_framework_builder/build.yaml#L6-L8
On Fri, Jun 18, 2021 at 8:57 PM Larry McKenzie @.***>
wrote:

Correct, no bin/server.dart is generated.
lib/functions.dart <- I renamed this file in my project. I thought the
annotation would be enough to generate the code. Is this filename a
requirement?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/GoogleCloudPlatform/functions-framework-dart/issues/178#issuecomment-864350888,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAAEFCVZLZUYMXCGA4NR5ILTTQITLANCNFSM4X6D52DQ
.

Thanks! I really appreciate you all working to make server side dart better.


How to monitor the status of the thanos component itself？

$ thanos --version
thanos, version 0.23.0-rc.0 (branch: HEAD, revision: 81841aed4a9e3d6f6ed772fea287f04504d164f3)
build user:       root@d1bae1e2c93c
build date:       20210908-14:46:03
go version:       go1.16.7
platform:         linux/amd64
How to monitor the status of the thanos component itself？
Which specific indicators have passed, thank you!

I mean how to know  Sidecar Query Store Rule Compact problem appear.I know the first time there is a problem with these components

All components are exposed self metrics with prometheus format on http port/metrics endpoint. here is the grafana dashboards and alerts. https://github.com/thanos-io/thanos/tree/main/mixin

Thanks for the reply, my understanding is that you need to use the new indicator monitoring after installing this package, right?

One more thing, I don’t use Kubernetes, I just use thanos +prometheus.Is the thanos-mixin you said is feasible

One more thing, I don’t use Kubernetes, I just use thanos +prometheus.Is the thanos-mixin you said is feasible

The thanos-minxin just generate grafana dashboard and alert rules about thanos component，not relevant with k8s.
You can deploy another prometheus and scrape thanos component metrics.

Thank you very much, I will test it~

Close it now as no activity.


This script not longer works

The following script which I obtained from my modeling textbook no longer works. The issue appears to be with te.plotWithLegend (rr, result)
The error message is:
line 66, in figureFromTimecourse
if m.colnames[0] != 'time':
AttributeError: 'numpy.ndarray' object has no attribute 'colnames'
Running:
[('tellurium', '2.0.12'),
('roadrunner', '1.4.24'),
('antimony', '2.9.4'),
('libsbml', '5.15.0'),
('libsedml', '402'),
('phrasedml', '1.0.8'),
('pySBOL', '2.2.0')]
import tellurium as te
import numpy as np
Coherent Type I Genetic Network, noise filter
cell = '''
$G2 -> P2; Vmax2P1^4/(Km1 + P1^4);
P2 -> $w;  k1P2;
$G3 -> P3; Vmax3P1^4P2^4/(Km1 + P1^4P2^4);
P3 -> $w;  k1P3;
Vmax2 = 1; Vmax3 = 1;
Km1 = 0.5; k1 = 0.1;
P1 = 0;    P2 = 0;    P3 = 0;

'''
rr = te.loadAntimonyModel(cell)
rr.getSteadyStateValues()
print rr.model.getFloatingSpeciesConcentrations()
Pulse width
Set to 1 for no effect
Set to 4 for full effect
width = 1
rr.P1 = 0.3
m1 = rr.simulate(0, 10, 100, ["time", "P1", "P3"])
rr.P1 = 0.7 # input stimulus
m2 = rr.simulate(10, 10 + width, 100, ["time", "P1", "P3"])
rr.P1 = 0.3
m3 = rr.simulate(10 + width, 40, 100, ["time", "P1", "P3"])
m = np.vstack((m1, m2))
result = np.vstack((m, m3))
te.plotWithLegend(rr, result)

Basically, when vstack is called, the colnames are striped off. colnames are used to check that the array you pass through is actually formatted correctly. I don't think we should remove this check btw, the original script is already problematic because it does not have any information on time and its scale passed to plot.

What's the best way to splice two simulations together and plot them with a legend? I used the above approach a lot but if it doesn't work anymore I need another way to do.

vstack or concatenate will work fine for splicing. For plotting, something like:
plt.plot(result[:,0], result[:,1:])
plt.legend(["P1","P3"])
plt.show()

will do. In this case, notice that you are manually specifying x value and y values.

I'd like a simpler way for novice users, slicing is a bit scary for many
biologists.
H
On Sun, Mar 18, 2018 at 1:01 PM Kiri Choi<EMAIL_ADDRESS>wrote:

vstack or concatenate will work fine for splicing. For plotting, something
like:
plt.plot(result[:,0], result[:,1:])
plt.legend(["P1","P3"])
plt.show()
will do. In this case, notice that you are manually specifying x value and
y values.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/sys-bio/tellurium/issues/347#issuecomment-374039644,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABAZDqcA2uPR3BYeqIM_DOgxQNcsu9k1ks5tfr0IgaJpZM4SvT-q
.

If one does not wish to use events, I don't think there are good alternatives. TBH, array manipulation is the basic of numpy basics, so it might be something they have to go through unfortunately.

The other thing I noticed is that plotWithLegend is deprecated anyway,
along with plotArray.
Hence what I will do is addplotWithLegend (without the restriction) as part
of my own personal set of utilities (along with the others I've created)
which people can choose to download if need be. That way I can also
continue to use these methods in my textbook.
Herbert
On Sun, Mar 18, 2018 at 1:24 PM, Kiri Choi<EMAIL_ADDRESS>wrote:

If one does not wish to use events, I don't think there are good
alternatives. TBH, array manipulation is the basic of numpy basics, so it
might be something they have to go through unfortunately.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/sys-bio/tellurium/issues/347#issuecomment-374042100,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABAZDgRqLgpRpBUz2eeYHaLpggH2snZyks5tfsKGgaJpZM4SvT-q
.


404 error

https://images.weserv.nl/?url=http://joyreactor.cc/apple-touch-icon.png
For some reason I get 404 eror

Duplicate of #339

@kleisauke ok, so why this https://images.weserv.nl/?url=http://joyreactor.com/apple-touch-icon.png also doesen't work? domain is .com


please go and actually test this

wasted 5 hours of my time. You ought to take the webui out since it's not going to work except in some magical scenario where it's trivial and reasonable to give up whatever ingress controller I'm using for another. Just get rid of it dude wtf

I can turn the tls off and it will work. I guess the "secure mode" aint so secure if I'm forced into turning it off so that I can use the god damned thing is it

ya that provisioner is broke too I configured that and it didn't do that neither

sorry for being a bitch, I changed:
http-port: 443 (was 8080
also did this for service
    http:
    port: 443
    name: http

then I just had the same sorta ingress layout in the end
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  annotations:
    cert-manager.io/cluster-issuer: letsencrypt-prod
    kubernetes.io/ingress.class: traefik
    meta.helm.sh/release-name: cockroachdb
    meta.helm.sh/release-namespace: bing-prod
    traefik.ingress.kubernetes.io/service.serversscheme: https
  creationTimestamp: "2022-05-25T04:01:20Z"
  generation: 1
  labels:
    app.kubernetes.io/instance: cockroachdb
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/name: cockroachdb
    helm.sh/chart: cockroachdb-7.0.3
  name: cockroachdb-ingress
  namespace: bing-prod
  resourceVersion: "4566744"
  uid: 84c900d3-e47b-4800-b3ad-a0d43dd2c272
spec:
  rules:
  - host: bing.bong
    http:
      paths:
      - backend:
          service:
            name: cockroachdb-public
            port:
              name: http
        path: /
        pathType: Prefix
  tls:
  - hosts:
    - bing.bong
    secretName: cockroachlabs-tls
status:
  loadBalancer: {}

and you have to add this to traefik   - --serverstransport.insecureskipverify=true its stupid I was planning on using cert-manager but that's an even bigger problem to work through with this I tried earlier to make a self signing cluster issuer but crdb wasn't having it

I figure once I've got the cert-manager working for that though should be easy to turn off insecureskipverify but who knows


fix: Emoji display fix uses relative unit

:tada: This PR is included in version 2.3.1 :tada:
The release is available on:

npm package (@latest dist-tag)
GitHub release

Your semantic-release bot :package::rocket:


[big-bang] This should fix the Galleon Linux failures on big bang

WFLY-16572 Remove usage of transformed repo in microprofile test module.

Yay - "Galleon Linux" is green again! (And failures on Windows are unrelated messaging ones)

Thanks @rhusar !


run success but it shows Offline

Issues and Contributing
Please note that only issues related to this Docker image will be addressed here.
https://hub.docker.com/_/jenkins

If you have Docker related issues, please ask in the Docker user mailing list.
If you have Jenkins related issues, please ask in the Jenkins mailing lists.
If you are not sure, then this is probably not the place to create an issue and you should use any of the previously mentioned mailing lists.

If after going through the previous checklist you still think you should create an issue here please provide:
Docker commands that you execute
docker run -d  -p 808:8080 -p 50000:50000 jenkins
Actual result
success but it shows Offline
Expected outcome
Have you tried a non-dockerized Jenkins and get the expected outcome?
Output of docker version
Docker version 19.03.12, build 48a66213fe
Other relevant information

is the docker version problem?

because i can't access the google.com?
the china can't access.will you use the china vps to do this ?

Jenkins needs internet connectivity to download plugins it will fail without this.


Add related products table

The current endpoint http://localhost:8083/api/v1/cve/{cve_id} expects the following response body (this is mock data not real):
{
  "id": "CVE_1",
  "products": {
    "fixed": [],
    "first_fixed": [],
    "first_affected": [],
    "known_affected": [],
    "last_affected": [],
    "under_investigation": [
      {
        "sbom_id": "fuse-7.json.bz2",
        "packages": [
          {
            "purl"<EMAIL_ADDRESS>            "type": "Direct"
          },
          {
            "purl"<EMAIL_ADDRESS>            "type": "Transitive"
          }
        ]
      }
    ]
  }
}

From that I saw in @ctron 's code, the decision of setting "fixed|known_affected|under_investigation" will be taken from Vexination so no need to Guac to deal with it (anyone feel free to correct my assumptions if they are wrong)
@dejanb GUAC needs to have something like given a CVE ID then return the *a list of objects*, each object must contain the sbom_id and a list of packages affected only by the CVE in context. Eg.

from the image above:

The CVE-1 affects a product (sbom) whose Id is fuse-7.json.bz2 and the packages affected by CVE-1 under the context of the SBOM fuse-7.json.bz2 are:

<EMAIL_ADDRESS><EMAIL_ADDRESS>

The package has a type=Direct|Transitive. I believe this depends on the position of the package under the tree (within the context of the SBOM)

@dejanb @mrizzi  is this something possible to do in GUAC?

From that I saw in @ctron 's code, the decision of setting "fixed|known_affected|under_investigation" will be taken from Vexination so no need to Guac to deal with it (anyone feel free to correct my assumptions if they are wrong)

not from vexination but from guac because guac should be the only source of truth for avoiding data inconsistency.

@dejanb GUAC needs to have something like given a CVE ID then return the *a list of objects*, each object must contain the sbom_id and a list of packages affected only by the CVE in context. Eg.

guac endpoint has been implemented and with the JSON sample file you provided, @dejanb can create the SPoG API endpoint that will call guac and, based on its response, will create the JSON in the format you need for the UI.
Some questions:
What is sbom_id meant for?
Shouldn't the sample JSON also contain the fields name, version, publisher and release_date to reflect the data needed for fill the table's columns?
If yes, could them "replace" sbom_id?

Some questions:
What is sbom_id meant for?
Shouldn't the sample JSON also contain the fields name, version, publisher and release_date to reflect the data needed for fill the table's columns?
If yes, could them "replace" sbom_id?

The name, version, supplier, and release_date is strictly related to the SBOM. So in theory, as long as GUAC can return a concrete reference to the SBOM (sbom_id) then this sbom_id can be used against https://api.staging.trustification.dev/api/v1/package?id={SBOM_ID} and get the name, version, supplier, and release_date data.

Even if GUAC can return name, version, supplier, and release_date I believe sbom_id is still necesary since there is the plan/idea to show more data related to the SBOM in the following Mockup

The expanded section will continue becoming greater therefore we should guarantee we can render any data associated to the SBOM (here is here the sbom_id comes from)
WHEN I SAY SBOM_ID it should be just a unique value that allows us to connect the GUAC response with a UNIQUE SBOM stored in Bombastic

@ctron this is the PR for related products. The code has low quality but I hope it helps even a bit. If you are fine we can merge this PR and then iterate on a next PR


mixing flags with --remote-wait

Running this with latest nvr gives expected at least one argument.
nvr  --remote-tab-wait -q <(ag foo bar)

Same if I do something like nvr --remote-wait -o foo or -o --remote-wait.

nvr -h
  --remote-tab-wait <file> [<file> ...]

Actually all --remote* options take at least one file as arguments. :]

Except that those two examples don't work.
Running nvr -o --remote-wait  foo on the file foo gives an error because -o expects a file, and switching the order gives the same issue since then remote-wait expects a file.

Yes, both options, -o and --remote-wait expect a file.
I think you want this instead:
$ nvr -cc split --remote-wait foo


Naming Convention

Expected behavior
There is a mix of naming convention in wit.
Example:
https://github.com/fabric8-services/fabric8-wit/blob/master/controller/test-files/iteration/show/ok.res.iteration.golden.json
active_status is snake case
startAt is camel case
Actual behavior
This is not harmful but we should really practice using one of the naming conventions for:
- better code readability
- consistency

To make things worse, we also have - in member names: created-at. For go code we should use follow: https://golang.org/doc/effective_go.html#mixed-caps

@DhritiShikhar you wrote: "There is a mix of naming convention in wit."
Do you mean in the response/request format or in the Go code.

See also https://github.com/golang/go/wiki/CodeReviewComments#mixed-caps


Tuffle compile error during thirdweb deploy

I have already deployed a contract to testnet. i would like to deploy with thirdweb sdk and then I can use it for my front end.
But the error shows when I  type :  npx thirdweb deploy

I think this might be an issue with npx not working with truffle unless you have a local version installed.
can you run npm install --save-dev truffle and try again?

@allenjeep did that work for you?

Any updates on this @allenjeep? Are you happy to close this issue?


Simple SSI User Authentication

In addition to the powerful OIDC integration we want to provide a simple addition to the local authentication strategy.
In addition to user name/password the login page should provide the possibility to login using a proof request encoded in a QR code. This should provide a lightweight demonstration of VC-based login without any other external dependencies.

The QR code should either be a connection-less proof request or an OOB proof request supporting connection reuse.
The proof template should be configurable

I'd suggest not using a connection-less proof and use a connection instead, assuming OOB and connection reuse is possible. If you use a connection, you have certainty that the proofs are always coming from the same party, and knowledge of the party builds. Further, if you subsequently issue on the same connection, you have certainty that the credential is going to the same party.
I think that a cookie in the browser that allows the BPA to link the browser to a connection could be very useful here so that there is no need for a scan of a QR code on every visit.
That said, the vc-authn-oidc implementation BC Gov has done would allow using the OIDC integration using VCs via connection-less proofs.

Thanks for your input. That's great! We need to check if the smartphone wallets already support OOB and we'd need to prepare https://github.com/hyperledger-labs/acapy-java-client to support OOB.
@parc-jason has already implemented an OIDC integration that would allow to use VC-AuthN-OIDC, but I think it make sense to provide a lightweight SSI authentication method without additional dependencies as well.

@ntsbs Could you notify us here when OOB is getting close? :)


Polish Github extension

My git extension also stopped working...

Restarted vscode, now it's working

@chrmarti What is the GitHub extension?

It's a not yet published example for custom views.

I should add: We will polish that to make useful beyond being an example.

Is it in a public repo at this point? Would love to take a look at it as I'm working on custom views for GitLens :)

It's here: https://github.com/chrmarti/vscode-githubissues. I'll move it to Microsoft's account before we publish the extension.
Let us know what you have in mind for GitLens. @rebornix is working on another extension adding a few Git-specific views.

I'm still experimenting at this point, but thinking about a few different options (maybe 2 views).
Here is a peek at one idea

@eamodio I'm really happy to see we share the same thoughts, you can take a look at https://github.com/Microsoft/vscode/issues/28657 and see where I have gone. I'm going to open source the repo and publish the ext in one day or two.
Do you think it's a good idea to join forces as the list/diff part is the same :)

Doh -- so I have 1 or 2 days to get this out first? ;) j/k
I would definitely be interested in joining forces (not sure what that looks like at this point though) -- As your PR list was something I wanted to tackle as well.
I have a slack for GitLens https://join.slack.com/vscode-gitlens/shared_invite/MTk0NjA3OTIwNTE3LTE0OTY4OTc3NzQtMWQxODFhZWMyMA (link is good for ~24days) and would love to talk more about it.

Just published the GitHub Issues and PRs extension: https://marketplace.visualstudio.com/items?itemName=ms-vscode.github-issues-prs
New repo: https://github.com/Microsoft/vscode-github-issues-prs


pull request for e2e test at 01/26/2017 02:45:08

:white_check_mark: Validation status: passed
For more details, please refer to the build report.
Note: If you changed an existing file name or deleted a file, broken links in other files to the deleted or renamed file are listed only in the full build report.


🔄 Synced file(s) with BetaHuhn/github-files

Synced local file(s) with BetaHuhn/github-files.

Changed files

Synced local  .github/workflows/release.yml with remote  workflows/versioning/release.ymlSynced local  .github/workflows/lint.yml with remote  workflows/node/lint.ymlSynced local  LICENSE with remote  LICENSE

This PR was created automatically by the action-github-file-sync workflow run #474147881

:tada: This PR is included in version 0.3.8 :tada:
The release is available on:

GitHub release
npm package (@latest dist-tag)

Your semantic-release bot :package::rocket:

:tada: This PR is included in version 0.3.8 :tada:
The release is available on:

GitHub release
npm package (@latest dist-tag)

Your semantic-release bot :package::rocket: