Closed krisnova closed 7 years ago
That is bizarre. That that line would produce an mem address or nil pointer deref...wat?
You're on the latest gps master, right?
Latest GPS (less my PR your just merged)
kris-nova:gps kris$ git checkout master
Already on 'master'
Your branch is up-to-date with 'origin/master'.
kris-nova:gps kris$ git pull origin master
From github.com:kris-nova/gps
* branch master -> FETCH_HEAD
Already up-to-date.
kris-nova:gps kris$ git rev-parse HEAD
2fe10c61f5e68b06b1d2cf6aa7f9a08fab92f94b
kris-nova:gps kris$ go build -o gps example.go && chmod +x gps && mv gps ~/Workspace/kops && cd ~/Workspace/kops/ && ./gps
panic: runtime error: invalid memory address or nil pointer dereference
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0xb0 pc=0x1324c39]
goroutine 1 [running]:
github.com/sdboyer/gps.(*SourceMgr).Release(0x0)
/go/src/github.com/sdboyer/gps/source_manager.go:282 +0x29
panic(0x13a2e20, 0x15d2e20)
/usr/local/go/src/runtime/panic.go:489 +0x2cf
github.com/sdboyer/gps.(*SourceMgr).DeduceProjectRoot(0x0, 0xc42040fb81, 0x1d, 0x0, 0x0, 0x0, 0x0)
/go/src/github.com/sdboyer/gps/source_manager.go:493 +0x58
github.com/sdboyer/gps.(*bridge).DeduceProjectRoot(0xc420248540, 0xc42040fb81, 0x1d, 0x0, 0x0, 0x0, 0x0)
/go/src/github.com/sdboyer/gps/bridge.go:315 +0x79
github.com/sdboyer/gps.(*solver).intersectConstraintsWithImports(0xc4203ae000, 0x15f9440, 0x0, 0x0, 0xc420350000, 0x84, 0xb7, 0xc4201f3e00, 0xc4201f3ec0, 0xc4201f3ef0, ...)
/go/src/github.com/sdboyer/gps/solver.go:583 +0x71d
github.com/sdboyer/gps.(*solver).selectRoot(0xc4203ae000, 0xc4201f3e00, 0xc4201f3ec0)
/go/src/github.com/sdboyer/gps/solver.go:463 +0x2e1
github.com/sdboyer/gps.(*solver).Solve(0xc4203ae000, 0x1a, 0xc42000c0a4, 0x1a, 0xc420140a80)
/go/src/github.com/sdboyer/gps/solver.go:312 +0x6a
main.main()
/go/src/github.com/sdboyer/gps/example.go:46 +0x35d
kris-nova:kops kris$ rm -rf ~/Workspace/kops/.repocache/
kris-nova:kops kris$ cd -
/go/src/github.com/sdboyer/gps
kris-nova:gps kris$ go build -o gps example.go && chmod +x gps && mv gps ~/Workspace/kops && cd ~/Workspace/kops/ && ./gps
..working gps logs here..
Maybe it has something to do with kops? Not sure..
...so weird. I mean just so, so weird. I wonder if this is something odd related to defer
in main
packages?
In any case, I think we can fix just by using an ioutil.TempDir()
for the cache, rather than placing it in the current directory.
Ah so I was using a 1.8
release candidate.. I just flipped over to 1.7.5
kris-nova:gps kris$ git pull origin master
From github.com:kris-nova/gps
* branch master -> FETCH_HEAD
Already up-to-date.
kris-nova:gps kris$ git rev-parse HEAD
a04c90d985bb5980f22b6079a842e17c49f862d8
kris-nova:gps kris$ go version
go version go1.7.5 darwin/amd64
kris-nova:gps kris$ file ~/Workspace/kops/.repocache
/Users/kris/Workspace/kops/.repocache: directory
kris-nova:gps kris$ go build -o gps example.go && chmod +x gps && mv gps ~/Workspace/kops && cd ~/Workspace/kops/ && ./gps
.. working gps logs..
I pushed 8f8d2e5, which should sidestep the problem
Recieving this panic message when trying to run a gps example.go binary against an already processed repository. Looks like removing the
.repocache
directory solves the problem.Could we get a check in place so at least we aren't seg faulting when this happens?