Uploaded image for project: 'Container Tools'
  1. Container Tools
  2. RUN-2113

[containers/buildah] stacktrace on syntax error with empty RUN step

XMLWordPrintable

    • False
    • None
    • False
    • rhel-sst-container-tools

      [2112613726] Upstream Reporter: dawg
      Upstream issue status: Closed
      Upstream description:

      Issue Description

      Client:       Podman Engine
      Version:      4.8.3
      API Version:  4.8.3
      Go Version:   go1.20.12
      Built:        Wed Jan  3 14:11:31 2024
      OS/Arch:      linux/amd64

      Steps to reproduce the issue

      Steps to reproduce the issue

      1. add empty RUN step to Dockerfile
      2. run podman build

      Describe the results you received

      Describe the results you received

      Panic/stacktrace with out-of-bounds access

      [1/2] STEP 5/8: RUN
      panic: runtime error: slice bounds out of range [4:3]
      
      goroutine 41 [running]:
      panic({0x559349089ae0, 0xc000662900})
              /usr/lib/golang/src/runtime/panic.go:987 +0x3bb fp=0xc0006df3c0 sp=0xc0006df300 pc=0x5593476892fb
      runtime.goPanicSliceB(0x4, 0x3)
              /usr/lib/golang/src/runtime/panic.go:153 +0x7f fp=0xc0006df400 sp=0xc0006df3c0 pc=0x55934768767f
      github.com/containers/buildah/imagebuildah.(*StageExecutor).getCreatedBy(0xc0002f9680, 0xc0002bec60, {0x0, 0x0})
              /builddir/build/BUILD/podman-4.8.3/vendor/github.com/containers/buildah/imagebuildah/stage_executor.go:1727 +0x415 fp=0xc0006df560 sp=0xc0006df400 pc=0x5593484ecdd5
      github.com/containers/buildah/imagebuildah.(*StageExecutor).generateCacheKey(0xc0002f9680, {0x55934917dac0, 0xc0003056b0}, 0x1?, {0x0, 0x0}, 0x1)
              /builddir/build/BUILD/podman-4.8.3/vendor/github.com/containers/buildah/imagebuildah/stage_executor.go:1886 +0x294 fp=0xc0006df698 sp=0xc0006df560 pc=0x5593484ee754
      github.com/containers/buildah/imagebuildah.(*StageExecutor).Execute(0xc0002f9680, {0x55934917dac0, 0xc0003056b0}, {0xc00025f880, 0x68})
              /builddir/build/BUILD/podman-4.8.3/vendor/github.com/containers/buildah/imagebuildah/stage_executor.go:1385 +0x29d5 fp=0xc0006dfc70 sp=0xc0006df698 pc=0x5593484e94d5
      github.com/containers/buildah/imagebuildah.(*Executor).buildStage(0xc0002a6c00, {0x55934917dac0, 0xc0003056b0}, 0x7?, {0xc000560410?, 0x2, 0x2}, 0x0)
              /builddir/build/BUILD/podman-4.8.3/vendor/github.com/containers/buildah/imagebuildah/executor.go:579 +0x5c5 fp=0xc0006dfe30 sp=0xc0006dfc70 pc=0x5593484d7de5
      github.com/containers/buildah/imagebuildah.(*Executor).Build.func3.1()
              /builddir/build/BUILD/podman-4.8.3/vendor/github.com/containers/buildah/imagebuildah/executor.go:949 +0x2c5 fp=0xc0006dffe0 sp=0xc0006dfe30 pc=0x5593484dc7c5
      runtime.goexit()
              /usr/lib/golang/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc0006dffe8 sp=0xc0006dffe0 pc=0x5593476c0501
      created by github.com/containers/buildah/imagebuildah.(*Executor).Build.func3
              /builddir/build/BUILD/podman-4.8.3/vendor/github.com/containers/buildah/imagebuildah/executor.go:920 +0x34a

      Describe the results you expected

      Describe the results you expected

      An error about the syntax, was having

      RUN
        cmd && cmd

      podman info output

      host:   arch: amd64
        buildahVersion: 1.33.2
        cgroupControllers:   - cpu
        - io
        - memory
        - pids
        cgroupManager: systemd
        cgroupVersion: v2
        conmon:     package: conmon-2.1.8-2.fc39.x86_64
          path: /usr/bin/conmon
          version: 'conmon version 2.1.8, commit: '
        cpuUtilization:     idlePercent: 93.32
          systemPercent: 1.78
          userPercent: 4.9
        cpus: 16
        databaseBackend: boltdb
        distribution:     distribution: fedora
          variant: workstation
          version: "39"
        eventLogger: journald
        freeLocks: 2047
        hostname: dawgFW12
        idMappings:     gidmap:     - container_id: 0
            host_id: 1000
            size: 1
          - container_id: 1
            host_id: 100000
            size: 65536
          uidmap:     - container_id: 0
            host_id: 1000
            size: 1
          - container_id: 1
            host_id: 100000
            size: 65536
        kernel: 6.6.13-200.fc39.x86_64
        linkmode: dynamic
        logDriver: journald
        memFree: 11844546560
        memTotal: 41752637440
        networkBackend: netavark
        networkBackendInfo:     backend: netavark
          dns:       package: aardvark-dns-1.9.0-1.fc39.x86_64
            path: /usr/libexec/podman/aardvark-dns
            version: aardvark-dns 1.9.0
          package: netavark-1.9.0-1.fc39.x86_64
          path: /usr/libexec/podman/netavark
          version: netavark 1.9.0
        ociRuntime:     name: crun
          package: crun-1.13-1.fc39.x86_64
          path: /usr/bin/crun
          version: |-
            crun version 1.13
            commit: c761349704905da07cfe67f38dda6850334a160f
            rundir: /run/user/1000/crun
            spec: 1.0.0
            +SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +CRIU +LIBKRUN +WASM:wasmedge +YAJL
        os: linux
        pasta:     executable: /usr/bin/pasta
          package: passt-0^20231230.gf091893-1.fc39.x86_64
          version: |
            pasta 0^20231230.gf091893-1.fc39.x86_64
            Copyright Red Hat
            GNU General Public License, version 2 or later
              <https://www.gnu.org/licenses/old-licenses/gpl-2.0.html>
            This is free software: you are free to change and redistribute it.
            There is NO WARRANTY, to the extent permitted by law.
        remoteSocket:     exists: false
          path: /run/user/1000/podman/podman.sock
        security:     apparmorEnabled: false
          capabilities: CAP_CHOWN,CAP_DAC_OVERRIDE,CAP_FOWNER,CAP_FSETID,CAP_KILL,CAP_NET_BIND_SERVICE,CAP_SETFCAP,CAP_SETGID,CAP_SETPCAP,CAP_SETUID,CAP_SYS_CHROOT
          rootless: true
          seccompEnabled: true
          seccompProfilePath: /usr/share/containers/seccomp.json
          selinuxEnabled: true
        serviceIsRemote: false
        slirp4netns:     executable: /usr/bin/slirp4netns
          package: slirp4netns-1.2.2-1.fc39.x86_64
          version: |-
            slirp4netns version 1.2.2
            commit: 0ee2d87523e906518d34a6b423271e4826f71faf
            libslirp: 4.7.0
            SLIRP_CONFIG_VERSION_MAX: 4
            libseccomp: 2.5.3
        swapFree: 15478939648
        swapTotal: 16823549952
        uptime: 31h 19m 5.00s (Approximately 1.29 days)
        variant: ""
      plugins:   authorization: null
        log:   - k8s-file
        - none
        - passthrough
        - journald
        network:   - bridge
        - macvlan
        - ipvlan
        volume:   - local
      registries:   search:   - registry.fedoraproject.org
        - registry.access.redhat.com
        - docker.io
        - quay.io
      store:   configFile: /home/dawg/.config/containers/storage.conf
        containerStore:     number: 1
          paused: 0
          running: 1
          stopped: 0
        graphDriverName: overlay
        graphOptions: {}
        graphRoot: /home/dawg/.local/share/containers/storage
        graphRootAllocated: 498387124224
        graphRootUsed: 379662491648
        graphStatus:     Backing Filesystem: btrfs
          Native Overlay Diff: "true"
          Supports d_type: "true"
          Supports shifting: "false"
          Supports volatile: "true"
          Using metacopy: "false"
        imageCopyTmpDir: /var/tmp
        imageStore:     number: 883
        runRoot: /run/user/1000/containers
        transientStore: false
        volumePath: /home/dawg/.local/share/containers/storage/volumes
      version:   APIVersion: 4.8.3
        Built: 1704291100
        BuiltTime: Wed Jan  3 15:11:40 2024
        GitCommit: ""
        GoVersion: go1.21.5
        Os: linux
        OsArch: linux/amd64
        Version: 4.8.3
      

      Podman in a container

      No

      Privileged Or Rootless

      Rootless

      Upstream Latest Release

      Yes

      Additional environment details

      Additional environment details

      Additional information

      Additional information like issue happens only occasionally or issue happens with a particular architecture or on a particular setting


      Upstream URL: https://github.com/containers/buildah/issues/5312

              gscrivan@redhat.com Giuseppe Scrivano
              upstream-sync Upstream Sync
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: