# Disturbing output from libchk



## z662 (Apr 16, 2013)

Hello,

I recently discovered the libchk tool and ran it on my system.  I was very surprised to see the amount of unreferenced libraries, unresolvable links, and seemingly broken functionality of my system.  I am not sure how long my system has been having these errors/issues and wanted to know what people recommend in regards to fixing this output. Please let me know what your thoughts are.  



```
[brad@mercury /usr/ports/lang/perl5.16]$ libchk
Will look into:
        /bin
        /lib
        /sbin
        /usr/bin
        /usr/games
        /usr/lib
        /usr/libexec
        /usr/local/bin
        /usr/local/lib
        /usr/local/libexec
        /usr/local/sbin
        /usr/sbin
Unreadable file or directory: /sbin/poweroff
Unreadable file or directory: /sbin/mksnap_ffs
Unreadable file or directory: /sbin/shutdown
Unresolvable link(s) found in: /usr/local/bin/gio-querymodules
        libpcre.so.0
Unresolvable link(s) found in: /usr/local/bin/glib-genmarshal
        libpcre.so.0
Unresolvable link(s) found in: /usr/local/bin/gobject-query
        libpcre.so.0
Unresolvable link(s) found in: /usr/local/bin/gtester
        libpcre.so.0
Unresolvable link(s) found in: /usr/local/bin/irssi
        libpcre.so.0
Unresolvable link(s) found in: /usr/local/lib/libgio-2.0.so.0
        libpcre.so.0
Unresolvable link(s) found in: /usr/local/lib/libgthread-2.0.so.0
        libpcre.so.0
Unresolvable link(s) found in: /usr/local/lib/libgobject-2.0.so.0
        libpcre.so.0
Unresolvable link(s) found in: /usr/local/lib/libgmodule-2.0.so.0
        libpcre.so.0
Unresolvable link(s) found in: /usr/local/lib/libglib-2.0.so.0
        libpcre.so.0
Unresolvable link(s) found in: /usr/local/lib/compat/pkg/libgnutls.so.40
        libgcrypt.so.17
Unreadable file or directory: /usr/sbin/ppp
Unreferenced library: /lib/libssp.so.0
Unreferenced library: /usr/lib/libform.so.5
Unreferenced library: /usr/lib/libformw.so.5
Unreferenced library: /usr/lib/libgomp.so.1
Unreferenced library: /usr/lib/libgpib.so.3
Unreferenced library: /usr/lib/libgssapi_ntlm.so.10
Unreferenced library: /usr/lib/libgssapi_spnego.so.10
Unreferenced library: /usr/lib/libhistory.so.8
Unreferenced library: /usr/lib/liblwres.so.50
Unreferenced library: /usr/lib/libmenu.so.5
Unreferenced library: /usr/lib/libmenuw.so.5
Unreferenced library: /usr/lib/libmilter.so.5
Unreferenced library: /usr/lib/libobjc.so.4
Unreferenced library: /usr/lib/libpanelw.so.5
Unreferenced library: /usr/lib/librpcsec_gss.so.1
Unreferenced library: /usr/lib/libthread_db.so.3
Unreferenced library: /usr/lib/libvgl.so.6
Unreferenced library: /usr/local/lib/compat/libalias.so.6
Unreferenced library: /usr/local/lib/compat/libarchive.so.4
Unreferenced library: /usr/local/lib/compat/libavl.so.1
Unreferenced library: /usr/local/lib/compat/libbegemot.so.3
Unreferenced library: /usr/local/lib/compat/libbluetooth.so.3
Unreferenced library: /usr/local/lib/compat/libbsm.so.2
Unreferenced library: /usr/local/lib/compat/libbsnmp.so.4
Unreferenced library: /usr/local/lib/compat/libcalendar.so.4
Unreferenced library: /usr/local/lib/compat/libcam.so.4
Unreferenced library: /usr/local/lib/compat/libctf.so.1
Unreferenced library: /usr/local/lib/compat/libdevstat.so.6
Unreferenced library: /usr/local/lib/compat/libdialog.so.6
Unreferenced library: /usr/local/lib/compat/libdtrace.so.1
Unreferenced library: /usr/local/lib/compat/libdwarf.so.1
Unreferenced library: /usr/local/lib/compat/libedit.so.6
Unreferenced library: /usr/local/lib/compat/libfetch.so.5
Unreferenced library: /usr/local/lib/compat/libform.so.4
Unreferenced library: /usr/local/lib/compat/libformw.so.4
Unreferenced library: /usr/local/lib/compat/libftpio.so.7
Unreferenced library: /usr/local/lib/compat/libgnuregex.so.4
Unreferenced library: /usr/local/lib/compat/libgpib.so.2
Unreferenced library: /usr/local/lib/compat/libgssapi_krb5.so.9
Unreferenced library: /usr/local/lib/compat/libhdb.so.9
Unreferenced library: /usr/local/lib/compat/libhistory.so.7
Unreferenced library: /usr/local/lib/compat/libipsec.so.3
Unreferenced library: /usr/local/lib/compat/libkadm5clnt.so.9
Unreferenced library: /usr/local/lib/compat/libkadm5srv.so.9
Unreferenced library: /usr/local/lib/compat/libkafs5.so.9
Unreferenced library: /usr/local/lib/compat/libkse.so.3
Unreferenced library: /usr/local/lib/compat/liblwres.so.30
Unreferenced library: /usr/local/lib/compat/libmagic.so.3
Unreferenced library: /usr/local/lib/compat/libmenu.so.4
Unreferenced library: /usr/local/lib/compat/libmenuw.so.4
Unreferenced library: /usr/local/lib/compat/libmilter.so.4
Unreferenced library: /usr/local/lib/compat/libmp.so.6
Unreferenced library: /usr/local/lib/compat/libncp.so.3
Unreferenced library: /usr/local/lib/compat/libngatm.so.3
Unreferenced library: /usr/local/lib/compat/libnvpair.so.1
Unreferenced library: /usr/local/lib/compat/libobjc.so.3
Unreferenced library: /usr/local/lib/compat/libpanel.so.4
Unreferenced library: /usr/local/lib/compat/libpanelw.so.4
Unreferenced library: /usr/local/lib/compat/libpcap.so.5
Unreferenced library: /usr/local/lib/compat/libpmc.so.4
Unreferenced library: /usr/local/lib/compat/libproc.so.1
Unreferenced library: /usr/local/lib/compat/libreadline.so.7
Unreferenced library: /usr/local/lib/compat/librpcsvc.so.4
Unreferenced library: /usr/local/lib/compat/libsdp.so.3
Unreferenced library: /usr/local/lib/compat/libsmb.so.3
Unreferenced library: /usr/local/lib/compat/libufs.so.4
Unreferenced library: /usr/local/lib/compat/libugidfw.so.3
Unreferenced library: /usr/local/lib/compat/libumem.so.1
Unreferenced library: /usr/local/lib/compat/libusbhid.so.3
Unreferenced library: /usr/local/lib/compat/libuutil.so.1
Unreferenced library: /usr/local/lib/compat/libvgl.so.5
Unreferenced library: /usr/local/lib/compat/libwrap.so.5
Unreferenced library: /usr/local/lib/compat/libzfs.so.1
Unreferenced library: /usr/local/lib/compat/libzpool.so.1
Unreferenced library: /usr/local/lib/compat/pkg/libapr-1.so.3
Unreferenced library: /usr/local/lib/compat/pkg/libgcrypt.so.16
Unreferenced library: /usr/local/lib/compat/pkg/libgettextpo.so.4
Unreferenced library: /usr/local/lib/compat/pkg/libgnutls-extra.so.40
Unreferenced library: /usr/local/lib/compat/pkg/libgnutls-openssl.so.40
Unreferenced library: /usr/local/lib/compat/pkg/libgnutlsxx.so.40
Unreferenced library: /usr/local/lib/compat/pkg/libpng.so.5
Unreferenced library: /usr/local/lib/compat/pkg/libsigsegv.so.0
Unreferenced library: /usr/local/lib/libUil.so.3
Unreferenced library: /usr/local/lib/libX11-xcb.so.1
Unreferenced library: /usr/local/lib/libXau.so.0
Unreferenced library: /usr/local/lib/libXaw.so.6
Unreferenced library: /usr/local/lib/libXaw.so.7
Unreferenced library: /usr/local/lib/libXaw6.so.6
Unreferenced library: /usr/local/lib/libXmuu.so.1
Unreferenced library: /usr/local/lib/libXrender.so.1
Unreferenced library: /usr/local/lib/libXtst.so.6
Unreferenced library: /usr/local/lib/libasprintf.so.0
Unreferenced library: /usr/local/lib/libcharset.so.1
Unreferenced library: /usr/local/lib/libcheck.so.0
Unreferenced library: /usr/local/lib/libdb41_cxx.so.1
Unreferenced library: /usr/local/lib/libdb_cxx-4.2.so.2
Unreferenced library: /usr/local/lib/libgettextpo.so.5
Unreferenced library: /usr/local/lib/libgmpxx.so.6
Unreferenced library: /usr/local/lib/libgnutls-openssl.so.27
Unreferenced library: /usr/local/lib/libgnutlsxx.so.27
Unreferenced library: /usr/local/lib/libgthread-12.so.3
Unreferenced library: /usr/local/lib/libneon.so.28
Unreferenced library: /usr/local/lib/libpcrecpp.so.0
Unreferenced library: /usr/local/lib/libpython2.6.so.1
Unreferenced library: /usr/local/lib/libtcl85.so.1
Unreferenced library: /usr/local/lib/libtiffxx.so.4
Unreferenced library: /usr/local/lib/libwwwssl.so.1
Unreferenced library: /usr/local/lib/libxcb-composite.so.0
Unreferenced library: /usr/local/lib/libxcb-damage.so.0
Unreferenced library: /usr/local/lib/libxcb-dpms.so.0
Unreferenced library: /usr/local/lib/libxcb-dri2.so.0
Unreferenced library: /usr/local/lib/libxcb-glx.so.0
Unreferenced library: /usr/local/lib/libxcb-randr.so.1
Unreferenced library: /usr/local/lib/libxcb-record.so.0
Unreferenced library: /usr/local/lib/libxcb-render.so.0
Unreferenced library: /usr/local/lib/libxcb-res.so.0
Unreferenced library: /usr/local/lib/libxcb-screensaver.so.0
Unreferenced library: /usr/local/lib/libxcb-shape.so.0
Unreferenced library: /usr/local/lib/libxcb-shm.so.0
Unreferenced library: /usr/local/lib/libxcb-sync.so.0
Unreferenced library: /usr/local/lib/libxcb-xevie.so.0
Unreferenced library: /usr/local/lib/libxcb-xf86dri.so.0
Unreferenced library: /usr/local/lib/libxcb-xfixes.so.0
Unreferenced library: /usr/local/lib/libxcb-xinerama.so.0
Unreferenced library: /usr/local/lib/libxcb-xinput.so.0
Unreferenced library: /usr/local/lib/libxcb-xprint.so.0
Unreferenced library: /usr/local/lib/libxcb-xtest.so.0
Unreferenced library: /usr/local/lib/libxcb-xv.so.0
Unreferenced library: /usr/local/lib/libxcb-xvmc.so.0
Unreferenced library: /usr/local/lib/mysql/libmysqlclient.so.18
Unreferenced library: /usr/local/lib/mysql/libmysqlclient_r.so.18
[brad@mercury /usr/ports/lang/perl5.16]$
```


