OpenWrt/LEDE Project

  • Status Closed
  • Percent Complete
    100%
  • Task Type Bug Report
  • Category Base system
  • Assigned To No-one
  • Operating System All
  • Severity Low
  • Priority Very Low
  • Reported Version Trunk
  • Due in Version Undecided
  • Due Date Undecided
  • Private
Attached to Project: OpenWrt/LEDE Project
Opened by Ivan - 06.04.2020
Last edited by Jo-Philipp Wich - 05.05.2020

FS#2970 - tcpdump error loading shared libraray libpcap.so.1

Hi All!

I have Asus RT-N16 with OpenWrt 19.07.2 r10947-65030d81f3 / LuCI openwrt-19.07 branch git-20.094.46635-de52000

Problem with package tcpdump:

root@asus:~# opkg list-installed | grep tcpdump
tcpdump - 4.9.3-1
root@asus:~# tcpdump
Error loading shared library libpcap.so.1: No such file or directory (needed by /usr/sbin/tcpdump)
Error relocating /usr/sbin/tcpdump: pcap_set_tstamp_type: symbol not found
Error relocating /usr/sbin/tcpdump: pcap_close: symbol not found
Error relocating /usr/sbin/tcpdump: pcap_freealldevs: symbol not found
Error relocating /usr/sbin/tcpdump: pcap_set_snaplen: symbol not found
Error relocating /usr/sbin/tcpdump: pcap_open_offline_with_tstamp_precision: symbol not found
Error relocating /usr/sbin/tcpdump: pcap_dump: symbol not found
Error relocating /usr/sbin/tcpdump: pcap_list_datalinks: symbol not found
Error relocating /usr/sbin/tcpdump: pcap_stats: symbol not found
Error relocating /usr/sbin/tcpdump: pcap_create: symbol not found
Error relocating /usr/sbin/tcpdump: pcap_loop: symbol not found
Error relocating /usr/sbin/tcpdump: pcap_datalink_val_to_name: symbol not found
Error relocating /usr/sbin/tcpdump: pcap_datalink: symbol not found
Error relocating /usr/sbin/tcpdump: pcap_can_set_rfmon: symbol not found
Error relocating /usr/sbin/tcpdump: pcap_compile: symbol not found
Error relocating /usr/sbin/tcpdump: pcap_dump_flush: symbol not found
Error relocating /usr/sbin/tcpdump: pcap_set_promisc: symbol not found
Error relocating /usr/sbin/tcpdump: pcap_set_buffer_size: symbol not found
Error relocating /usr/sbin/tcpdump: pcap_open_offline: symbol not found
Error relocating /usr/sbin/tcpdump: pcap_next_etherent: symbol not found
Error relocating /usr/sbin/tcpdump: pcap_strerror: symbol not found
Error relocating /usr/sbin/tcpdump: pcap_set_datalink: symbol not found
Error relocating /usr/sbin/tcpdump: pcap_free_tstamp_types: symbol not found
Error relocating /usr/sbin/tcpdump: pcap_dump_close: symbol not found
Error relocating /usr/sbin/tcpdump: pcap_tstamp_type_val_to_description: symbol not found
Error relocating /usr/sbin/tcpdump: pcap_breakloop: symbol not found
Error relocating /usr/sbin/tcpdump: pcap_datalink_name_to_val: symbol not found
Error relocating /usr/sbin/tcpdump: pcap_lookupnet: symbol not found
Error relocating /usr/sbin/tcpdump: pcap_datalink_val_to_description: symbol not found
Error relocating /usr/sbin/tcpdump: pcap_dump_open: symbol not found
Error relocating /usr/sbin/tcpdump: pcap_snapshot: symbol not found
Error relocating /usr/sbin/tcpdump: pcap_free_datalinks: symbol not found
Error relocating /usr/sbin/tcpdump: bpf_dump: symbol not found
Error relocating /usr/sbin/tcpdump: pcap_tstamp_type_name_to_val: symbol not found
Error relocating /usr/sbin/tcpdump: pcap_setdirection: symbol not found
Error relocating /usr/sbin/tcpdump: pcap_setfilter: symbol not found
Error relocating /usr/sbin/tcpdump: pcap_dump_ftell: symbol not found
Error relocating /usr/sbin/tcpdump: pcap_geterr: symbol not found
Error relocating /usr/sbin/tcpdump: pcap_set_immediate_mode: symbol not found
Error relocating /usr/sbin/tcpdump: pcap_freecode: symbol not found
Error relocating /usr/sbin/tcpdump: pcap_set_tstamp_precision: symbol not found
Error relocating /usr/sbin/tcpdump: pcap_activate: symbol not found
Error relocating /usr/sbin/tcpdump: pcap_lib_version: symbol not found
Error relocating /usr/sbin/tcpdump: pcap_set_timeout: symbol not found
Error relocating /usr/sbin/tcpdump: pcap_findalldevs: symbol not found
Error relocating /usr/sbin/tcpdump: pcap_set_rfmon: symbol not found
Error relocating /usr/sbin/tcpdump: pcap_statustostr: symbol not found
Error relocating /usr/sbin/tcpdump: pcap_list_tstamp_types: symbol not found
Error relocating /usr/sbin/tcpdump: pcap_tstamp_type_val_to_name: symbol not found
root@asus:~#

