facebook / watchman

Watches files and records, or triggers actions, when they change.
https://facebook.github.io/watchman/
MIT License
12.57k stars 986 forks source link

Ubuntu 22.04 binaries undefined symbol #1066

Closed stephenh closed 1 year ago

stephenh commented 1 year ago

Really excited to try the watchman binaries again (I had been using a ~20220707 locally built version iirc); I just tried downloading the deb and followed the dpkg -i + sudo apt-get -f install install instructions but am getting this error:

 watchman depends on libboost-context1.74.0; however:
  Package libboost-context1.74.0 is not installed.
 watchman depends on libevent-2.1-7; however:
  Package libevent-2.1-7 is not installed.

dpkg: error processing package watchman (--install):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 watchman
[I] ~/Downloads $ sudo apt-get -f install
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Correcting dependencies... Done
The following additional packages will be installed:
  libboost-context1.74.0 libevent-2.1-7 libgflags2.2 libgoogle-glog0v5
The following NEW packages will be installed:
  libboost-context1.74.0 libevent-2.1-7 libgflags2.2 libgoogle-glog0v5
0 upgraded, 4 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
Need to get 509 kB of archives.
After this operation, 3,017 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://us.archive.ubuntu.com/ubuntu jammy/universe amd64 libgflags2.2 amd64 2.2.2-2 [78.1 kB]
Get:2 http://us.archive.ubuntu.com/ubuntu jammy/universe amd64 libgoogle-glog0v5 amd64 0.5.0+really0.4.0-2 [60.3 kB]
Get:3 http://us.archive.ubuntu.com/ubuntu jammy/main amd64 libboost-context1.74.0 amd64 1.74.0-14ubuntu3 [223 kB]
Get:4 http://us.archive.ubuntu.com/ubuntu jammy/main amd64 libevent-2.1-7 amd64 2.1.12-stable-1build3 [148 kB]
Fetched 509 kB in 1s (698 kB/s)
Selecting previously unselected package libgflags2.2.
(Reading database ... 367424 files and directories currently installed.)
Preparing to unpack .../libgflags2.2_2.2.2-2_amd64.deb ...
Unpacking libgflags2.2 (2.2.2-2) ...
Selecting previously unselected package libgoogle-glog0v5.
Preparing to unpack .../libgoogle-glog0v5_0.5.0+really0.4.0-2_amd64.deb ...
Unpacking libgoogle-glog0v5 (0.5.0+really0.4.0-2) ...
Selecting previously unselected package libboost-context1.74.0:amd64.
Preparing to unpack .../libboost-context1.74.0_1.74.0-14ubuntu3_amd64.deb ...
Unpacking libboost-context1.74.0:amd64 (1.74.0-14ubuntu3) ...
Selecting previously unselected package libevent-2.1-7:amd64.
Preparing to unpack .../libevent-2.1-7_2.1.12-stable-1build3_amd64.deb ...
Unpacking libevent-2.1-7:amd64 (2.1.12-stable-1build3) ...
Setting up libboost-context1.74.0:amd64 (1.74.0-14ubuntu3) ...
Setting up libevent-2.1-7:amd64 (2.1.12-stable-1build3) ...
Setting up libgflags2.2 (2.2.2-2) ...
Setting up libgoogle-glog0v5 (0.5.0+really0.4.0-2) ...
Setting up watchman (20221009.103647.0) ...
Processing triggers for libc-bin (2.35-0ubuntu3.1) ...
[I] ~/Downloads $ watchman --version
watchman: symbol lookup error: watchman: undefined symbol: _ZN6google21kLogSiteUninitializedE

cc @chadaustin

Thank you!

Not sure what would help debug this:

$ uname -a
Linux sh12 5.15.0-50-generic #56-Ubuntu SMP Tue Sep 20 13:23:26 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

And I'm using Regolith Desktop 2.1, which is a Ubuntu 22.04+i3wm based distro.

chadaustin commented 1 year ago

I just manually installed Regolith 20.04 and Regolith 22.04, downloaded the appropriate .deb files, and they run fine for me. That looks like a google logging package mismatch. Did you install the correct .deb?

stephenh commented 1 year ago

:thinking: hm, yeah:

 $ sudo dpkg -i watchman_ubuntu22.04_v2022.10.17.00.deb
