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

Dep ensure panics, but works when -v is included #1930

Closed
zezha-msft opened this issue Jul 11, 2018 · 3 comments
Closed

Dep ensure panics, but works when -v is included #1930

zezha-msft opened this issue Jul 11, 2018 · 3 comments

Comments

@zezha-msft
Copy link

What version of dep are you using (dep version)?

installed via go get: v0.4.1-246-g5a7960a4

What dep command did you run?

Our CI started failing out of the blue, and we were able to reproduce the same problem locally on a Mac after doing a: go get -u github.com/golang/dep/cmd/dep.

dep ensure fails with the following error:

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

goroutine 1 [running]:
log.(*Logger).Output(0x0, 0x2, 0xc42035d090, 0x44, 0x0, 0x0)
	/usr/local/Cellar/go/1.10/libexec/src/log/log.go:153 +0x47
log.(*Logger).Printf(0x0, 0x158ab9a, 0x17, 0xc420560fd8, 0x5, 0x5)
	/usr/local/Cellar/go/1.10/libexec/src/log/log.go:179 +0x7e
github.com/golang/dep.(*DeltaWriter).Write(0xc4203a9b00, 0xc42002c0f4, 0x4b, 0x15fa1c0, 0xc4200c6cc0, 0xc4204b4601, 0x0, 0x0, 0x15f21e0)
	/Users/Zed/Documents/go_workspace/src/github.com/golang/dep/txn_writer.go:540 +0xfc9
main.(*ensureCommand).runDefault(0xc42019f940, 0xc4200da980, 0xc420157800, 0x0, 0x0, 0xc4200fc090, 0x15fa1c0, 0xc4200c6cc0, 0xc42002c0f4, 0x4b, ...)
	/Users/Zed/Documents/go_workspace/src/github.com/golang/dep/cmd/dep/ensure.go:318 +0x94a
main.(*ensureCommand).Run(0xc42019f940, 0xc4200da980, 0xc420157800, 0x0, 0x0, 0x0, 0x0)
	/Users/Zed/Documents/go_workspace/src/github.com/golang/dep/cmd/dep/ensure.go:218 +0x865
main.(*Config).Run(0xc4200c6f60, 0x0)
	/Users/Zed/Documents/go_workspace/src/github.com/golang/dep/cmd/dep/main.go:243 +0x1114
main.main()
	/Users/Zed/Documents/go_workspace/src/github.com/golang/dep/cmd/dep/main.go:70 +0x52c

dep ensure -v output:

Gopkg.lock is out of sync with Gopkg.toml and project code:
	github.com/spf13/viper is missing from input-imports
	gopkg.in/check.v1 is missing from input-imports
	github.com/Azure/azure-pipeline-go/pipeline is missing from input-imports
	github.com/Azure/azure-storage-blob-go/2016-05-31/azblob is missing from input-imports
	github.com/Azure/azure-storage-blob-go/2017-07-29/azblob is missing from input-imports
	github.com/Azure/azure-storage-file-go/2017-07-29/azfile is missing from input-imports
	github.com/mitchellh/go-homedir is missing from input-imports
	github.com/spf13/cobra is missing from input-imports
	github.com/Azure/azure-storage-file-go is at 0.1.0, which is not allowed by constraint master

Root project is "github.com/Azure/azure-storage-azcopy"
 7 transitively valid internal packages
 8 external packages imported from 7 projects
