Skip to content

Don't crash when a file disappears#236

Open
erikdubbelboer wants to merge 1 commit intooxequa:masterfrom
erikdubbelboer:filegone
Open

Don't crash when a file disappears#236
erikdubbelboer wants to merge 1 commit intooxequa:masterfrom
erikdubbelboer:filegone

Conversation

@erikdubbelboer
Copy link

When a file disappears during filepath.Walk it will set err and info will be nil. If we continue our normal processing realize crashes with the following panic:

stat /go/src/github.com/erikdubbelboer/test/test.go: no such file or directory
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x82da1a]

goroutine 1285 [running]:
github.com/oxequa/realize/realize.(*Project).tools.func1(0x91a620, 0xc000129400, 0x99, 0xc000090a00, 0x0, 0x0, 0xc0003e64e0, 0xc0001e6210, 0xc0002761e0, 0xc0003e6480)
	/go/src/github.com/oxequa/realize/realize/projects.go:420 +0x1da
created by github.com/oxequa/realize/realize.(*Project).tools
	/go/src/github.com/oxequa/realize/realize/projects.go:415 +0x1fd

When a file disappears during filepath.Walk it will set err and info
will be nil. If we continue our normal processing realize crashes with
the following panic:

stat /go/src/github.com/erikdubbelboer/test/test.go: no such file or directory
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x82da1a]

goroutine 1285 [running]:
github.com/oxequa/realize/realize.(*Project).tools.func1(0x91a620, 0xc000129400, 0x99, 0xc000090a00, 0x0, 0x0, 0xc0003e64e0, 0xc0001e6210, 0xc0002761e0, 0xc0003e6480)
	/go/src/github.com/oxequa/realize/realize/projects.go:420 +0x1da
created by github.com/oxequa/realize/realize.(*Project).tools
	/go/src/github.com/oxequa/realize/realize/projects.go:415 +0x1fd
@cameracker
Copy link

Can we get this merged in? As it stands now this tool is barely usable because anytime a branch is switched it crashes.

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

Successfully merging this pull request may close these issues.

2 participants