root@asus:/# ls -alF /usr/lib/libpc*
-rw-r–r– 1 root root 189647 Mar 30 22:36 /usr/lib/libpcap.so.
lrwxrwxrwx 1 root root 11 Apr 5 09:51 /usr/lib/libpcap.so.0.8 → libpcap.so.

root@asus:/# opkg list-installed | grep libpcap
libpcap1 - 1.9.1-2

Closed by  Jo-Philipp Wich
05.05.2020 22:54
Reason for closing:  Fixed
hamelg commented on 14.04.2020 08:33

I did an upgrade yesterday : libpcap is broken. I had to add the missing link manually :(

# opkg files libpcap1
Package libpcap1 (1.9.1-2) is installed on root and has the following files:
/usr/lib/libpcap.so.0.8
/usr/lib/libpcap.so.
# ls -l /usr/lib/libpca*
-rw-r--r--    1 root     root        189648 Apr  7 15:51 /usr/lib/libpcap.so.
lrwxrwxrwx    1 root     root            11 Apr 14 00:09 /usr/lib/libpcap.so.0.8 -> libpcap.so.

libcap 0.8 ???! but I installed libcap 1.9 ...
and look the filename "/usr/lib/libpcap.so.", it misses the library version number in the filename.

Then, it causes some other kinds of breakage in other packages, for instance collectd-mod-dns :

# ldd /usr/lib/collectd/dns.so
        ldd (0x77f4a000)
        libz.so.1 => /usr/lib/libz.so.1 (0x77f14000)
        liblua.so.5.1.5 => /usr/lib/liblua.so.5.1.5 (0x77ee4000)
        libpcap.so.0.8 => /usr/lib/libpcap.so.0.8 (0x77ea4000)
        libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x77e80000)
        libc.so => ldd (0x77f4a000)
Error relocating /usr/lib/collectd/dns.so: plugin_register_config: symbol not found
Error relocating /usr/lib/collectd/dns.so: plugin_get_interval: symbol not found
Error relocating /usr/lib/collectd/dns.so: plugin_log: symbol not found
Error relocating /usr/lib/collectd/dns.so: plugin_dispatch_values: symbol not found
Error relocating /usr/lib/collectd/dns.so: ssnprintf: symbol not found
Error relocating /usr/lib/collectd/dns.so: plugin_thread_create: symbol not found
Error relocating /usr/lib/collectd/dns.so: sstrerror: symbol not found
Error relocating /usr/lib/collectd/dns.so: plugin_register_init: symbol not found
Error relocating /usr/lib/collectd/dns.so: plugin_register_read: symbol not found
Error relocating /usr/lib/collectd/dns.so: sstrncpy: symbol not found

It seems this commit is the culprit :
https://github.com/openwrt/openwrt/commit/96ee7c8bfddd5a7fb34281aeffb88ed56c1d7b68

Frederick Zhang commented on 04.05.2020 08:28

It seems that packages in the official repo (mvebu/cortexa9, arm_cortex-a9_vfpv3) were built against libpcap1 1.9.1-2 though? My firmware was built locally and v19.07.2 branch pulled 1.9.1-1, so after `opkg upgrade` it broke all the packages that depended on libpcap1. Just ran `opkg install –force-reinstall xx yy zz` and the issue is gone for now. Probably gonna need to bump PKG_RELEASE of the whole dependency tree after this is resolved(?)

Strasedon commented on 05.05.2020 21:50

I ran into this bug after updating my router (TP-Link Archer C7 V2) this morning, except I compiled my own image. I found this bug report while searching for a similar issue with iftop:

root@OpenWrt:~# iftop
Error loading shared library libpcap.so.1: No such file or directory (needed by /usr/bin/iftop)
Error relocating /usr/bin/iftop: pcap_compile: symbol not found
Error relocating /usr/bin/iftop: pcap_close: symbol not found
Error relocating /usr/bin/iftop: pcap_geterr: symbol not found
Error relocating /usr/bin/iftop: pcap_setfilter: symbol not found
Error relocating /usr/bin/iftop: pcap_open_live: symbol not found
Error relocating /usr/bin/iftop: pcap_loop: symbol not found
Error relocating /usr/bin/iftop: pcap_datalink: symbol not found

The libpcap1 package only had the files "libpcap.so." and "libpcap.so.0.8". Creating a symlink to "libpcap.so." made iftop happy, and I can report that tcpdump also runs fine.

EDIT: Looking at the patch, these lines are suspect:

MAJ=0.8
LIBVERSION=$(shell head -1 debian/changelog | perl -nle 'm/\S+\s+\((\S+)-\S+\)/ and print $$1')

Building libpcap with V=sc I this in the output:

make[3]: Entering directory '/ow/openwrt/build_dir/target-mips_24kc_musl/libpcap-1.9.1'
head: cannot open 'debian/changelog' for reading: No such file or directory
head: cannot open 'debian/changelog' for reading: No such file or directory
head: cannot open 'debian/changelog' for reading: No such file or directory
head: cannot open 'debian/changelog' for reading: No such file or directory
Admin
Jo-Philipp Wich commented on 05.05.2020 22:54

Should be fixed with https://git.openwrt.org/429e4490c4a325de5459b5d236633586be38cde7

Updated packages will appear within the next 24-48 hours.

Loading...

Available keyboard shortcuts

Tasklist

Task Details

Task Editing