Community Packages

Please read this before reporting a bug:

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!

FS#73674 - [openocd] stlink driver segfaults with libusb >= 1.0.24

Attached to Project: Community Packages
Opened by Timothy Lee (timothy.ty.lee) - Tuesday, 08 February 2022, 03:27 GMT
Last edited by Toolybird (Toolybird) - Saturday, 22 October 2022, 21:34 GMT
Task Type Bug Report
Category Packages
Status Assigned
Assigned To Santiago Torres (sangy)
Filipe LaĆ­ns (FFY00)
Architecture All
Severity High
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 4
Private No


On a system with newer libusb (>= 1.0.24), OpenOCD would segfault trying to connect to an ST-LINK/V2 in-circuit debugger.

Additional info:
* openocd package version: 1:0.11.0-1

Output of OpenOCD leading up to the crash:
$ openocd -f interface/stlink.cfg -f target/stm32l0.cfg
Open On-Chip Debugger 0.11.0
Licensed under GNU GPL v2
For bug reports, read
Info : auto-selecting first available session transport "hla_swd". To override use 'transport select <transport>'.
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : clock speed 300 kHz
Segmentation fault (core dumped)

This bug has an upstream ticket:

There is an upstream fix, which has not yet been included in any releases:

Steps to reproduce:
* Install latest version of openocd from the Community repo
* Connect a STM32L0538-DISCO board to the PC
* Run the command: openocd -f interface/stlink.cfg -f target/stm32l0.cfg
This task depends upon

Comment by Timothy Lee (timothy.ty.lee) - Tuesday, 08 February 2022, 03:30 GMT
Attached is an updated PKGBUILD file with the upstream patch.

The OpenOCD executable built from the updated PKGBUILD no longer crashes when connecting to an ST-LINK/V2 in-circuit debugger.
Comment by Angus Gratton (projectgus) - Tuesday, 01 March 2022, 09:30 GMT
Can confirm both the bug and the attached fix, thanks for preparing that Timothy.
Comment by Marcin Wieczorek (MarcinWieczorek) - Friday, 22 April 2022, 09:30 GMT
Me too. Problem fixed with given patch.
Comment by Toolybird (Toolybird) - Saturday, 22 October 2022, 21:34 GMT
Correcting severity level in line with [1]