← Back to team overview

kernel-packages team mailing list archive

[Bug 1397976] Re: tty hangup regression in 3.13 kernel (trusty LTS)

 

Hi,
I've just got the new -proposed kernel with that fix, and got an important regression: it broke tty connection to my devices using FTDI chips.

I haven't fully checked yet, but I think that's because you've cherry-
picked commit  eafbe67f84761d787802e5113d895a316b6292fe "n_tty: Refactor
input_available_p() by call site", without also taking commit
a5934804a834f525c9e6289935ceef65b952b101 "n_tty: Fix poll() when
TIME_CHAR and MIN_CHAR == 0" (which fixes that first commit).

Note: I'm not affected by the original bug, so cannot comment on the
effect of the other commits.

How to reproduce the regression:
? python
> import serial
> p = serial.Serial("/dev/ttyACM0", timeout=1)
> p.read()
SerialException: device reports readiness to read but returned no data (device disconnected?)

Expected:
p.read() waits one second and returns nothing (due to timeout).

-- 
You received this bug notification because you are a member of Kernel
Packages, which is subscribed to linux in Ubuntu.
https://bugs.launchpad.net/bugs/1397976

Title:
  tty hangup regression in 3.13 kernel (trusty LTS)

Status in linux package in Ubuntu:
  Fix Released
Status in linux-lts-trusty package in Ubuntu:
  Invalid
Status in linux source package in Trusty:
  Fix Committed
Status in linux-lts-trusty source package in Trusty:
  In Progress

Bug description:
  From https://lkml.org/lkml/2014/10/10/345

  #####
  Commit f95499c3030f ("n_tty: Don't wait for buffer work in read() loop")
  introduces a race window where a pty master can be signalled that the ptyslave was closed before all the data that the slave wrote is delivered.
  Commit f8747d4a466a ("tty: Fix pty master read() after slave closes") fixed theproblem in case of n_tty_read, but the problem still exists for n_tty_poll.This can be seen by running 'for ((i=0; i<100;i++));do ./test.py ;done'where test.py is:

  import os, select, pty
  (pid, pty_fd) = pty.fork()

  if pid == 0:
     os.write(1, 'This string should be received by parent')
  else:
     poller = select.epoll()
     poller.register( pty_fd, select.EPOLLIN )
     ready = poller.poll( 1 * 1000 )
     for fd, events in ready:
        if not events & select.EPOLLIN:
           print 'missed POLLIN event'
        else:
           print os.read(fd, 100)
     poller.close()

  The string from the slave is missed several times.
  This patch takes the same approach as the fix for read and special casesthis condition for poll.
  Tested on 3.16.
  #####

  This is has been merged to Linus Torvalds branch:
  https://github.com/torvalds/linux/commit/c4dc304677e8d566572c4738d95c48be150c6606

  This would be needed to be implemented in to 3.13 kernel too. As both
  12.04 and 14.04 is currently running the Trusty LTS it affectes both.

  br,

  Björn

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