FS#72151 - [libserialport] fix on recent kernels

Attached to Project: Community Packages
Opened by mid-kid (mid-kid) - Thursday, 16 September 2021, 11:04 GMT
Last edited by Anatol Pomozov (anatolik) - Wednesday, 22 September 2021, 18:57 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Anatol Pomozov (anatolik)
Filipe Laíns (FFY00)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

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

* package version(s): 0.1.1
This task depends upon

Closed by  Anatol Pomozov (anatolik)
Wednesday, 22 September 2021, 18:57 GMT
Reason for closing:  Fixed
Additional comments about closing:  libserialport-0.1.1-5
Comment by mid-kid (mid-kid) - Thursday, 16 September 2021, 11:05 GMT
Dang, I forgot to edit out the "sys-kernel/gentoo-kernel-5.10.61" part after copying the message over from the gentoo tracker. Sorry about that, though this affects the current "linux-lts" package in Arch, too.
Comment by Anatol Pomozov (anatolik) - Sunday, 19 September 2021, 19:20 GMT
Thank you for reporting it. I applied the upstream patch and pushed to testing as libserialport-0.1.1-5

Please take a look at it and let me know if you still see any issues.
Comment by mid-kid (mid-kid) - Wednesday, 22 September 2021, 18:04 GMT
That works. Thanks a lot!

Loading...