----------



## wblock@ (Apr 16, 2013)

```
Unreadable file or directory: /sbin/poweroff
Unreadable file or directory: /sbin/mksnap_ffs
Unreadable file or directory: /sbin/shutdown
```

Those are just because the user running the program is not a root or a member of the operator group.  The "unreferenced library" errors seem to be just warnings.  All the ones in /usr/local/lib/compat/ can be ignored.

That leaves the "Unresolvable link(s)" errors.  The first is for libpcre.so.0, which prompts the question: do you read and follow /usr/ports/UPDATING?

You may also wish to install sysutils/bsdadminscripts and run pkg_libchk(1) for comparison.


----------



## z662 (Apr 16, 2013)

Thank you for the info.

In regards to /usr/ports/UPDATING...I have in the past but mostly just in the past year or so.  Generally this is my 'method' for updating stuff (I am sure its sub optimal) but it is pretty easy and works for me:

-I run [cmd=]portaudit -Fa[/cmd] every other day or so. Depending on the output I will either update the ports with either portmaster or portupgrade unless I run into a problem.  If I run into a problem or dependency conflict I will refer to that file. If it is something that I know I am going to need to refer to that file in the first place (like Apache or Perl or something) I will always refer to that first. Usually I end up using portmaster or sometimes just finding the port directory and doing a make deinstall/reinstall in the relevant directory. Aside from portaudit I almost never update anything (other than the base system via freebsd-update).

In regards to libpcre (which I have found always breaks when not using the -w flag for portmaster) should I just start there based on the instructions in the UPDATING file and then work my way through the others with similar errors?

Thanks


----------



## wblock@ (Apr 16, 2013)

Always, yes _always_, check /usr/ports/UPDATING before installing or updating ports.  If the new entries apply to your system, do them first.

If you have problems, pkg_libchk(1) will show which ports need to be rebuilt.  Using ports-mgmt/portmaster is generally the right way to do that, because it will try to figure out dependent ports and rebuild them also.


----------



## z662 (Apr 16, 2013)

Thank you!  I will do that either tonight or tomorrow and post back if I have any problems.  I will take your advice too


----------



## z662 (Apr 17, 2013)

*U*sing [cmd=]portmaster -w -r pcre[/cmd] solved all of my issues minus this: 
	
	



```
Unresolvable link(s) found in: /usr/local/lib/compat/pkg/libgnutls.so.40
        libgcrypt.so.17
```
which I plan to fix now. Thanks.


----------



## z662 (Apr 18, 2013)

Actually it looks like there are a few more unexpected issues.  After updating/fixing pcre I only had one error (shown above) however after following the instructions in the UPDATING file I now have these:

```
Unresolvable link(s) found in: /usr/local/bin/pngtopnm
        libpng.so.6
Unresolvable link(s) found in: /usr/local/bin/pnmtopng
        libpng.so.6
Unresolvable link(s) found in: /usr/local/bin/dvipdfmx
        libpng.so.6
Unresolvable link(s) found in: /usr/local/bin/fixrtf
        libpng.so.6
Unresolvable link(s) found in: /usr/local/lib/compat/pkg/libgnutls.so.40
        libgcrypt.so.17
Unresolvable link(s) found in: /usr/local/lib/compat/pkg/libgs.so.8.71
        libpng.so.6
```


I am not sure how to fix these; the non compat ones (since I can ignore those ones based on wblock) since whereis yields no results and when I try to use portmaster it says that it is an invalid name.  I would imagine this means that these packages are not actually installed, however if that is the case I would not expect them to be appearing in my output.  Let me know what your thoughts are please.  Thanks in advance[red]*.*[/red]


----------



## wblock@ (Apr 18, 2013)

The ones in /usr/local/lib/compat can be ignored.  The libraries there are old versions saved by portmaster(1).

The first two are from graphics/netpbm, not sure what port installs dvipdfmx, and fixrtf is from textproc/fixrtf.  Reinstall those.

Again, try pkg_libchk(1), maybe with -q, which has better output and does not report the false positives in /usr/local/lib/compat.


----------



## z662 (Apr 18, 2013)

Thanks.  All fixed now.  Not sure why but I do not have the ability to install (via pkg_add or /usr/ports/) pkg_libchk.

I am running 8.3 if that makes a difference?


----------



## wblock@ (Apr 18, 2013)

See message #2.


----------

