Bug#990863: [Pkg-electronics-devel] Bug#990863: Bug#990863: libserialport0: libserialport tries to use termiox on bullseye, and fails to open serial ports

2021-07-10 Thread Jonathan McDowell
Control: tags -1 pending

On Fri, Jul 09, 2021 at 06:06:52PM +0100, Jonathan McDowell wrote:
> On Fri, Jul 09, 2021 at 05:55:52PM +0100, Tim Small wrote:
> > Package: libserialport0
> > Version: 0.1.1-3+b1
> > Severity: important
> > Tags: upstream patch
> > X-Debbugs-Cc: t...@seoss.co.uk
> > 
> > Serial port open seems to fail on bullseye.  Strace output follows:
> > 
> > 1512868 openat(AT_FDCWD, "/dev/ttyACM0", O_RDWR|O_NOCTTY|O_NONBLOCK) = 9
> > 1512868 ioctl(9, TCGETS, {B9600 opost isig icanon echo ...}) = 0
> > 1512868 ioctl(9, TIOCMGET, [TIOCM_DTR|TIOCM_RTS|TIOCM_CTS]) = 0
> > 1512868 ioctl(9, TCGETX, 0x55cd7cc80df0) = -1 ENOTTY (Inappropriate ioctl 
> > for device)
> > 1512868 close(9)= 0
> > 1512868 write(2, "sr: ", 4) = 4
> > 1512868 write(2, "serial-libsp: Error opening port"..., 71) = 71
> > 1512868 write(2, "No devices found.\n", 18) = 18
> > 
> > Applying upstream commit 6f9b03e597ea fixes the issue.  I tested this
> > with:
> > 
> > /usr/local/bin/sigrok-cli --driver=rdtech-tc:conn=/dev/ttyACM0 --continuous
> > 
> > Patch here:
> > 
> > https://github.com/sigrokproject/libserialport/commit/6f9b03e597ea7200eb616a4e410add3dd1690cb1
> > 
> > I suspect that libserialport0 will fail to open all serial ports on
> > bullseye without this fix, so this bug may unfortunately be RC?
> 
> It looks like the kernel broke this in the v5.10.37 update
> (eef2158b0c44baa8cd9855091b1d99a35e16afdb), which hit
> unstable towards the end of May. Not clear why this was backported to
> the stable tree but I guess fixing libserialport is going to be the
> easier solution.

Fixed in
https://salsa.debian.org/electronics-team/sigrok/libserialport/-/tree/Bug990863
and unblock request sent to the release team; given we're so close to
release I'll understand entirely if this has to wait until the first
point release.

J.

-- 
101 things you can't have too much of : 53 - Space.



Bug#990863: [Pkg-electronics-devel] Bug#990863: libserialport0: libserialport tries to use termiox on bullseye, and fails to open serial ports

2021-07-09 Thread Jonathan McDowell
On Fri, Jul 09, 2021 at 05:55:52PM +0100, Tim Small wrote:
> Package: libserialport0
> Version: 0.1.1-3+b1
> Severity: important
> Tags: upstream patch
> X-Debbugs-Cc: t...@seoss.co.uk
> 
> Serial port open seems to fail on bullseye.  Strace output follows:
> 
> 1512868 openat(AT_FDCWD, "/dev/ttyACM0", O_RDWR|O_NOCTTY|O_NONBLOCK) = 9
> 1512868 ioctl(9, TCGETS, {B9600 opost isig icanon echo ...}) = 0
> 1512868 ioctl(9, TIOCMGET, [TIOCM_DTR|TIOCM_RTS|TIOCM_CTS]) = 0
> 1512868 ioctl(9, TCGETX, 0x55cd7cc80df0) = -1 ENOTTY (Inappropriate ioctl for 
> device)
> 1512868 close(9)= 0
> 1512868 write(2, "sr: ", 4) = 4
> 1512868 write(2, "serial-libsp: Error opening port"..., 71) = 71
> 1512868 write(2, "No devices found.\n", 18) = 18
> 
> Applying upstream commit 6f9b03e597ea fixes the issue.  I tested this
> with:
> 
> /usr/local/bin/sigrok-cli --driver=rdtech-tc:conn=/dev/ttyACM0 --continuous
> 
> Patch here:
> 
> https://github.com/sigrokproject/libserialport/commit/6f9b03e597ea7200eb616a4e410add3dd1690cb1
> 
> I suspect that libserialport0 will fail to open all serial ports on
> bullseye without this fix, so this bug may unfortunately be RC?

It looks like the kernel broke this in the v5.10.37 update
(eef2158b0c44baa8cd9855091b1d99a35e16afdb), which hit
unstable towards the end of May. Not clear why this was backported to
the stable tree but I guess fixing libserialport is going to be the
easier solution.

J.

-- 
] https://www.earth.li/~noodles/ []  Minorities are the foundation of  [
]  PGP/GPG Key @ the.earth.li[]  society.  [
] via keyserver, web or email.   [][
] RSA: 4096/0x94FA372B2DA8B985   [][



Bug#990863: libserialport0: libserialport tries to use termiox on bullseye, and fails to open serial ports

2021-07-09 Thread Tim Small
Package: libserialport0
Version: 0.1.1-3+b1
Severity: important
Tags: upstream patch
X-Debbugs-Cc: t...@seoss.co.uk

Serial port open seems to fail on bullseye.  Strace output follows:

1512868 openat(AT_FDCWD, "/dev/ttyACM0", O_RDWR|O_NOCTTY|O_NONBLOCK) = 9
1512868 ioctl(9, TCGETS, {B9600 opost isig icanon echo ...}) = 0
1512868 ioctl(9, TIOCMGET, [TIOCM_DTR|TIOCM_RTS|TIOCM_CTS]) = 0
1512868 ioctl(9, TCGETX, 0x55cd7cc80df0) = -1 ENOTTY (Inappropriate ioctl for 
device)
1512868 close(9)= 0
1512868 write(2, "sr: ", 4) = 4
1512868 write(2, "serial-libsp: Error opening port"..., 71) = 71
1512868 write(2, "No devices found.\n", 18) = 18

Applying upstream commit 6f9b03e597ea fixes the issue.  I tested this
with:

/usr/local/bin/sigrok-cli --driver=rdtech-tc:conn=/dev/ttyACM0 --continuous

Patch here:

https://github.com/sigrokproject/libserialport/commit/6f9b03e597ea7200eb616a4e410add3dd1690cb1

I suspect that libserialport0 will fail to open all serial ports on
bullseye without this fix, so this bug may unfortunately be RC?

Cheers,

Tim.



-- System Information:
Debian Release: 11.0
  APT prefers testing-security
  APT policy: (500, 'testing-security'), (500, 'testing')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 5.10.0-7-amd64 (SMP w/4 CPU threads)
Kernel taint flags: TAINT_WARN, TAINT_CRAP
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_GB:en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages libserialport0 depends on:
ii  libc6  2.31-12

libserialport0 recommends no packages.

libserialport0 suggests no packages.

-- no debconf information
>From 6f9b03e597ea7200eb616a4e410add3dd1690cb1 Mon Sep 17 00:00:00 2001
From: Karl Palsson 
Date: Fri, 11 Jun 2021 17:07:09 +
Subject: [PATCH] HACK: don't even check for termiox

termiox was removed from linux in e0efb3168d34
Some more information available in 
https://www.spinics.net/lists/linux-serial/msg41926.html

Attempting to use the termiox ioctls on more modern kernels results in
"Inappropriate IOCTL" errors.

While the "right" solution might be to remove the termiox code from the
linux path, simply not checking for termiox builds a libserialport that
functions on modern linux kernels.

Signed-off-by: Karl Palsson 
---
 configure.ac | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index b1af16f..a26b851 100644
--- a/configure.ac
+++ b/configure.ac
@@ -112,7 +112,7 @@ AC_SYS_LARGEFILE
 AC_TYPE_SIZE_T
 
 # Check for specific termios structures.
-AC_CHECK_TYPES([struct termios2, struct termiox],,,
+AC_CHECK_TYPES([struct termios2],,,
[[#include ]])
 AC_CHECK_MEMBERS([struct termios.c_ispeed, struct termios.c_ospeed,
struct termios2.c_ispeed, struct termios2.c_ospeed],,,
-- 
2.30.2