Hi,

It looks like my pull request went through; the fix is now upstream and will 
eventually find its way into Debian. 🙂 
https://github.com/hramrach/lm-sensors/pull/13
Thank you for pointing me in the right direction. This issue can be closed.

Kind Regards,
Michael


________________________________
Von: Aurelien Jarno <[email protected]>
Gesendet: Mittwoch, 16. Juli 2025 18:52
An: Michael Lettrich <[email protected]>; [email protected] 
<[email protected]>
Betreff: Re: Bug#1105772: libsensors5: Parsing Error in sysfs device path for 
ISA sensor chips

Hi,

On 2025-05-14 15:39, Michael Lettrich wrote:
> Package: libsensors5
> Version: 1:3.6.0-7.1 arm64
> Severity: normal
> Tags: patch upstream
> X-Debbugs-Cc: [email protected], [email protected]
>
> Dear Maintainer,
>
> we have found an issue in libsensors that occurs when parsing the chip
> address of ISA sensors resulting in an incorrect ISA address.
>
> The ISA sensor chip address of a sensor is obtained by parsing the
> "device" symlink of an hwmon device. The regular expression extracting
> the device address will fail if the "device" symlink contains dashes
> and sets the address to 0. If multiple instances of the same board are
> plugged into the same system, cards can no longer be distinguished, as
> they all will  be incorrectly be assigned an address of 0.
>
> Example:
> const char* dev_name = "ucsi-source-psy-USBC000:001";
> int addr = -1;
> /* current regex */
> if (sscanf(dev_name, "%*[a-zA-Z0-9_]%*1[.:]%d", &addr) != 1)
>    addr= 0;
> printf("addr: %d\n", addr); /* prints 0 */
> addr = -1;
> /* proposed regex */
> if (sscanf(dev_name, "%*[a-zA-Z0-9_-]%*1[.:]%d", &addr) != 1)
>    addr= 0;
> printf("addr: %d\n", addr); /* prints 1 */
>
>
> We propose to add dashes to the regular expression, so that device
> names with dashes will be correctly recognized, and provide it as a
> patch. Note that we already opened an issue upstream at
> https://github.com/lm-sensors/lm-sensors/pull/529
> It seems though, that the package is abandoned for a few years now. It
> would be great if we could at least fix things in Debian.

The original lm-sensors upstream is indeed dead. Debian and a few other
distributions (Arch, SUSE, Gentoo, ...) have switched to a new upstream:
https://github.com/hramrach/lm-sensors . You might want to submit your
patch there (note that there have been changes the few lines around).

If it doesn't get merged there, we can indeed take it as a Debian
specific change.

Regards
Aurelien

--
Aurelien Jarno                          GPG: 4096R/1DDD8C9B
[email protected]                     http://aurel32.net

Reply via email to