Bash script generates "interrupted system call" events on tty window resize
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.
Updated by Nikola M. about 6 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.
Updated by Nikola M. over 5 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.