Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sometimes air panics when ran #655

Open
MilkeeyCat opened this issue Sep 25, 2024 · 3 comments
Open

Sometimes air panics when ran #655

MilkeeyCat opened this issue Sep 25, 2024 · 3 comments

Comments

@MilkeeyCat
Copy link

Sometimes when I run command air I get such an error

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

goroutine 40 [running]:
regexp.(*Regexp).doExecute(0xc00032be00?, {0x0?, 0x0?}, {0xc000380050?, 0x7fcd05?, 0xc00032be26?}, {0x0?, 0xc00032be00?}, 0x4d?, 0x0, ...)
        /home/alex/Downloads/go/src/regexp/exec.go:527 +0x80
regexp.(*Regexp).doMatch(...)
        /home/alex/Downloads/go/src/regexp/exec.go:514
regexp.(*Regexp).Match(...)
        /home/alex/Downloads/go/src/regexp/regexp.go:537
github.com/cosmtrek/air/runner.(*Engine).isExcludeRegex(0xc0001d6000?, {0xc00032be00, 0x4d})
        /home/alex/go/pkg/mod/github.com/cosmtrek/[email protected]/runner/util.go:149 +0xcb
github.com/cosmtrek/air/runner.(*Engine).watchPath.func1()
        /home/alex/go/pkg/mod/github.com/cosmtrek/[email protected]/runner/engine.go:257 +0x3d3
created by github.com/cosmtrek/air/runner.(*Engine).watchPath in goroutine 1
        /home/alex/go/pkg/mod/github.com/cosmtrek/[email protected]/runner/engine.go:224 +0x23f

I had version 1.52.0 but the place where the error occurred doesn't seem to be updated since 1.52.0 version

OS: Linux

@cosmtrek
Copy link
Collaborator

@MilkeeyCat please provide more details to reproduce it

@MilkeeyCat
Copy link
Author

I don't have a way how to reproduce it, it just happens sometimes

@istyf
Copy link

istyf commented Nov 2, 2024

This seems to be the same issue as #530 that is reported on an even older version of air. It seems that the compiled regex is nil when it is dereferenced in regexp/exec.go:527, but it isn't immediately obvious what could have caused that when reading through the code higher up in the call stack ... This smells like some sort of memory issue ... (edit: or a race, see PR below)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants