Skip to content

2.4.1 Segfault on down -p project --rmi local #9383

@ghost

Description

Hi !

Description

Segmentation violation

Steps to reproduce the issue:

  1. docker-compose -p something --rmi local

Describe the results you received:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x28 pc=0x55d6acefeb7f]

goroutine 24 [running]:
github.com/docker/compose/v2/pkg/compose.(*composeService).getServiceImages(...)
	github.com/docker/compose/v2/pkg/compose/down.go:149
github.com/docker/compose/v2/pkg/compose.(*composeService).ensureImagesDown(0xc0004b6010, {0x55d6ad6b5c40?, 0xc000540090}, {0x7ffc37e0cbd6, 0x10}, {0x0, 0x0, 0x0, {0x7ffc37e0cbf2, 0x5}, ...}, ...)
	github.com/docker/compose/v2/pkg/compose/down.go:119 +0xff
github.com/docker/compose/v2/pkg/compose.(*composeService).down(0xc0004b6010, {0x55d6ad6b5c40, 0xc000540090}, {0x7ffc37e0cbd6, 0x10}, {0x0, 0x0, 0x0, {0x7ffc37e0cbf2, 0x5}, ...})
	github.com/docker/compose/v2/pkg/compose/down.go:85 +0x505
github.com/docker/compose/v2/pkg/compose.(*composeService).Down.func1({0x55d6ad6b5c40, 0xc000540090})
	github.com/docker/compose/v2/pkg/compose/down.go:39 +0x85
github.com/docker/compose/v2/pkg/progress.Run.func1({0x55d6ad6b5c40?, 0xc000540090?})
	github.com/docker/compose/v2/pkg/progress/writer.go:61 +0x27
github.com/docker/compose/v2/pkg/progress.RunWithStatus.func2()
	github.com/docker/compose/v2/pkg/progress/writer.go:82 +0x87
golang.org/x/sync/errgroup.(*Group).Go.func1()
	golang.org/x/sync@v0.0.0-20210220032951-036812b2e83c/errgroup/errgroup.go:57 +0x67
created by golang.org/x/sync/errgroup.(*Group).Go
	golang.org/x/sync@v0.0.0-20210220032951-036812b2e83c/errgroup/errgroup.go:54 +0x8d

Describe the results you expected:
Properly downed services

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

Issue happens everytime, with even a simple docker-compose.

version: '3.5'
services:
  build:
    image: nginx

Output of docker compose version:

Docker Compose version 2.4.1

Output of docker info:

Client:
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc., v0.8.1-docker)
  compose: Docker Compose (Docker Inc., 2.4.1)

Server:
 Containers: 44
  Running: 17
  Paused: 0
  Stopped: 27
 Images: 62
 Server Version: 20.10.14
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: false
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: systemd
 Cgroup Version: 2
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 io.containerd.runtime.v1.linux runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: de8046a5501db9e0e478e1c10cbcfb21af4c6b2d.m
 runc version: 
 init version: de40ad0
 Security Options:
  seccomp
   Profile: default
  cgroupns
 Kernel Version: 5.17.1-arch1-1
 Operating System: Arch Linux
 OSType: linux
 Architecture: x86_64
 CPUs: 8
 Total Memory: 31.14GiB
 Name: mmeisson
 ID: SUGO:2FQB:SIEN:RJQH:UVBS:PWHS:5JOS:KSUU:TOD4:EQH6:GVSW:SRBM
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Username: don't need
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

Additional environment details:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions