You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I0903 01:29:39.651779 1196665 strace.go:567] [ 2: 2] python E ioctl(0x0 /dev/pts/0, 0x5401, 0x7ea66e856fe0)
I0903 01:29:39.651792 1196665 strace.go:605] [ 2: 2] python X ioctl(0x0 /dev/pts/0, 0x5401, 0x7ea66e856fe0) = 0 (0x0) (1.778µs)
I0903 01:29:39.651803 1196665 strace.go:567] [ 2: 2] python E ioctl(0x0 /dev/pts/0, 0x5404, 0x7ea66e856fb0)
I0903 01:29:39.651821 1196665 compat.go:120] Unsupported syscall ioctl(0x0,0x5404,0x7ea66e856fb0,0x0,0x10,0x7ea66e857054). It is likely that you can safely ignore this message and that
this is not the cause of any error. Please, refer to https://gvisor.dev/c/linux/amd64/ioctl for more information.
I0903 01:29:39.651831 1196665 strace.go:605] [ 2: 2] python X ioctl(0x0 /dev/pts/0, 0x5404, 0x7ea66e856fb0) = 0 (0x0) errno=25 (not a typewriter) (22.458µs)
The workaround in our case is simple, just doing tty.setraw(pty.STDIN_FILENO, when=termios.TCSANOW), but it seems like created a compatibility-tagged issue is the thing to do. I'd also venture that this page should have a "Partially supported" entry for ioctl_tty: https://gvisor.dev/docs/user_guide/compatibility/linux/amd64/
Steps to reproduce
A modified Python pty.spawn function can be used to surface the issue:
# mod_spawn.pyimportptydefspawn(argv, master_read=pty._read, stdin_read=pty._read):
"""Create a spawned process. Modified from pty.spawn"""iftype(argv) ==type(''):
argv= (argv,)
sys.audit('pty.spawn', argv)
pid, master_fd=pty.fork()
ifpid==pty.CHILD:
os.execlp(argv[0], *argv)
try:
mode=tty.tcgetattr(pty.STDIN_FILENO)
print("set raw")
tty.setraw(pty.STDIN_FILENO)
restore=1excepttty.error: # This is the same as termios.errorraiserestore=0try:
pty._copy(master_fd, master_read, stdin_read)
exceptOSError:
ifrestore:
tty.tcsetattr(pty.STDIN_FILENO, tty.TCSAFLUSH, mode)
os.close(master_fd)
returnos.waitpid(pid, 0)[1]
if__name__=="__main__":
pty.spawn("sh")
The stdlib implementation ignores the exception.
docker run -it --runtime=runsc mod1323 python3 -c "$(cat mod_spawn.py)" does not reproduce because the ioctl is made to the host. The ioctl only fails when issued to /dev/pts/0.
To give a proper reproduction I'd have to extract out some of our code, which I don't think is necessary because it's clear that the ioctl cmd is unimplemented.
runsc version
runsc version release-20230717.0-12-g0244c8c19fb7
spec: 1.1.0-rc.1
docker version (if using docker)
Client: Docker Engine - Community
Version: 23.0.1
API version: 1.42
Go version: go1.19.5
Git commit: a5ee5b1
Built: Thu Feb 9 19:46:56 2023
OS/Arch: linux/amd64
Context: default
Server: Docker Engine - Community
Engine:
Version: 23.0.1
API version: 1.42 (minimum version 1.12)
Go version: go1.19.5
Git commit: bc3805a
Built: Thu Feb 9 19:46:56 2023
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.6.18
GitCommit: 2456e983eb9e37e47538f59ea18f2043c9a73640
runc:
Version: 1.1.4
GitCommit: v1.1.4-0-g5fd4c4d
docker-init:
Version: 0.19.0
GitCommit: de40ad0
uname
Linux ip-172-31-70-51 5.15.0-1039-aws #44~20.04.1-Ubuntu SMP Thu Jun 22 12:21:12 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Description
The
TCSETSF
argument is unimplemented in https://github.com/google/gvisor/blob/master/pkg/sentry/fsimpl/devpts/master.go#L221, causing https://docs.python.org/3/library/tty.html#tty.setraw to fail because that function by default usesTCSETSF
.The workaround in our case is simple, just doing
tty.setraw(pty.STDIN_FILENO, when=termios.TCSANOW)
, but it seems like created a compatibility-tagged issue is the thing to do. I'd also venture that this page should have a "Partially supported" entry for ioctl_tty: https://gvisor.dev/docs/user_guide/compatibility/linux/amd64/Steps to reproduce
A modified Python
pty.spawn
function can be used to surface the issue:The stdlib implementation ignores the exception.
docker run -it --runtime=runsc mod1323 python3 -c "$(cat mod_spawn.py)"
does not reproduce because theioctl
is made to the host. Theioctl
only fails when issued to/dev/pts/0
.To give a proper reproduction I'd have to extract out some of our code, which I don't think is necessary because it's clear that the
ioctl
cmd is unimplemented.runsc version
docker version (if using docker)
Client: Docker Engine - Community Version: 23.0.1 API version: 1.42 Go version: go1.19.5 Git commit: a5ee5b1 Built: Thu Feb 9 19:46:56 2023 OS/Arch: linux/amd64 Context: default Server: Docker Engine - Community Engine: Version: 23.0.1 API version: 1.42 (minimum version 1.12) Go version: go1.19.5 Git commit: bc3805a Built: Thu Feb 9 19:46:56 2023 OS/Arch: linux/amd64 Experimental: false containerd: Version: 1.6.18 GitCommit: 2456e983eb9e37e47538f59ea18f2043c9a73640 runc: Version: 1.1.4 GitCommit: v1.1.4-0-g5fd4c4d docker-init: Version: 0.19.0 GitCommit: de40ad0
uname
Linux ip-172-31-70-51 5.15.0-1039-aws #44~20.04.1-Ubuntu SMP Thu Jun 22 12:21:12 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
kubectl (if using Kubernetes)
No response
repo state (if built from source)
No response
runsc debug logs (if available)
The text was updated successfully, but these errors were encountered: