Files
moby/daemon
Paweł Gronowski 1200f5e45c daemon: Fix panic in shutdown after daemon init fails
When error during daemon initialization fails before the events manager
is created the daemon will panic instead of erroring out cleanly with
an actual error message.

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

goroutine 1 [running, locked to thread]:
github.com/moby/moby/v2/daemon/events.(*Events).Close(...)
	/go/src/github.com/docker/docker/daemon/events/events.go:157
github.com/moby/moby/v2/daemon.(*Daemon).Shutdown(0x40001bf908, {0x2d664f0, 0x44c87e0})
	/go/src/github.com/docker/docker/daemon/daemon.go:1505 +0x3bc
github.com/moby/moby/v2/daemon.NewDaemon.func1()
	/go/src/github.com/docker/docker/daemon/daemon.go:907 +0x44
github.com/moby/moby/v2/daemon.NewDaemon({0x2d66560, 0x4000051c20}, 0x40004a6108, 0x40006fe810, 0x4000318700)
	/go/src/github.com/docker/docker/daemon/daemon.go:1371 +0x2130
github.com/moby/moby/v2/daemon/command.(*daemonCLI).start(0x4000051bd0, {0x2d664f0, 0x44c87e0})
	/go/src/github.com/docker/docker/daemon/command/daemon.go:264 +0xb90
github.com/moby/moby/v2/daemon/command.runDaemon(...)
	/go/src/github.com/docker/docker/daemon/command/docker_unix.go:13
github.com/moby/moby/v2/daemon/command.newDaemonCommand.func1(0x4000381808, {0x40006ac780?, 0x7?, 0x287f0b1?})
	/go/src/github.com/docker/docker/daemon/command/docker.go:48 +0xb0
github.com/spf13/cobra.(*Command).execute(0x4000381808, {0x4000050060, 0x4, 0x4})
	/go/src/github.com/docker/docker/vendor/github.com/spf13/cobra/command.go:1015 +0x7d4
github.com/spf13/cobra.(*Command).ExecuteC(0x4000381808)
	/go/src/github.com/docker/docker/vendor/github.com/spf13/cobra/command.go:1148 +0x350
github.com/spf13/cobra.(*Command).Execute(...)
	/go/src/github.com/docker/docker/vendor/github.com/spf13/cobra/command.go:1071
github.com/spf13/cobra.(*Command).ExecuteContext(...)
	/go/src/github.com/docker/docker/vendor/github.com/spf13/cobra/command.go:1064
github.com/moby/moby/v2/daemon/command.daemonRunner.Run({0x2d35440?}, {0x2d664f0, 0x44c87e0})
	/go/src/github.com/docker/docker/daemon/command/docker.go:97 +0x6c
main.main()
	/go/src/github.com/docker/docker/cmd/dockerd/main.go:35 +0x108
```

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2026-01-27 11:55:03 +01:00
..
2026-01-24 17:16:05 +01:00
2025-12-15 18:56:34 +01:00
2026-01-24 17:16:05 +01:00
2026-01-24 17:16:05 +01:00
2025-07-31 10:13:29 -07:00
2025-12-02 02:30:14 +09:00
2025-12-11 11:07:42 +01:00
2025-12-15 18:56:34 +01:00
2026-01-24 17:16:05 +01:00
2026-01-05 12:42:49 +01:00
2025-05-30 15:59:13 +02:00
2025-12-15 18:56:34 +01:00
2025-12-15 10:36:05 +00:00
2025-05-30 15:59:13 +02:00
2025-07-31 10:13:29 -07:00
2025-12-15 18:56:34 +01:00
2025-12-15 18:56:34 +01:00
2025-12-15 18:56:34 +01:00
2025-12-15 18:56:34 +01:00
2025-11-05 15:48:02 +01:00
2025-12-15 18:56:34 +01:00
2025-12-15 13:59:09 +00:00
2026-01-24 17:16:05 +01:00
2025-08-01 01:48:55 +02:00