Project

General

Profile

Bug #6533

Bash script generates "interrupted system call" events on tty window resize

Added by Granville Moore almost 5 years ago. Updated over 4 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
2015-12-26
Due date:
% Done:

0%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage

Description

When pasted into an interactive bash shell in a remote tty (ssh/putty) on OI151a7, the attached script generates a
"-bash: echo: write error: Interrupted system call"
event when the window is resized.

Function A simply outputs zero (in hex); function B fills a data file with garbage and then loops infinitely reads the data file one line at a time, passing the line to a shell that reads it, calls A and then outputs 0 to /dev/null using printf. Calling function B and then resizing the terminal window (i.e sending a SIGWINCH signal to the process) causes the "Interrupted system call".

Removing almost any element of the script causes the behaviour to change, suggesting a race condition (which might mean that it may not occur on all systems).

Blocking SIGWINCH events using trap "" 20 inhibits the behaviour.

This is a cut-down version of a real script that exhibited this behaviour, reduced to the point just before the behaviour stops occuring.


Files

OI151-bash-interrupted-system-call-issue (1.12 KB) OI151-bash-interrupted-system-call-issue OI151-bash-interrupted-system-call-issue-script Granville Moore, 2015-12-26 10:56 PM
#1

Updated by Granville Moore almost 5 years ago

Just to clarify, when this interrupted system call occurs in a non-trivial example, any data that should have been written by the interrupted echo statement is lost.

#2

Updated by Nikola M. almost 5 years ago

151a7 is older dev release but, it is neded to report bugss in newest possible OI.

Please confirm it it behaves the same in newest /dev , 151a9 ,
also check to see how it behaves in latest updated OI Hipster rolling release (/hipster-2015, dlc.openindiana.org).

Could be nice excuse to test upgrading from dev to hipster or install hipster in Virtualbox and zfs send it to new emptied Boot Eenvironment.

#3

Updated by Nikola M. over 4 years ago

Newest hipster change publisher address back to pkg.openindiana.org/hipster ,
so running newestOI hipster is needed to test if bug is still happening for you.

To change it, do
pkg set-publisher -G http://pkg.openindiana.org/hipster-2015 -g http://pkg.openindiana.org/hipster openindiana.org

(http://openindiana.org/pipermail/oi-dev/2016-April/004313.html)

Also available in: Atom PDF