air-verse / air

☁️ Live reload for Go apps
GNU General Public License v3.0
16.35k stars 771 forks source link

Bug report: one-off `panic: runtime error: invalid memory address or nil pointer dereference` at startup #530

Open ChrysmOre opened 4 months ago

ChrysmOre commented 4 months ago

Have recently integrated Air into a repo at work, everything has been running fine until today on a fresh pull from the repository, everything in the same state as has been working perfectly but have hit a panic:

building...
***
2024-02-16 14:08:32 panic: runtime error: invalid memory address or nil pointer dereference
2024-02-16 14:08:32 [signal SIGSEGV: segmentation violation code=0x1 addr=0x90 pc=0x518949]
2024-02-16 14:08:32 
2024-02-16 14:08:32 goroutine 37 [running]:
2024-02-16 14:08:32 regexp.(*Regexp).doExecute(0x28?, {0x0?, 0x0?}, {0xc000126750?, 0xc0001266f5?, 0x4?}, {0x0?, 0x2d?}, 0x28?, 0x0, ...)
2024-02-16 14:08:32     /usr/local/go/src/regexp/exec.go:527 +0x89
2024-02-16 14:08:32 regexp.(*Regexp).doMatch(...)
2024-02-16 14:08:32     /usr/local/go/src/regexp/exec.go:514
2024-02-16 14:08:32 regexp.(*Regexp).Match(...)
2024-02-16 14:08:32     /usr/local/go/src/regexp/regexp.go:539
2024-02-16 14:08:32 github.com/cosmtrek/air/runner.(*Engine).isExcludeRegex(0xc000246000?, {0xc0001266f0, 0x2d})
2024-02-16 14:08:32     /go/pkg/mod/github.com/cosmtrek/air@v1.49.0/runner/util.go:149 +0xcb
2024-02-16 14:08:32 github.com/cosmtrek/air/runner.(*Engine).watchPath.func1()
2024-02-16 14:08:32     /go/pkg/mod/github.com/cosmtrek/air@v1.49.0/runner/engine.go:255 +0x3c9
2024-02-16 14:08:32 created by github.com/cosmtrek/air/runner.(*Engine).watchPath in goroutine 1
2024-02-16 14:08:32     /go/pkg/mod/github.com/cosmtrek/air@v1.49.0/runner/engine.go:222 +0x24e
2024-02-16 14:08:32 panic: runtime error: invalid memory address or nil pointer dereference
2024-02-16 14:08:32 [signal SIGSEGV: segmentation violation code=0x1 addr=0x90 pc=0x518949]
2024-02-16 14:08:32 
2024-02-16 14:08:32 goroutine 39 [running]:
2024-02-16 14:08:32 regexp.(*Regexp).doExecute(0x1b?, {0x0?, 0x0?}, {0xc0000bedc0?, 0xc0000beda5?, 0x4?}, {0x0?, 0x20?}, 0x1b?, 0x0, ...)
2024-02-16 14:08:32     /usr/local/go/src/regexp/exec.go:527 +0x89
2024-02-16 14:08:32 regexp.(*Regexp).doMatch(...)
2024-02-16 14:08:32     /usr/local/go/src/regexp/exec.go:514
2024-02-16 14:08:32 regexp.(*Regexp).Match(...)
2024-02-16 14:08:32     /usr/local/go/src/regexp/regexp.go:539
2024-02-16 14:08:32 github.com/cosmtrek/air/runner.(*Engine).isExcludeRegex(0xc000246000?, {0xc0000beda0, 0x20})
2024-02-16 14:08:32     /go/pkg/mod/github.com/cosmtrek/air@v1.49.0/runner/util.go:149 +0xcb
2024-02-16 14:08:32 github.com/cosmtrek/air/runner.(*Engine).watchPath.func1()
2024-02-16 14:08:32     /go/pkg/mod/github.com/cosmtrek/air@v1.49.0/runner/engine.go:255 +0x3c9
2024-02-16 14:08:32 created by github.com/cosmtrek/air/runner.(*Engine).watchPath in goroutine 1
2024-02-16 14:08:32     /go/pkg/mod/github.com/cosmtrek/air@v1.49.0/runner/engine.go:222 +0x24e
2024-02-16 14:08:32 panic: runtime error: invalid memory address or nil pointer dereference
2024-02-16 14:08:32 [signal SIGSEGV: segmentation violation code=0x1 addr=0x90 pc=0x518949]
2024-02-16 14:08:32 
2024-02-16 14:08:32 goroutine 38 [running]:
2024-02-16 14:08:32 regexp.(*Regexp).doExecute(0x28?, {0x0?, 0x0?}, {0xc0002598c0?, 0xc000259865?, 0x4?}, {0x0?, 0x2d?}, 0x28?, 0x0, ...)
2024-02-16 14:08:32     /usr/local/go/src/regexp/exec.go:527 +0x89
2024-02-16 14:08:32 regexp.(*Regexp).doMatch(...)
2024-02-16 14:08:32     /usr/local/go/src/regexp/exec.go:514
2024-02-16 14:08:32 regexp.(*Regexp).Match(...)
2024-02-16 14:08:32     /usr/local/go/src/regexp/regexp.go:539
2024-02-16 14:08:32 github.com/cosmtrek/air/runner.(*Engine).isExcludeRegex(0xc000246000?, {0xc000259860, 0x2d})
2024-02-16 14:08:32     /go/pkg/mod/github.com/cosmtrek/air@v1.49.0/runner/util.go:149 +0xcb
2024-02-16 14:08:32 github.com/cosmtrek/air/runner.(*Engine).watchPath.func1()
2024-02-16 14:08:32     /go/pkg/mod/github.com/cosmtrek/air@v1.49.0/runner/engine.go:255 +0x3c9
2024-02-16 14:08:32 created by github.com/cosmtrek/air/runner.(*Engine).watchPath in goroutine 1
2024-02-16 14:08:32     /go/pkg/mod/github.com/cosmtrek/air@v1.49.0/runner/engine.go:222 +0x24e

Simply re-running the container seemingly fixed the bug, so it seems like a one-off, however is something you probably would like to be aware of.