[sudo] password for stephen:
(Reading database ... 367709 files and directories currently installed.)
Preparing to unpack watchman_ubuntu22.04_v2022.10.17.00.deb ...
Unpacking watchman (20221016.020512.0) over (20221009.103647.0) ...
Setting up watchman (20221016.020512.0) ...
[I] ~/Downloads $ sudo apt install -f
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
[I] ~/Downloads $ watchman --version
watchman: symbol lookup error: watchman: undefined symbol: _ZN6google21kLogSiteUninitializedE

I tried reinstalling the google logging:

$ sudo apt-get --reinstall install libgoogle-glog0v5
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 0 not upgraded.
Need to get 0 B/60.3 kB of archives.
After this operation, 0 B of additional disk space will be used.
(Reading database ... 367709 files and directories currently installed.)
Preparing to unpack .../libgoogle-glog0v5_0.5.0+really0.4.0-2_amd64.deb ...
Unpacking libgoogle-glog0v5 (0.5.0+really0.4.0-2) over (0.5.0+really0.4.0-2) ...
Setting up libgoogle-glog0v5 (0.5.0+really0.4.0-2) ...
Processing triggers for libc-bin (2.35-0ubuntu3.1) ...

And yeah I have 22.04:

$ lsb_release  -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.1 LTS
Release:        22.04
Codename:       jammy

And in my original post the jammy repo was used to download the libgoogle package...

I just manually installed Regolith 20.04 and Regolith 22.04, downloaded the appropriate .deb files, and they run fine for me.

Ah wow, thanks for taking the time to check both of those!