(0)   ✓ select (root)
(1)	? attempt github.com/Azure/azure-pipeline-go with 1 pkgs; at least 1 versions to try
(1)	    try github.com/Azure/azure-pipeline-go@0.1.6
(1)	✓ select github.com/Azure/azure-pipeline-go@0.1.6 w/1 pkgs
(2)	? attempt github.com/Azure/azure-storage-blob-go with 2 pkgs; at least 1 versions to try
(2)	    try github.com/Azure/azure-storage-blob-go@0.1.4
(2)	✓ select github.com/Azure/azure-storage-blob-go@0.1.4 w/2 pkgs
(3)	? attempt github.com/Azure/azure-storage-file-go with 1 pkgs; at least 1 versions to try
(3)	    try github.com/Azure/azure-storage-file-go@0.1.0
(4)	✗   github.com/Azure/azure-storage-file-go@0.1.0 not allowed by constraint master:
(4)	    master from (root)
(3)	    try github.com/Azure/azure-storage-file-go@0.2.0
(4)	✗   github.com/Azure/azure-storage-file-go@0.2.0 not allowed by constraint master:
(4)	    master from (root)
(3)	    try github.com/Azure/azure-storage-file-go@master
(4)	✗   github.com/Azure/azure-storage-file-go@master depends on github.com/Azure/azure-pipeline-go with ^0.1.7, but that's already selected at 0.1.6
(3)	    try github.com/Azure/azure-storage-file-go@dev
(4)	✗   github.com/Azure/azure-storage-file-go@dev not allowed by constraint master:
(4)	    master from (root)
(3)	  ← no more versions of github.com/Azure/azure-storage-file-go to try; begin backtrack
(2)	← backtrack: no more versions of github.com/Azure/azure-storage-blob-go to try
(1)	← backtrack: no more versions of github.com/Azure/azure-pipeline-go to try
(1)	  ? continue github.com/Azure/azure-pipeline-go with 1 pkgs; 9 more versions to try
(1)	    try github.com/Azure/azure-pipeline-go@0.1.7
(1)	✓ select github.com/Azure/azure-pipeline-go@0.1.7 w/1 pkgs
(2)	? attempt github.com/spf13/viper with 1 pkgs; at least 1 versions to try
(2)	    try github.com/spf13/viper@v1.0.2
(2)	✓ select github.com/spf13/viper@v1.0.2 w/1 pkgs
(3)	? attempt github.com/Azure/azure-storage-blob-go with 2 pkgs; at least 1 versions to try
(3)	    try github.com/Azure/azure-storage-blob-go@0.1.4
(3)	✓ select github.com/Azure/azure-storage-blob-go@0.1.4 w/2 pkgs
(4)	? attempt github.com/pelletier/go-toml with 1 pkgs; at least 1 versions to try
(4)	    try github.com/pelletier/go-toml@v1.1.0
(4)	✓ select github.com/pelletier/go-toml@v1.1.0 w/1 pkgs
(5)	? attempt github.com/fsnotify/fsnotify with 1 pkgs; at least 1 versions to try
(5)	    try github.com/fsnotify/fsnotify@v1.4.7
(5)	✓ select github.com/fsnotify/fsnotify@v1.4.7 w/1 pkgs
(6)	? attempt github.com/spf13/afero with 1 pkgs; at least 1 versions to try
(6)	    try github.com/spf13/afero@v1.1.0
(6)	✓ select github.com/spf13/afero@v1.1.0 w/2 pkgs
(7)	? attempt github.com/Azure/azure-storage-file-go with 1 pkgs; at least 1 versions to try
(7)	    try github.com/Azure/azure-storage-file-go@0.1.0
(8)	✗   github.com/Azure/azure-storage-file-go@0.1.0 not allowed by constraint master:
(8)	    master from (root)
(7)	    try github.com/Azure/azure-storage-file-go@0.2.0
(8)	✗   github.com/Azure/azure-storage-file-go@0.2.0 not allowed by constraint master:
(8)	    master from (root)
(7)	    try github.com/Azure/azure-storage-file-go@master
(7)	✓ select github.com/Azure/azure-storage-file-go@master w/1 pkgs
(8)	? attempt github.com/hashicorp/hcl with 2 pkgs; at least 1 versions to try
(8)	    try github.com/hashicorp/hcl@master
(8)	✓ select github.com/hashicorp/hcl@master w/10 pkgs
(9)	? attempt github.com/mitchellh/mapstructure with 1 pkgs; at least 1 versions to try
(9)	    try github.com/mitchellh/mapstructure@master
(9)	✓ select github.com/mitchellh/mapstructure@master w/1 pkgs
(10)  ? attempt github.com/spf13/cobra with 1 pkgs; at least 1 versions to try
(10)      try github.com/spf13/cobra@v0.0.3
(10)  ✓ select github.com/spf13/cobra@v0.0.3 w/1 pkgs
(11)  ? attempt github.com/inconshreveable/mousetrap with 1 pkgs; at least 1 versions to try
(11)      try github.com/inconshreveable/mousetrap@v1.0
(11)  ✓ select github.com/inconshreveable/mousetrap@v1.0 w/1 pkgs
(12)  ? attempt golang.org/x/sys with 1 pkgs; at least 1 versions to try
(12)      try golang.org/x/sys@master
(12)  ✓ select golang.org/x/sys@master w/1 pkgs
(13)  ? attempt gopkg.in/yaml.v2 with 1 pkgs; at least 1 versions to try
(13)      try gopkg.in/yaml.v2@v2.2.1
(13)  ✓ select gopkg.in/yaml.v2@v2.2.1 w/1 pkgs
(14)  ? attempt github.com/mitchellh/go-homedir with 1 pkgs; at least 1 versions to try
(14)      try github.com/mitchellh/go-homedir@master
(14)  ✓ select github.com/mitchellh/go-homedir@master w/1 pkgs
(15)  ? attempt github.com/spf13/jwalterweatherman with 1 pkgs; at least 1 versions to try
(15)      try github.com/spf13/jwalterweatherman@master
(15)  ✓ select github.com/spf13/jwalterweatherman@master w/1 pkgs
(16)  ? attempt github.com/spf13/cast with 1 pkgs; at least 1 versions to try
(16)      try github.com/spf13/cast@v1.2.0
(16)  ✓ select github.com/spf13/cast@v1.2.0 w/1 pkgs
(17)  ? attempt github.com/spf13/pflag with 1 pkgs; at least 1 versions to try
(17)      try github.com/spf13/pflag@v1.0.1
(17)  ✓ select github.com/spf13/pflag@v1.0.1 w/1 pkgs
(18)  ? attempt gopkg.in/check.v1 with 1 pkgs; at least 1 versions to try
(18)      try gopkg.in/check.v1@v1
(18)  ✓ select gopkg.in/check.v1@v1 w/1 pkgs
(19)  ? attempt golang.org/x/text with 2 pkgs; at least 1 versions to try
(19)      try golang.org/x/text@v0.3.0
(19)  ✓ select golang.org/x/text@v0.3.0 w/6 pkgs
(20)  ? attempt github.com/magiconair/properties with 1 pkgs; at least 1 versions to try
(20)      try github.com/magiconair/properties@v1.7.6
(20)  ✓ select github.com/magiconair/properties@v1.7.6 w/1 pkgs
  ✓ found solution with 36 packages from 20 projects

