mystikos icon indicating copy to clipboard operation
mystikos copied to clipboard

File descriptor of stdio does not support fcntl(F_GETFL/F_SETFL) or ioctl(TCGETS/TCSETS)

Open bodzhang opened this issue 3 years ago • 1 comments

Python runtime invokes ioctl(TCGETS) on open fds.

Recent version of NodeJS calls fcntl(F_GETFL/F_SETFL) and ioctl(TCGETS/TCSETS) on stdio fds during initialization, and treat failures as fatal. Using the following NodeJs sample, the fatal failure reported by NodeJS can be reproduced.

docker file:

FROM node:13-alpine

WORKDIR /app
COPY app.js /app/app.js

CMD ["/bin/sh"]

app.js

const http = require('http');

const hostname = '127.0.0.1';
const port = 3000;

const server = http.createServer((req, res) => {
res.statusCode = 200;
res.setHeader('Content-Type', 'text/plain');
res.end('Hello World');
});

server.listen(port, hostname, () => {
console.log(`Server running at http://${hostname}:${port}/`);
});

bodzhang avatar Jul 16 '21 15:07 bodzhang

Related #654

jxyang avatar Aug 02 '21 21:08 jxyang