It looks like some symbols are working:

   1791887:     symbol=_ZTIN6google7LogSinkE;  lookup in file=watchman [0]
   1791887:     symbol=_ZTIN6google7LogSinkE;  lookup in file=/usr/local/lib/libglog.so.0 [0]
   1791887:     symbol=_ZN6google7LogSink12WaitTillSentEv;  lookup in file=watchman [0]
   1791887:     symbol=_ZN6google7LogSink12WaitTillSentEv;  lookup in file=/usr/local/lib/libglog.so.0 [0]
   1791887:     symbol=_ZN6google10LogMessage19WriteToStringAndLogEv;  lookup in file=watchman [0]
   1791887:     symbol=_ZN6google10LogMessage19WriteToStringAndLogEv;  lookup in file=/usr/local/lib/libglog.so.0 [0]
   1791887:     symbol=_ZN6google10LogMessage9SendToLogEv;  lookup in file=watchman [0]
   1791887:     symbol=_ZN6google10LogMessage9SendToLogEv;  lookup in file=/usr/local/lib/libglog.so.0 [0]
   1791887:     symbol=_ZN6google19g_logging_fail_funcE;  lookup in file=watchman [0]
   1791887:     symbol=_ZN6google19g_logging_fail_funcE;  lookup in file=/usr/local/lib/libglog.so.0 [0]
   1791887:     symbol=_ZN6google10LogMessage13num_messages_E;  lookup in file=watchman [0]
   1791887:     symbol=_ZN6google10LogMessage13num_messages_E;  lookup in file=/usr/local/lib/libglog.so.0 [0]
   1791887:     symbol=_ZTVN6google12base_logging12LogStreamBufE;  lookup in file=watchman [0]
   1791887:     symbol=_ZTVN6google12base_logging12LogStreamBufE;  lookup in file=/usr/local/lib/libglog.so.0 [0]
   1791887:     symbol=_ZN6google16LogSeverityNamesE;  lookup in file=watchman [0]
   1791887:     symbol=_ZN6google16LogSeverityNamesE;  lookup in file=/usr/local/lib/libglog.so.0 [0]
   1791887:     symbol=_ZN6google10LogMessage10SendToSinkEv;  lookup in file=watchman [0]
   1791887:     symbol=_ZN6google10LogMessage10SendToSinkEv;  lookup in file=/usr/local/lib/libglog.so.0 [0]
   1791887:     symbol=_ZN6google10LogMessage16SendToSinkAndLogEv;  lookup in file=watchman [0]
   1791887:     symbol=_ZN6google10LogMessage16SendToSinkAndLogEv;  lookup in file=/usr/local/lib/libglog.so.0 [0]
   1791887:     symbol=_ZN6google10LogMessage15SaveOrSendToLogEv;  lookup in file=watchman [0]
   1791887:     symbol=_ZN6google10LogMessage15SaveOrSendToLogEv;  lookup in file=/usr/local/lib/libglog.so.0 [0]
   1791887:     symbol=_ZN6google10LogMessage9SendToLogEv;  lookup in file=watchman [0]
   1791887:     symbol=_ZN6google10LogMessage9SendToLogEv;  lookup in file=/usr/local/lib/libglog.so.0 [0]
   1791887:     symbol=_ZN6google21kLogSiteUninitializedE;  lookup in file=watchman [0]
   1791887:     symbol=_ZN6google21kLogSiteUninitializedE;  lookup in file=/usr/local/lib/libglog.so.0 [0]
   1791887:     symbol=_ZN6google21kLogSiteUninitializedE;  lookup in file=/lib/x86_64-linux-gnu/libpcre2-8.so.0 [0]
   1791887:     symbol=_ZN6google21kLogSiteUninitializedE;  lookup in file=/lib/x86_64-linux-gnu/libcrypto.so.3 [0]
   1791887:     symbol=_ZN6google21kLogSiteUninitializedE;  lookup in file=/lib/x86_64-linux-gnu/libboost_context.so.1.74.0 [0]
   1791887:     symbol=_ZN6google21kLogSiteUninitializedE;  lookup in file=/usr/local/lib/libgflags.so.2.2 [0]
   1791887:     symbol=_ZN6google21kLogSiteUninitializedE;  lookup in file=/lib/x86_64-linux-gnu/libdouble-conversion.so.3 [0]
   1791887:     symbol=_ZN6google21kLogSiteUninitializedE;  lookup in file=/usr/local/lib/libevent-2.1.so.7 [0]
   1791887:     symbol=_ZN6google21kLogSiteUninitializedE;  lookup in file=/lib/x86_64-linux-gnu/libz.so.1 [0]
   1791887:     symbol=_ZN6google21kLogSiteUninitializedE;  lookup in file=/lib/x86_64-linux-gnu/libbz2.so.1.0 [0]
   1791887:     symbol=_ZN6google21kLogSiteUninitializedE;  lookup in file=/lib/x86_64-linux-gnu/liblzma.so.5 [0]
   1791887:     symbol=_ZN6google21kLogSiteUninitializedE;  lookup in file=/lib/x86_64-linux-gnu/liblz4.so.1 [0]
   1791887:     symbol=_ZN6google21kLogSiteUninitializedE;  lookup in file=/usr/local/lib/libzstd.so.1 [0]
   1791887:     symbol=_ZN6google21kLogSiteUninitializedE;  lookup in file=/usr/local/lib/libsnappy.so.1 [0]
   1791887:     symbol=_ZN6google21kLogSiteUninitializedE;  lookup in file=/lib/x86_64-linux-gnu/libunwind.so.8 [0]
   1791887:     symbol=_ZN6google21kLogSiteUninitializedE;  lookup in file=/lib/x86_64-linux-gnu/libstdc++.so.6 [0]
   1791887:     symbol=_ZN6google21kLogSiteUninitializedE;  lookup in file=/lib/x86_64-linux-gnu/libm.so.6 [0]
   1791887:     symbol=_ZN6google21kLogSiteUninitializedE;  lookup in file=/lib/x86_64-linux-gnu/libgcc_s.so.1 [0]
   1791887:     symbol=_ZN6google21kLogSiteUninitializedE;  lookup in file=/lib/x86_64-linux-gnu/libc.so.6 [0]
   1791887:     symbol=_ZN6google21kLogSiteUninitializedE;  lookup in file=/lib64/ld-linux-x86-64.so.2 [0]
   1791887:     watchman: error: symbol lookup error: undefined symbol: _ZN6google21kLogSiteUninitializedE (fatal)

I wonder if the error is because I'd been running a locally-built version of watchman...

Ah! Yep:

$ sudo rm /usr/local/lib/libglog.so.0

Fixed it. The ubuntu package was putting libglog some place else:

$ dpkg -L libgoogle-glog0v5
/.
/usr
/usr/lib
/usr/lib/x86_64-linux-gnu
/usr/lib/x86_64-linux-gnu/libglog.so.0.4.0

That I guess was further back in the resolution chain than the one I'd manually built from the watchman repo awhile ago, so my old/manually-built one got hit first I guess.

This is great, thanks again!

chadaustin commented 1 year ago

Great, thanks for confirmation!