Solver wall times by segment:
              b-gmal: 4.488331633s
         b-list-pkgs: 1.516646608s
     b-list-versions: 350.934275ms
     b-source-exists:  68.689941ms
             satisfy:   8.878117ms
         select-atom:   3.648319ms
            new-atom:   1.276724ms
         select-root:    505.515µs
               other:    196.535µs
  b-deduce-proj-root:    142.692µs
            unselect:    115.668µs
           backtrack:     71.365µs

  TOTAL: 6.439437392s

(1/20) Wrote github.com/fsnotify/fsnotify@v1.4.7: prune options changed ( -> UT)
(2/20) Wrote github.com/mitchellh/go-homedir@master: prune options changed ( -> UT)
(3/20) Wrote github.com/spf13/cobra@v0.0.3: prune options changed ( -> UT)
(4/20) Wrote gopkg.in/check.v1@v1: prune options changed ( -> UT)
(5/20) Wrote gopkg.in/yaml.v2@v2.2.1: prune options changed ( -> UT)
(6/20) Wrote github.com/spf13/jwalterweatherman@master: prune options changed ( -> UT)
(7/20) Wrote github.com/pelletier/go-toml@v1.1.0: prune options changed ( -> UT)
(8/20) Wrote github.com/inconshreveable/mousetrap@v1.0: prune options changed ( -> UT)
(9/20) Wrote github.com/spf13/afero@v1.1.0: prune options changed ( -> UT)
(10/20) Wrote github.com/Azure/azure-storage-file-go@master: prune options changed ( -> UT)
(11/20) Wrote github.com/spf13/viper@v1.0.2: prune options changed ( -> UT)
(12/20) Wrote github.com/Azure/azure-pipeline-go@0.1.7: prune options changed ( -> UT)
(13/20) Wrote github.com/magiconair/properties@v1.7.6: prune options changed ( -> UT)
(14/20) Wrote github.com/mitchellh/mapstructure@master: prune options changed ( -> UT)
(15/20) Wrote github.com/Azure/azure-storage-blob-go@0.1.4: prune options changed ( -> UT)
(16/20) Wrote github.com/spf13/cast@v1.2.0: prune options changed ( -> UT)
(17/20) Wrote golang.org/x/text@v0.3.0: prune options changed ( -> UT)
(18/20) Wrote github.com/hashicorp/hcl@master: prune options changed ( -> UT)
(19/20) Wrote golang.org/x/sys@master: prune options changed ( -> UT)
(20/20) Wrote github.com/spf13/pflag@v1.0.1: prune options changed ( -> UT)

What did you expect to see?

It is really strange that -v makes a difference.

What did you see instead?

dep ensure should work like before.

@zezha-msft
Copy link
Author

zezha-msft commented Jul 11, 2018

By the way, I deleted the vendor folder before running both commands:
image

@sdboyer
Copy link
Member

sdboyer commented Jul 11, 2018

yeah, sorry, this was a bug in #1912 - didn't set loggers correctly when -v wasn't passed, and the tests missed it because they all override the logger in a way that masks the problem. It should be fixed now.

Note, though, that your CI may have a bumpy ride unless everyone else is also running the very latest of dep - #1912 also made significant changes to the way Gopkg.lock is structured. i'm aiming for an official release in the next couple days, but until then, you may want to use a released version instead of tip.

@sdboyer sdboyer closed this as completed Jul 11, 2018
@zezha-msft
Copy link
Author

Hi @sdboyer, thanks for the quick response!

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