Segmentation fault when window is resized
The process throws "Segmentation fault" if an user resize a window when a script is waiting for user input via TTY, after it accesses to process.stdout.
For example:
var fs = require('fs'), bufferSize = 1024, buffer = new Buffer(bufferSize), readSize, chunk; readSize = fs.readSync(fs.openSync('/dev/tty', 'r'), buffer, 0, bufferSize); chunk = buffer.toString('utf8', 0, readSize); console.log('INPUT: ' + chunk);
This code above works fine without error.
But, if process.stdout is accessed:
var fs = require('fs'), bufferSize = 1024, buffer = new Buffer(bufferSize), readSize, chunk; process.stdout; // access to property readSize = fs.readSync(fs.openSync('/dev/tty', 'r'), buffer, 0, bufferSize); chunk = buffer.toString('utf8', 0, readSize); console.log('INPUT: ' + chunk);
If a window is resized when the script is waiting for user input, it throws "Segmentation fault".
I tried this code in some versions, and it seems that this issue occurs in v3.3.0+.
v3.2.0 is OK.
v3.3.0 makes this issue occur.
Is this a problem of libuv v1.7.3 ?