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

  1. added a commit that references this issue on Aug 19, 2018
  2. self-assigned this
    on Sep 6, 2018
  3. jperkin commented on Sep 6, 2018

    @jperkin
    Collaborator

    Thanks for finding this, sorry it took so long to fix. This has been resolved and will be in 2018Q3.

  4. added a commit that references this issue on Sep 6, 2018
    aaf53d6
  5. added a commit that references this issue on Feb 6, 2019
  6. added a commit that references this issue on Aug 26, 2019
  7. added a commit that references this issue on Oct 20, 2019
  8. added a commit that references this issue on Jan 27, 2020
  9. 95 remaining items

  10. added a commit that references this issue on Jun 29, 2026
  11. added a commit that references this issue on Jul 26, 2026
  12. added a commit that references this issue on Sep 12, 2026
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