Bug #6533

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

Added by Granville Moore about 5 years ago. Updated almost 5 years ago.

Target version:
Start date:
Due date:
% Done:


Estimated time:


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.


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

Updated by Granville Moore about 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.


Updated by Nikola M. about 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,

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.


Updated by Nikola M. almost 5 years ago

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

To change it, do
pkg set-publisher -G -g


Also available in: Atom PDF