containers / podman

Podman: A tool for managing OCI containers and pods.
https://podman.io
Apache License 2.0
23.27k stars 2.37k forks source link

Podman-remote mangles SIGINT #5004

Closed cevich closed 4 years ago

cevich commented 4 years ago

/kind bug

Description

Discovered in master, sometime prior to commit a8bd3473e0bb648be88b6d9b84f18fc097de70ee under F31, the system-tests fail in 130-kill.bats.

Steps to reproduce the issue:

  1. From a clone of the repo. run 'make remotesystem' (observe test failure)

  2. Copy attached script into root of source tree, rename and execute it. repro.sh.txt

Describe the results you received:

[foobar@cevich-fedora-31-libpod-6413201982095360 ~]$ ./repro.sh 
Starting background varlink server
Starting background signal-recipient container
94020eaaf1d3447b9a486f21b09c88e5a4ea6e3b22a812916186d09138d495f5
Sending signal 8
got: 8
...cut...
Sending signal 20
got: 20
Sending signal 2
got: 20
Sending signal 16
got: 16
...cut...

Describe the results you expected:

Running 'make remotesystem' should pass.

Additional information you deem important (e.g. issue happens only occasionally):

Unsure if munging of signal 2 is intended or not, guess that it is.

Output of podman version:

Version:            1.7.1-dev
RemoteAPI Version:  1
Go Version:         go1.13.5
Git Commit:         61f91e5bc6c241955c189495df48949951667b08-dirty
Built:              Tue Jan 28 10:26:05 2020
OS/Arch:            linux/amd64

Output of podman info --debug:

debug:
  compiler: gc
  git commit: 61f91e5bc6c241955c189495df48949951667b08-dirty
  go version: go1.13.5
  podman version: 1.7.1-dev
host:
  BuildahVersion: 1.13.1
  CgroupVersion: v2
  Conmon:
    package: conmon-2.0.9-2.fc31.x86_64
    path: /usr/bin/conmon
    version: 'conmon version 2.0.9, commit: 7d46f3e7711aa3578488284ae2f98b447658f086'
  Distribution:
    distribution: fedora
    version: "31"
  IDMappings:
    gidmap:
    - container_id: 0
      host_id: 11025
      size: 1
    - container_id: 1
      host_id: 362144
      size: 65536
    uidmap:
    - container_id: 0
      host_id: 18143
      size: 1
    - container_id: 1
      host_id: 362144
      size: 65536
  MemFree: 2577997824
  MemTotal: 4121264128
  OCIRuntime:
    name: crun
    package: crun-0.11-1.fc31.x86_64
    path: /usr/bin/crun
    version: |-
      crun version 0.11
      commit: 4a9b272b98768549da1277ec073c66c3ef51fd5b
      spec: 1.0.0
      +SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +YAJL
  SwapFree: 0
  SwapTotal: 0
  arch: amd64
  cpus: 2
  eventlogger: journald
  hostname: cevich-fedora-31-libpod-6413201982095360
  kernel: 5.4.8-200.fc31.x86_64
  os: linux
  rootless: true
  slirp4netns:
    Executable: /usr/bin/slirp4netns
    Package: slirp4netns-0.4.0-20.1.dev.gitbbd6f25.fc31.x86_64
    Version: |-
      slirp4netns version 0.4.0-beta.3+dev
      commit: bbd6f25c70d5db2a1cd3bfb0416a8db99a75ed7e
  uptime: 1h 29m 14.79s (Approximately 0.04 days)
registries:
  search:
  - docker.io
  - quay.io
  - registry.fedoraproject.org
store:
  ConfigFile: /home/foobar/.config/containers/storage.conf
  ContainerStore:
    number: 0
  GraphDriverName: overlay
  GraphOptions:
    overlay.mount_program:
      Executable: /usr/bin/fuse-overlayfs
      Package: fuse-overlayfs-0.7.3-2.fc31.x86_64
      Version: |-
        fusermount3 version: 3.6.2
        fuse-overlayfs: version 0.7.3
        FUSE library version 3.6.2
        using FUSE kernel interface version 7.29
  GraphRoot: /home/foobar/.local/share/containers/storage
  GraphStatus:
    Backing Filesystem: extfs
    Native Overlay Diff: "false"
    Supports d_type: "true"
    Using metacopy: "false"
  ImageStore:
    number: 0
  RunRoot: /run/user/18143/containers
  VolumePath: /home/foobar/.local/share/containers/storage/volumes

Additional environment details (AWS, VirtualBox, physical, etc.):

Was running as the local user "foobar". Problem does not reproduce under F30.

cevich commented 4 years ago

@vrothberg PTAL

baude commented 4 years ago

I have moved this to crun -> https://github.com/containers/crun/issues/230

closing for now

giuseppe commented 4 years ago

I've changed crun to force the default for the signal handlers and behave like runc.

But I think it is safer anyway to do: ./bin/podman-remote run -d --name=foobar fedora-minimal env --default-signal sh -c "for i in ${signals[*]}; do trap \"echo got: \$i\" \$i; done; echo READY; while ! test -e /stop; do sleep 0.05; done;echo DONE"

Note the extra env --default-signal

cevich commented 4 years ago

Note the extra env --default-signal

Good idea, thx.