Skip to content

stress_mt failed on OpenBSD #1759

Open
Open

Description

@mcuee

Test setup:

Intel N4500 Mini PC --> USB Type C Hub --> USB Type A Hub, OpenBSD 7.7

make check failed when testing libusb-1.0.30-rc1. The log shows that stress_mt is the problem.

This is not a regression though, as libusb-1.0.29/1.0.28/1.0.27 releases have the same issue under the same physical machine, an Intel N4200 CPU based mini PC running OpenBSD 7.7.

Therefore I do not think this is a blocker for libusb-1.0.30 release.

Activity

  1. added
    BSD
    on Feb 28, 2026
  2. mcuee commented on Feb 28, 2026

    @mcuee
    MemberAuthor

    On the other hand, it would be good for users of OpenBSD and NetBSD to give libusb-1.0.30-rc1 some testing as I am not an expert in the BSDs.

    Last time I usually used VMs to carry out the tests. Now I have installed FreeBSD, OpenBSD and NetBSD on mini PCs to carry out more realistic testing.

  3. mcuee commented on Feb 28, 2026

    @mcuee
    MemberAuthor

    Since USB HID mouse receiver 1ea7:0064 is causing issues under Ubuntu 24.04 for my Ryzen 5 5600G desktop, so I removed it to see if that helps.

    It does not help.

    [mcuee@openbsdn4200 libusb-1.0.30-rc1]$ sudo usbdevs
    Controller /dev/usb0:
    addr 01: 8086:0000 Intel, xHCI root hub
    addr 02: 04b4:8613 Cypress Semiconductor, product 0x8613
    addr 03: 25a7:fa61 Compx, 2.4G Receiver
    addr 04: 05e3:0610 GenesysLogic, USB2.1 Hub
    addr 06: 05e3:0610 GenesysLogic, USB2.0 Hub
    addr 07: 16c0:05dc www.fischl.de, USBasp
    addr 08: 248a:5b2f SSCYPL, Wireless-Receiver
    addr 09: 046d:c548 Logitech, USB Receiver
    addr 10: 0bda:8156 Realtek, USB 10/100/1G/2.5G LAN
    addr 11: 0bda:c821 Realtek, Bluetooth Radio
    
    [mcuee@openbsdn4200 libusb-1.0.30-rc1]$ sudo make check
    Making check in libusb
    Making check in examples
    Making check in tests
    make  check-TESTS
    PASS: stress
    FAIL: stress_mt
    PASS: set_option
    PASS: init_context
    ============================================================================
    Testsuite summary for libusb-1.0 1.0.30-rc1
    ============================================================================
    # TOTAL: 4
    # PASS:  3
    # SKIP:  0
    # XFAIL: 0
    # FAIL:  1
    # XPASS: 0
    # ERROR: 0
    ============================================================================
    See tests/test-suite.log for debugging.
    Some test(s) failed.  Please report this to libusb-devel@lists.sourceforge.net,
    together with the test-suite.log file (gzipped) and your system
    information.  Thanks.
    ============================================================================
    *** Error 1 in tests (Makefile:932 'test-suite.log': @case $- in *e*) set +e;; esac; {  mgn= red= grn= lgn= blu= brg= std=;  am__color_tests...)
    *** Error 2 in tests (Makefile:942 'check-TESTS': @set +e; bases='stress.log stress_mt.log set_option.log init_context.log';  bases=`for i i...)
    *** Error 2 in tests (Makefile:1044 'check-am')
    *** Error 1 in /home/mcuee/build/libusb/libusb-1.0.30-rc1 (Makefile:521 'check-recursive': @fail=;  if (target_option=k; case ${target_optio...)
    
  4. mcuee commented on Feb 28, 2026

    @mcuee
    MemberAuthor

    Then I just keep the mouse and keyboard USB receivers inserted to the built-in USB ports and removed the two external USB hubs.

    Then it is okay.

    [mcuee@openbsdn4200 ~]$ sudo usbdevs
    Password: 
    Controller /dev/usb0:
    addr 01: 8086:0000 Intel, xHCI root hub
    addr 03: 25a7:fa61 Compx, 2.4G Receiver
    addr 05: 1ea7:0064 vendor 0x1ea7, 2.4G Mouse
    addr 11: 0bda:c821 Realtek, Bluetooth Radio
    
    [mcuee@openbsdn4200 ~]$ cd build/libusb/
    [mcuee@openbsdn4200 libusb]$ cd libusb-1.0.30-rc1
    [mcuee@openbsdn4200 libusb-1.0.30-rc1]$ sudo usbdevs
    Controller /dev/usb0:
    addr 01: 8086:0000 Intel, xHCI root hub
    addr 03: 25a7:fa61 Compx, 2.4G Receiver
    addr 05: 1ea7:0064 vendor 0x1ea7, 2.4G Mouse
    addr 11: 0bda:c821 Realtek, Bluetooth Radio
    [mcuee@openbsdn4200 libusb-1.0.30-rc1]$ sudo make check
    Making check in libusb
    Making check in examples
    Making check in tests
    make  check-TESTS
    PASS: stress
    PASS: stress_mt
    PASS: set_option
    PASS: init_context
    ============================================================================
    Testsuite summary for libusb-1.0 1.0.30-rc1
    ============================================================================
    # TOTAL: 4
    # PASS:  4
    # SKIP:  0
    # XFAIL: 0
    # FAIL:  0
    # XPASS: 0
    # ERROR: 0
    ============================================================================
    

    Interestingly, after I plug in the external HUB, it runs okay as well.

    [mcuee@openbsdn4200 libusb-1.0.30-rc1]$ sudo usbdevs
    Controller /dev/usb0:
    addr 01: 8086:0000 Intel, xHCI root hub
    addr 02: 05e3:0610 GenesysLogic, USB2.1 Hub
    addr 03: 25a7:fa61 Compx, 2.4G Receiver
    addr 04: 04b4:8613 Cypress Semiconductor, product 0x8613
    addr 05: 1ea7:0064 vendor 0x1ea7, 2.4G Mouse
    addr 06: 05e3:0610 GenesysLogic, USB2.0 Hub
    addr 07: 16c0:05dc www.fischl.de, USBasp
    addr 08: 248a:5b2f SSCYPL, Wireless-Receiver
    addr 09: 046d:c548 Logitech, USB Receiver
    addr 10: 0bda:8156 Realtek, USB 10/100/1G/2.5G LAN
    addr 11: 0bda:c821 Realtek, Bluetooth Radio
    [mcuee@openbsdn4200 libusb-1.0.30-rc1]$ sudo make check
    Making check in libusb
    Making check in examples
    Making check in tests
    make  check-TESTS
    PASS: stress
    PASS: stress_mt
    PASS: set_option
    PASS: init_context
    ============================================================================
    Testsuite summary for libusb-1.0 1.0.30-rc1
    ============================================================================
    # TOTAL: 4
    # PASS:  4
    # SKIP:  0
    # XFAIL: 0
    # FAIL:  0
    # XPASS: 0
    # ERROR: 0
    ============================================================================
    
  5. mcuee commented on Feb 28, 2026

    @mcuee
    MemberAuthor

    Interesting that I can not reproduce the issue any more.

    
    [mcuee@openbsdn4200 ~]$ cd build/libusb/libusb-1.0.30-rc1
    [mcuee@openbsdn4200 libusb-1.0.30-rc1]$ sudo usbdevs
    Password: 
    Controller /dev/usb0:
    addr 01: 8086:0000 Intel, xHCI root hub
    addr 02: 05e3:0610 GenesysLogic, USB2.1 Hub
    addr 03: 05e3:0610 GenesysLogic, USB2.0 Hub
    addr 04: 046d:c548 Logitech, USB Receiver
    addr 05: 04b4:8613 Cypress Semiconductor, product 0x8613
    addr 06: 25a7:fa61 Compx, 2.4G Receiver
    addr 07: 1ea7:0064 vendor 0x1ea7, 2.4G Mouse
    addr 08: 248a:5b2f SSCYPL, Wireless-Receiver
    addr 10: 0bda:8156 Realtek, USB 10/100/1G/2.5G LAN
    addr 11: 0bda:c821 Realtek, Bluetooth Radio
    
    [mcuee@openbsdn4200 libusb-1.0.30-rc1]$ sudo make check
    Making check in libusb
    Making check in examples
    Making check in tests
    make  check-TESTS
    PASS: stress
    PASS: stress_mt
    PASS: set_option
    PASS: init_context
    ============================================================================
    Testsuite summary for libusb-1.0 1.0.30-rc1
    ============================================================================
    # TOTAL: 4
    # PASS:  4
    # SKIP:  0
    # XFAIL: 0
    # FAIL:  0
    # XPASS: 0
    # ERROR: 0
    ============================================================================
    
    [mcuee@openbsdn4200 libusb-1.0.30-rc1]$ sudo ./examples/listdevs
    8086:0000 (bus 0, device 1)
    05e3:0610 (bus 0, device 2) path: 5
    05e3:0610 (bus 0, device 3) path: 2
    046d:c548 (bus 0, device 4) path: 4
    04b4:8613 (bus 0, device 5) path: 1
    25a7:fa61 (bus 0, device 6) path: 2
    1ea7:0064 (bus 0, device 7) path: 1
    248a:5b2f (bus 0, device 8) path: 3
    0bda:8156 (bus 0, device 10) path: 3
    0bda:c821 (bus 0, device 11) path: 8
    
    [mcuee@openbsdn4200 libusb-1.0.30-rc1]$ sudo ./examples/testlibusb
    Dev (bus 0, device 1): 8086 - 0000 speed: 5G
      Manufacturer:              Intel
      Product:                   xHCI root hub
    Dev (bus 0, device 2): 05E3 - 0610 speed: 480M
      Manufacturer:              GenesysLogic
      Product:                   USB2.1 Hub
    Dev (bus 0, device 3): 05E3 - 0610 speed: 480M
      Manufacturer:              GenesysLogic
      Product:                   USB2.0 Hub
    Dev (bus 0, device 4): 046D - C548 speed: 12M
      Manufacturer:              Logitech
      Product:                   USB Receiver
    Dev (bus 0, device 5): 04B4 - 8613 speed: 480M
    Dev (bus 0, device 6): 25A7 - FA61 speed: 12M
      Manufacturer:              Compx
      Product:                   2.4G Receiver
    Dev (bus 0, device 7): 1EA7 - 0064 speed: 12M
      Product:                   2.4G Mouse
    Dev (bus 0, device 8): 248A - 5B2F speed: 12M
      Manufacturer:              SSCYPL
      Product:                   Wireless-Receiver
    Dev (bus 0, device 10): 0BDA - 8156 speed: 480M
      Manufacturer:              Realtek
      Product:                   USB 10/100/1G/2.5G LAN
    Dev (bus 0, device 11): 0BDA - C821 speed: 12M
      Manufacturer:              Realtek 
      Product:                   Bluetooth Radio 
    
  6. mcuee commented on Feb 28, 2026

    @mcuee
    MemberAuthor

    Even after I reboot the mini PC and remove the added USB device (another USB mouse receiver), I cannot reproduce the issue any more. Very strange.

    [mcuee@openbsdn4200 ~]$ cd build/libusb/libusb-1.0.30-rc1
    [mcuee@openbsdn4200 libusb-1.0.30-rc1]$ sudo usbdevs
    Password: 
    Controller /dev/usb0:
    addr 01: 8086:0000 Intel, xHCI root hub
    addr 02: 1ea7:0064 vendor 0x1ea7, 2.4G Mouse
    addr 03: 25a7:fa61 Compx, 2.4G Receiver
    addr 04: 05e3:0610 GenesysLogic, USB2.1 Hub
    addr 05: 04b4:8613 Cypress Semiconductor, product 0x8613
    addr 06: 05e3:0610 GenesysLogic, USB2.0 Hub
    addr 07: 046d:c548 Logitech, USB Receiver
    addr 08: 0bda:8156 Realtek, USB 10/100/1G/2.5G LAN
    addr 09: 0bda:c821 Realtek, Bluetooth Radio
    
    [mcuee@openbsdn4200 libusb-1.0.30-rc1]$ sudo make check
    Making check in libusb
    Making check in examples
    Making check in tests
    make  check-TESTS
    PASS: stress
    PASS: stress_mt
    PASS: set_option
    PASS: init_context
    ============================================================================
    Testsuite summary for libusb-1.0 1.0.30-rc1
    ============================================================================
    # TOTAL: 4
    # PASS:  4
    # SKIP:  0
    # XFAIL: 0
    # FAIL:  0
    # XPASS: 0
    # ERROR: 0
    ============================================================================
    
  7. seanm commented on Feb 28, 2026

    @seanm
    Contributor

    stress_mt is the test that fails under TSan, no? Don't waste your time testing it more until someone fixes the issues TSan flags.

  8. mcuee commented on Mar 1, 2026

    @mcuee
    MemberAuthor

    stress_mt is the test that fails under TSan, no? Don't waste your time testing it more until someone fixes the issues TSan flags.

    Not so sure how to run TScan for the BSDs.

  9. seanm commented on Mar 1, 2026

    @seanm
    Contributor

    Not sure if TSan works on OpenBSD, but it does work on the other BSDs: https://clang.llvm.org/docs/ThreadSanitizer.html

  10. mcuee commented on Mar 3, 2026

    @mcuee
    MemberAuthor

    @botovq

    Just wondering if you can test on your OpenBSD machines. Thanks.

  11. botovq commented on Mar 3, 2026

    @botovq
    Contributor

    TSan isn't available on OpenBSD.

    I can see this issue with v1.0.30-rc1 on several of my OpenBSD machines and this goes back to at least v1.0.27. For example on my mac mini M1:

    $ cat tests/test-suite.log
    =========================================
       libusb-1.0 ..: tests/test-suite.log
    =========================================
    
    # TOTAL: 4
    # PASS:  3
    # SKIP:  0
    # XFAIL: 0
    # FAIL:  1
    # XPASS: 0
    # ERROR: 0
    
    .. contents:: :depth: 2
    
    FAIL: stress_mt
    ===============
    
    Thread 0 failed (iteration 50): LIBUSB_ERROR_IO
    Thread 1 failed (iteration 49): LIBUSB_ERROR_IO
    Thread 2 failed (iteration 15): LIBUSB_ERROR_IO
    Thread 4 failed (iteration 26): LIBUSB_ERROR_IO
    Thread 5 failed (iteration 40): LIBUSB_ERROR_IO
    Thread 6 failed (iteration 61): LIBUSB_ERROR_IO
    Running multithreaded init/exit test...
    Starting 8 threads
    Running multithreaded init/exit test with enumeration...
    Starting 8 threads
    All threads discovered 5 devices (0 not opened)
    All done, 6 errors
    FAIL stress_mt (exit status: 1)
    
    $ sudo usbdevs -v
    Controller /dev/usb0:
    addr 01: 0000:0000 Generic, xHCI root hub
    	 super speed, self powered, config 1, rev 1.00
    	 driver: uhub0
    Controller /dev/usb1:
    addr 01: 0000:0000 Generic, xHCI root hub
    	 super speed, self powered, config 1, rev 1.00
    	 driver: uhub1
    Controller /dev/usb2:
    addr 01: 1b73:0000 Fresco Logic, xHCI root hub
    	 super speed, self powered, config 1, rev 1.00
    	 driver: uhub2
    addr 02: 0c45:652f SONiX, USB DEVICE
    	 full speed, power 400 mA, config 1, rev 1.05
    	 driver: uhidev0
    	 driver: uhidev1
    addr 03: 045e:0084 Microsoft, Basic Optical Mouse
    	 low speed, power 100 mA, config 1, rev 0.00
    	 driver: uhidev2
  12. mcuee commented on Mar 3, 2026

    @mcuee
    MemberAuthor

    @botovq
    Thanks a lot for the help.

    This is the same as my early tests -- it fails from 1.0.27 to 1.0.30-rc1.

    This is not a regression though -- so I think it is not a release blocker.

    Same issues under older release version.

    @tormodvolden
    So this is an anomaly but not a regression. In that case, it will not be a blocker for 1.0.30 release.

  13. mcuee commented on Mar 5, 2026

    @mcuee
    MemberAuthor

    I have upgraded my OpenBSD system from version 7.7 to 7.8.

    Interestingly I still cannot reproduce the issue on this system (Intel N4500 CPU based Chuwi mini PC, dual boot OpenBSD 7.8 and NetBSD 10.1).

  14. botovq commented on Mar 5, 2026

    @botovq
    Contributor

    FWIW I have one OpenBSD 7.8-current machine on which the issue didn't show when running the tests in a loop for about 20 minutes (an Intel i7-10700K-based Dell Precision 3640 Tower).

  15. mcuee commented on Mar 5, 2026

    @mcuee
    MemberAuthor

    TSan isn't available on OpenBSD.

    Indeed. But is actually supported under NetBSD. And we have similar codes for OpenBSD and NetBSD.

    https://clang.llvm.org/docs/ThreadSanitizer.html

    Supported Platforms
    ThreadSanitizer is supported on the following OS:

    1. Android aarch64, x86_64

    2. Darwin arm64, x86_64

    3. FreeBSD

    4. Linux aarch64, x86_64, powerpc64, powerpc64le

    5. NetBSD

    Support for other 64-bit architectures is possible, contributions are welcome. Support for 32-bit platforms is problematic and is not planned.

  16. mcuee commented on Mar 7, 2026

    @mcuee
    MemberAuthor

    I just installed a fresh OpenBSD 7.8 VM under Windows 11 VirtualBox. After attaching one USB device, doas make check will fail.

    On the other hand, I intalled another NetBSD 10.0 VM under Windows 11 VirtualBox, sudo make check is okay.

  17. mcuee commented on Mar 9, 2026

    @mcuee
    MemberAuthor

    Okay, I can reproduce the issue on the OpenBSD 7.8 physical machine again. I am using git in this case.

    You can see that first run is okay but second run fails.

    [mcuee@openbsdn4200 libusb]$ sudo ./examples/listdevs
    8086:0000 (bus 0, device 1)
    25a7:fa61 (bus 0, device 2) path: 1
    1ea7:0064 (bus 0, device 3) path: 2
    05e3:0610 (bus 0, device 4) path: 5
    04b4:8613 (bus 0, device 5) path: 1
    0bda:8156 (bus 0, device 6) path: 3
    0bda:c821 (bus 0, device 7) path: 8
    
    [mcuee@openbsdn4200 libusb]$ sudo ./examples/testlibusb
    Dev (bus 0, device 1): 8086 - 0000 speed: 5G
      Manufacturer:              Intel
      Product:                   xHCI root hub
    Dev (bus 0, device 2): 25A7 - FA61 speed: 12M
      Manufacturer:              Compx
      Product:                   2.4G Receiver
    Dev (bus 0, device 3): 1EA7 - 0064 speed: 12M
      Product:                   2.4G Mouse
    Dev (bus 0, device 4): 05E3 - 0610 speed: 480M
      Manufacturer:              GenesysLogic
      Product:                   USB2.1 Hub
    Dev (bus 0, device 5): 04B4 - 8613 speed: 480M
    Dev (bus 0, device 6): 0BDA - 8156 speed: 480M
      Manufacturer:              Realtek
      Product:                   USB 10/100/1G/2.5G LAN
    Dev (bus 0, device 7): 0BDA - C821 speed: 12M
      Manufacturer:              Realtek 
      Product:                   Bluetooth Radio 
    
    [mcuee@openbsdn4200 libusb]$ sudo make check
    Making check in libusb
    Making check in examples
    Making check in tests
    make  check-TESTS
    PASS: stress
    PASS: stress_mt
    PASS: set_option
    PASS: init_context
    ============================================================================
    Testsuite summary for libusb-1.0 ..
    ============================================================================
    # TOTAL: 4
    # PASS:  4
    # SKIP:  0
    # XFAIL: 0
    # FAIL:  0
    # XPASS: 0
    # ERROR: 0
    ============================================================================
    
    [mcuee@openbsdn4200 libusb]$ sudo make check
    Making check in libusb
    Making check in examples
    Making check in tests
    make  check-TESTS
    PASS: stress
    FAIL: stress_mt
    PASS: set_option
    PASS: init_context
    ============================================================================
    Testsuite summary for libusb-1.0 ..
    ============================================================================
    # TOTAL: 4
    # PASS:  3
    # SKIP:  0
    # XFAIL: 0
    # FAIL:  1
    # XPASS: 0
    # ERROR: 0
    ============================================================================
    See tests/test-suite.log for debugging.
    Some test(s) failed.  Please report this to libusb-devel@lists.sourceforge.net,
    together with the test-suite.log file (gzipped) and your system
    information.  Thanks.
    ============================================================================
    *** Error 1 in tests (Makefile:930 'test-suite.log': @case $- in *e*) set +e;; esac; {  mgn= red= grn= lgn= blu= brg= std=;  am__color_tests...)
    *** Error 2 in tests (Makefile:940 'check-TESTS': @set +e; bases='stress.log stress_mt.log set_option.log init_context.log';  bases=`for i i...)
    *** Error 2 in tests (Makefile:1043 'check-am')
    *** Error 1 in /home/mcuee/build/libusb/libusb (Makefile:519 'check-recursive': @fail=;  if (target_option=k; case ${target_option-} in  ?) ...)
    
    [mcuee@openbsdn4200 libusb]$ cat ./tests/test-suite.log 
    =========================================
       libusb-1.0 ..: tests/test-suite.log
    =========================================
    
    # TOTAL: 4
    # PASS:  3
    # SKIP:  0
    # XFAIL: 0
    # FAIL:  1
    # XPASS: 0
    # ERROR: 0
    
    System information (uname -a): OpenBSD 7.8 GENERIC.MP#54
    
    .. contents:: :depth: 2
    
    FAIL: stress_mt
    ===============
    
    Thread 1 failed (iteration 28): LIBUSB_ERROR_OTHER
    Running multithreaded init/exit test...
    Starting 8 threads
    Running multithreaded init/exit test with enumeration...
    Starting 8 threads
    All threads discovered 7 devices (0 not opened)
    All done, 1 errors
    FAIL stress_mt (exit status: 1)
    
    
  18. added
    test
    on Mar 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    BSDtest

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions