watchman: Watchman error on Ubuntu 22.04

Command watchman -v (and any other commands) fails after binaries installation (Linux installation guide) with error:

watchman: error while loading shared libraries: libcrypto.so.1.1: cannot open shared object file: No such file or directory

I fixed this error with the solution of smmoosavi here but another error appears:

terminate called after throwing an instance of 'std::system_error'
terminate called recursively
Aborted (core dumped)

Any ideas how to fix it? I tried different version of binaries but the result is the same…

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 11
  • Comments: 27 (5 by maintainers)

Commits related to this issue

Most upvoted comments

That works for me on ubuntu 22.04.1

first of all, you need to remove all watchman files that you have installed manualy

Removing files

removing bin files

sudo rm -rf /usr/local/bin/{watchman,watchmanctl}

removing lib files

sudo rm -rf /usr/local/lib/{libevent-2.1.so.7,libgflags.so.2.2,libglog.so.0,libsnappy.so.1,libzstd.so.1}

Installing watchman again

just install by using apt

sudo apt install watchman

I hope I was helpfull

Homebrew works for me.

First I did this from above:

Removing files removing bin files

sudo rm -rf /usr/local/bin/{watchman,watchmanctl}

removing lib files

sudo rm -rf /usr/local/lib/{libevent-2.1.so.7,libgflags.so.2.2,libglog.so.0,libsnappy.so.1,libzstd.so.1}

And then, installed Homebrew and run brew install watchman

And now:

> watchman --version 
2022.08.22.00

The weekly release process for Watchman now generates Ubuntu 22.04 (and 20.04 and 18.04) debs.

See the new installation instructions at https://facebook.github.io/watchman/docs/install.html

I’m going to close this issue, but please file a new one if the Ubuntu 22 package does not work for you.

It seems the latter is caused by changes to libgcc which made unwinding use glibc’s _dl_find_object when available, as reverting these changes makes watchman behave properly again.

diff --git c/libgcc/unwind-dw2-fde-dip.c i/libgcc/unwind-dw2-fde-dip.c
index 7f9be5e6b02..b8da2a51e9e 100644
--- c/libgcc/unwind-dw2-fde-dip.c
+++ i/libgcc/unwind-dw2-fde-dip.c
@@ -504,24 +504,6 @@ _Unwind_Find_FDE (void *pc, struct dwarf_eh_bases *bases)
   if (ret != NULL)
     return ret;
 
-  /* Use DLFO_STRUCT_HAS_EH_DBASE as a proxy for the existence of a glibc-style
-     _dl_find_object function.  */
-#ifdef DLFO_STRUCT_HAS_EH_DBASE
-  {
-    struct dl_find_object dlfo;
-    if (_dl_find_object (pc, &dlfo) == 0 && dlfo.dlfo_eh_frame != NULL)
-      return find_fde_tail ((_Unwind_Ptr) pc, dlfo.dlfo_eh_frame,
-# if DLFO_STRUCT_HAS_EH_DBASE
-                           (_Unwind_Ptr) dlfo.dlfo_eh_dbase,
-# else
-                           0,
-# endif
-                           bases);
-    else
-      return NULL;
-    }
-#endif /* DLFO_STRUCT_HAS_EH_DBASE */
-
   data.pc = (_Unwind_Ptr) pc;
 #if NEED_DBASE_MEMBER
   data.dbase = NULL;

bento/ubuntu2204 Vagrant box is available. I’ve confirmed that Watchman builds and passes tests on Ubuntu 22. The issue appears to be that the precompiled binaries created on GitHub Actions don’t run.

The libcrypto dependency causing issues on newer Ubuntu seems widespread:

https://github.com/hrkfdn/ncspot/issues/812 https://askubuntu.com/questions/1403778/upgrading-to-ubuntu-22-04-causes-libcrypto-errors-apt-dpkg-broken

In my VM I ran:

$ wget http://security.debian.org/debian-security/pool/updates/main/o/openssl/libssl1.1_1.1.0l-1~deb9u6_amd64.deb
$ sudo dpkg -i libssl1.1_1.1.0l-1~deb9u6_amd64.deb

And then reproduced the exception handling crash:

vagrant@watchman-ubuntu-22:~$ watchman --help
terminate called after throwing an instance of 'std::system_error'
terminate called recursively
Aborted (core dumped)

Sigh. This is awesome all around. I suppose one option is to ask you all to build and install from source locally (which works). Another would be to wait for the ubuntu-latest GitHub Actions image to use Ubuntu 22.

We could statically link OpenSSL but that’s a bad idea too.

We don’t have time to maintain a PPA, but that would be an obvious solution too.

Thanks for all of the investigation, folks, and let me know if you have better ideas.

terminate called after throwing an instance of ‘std::system_error’ terminate called recursively [1] 95316 IOT instruction (core dumped) watchman

Is there any workaround?

Has your workaround been applied yet? 2022.06.06 is still affected by this bug.

> watchman --help
terminate called after throwing an instance of 'std::system_error'
terminate called recursively
[1]    1346249 IOT instruction (core dumped)  watchman --help

I’m looking forward to when the generic/ubuntu2204 Vagrant box is ready so we can add it to our Vagrant-based build “CI”.

From reading this thread, I don’t have a clue yet either, but I’ll try to find time to chime in soon.

I believe one of the issues is a gcc bug introduced in 11.2: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104008

We have a workaround coming in Folly, and gcc 12 and gcc 11.3 should have the fix. The other issues I’ll try to get time to look at later.

I fixed that on my local with the following:

wget http://nz2.archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1l-1ubuntu1.3_amd64.deb
sudo dpkg -i libssl1.1_1.1.1l-1ubuntu1.3_amd64.deb

I found the issue at: https://askubuntu.com/questions/1403778/upgrading-to-ubuntu-22-04-causes-libcrypto-errors-apt-dpkg-broken

It’s a guess, but one of the big ubuntu 22 changes was an update to openssl 3.x (it require prisma changes for example) which might also be hitting watchman