FS#45629 - [linux] Data written to /dev/pts/x inside SIGINT handler is randomly discarded

Attached to Project: Arch Linux
Opened by ilya (leniviy) - Sunday, 12 July 2015, 19:50 GMT
Last edited by Eli Schwartz (eschwartz) - Monday, 02 October 2017, 22:25 GMT
Task Type Bug Report
Category Kernel
Status Closed
Assigned To Tobias Powalowski (tpowa)
Architecture x86_64
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

Description:

Have `Archlinux64` on `VirtualBox`

Here's my SIGINT trap:

trap 'echo x' INT

If I run this command inside an `ssh` session and press Ctrl-c multiple times, only a few times something appears in terminal. Here's a more complex example:

[il@vmarch ~]$ n=0; trap 'echo " $n'\''th INT"; n=$((n+1))' INT
[il@vmarch ~]$ ^C 0'th INT

[il@vmarch ~]$ ^C 7'th INT

[il@vmarch ~]$ ^C 8'th INT

[il@vmarch ~]$ ^C 9'th INT

[il@vmarch ~]$ ^C 18'th INT

[il@vmarch ~]$ ^C 21'th INT

Only pressing Ctrl-c has such effect. Sending `SIGINT` explicitly does not block the writing. Reproducible in multiple terminal emulators. Never occurs in text console (`/dev/tty1`). Similar symptoms in `zsh` and `dash`.

Doing nothing for 5-10 seconds before pressing Ctrl-c increases the chance of data being discarded.

$ uname -a
Linux vmarch.lan 4.0.4-2-ARCH #1 SMP PREEMPT Fri May 22 03:05:23 UTC 2015 x86_64 GNU/Linux


Additional info:
* package version(s)
# pacman -Q linux
linux 4.0.7-2

* config and/or log files etc.


Steps to reproduce:
download vbox: https://drive.google.com/file/d/0B40Hp1Tx6I6eUVVZUnBydXNjR1U/view?usp=sharing
login as root
type: ~/test.sh

or Install Arch on Vbox. num cpus: 1, ram: 4096.
type: n=0; trap 'echo " $n'\''th INT"; n=$((n+1))' INT
Start pressing Ctrl-c

This task depends upon

Closed by  Eli Schwartz (eschwartz)
Monday, 02 October 2017, 22:25 GMT
Reason for closing:  Fixed
Additional comments about closing:  OP no longer has this problem with the current kernel
Comment by Antonio (kokoko3k) - Friday, 24 July 2015, 15:43 GMT
I'm affected by this when running arch inside vmware Esxi 4:
https://bbs.archlinux.org/viewtopic.php?pid=1547539#p1547539
Comment by ilya (leniviy) - Friday, 21 August 2015, 14:49 GMT
Reproduced on an old laptop with Celeron
Comment by mattia (nTia89) - Monday, 02 October 2017, 19:46 GMT
I cannot reproduce it.

Is this issue still valid for you?
Comment by ilya (leniviy) - Monday, 02 October 2017, 20:35 GMT
Seems to be fixed. Thanks.

Loading...