Skip to content
This repository was archived by the owner on Sep 9, 2020. It is now read-only.

Panic on dep init #391

Closed
ryboe opened this issue Apr 16, 2017 · 3 comments
Closed

Panic on dep init #391

ryboe opened this issue Apr 16, 2017 · 3 comments

Comments

@ryboe
Copy link
Contributor

ryboe commented Apr 16, 2017

dep: Building dependency graph...
dep: Found import of "gopkg.in/yaml.v2", analyzing...
dep: Analyzing transitive imports...
dep: Analyzing "gopkg.in/yaml.v2"...
dep: Writing manifest and lock files.
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x1096ac8]

goroutine 8 [running]:
os.(*Process).signal(0x0, 0x166a7a0, 0x1664370, 0x0, 0x0)
	/usr/local/Cellar/go/1.8.1/libexec/src/os/exec_unix.go:56 +0x38
os.(*Process).Signal(0x0, 0x166a7a0, 0x1664370, 0x3, 0x3)
	/usr/local/Cellar/go/1.8.1/libexec/src/os/exec.go:121 +0x3f
os.(*Process).kill(0x0, 0x1319b1c, 0x18)
	/usr/local/Cellar/go/1.8.1/libexec/src/os/exec_posix.go:53 +0x43
os.(*Process).Kill(0x0, 0xc42027ca80, 0xc420039a30)
	/usr/local/Cellar/go/1.8.1/libexec/src/os/exec.go:106 +0x2b
github.com/golang/dep/vendor/github.com/sdboyer/gps.(*monitoredCmd).run(0xc42031ef90, 0x166c9e0, 0xc4201c3c70, 0x0, 0x0)
	/Users/ryan/go/src/github.com/golang/dep/vendor/github.com/sdboyer/gps/cmd.go:66 +0x344
github.com/golang/dep/vendor/github.com/sdboyer/gps.(*monitoredCmd).combinedOutput(0xc42031ef90, 0x166c9e0, 0xc4201c3c70, 0xc420326180, 0x4, 0x4, 0xc420091b80, 0x8)
	/Users/ryan/go/src/github.com/golang/dep/vendor/github.com/sdboyer/gps/cmd.go:83 +0x43
github.com/golang/dep/vendor/github.com/sdboyer/gps.runFromRepoDir(0x166c9e0, 0xc4201c3c70, 0x1670e40, 0xc420206000, 0x1487114, 0x3, 0xc420326180, 0x4, 0x4, 0x10, ...)
	/Users/ryan/go/src/github.com/golang/dep/vendor/github.com/sdboyer/gps/cmd.go:140 +0x248
github.com/golang/dep/vendor/github.com/sdboyer/gps.(*gitRepo).fetch(0xc420206000, 0x166c9e0, 0xc4201c3c70, 0xc4203247e0, 0xc420039cd0)
	/Users/ryan/go/src/github.com/golang/dep/vendor/github.com/sdboyer/gps/vcs_repo.go:55 +0x104
github.com/golang/dep/vendor/github.com/sdboyer/gps.(*baseVCSSource).updateLocal(0xc420204020, 0x166c9e0, 0xc4201c3c70, 0x0, 0x0)
	/Users/ryan/go/src/github.com/golang/dep/vendor/github.com/sdboyer/gps/vcs_source.go:75 +0x4e
github.com/golang/dep/vendor/github.com/sdboyer/gps.(*sourceGateway).require.func4(0x166c9e0, 0xc4201c3c70, 0x166c760, 0xc420184bc0)
	/Users/ryan/go/src/github.com/golang/dep/vendor/github.com/sdboyer/gps/source.go:468 +0x47
github.com/golang/dep/vendor/github.com/sdboyer/gps.(*supervisor).do(0xc4201732d0, 0x166c7a0, 0xc42001a7f8, 0x1487114, 0x3, 0x6, 0xc420039dd0, 0x1489dbb, 0xa)
	/Users/ryan/go/src/github.com/golang/dep/vendor/github.com/sdboyer/gps/source_manager.go:485 +0xd5
github.com/golang/dep/vendor/github.com/sdboyer/gps.(*sourceGateway).require(0xc4201d4000, 0x166c7a0, 0xc42001a7f8, 0xc400000015, 0xc42002cec0, 0x0, 0x0)
	/Users/ryan/go/src/github.com/golang/dep/vendor/github.com/sdboyer/gps/source.go:469 +0x367
github.com/golang/dep/vendor/github.com/sdboyer/gps.(*sourceGateway).syncLocal(0xc4201d4000, 0x166c7a0, 0xc42001a7f8, 0x0, 0x0)
	/Users/ryan/go/src/github.com/golang/dep/vendor/github.com/sdboyer/gps/source.go:211 +0xa3
github.com/golang/dep/vendor/github.com/sdboyer/gps.(*SourceMgr).SyncSourceFor(0xc42001f440, 0xc420133c41, 0x10, 0x0, 0x0, 0x0, 0xc42001f4a0)
	/Users/ryan/go/src/github.com/golang/dep/vendor/github.com/sdboyer/gps/source_manager.go:404 +0xda
main.getProjectData.func1(0xc420133c41, 0x10, 0xc42001f440)
	/Users/ryan/go/src/github.com/golang/dep/cmd/dep/init.go:228 +0x6c
created by main.getProjectData
	/Users/ryan/go/src/github.com/golang/dep/cmd/dep/init.go:253 +0xab5

I think this is a different bug than #351 because it bubbles up from the source_manager.go not solver.go. Also, it doesn't occur with the Apr 12th version of dep.

@sdboyer
Copy link
Member

sdboyer commented Apr 16, 2017

Yeah, definitely different. That's a call that should be surrounded by a nil check. It doesn't happen reliably, right?

In any case, easy fix - thanks for the report!

sdboyer added a commit to sdboyer/gps that referenced this issue Apr 16, 2017
A bad interleaving could (and has - golang/dep#391)
cause the context cancellation select branch to run before the normal
process termination branch.
sdboyer added a commit to sdboyer/gps that referenced this issue Apr 16, 2017
A bad interleaving could (and has - golang/dep#391) cause the context
cancellation select branch to run before the normal process termination
branch.
@sdboyer
Copy link
Member

sdboyer commented Apr 17, 2017

(now fixed)

@sdboyer sdboyer closed this as completed Apr 17, 2017
@ryboe
Copy link
Contributor Author

ryboe commented Apr 18, 2017

I can confirm this is fixed for me. Thanks for fixing it so quickly! 🥇

krisnova pushed a commit to krisnova/dep that referenced this issue Apr 21, 2017
A bad interleaving could (and has - golang#391) cause the context
cancellation select branch to run before the normal process termination
branch.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants