abiosoft / colima

Container runtimes on macOS (and Linux) with minimal setup
MIT License
18.62k stars 380 forks source link

panic: runtime error: invalid memory address or nil pointer dereference #1130

Closed gdw2vs closed 1 week ago

gdw2vs commented 2 weeks ago

Description

$ colima start -v INFO[0000] starting colima INFO[0000] runtime: docker INFO[0000] creating and starting ... context=vm

Terminal is not available, proceeding without opening an editor panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x840df3]

goroutine 1 [running]: github.com/lima-vm/lima/pkg/limayaml.executeGuestTemplate({0xc0006ab6b0, 0x2d}, {0xc0005de040, 0x29}) github.com/lima-vm/lima/pkg/limayaml/defaults.go:749 +0x193 github.com/lima-vm/lima/pkg/limayaml.FillDefault(0xc00032db88, 0xc0005e4008, 0xc0005e4288, {0xc0005de040, 0x33}) github.com/lima-vm/lima/pkg/limayaml/defaults.go:403 +0x1ecb github.com/lima-vm/lima/pkg/limayaml.Load({0xc0005e0000, 0x654, 0x700}, {0xc0005de040, 0x33}) github.com/lima-vm/lima/pkg/limayaml/load.go:89 +0x525 main.createInstance({0x1377678, 0x2202ca0}, 0xc0000c9b30, 0x0) github.com/lima-vm/lima/cmd/limactl/start.go:326 +0x1c5 main.loadOrCreateInstance(0xc00042cf08, {0xc00016fea0?, 0x0?, 0x0?}, 0x0) github.com/lima-vm/lima/cmd/limactl/start.go:278 +0x1778 main.startAction(0xc00042cf08, {0xc00016fea0, 0x1, 0x2}) github.com/lima-vm/lima/cmd/limactl/start.go:499 +0x78 github.com/spf13/cobra.(Command).execute(0xc00042cf08, {0xc00016fe80, 0x2, 0x2}) github.com/spf13/cobra@v1.8.0/command.go:983 +0xaca github.com/spf13/cobra.(Command).ExecuteC(0xc00042c908) github.com/spf13/cobra@v1.8.0/command.go:1115 +0x3ff github.com/spf13/cobra.(*Command).Execute(...) github.com/spf13/cobra@v1.8.0/command.go:1039 main.main() github.com/lima-vm/lima/cmd/limactl/main.go:26 +0x18 FATA[0000] error starting vm: error at 'creating and starting': exit status 2

Version

$ colima version && limactl --version && qemu-img --version colima version 0.7.5 git commit: 1588c06 limactl version 0.23.2 qemu-img version 9.0.2 Copyright (c) 2003-2024 Fabrice Bellard and the QEMU Project developers

Operating System

Output of colima status

$ colima status FATA[0000] colima is not running

Reproduction Steps

  1. Install the colima nix package on Ubuntu. (I don't know if this happens running on nixos)
  2. Run colima start -v

Expected behaviour

Colima starts

Additional context

No response

gdw2vs commented 2 weeks ago

Stacktrace has a lot of 'lima' in it. Lmk if I should move this over to the lima repo.

gdw2vs commented 2 weeks ago

I can reproduce this with just limactl. I'll close this and move it over there:

$ limactl create
? Creating an instance "default" Choose another template (docker, podman, archlinux, fedora, ...)
? Choose a template docker
? Creating an instance "default" Proceed with the current configuration
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x840df3]

goroutine 1 [running]:
github.com/lima-vm/lima/pkg/limayaml.executeGuestTemplate({0xc000326d90, 0x5e}, {0xc000650510, 0x1b})
        github.com/lima-vm/lima/pkg/limayaml/defaults.go:749 +0x193
github.com/lima-vm/lima/pkg/limayaml.FillDefault(0xc000329b88, 0xc00069a008, 0xc00069a288, {0xc000650510, 0x25})
        github.com/lima-vm/lima/pkg/limayaml/defaults.go:403 +0x1ecb
github.com/lima-vm/lima/pkg/limayaml.Load({0xc00067f000, 0xe56, 0x1000}, {0xc000650510, 0x25})
        github.com/lima-vm/lima/pkg/limayaml/load.go:89 +0x525
main.createInstance({0x1377678, 0x2202ca0}, 0xc0000dfb98, 0x1)
        github.com/lima-vm/lima/cmd/limactl/start.go:326 +0x1c5
main.loadOrCreateInstance(0xc00042ac08, {0x2202ca0?, 0x0?, 0x0?}, 0x1)
        github.com/lima-vm/lima/cmd/limactl/start.go:278 +0x1778
main.createAction(0xc00042ac08, {0x2202ca0, 0x0, 0x0})
        github.com/lima-vm/lima/cmd/limactl/start.go:479 +0x6c
github.com/spf13/cobra.(*Command).execute(0xc00042ac08, {0x2202ca0, 0x0, 0x0})
        github.com/spf13/cobra@v1.8.0/command.go:983 +0xaca
github.com/spf13/cobra.(*Command).ExecuteC(0xc00042a908)
        github.com/spf13/cobra@v1.8.0/command.go:1115 +0x3ff
github.com/spf13/cobra.(*Command).Execute(...)
        github.com/spf13/cobra@v1.8.0/command.go:1039
main.main()
        github.com/lima-vm/lima/cmd/limactl/main.go:26 +0x18
gdw2vs commented 1 week ago

On further inspection, I think this is an issue with how nix is packaging the binary. It works fine/better when I download the binaries on github.