Public bug reported:

# Launchpad bug report — gtkterm

**Package:** gtkterm
**Version:** 1.3.1-1build1
**Series:** Ubuntu 26.04 LTS (Resolute Raccoon)

---

## Title

gtkterm 1.3.1 fails to apply the configured baud rate under glibc 2.43
(garbage output until corrected with stty)

---

## Summary

On Ubuntu 26.04, GTKTerm 1.3.1-1build1 does not apply the configured baud rate 
to USB serial
ports. Opening a port at 115200 8N1 (or any rate) produces garbage characters, 
even though the
GTKTerm UI reports the correct settings. Running an external `stty` against the 
same device such as `stty -F /dev/ttyUSB0 115200`
immediately corrects the open port and GTKTerm starts displaying correct data.

The fix already exists upstream: GTKTerm's legacy baud-setting code (which 
writes the `CBAUD`
bits in `termios.c_cflag` directly, plus `TIOCGSERIAL`) has been replaced with 
the standard
`cfsetispeed()` / `cfsetospeed()` interface. That replacement is on the 
upstream `master` branch
but has never been included in a tagged release, so no Ubuntu or Debian package 
contains it.

---

## Steps to reproduce

1. Connect a USB serial adapter to a device transmitting serial data at 115200 
8N1, no flow
   control. (Reproduced with an FTDI FT2232H, USB ID `0403:6010`, driver 
`ftdi_sio`. The defect
   is in gtkterm's termios handling, not in the adapter or its driver, so it is 
not expected to be
   adapter-specific — FTDI is simply the confirmed reproducer.)
2. Launch `gtkterm` and configure the port for 115200 baud, 8 data bits, no 
parity, 1 stop bit,
   no flow control.
3. Observe the received data.

### Expected

Readable serial output at 115200 8N1.

### Actual

Garbage / mojibake. The data only becomes readable after running, in a
separate terminal:

```
stty -F /dev/ttyUSB0 115200
```

After that single `stty` command, the already-open GTKTerm session immediately 
begins showing
correct output. This confirms the configured rate was never applied by GTKTerm, 
and that the only
effective change is the baud rate (the data-bit / parity / stop-bit flags 
GTKTerm sets already
match the defaults).

---

## What we know

- GTKTerm 1.3.1's `src/serial.c` configures the line speed using the legacy 
method: writing
  `c_cflag` directly and using `TIOCGSERIAL`, rather than the standard 
`cfsetispeed()` /
  `cfsetospeed()` interface.
- Under glibc 2.43 (shipped in 26.04), this path does not result in the 
configured rate being
  applied to the port — the symptom is garbage output until an external `stty` 
sets the speed.
- `stty` (coreutils) sets the speed via `cfsetispeed()`/`cfsetospeed()`, which 
is why running it
  against the open device corrects it.

Note: we did not instrument the running binary to determine the exact internal 
failure (e.g.
whether the port is left at a different definite rate or simply unchanged); the 
above is limited
to what was directly observed.

### Upstream references

- Upstream issue: **wvdakker/gtkterm #81 "Termios speed setting problem"** 
(closed completed
  2025-11-12). https://github.com/wvdakker/gtkterm/issues/81
- Upstream fix: commit **`4d1018a` "Fix baud rate settings"** (PR #82), which 
switches to the
  `cfsetispeed()`/`cfsetospeed()` interface.
  https://github.com/wvdakker/gtkterm/commits/master/src/serial.c

The newest upstream tag is `1.3.1` (May 2024), which predates the fix. The fix 
is only on
`master`, so no released package includes it.

---

## Fix / suggested resolution

Backport upstream commit `4d1018a` (and the related serial.c termios cleanups 
merged alongside it,
e.g. PR #84 / `ec92a28` for RTS/CTS) into the Ubuntu `gtkterm` package as a 
Stable Release Update.

Building current upstream `master` (commit `d62c8a1`, 2025-11-11 — 
`1.3.1-13-gd62c8a1`,
13 commits past the 1.3.1 tag) resolves the problem completely; verified 
locally on the affected
system.

---

## SRU justification (for an LTS update)

- **Impact:** GTKTerm is unusable for its core purpose (serial communication) 
on a fresh 26.04 LTS
  install. The failure is silent (garbage, not an error) and non-obvious.
- **Test case:** Reproduce the steps above with a USB serial adapter; with the 
patched package the
  output is readable immediately without any `stty` workaround.
- **Regression potential:** Low. The change replaces a non-functional legacy 
code path with the
  standard POSIX termios speed-setting interface that coreutils `stty` already 
uses successfully
  on the same systems.

---

## Environment

- Ubuntu 26.04 LTS (Resolute Raccoon)
- Kernel: 7.0.0-15-generic (x86_64)
- gtkterm: 1.3.1-1build1 (universe)
- glibc: 2.43 (Ubuntu GLIBC 2.43-2ubuntu2)
- Adapter used to reproduce: FTDI FT2232H "Dual RS232-HS", USB `0403:6010`, 
driver `ftdi_sio`

ProblemType: Bug
DistroRelease: Ubuntu 26.04
Package: gtkterm 1.3.1-1build1
ProcVersionSignature: Ubuntu 7.0.0-15.15-generic 7.0.0
Uname: Linux 7.0.0-15-generic x86_64
ApportVersion: 2.34.0-0ubuntu2
Architecture: amd64
CasperMD5CheckResult: pass
CurrentDesktop: ubuntu:GNOME
Date: Tue Jun  2 11:06:31 2026
InstallationDate: Installed on 2025-09-25 (251 days ago)
InstallationMedia: Ubuntu 25.04 "Plucky Puffin" - Release amd64 (20250415.3)
ProcEnviron:
 LANG=en_US.UTF-8
 PATH=(custom, no user)
 SHELL=/bin/bash
 TERM=xterm-256color
 XDG_RUNTIME_DIR=<set>
SourcePackage: gtkterm
UpgradeStatus: Upgraded to resolute on 2026-05-20 (14 days ago)

** Affects: gtkterm (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: amd64 apport-bug resolute wayland-session

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2155056

Title:
  gtkterm 1.3.1 sets wrong baud rate under glibc 2.43 (garbage output
  until corrected with stty)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gtkterm/+bug/2155056/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to