Skip to content

ups-nut-usb is linking to "<horizontal tab>libusb-1.0" #117

Description

@gkoh

I'm running pkgsrc on OmniOS v11 r151022ax.
Currently on 2018Q1 with following package versions:

  • ups-nut-2.6.5nb1
  • ups-nut-usb-2.6.5nb3
  • libusb-compat-0.1.6rc2
  • libusb1-1.0.21

When running usbhid-ups directly (to debug), get this:

# /opt/local/libexec/nut/usbhid-ups 
libusb-compat: error while loading 	libusb-1.0.so.0 from libusb-0.1.so.4: ld.so.1: usbhid-ups: fatal: 	libusb-1.0.so.0: open failed: No such file or directory

An ldd shows nothing weird:

# ldd /opt/local/libexec/nut/usbhid-ups 
	libusb-0.1.so.4 =>	 /opt/local/lib//libusb-0.1.so.4
	libdl.so.1 =>	 /lib/64/libdl.so.1
	libsocket.so.1 =>	 /lib/64/libsocket.so.1
	libnsl.so.1 =>	 /lib/64/libnsl.so.1
	libumem.so.1 =>	 /lib/64/libumem.so.1
	libssp.so.0 =>	 /opt/local/gcc49/x86_64-sun-solaris2.11/lib/amd64/libssp.so.0
	libc.so.1 =>	 /lib/64/libc.so.1
	libgcc_s.so.1 =>	 /opt/local/gcc49/x86_64-sun-solaris2.11/lib/amd64/libgcc_s.so.1
	libmp.so.2 =>	 /lib/64/libmp.so.2
	libmd.so.1 =>	 /lib/64/libmd.so.1
	libm.so.2 =>	 /lib/64/libm.so.2

Finally got the root cause with truss:

# truss /opt/local/libexec/nut/usbhid-ups
...
stat("/opt/local/lib//\x09libusb-1.0.so.0", 0xFFFFFD7FFFDFECA0) Err#2 ENOENT
stat("/opt/local/gcc49/x86_64-sun-solaris2.11/lib/amd64/\x09libusb-1.0.so.0", 0xFFFFFD7FFFDFECA0) Err#2 ENOENT
stat("/opt/local/gcc49/lib/gcc/x86_64-sun-solaris2.11/4.9.4/\x09libusb-1.0.so.0", 0xFFFFFD7FFFDFECA0) Err#2 ENOENT
stat("/opt/local/lib/\x09libusb-1.0.so.0", 0xFFFFFD7FFFDFECA0) Err#2 ENOENT
stat("/lib/64/\x09libusb-1.0.so.0", 0xFFFFFD7FFFDFECA0) Err#2 ENOENT
stat("/usr/lib/64/\x09libusb-1.0.so.0", 0xFFFFFD7FFFDFECA0) Err#2 ENOENT
...

Hmm, it's looking for libusb-1.0 prefixed with ASCII 0x09 == HT == horizontal tab, no wonder I can't 'see' the problem!

I can work around this by doing:

# ln -s libusb-1.0.so.0 "`echo -e '\tlibusb-1.0.so.0'`"

And bingo, now it finds the library and errors normally:

# /opt/local/libexec/nut/usbhid-ups 
Network UPS Tools - Generic HID driver 0.37 (2.6.5)
USB communication driver 0.31
Error: specifying '-a id' is now mandatory. Try -h for help.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions