Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 813273 - dev-libs/libserialport-0.1.1 fix on recent kernels
Summary: dev-libs/libserialport-0.1.1 fix on recent kernels
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Embedded Gentoo Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-09-16 00:57 UTC by Esteve Varela Colominas
Modified: 2021-09-16 01:18 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Modified patch for /etc/portage/patches (libserialport-0.1.1-dont-check-termiox.patch,1.60 KB, patch)
2021-09-16 00:57 UTC, Esteve Varela Colominas
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Esteve Varela Colominas 2021-09-16 00:57:38 UTC
Created attachment 739461 [details, diff]
Modified patch for /etc/portage/patches

Upstream bug report: https://sigrok.org/bugzilla/show_bug.cgi?id=1687
Upstream fix to apply: https://sigrok.org/gitweb/?p=libserialport.git;a=commitdiff;h=6f9b03e597ea7200eb616a4e410add3dd1690cb1

Rationale:
This issue makes the library inoperable on any recent kernel, even the currently stabilized "sys-kernel/gentoo-kernel-5.10.61". Any program that opens a serial port using sp_open() will fail. If LIBSERIALPORT_DEBUG is set in the environment, the following relevant messages will appear:

sp: sp_open(0x55f7f28596b0, 0x3) called.
sp: Opening port /dev/ttyACM0.
sp: get_config(0x55f7f28596b0, 0x7ffc8c7459e0, 0x7ffc8c7459b0) called.
sp: Getting configuration for port /dev/ttyACM0.
sp: get_flow(3, 0x7ffc8c7459e0) called.
sp: Getting advanced flow control.
sp: sp_last_error_message() called.
sp: sp_last_error_message returning Inappropriate ioctl for device.
sp: get_flow returning SP_ERR_FAIL: Getting termiox failed: Inappropriate ioctl for device.
sp: sp_free_error_message(Inappropriate ioctl for device) called.
sp: sp_free_error_message returning.
sp: get_config returning SP_ERR_FAIL.
sp: sp_close(0x55f7f28596b0) called.
sp: Closing port /dev/ttyACM0.
sp: sp_close returning SP_OK.
sp: sp_open returning SP_ERR_FAIL.

Kernel patch causing the change: https://www.spinics.net/lists/linux-serial/msg41926.html
Lines causing the bug: https://sigrok.org/gitweb/?p=libserialport.git;a=blob;f=serialport.c;h=e6097eeda975f914ec7b960f72c9e2df546e8281;hb=HEAD#l1774
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-09-16 00:59:56 UTC
I'll apply it if you reply to me at https://bugs.gentoo.org/794592#c5 ;)

(Joking, of course, I'll look at this now.)
Comment 2 Larry the Git Cow gentoo-dev 2021-09-16 01:18:42 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d0d32526c2f5a421da0d79cd55d287bab06e260a

commit d0d32526c2f5a421da0d79cd55d287bab06e260a
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2021-09-16 01:05:11 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2021-09-16 01:17:33 +0000

    dev-libs/libserialport: add patch for runtime breakage w/ new kernels
    
    Closes: https://bugs.gentoo.org/813273
    Signed-off-by: Sam James <sam@gentoo.org>

 .../files/libserialport-0.1.1-kernel-termiox.patch | 32 +++++++++++++++
 .../libserialport/libserialport-0.1.1-r1.ebuild    | 46 ++++++++++++++++++++++
 2 files changed, 78 insertions(+)