Skip to content

all: 'go vet std cmd' no longer passes #37030

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

Closed
josharian opened this issue Feb 4, 2020 · 7 comments
Closed

all: 'go vet std cmd' no longer passes #37030

josharian opened this issue Feb 4, 2020 · 7 comments
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. release-blocker
Milestone

Comments

@josharian
Copy link
Contributor

Using Go 1.13.7, go vet std cmd passes cleanly. Using tip, it fails.

This is a regression, so I'm tentatively marking as release-blocker.

$ go-13
$ go vet std cmd
$ go-tip
$ go vet std cmd 
# sync/atomic
sync/atomic/value.go:59:44: possible misuse of unsafe.Pointer
# runtime/internal/atomic_test
runtime/internal/atomic/atomic_test.go:94:7: possible misuse of unsafe.Pointer
# strings
strings/builder.go:30:9: possible misuse of unsafe.Pointer
# sync/atomic_test
sync/atomic/atomic_test.go:168:26: possible misuse of unsafe.Pointer
sync/atomic/atomic_test.go:460:9: possible misuse of unsafe.Pointer
sync/atomic/atomic_test.go:461:35: possible misuse of unsafe.Pointer
sync/atomic/atomic_test.go:461:56: possible misuse of unsafe.Pointer
sync/atomic/atomic_test.go:464:13: possible misuse of unsafe.Pointer
sync/atomic/atomic_test.go:467:9: possible misuse of unsafe.Pointer
sync/atomic/atomic_test.go:468:34: possible misuse of unsafe.Pointer
sync/atomic/atomic_test.go:468:55: possible misuse of unsafe.Pointer
sync/atomic/atomic_test.go:471:13: possible misuse of unsafe.Pointer
sync/atomic/atomic_test.go:733:7: possible misuse of unsafe.Pointer
sync/atomic/atomic_test.go:1169:21: possible misuse of unsafe.Pointer
# runtime
runtime/alg.go:56:22: possible misuse of unsafe.Pointer
runtime/atomic_pointer.go:63:9: possible misuse of unsafe.Pointer
runtime/cgocall.go:200:13: possible misuse of unsafe.Pointer
runtime/cgocall.go:282:16: possible misuse of unsafe.Pointer
runtime/cgocall.go:287:16: possible misuse of unsafe.Pointer
runtime/cgocall.go:292:17: possible misuse of unsafe.Pointer
runtime/cgocall.go:295:16: possible misuse of unsafe.Pointer
runtime/cgocall.go:298:16: possible misuse of unsafe.Pointer
runtime/cgocall.go:315:16: possible misuse of unsafe.Pointer
runtime/cgocall.go:319:16: possible misuse of unsafe.Pointer
runtime/cgocall.go:323:16: possible misuse of unsafe.Pointer
runtime/cgocall.go:360:27: possible misuse of unsafe.Pointer
runtime/cgocall.go:362:27: possible misuse of unsafe.Pointer
runtime/cgocall.go:612:62: possible misuse of unsafe.Pointer
runtime/cgocheck.go:26:21: possible misuse of unsafe.Pointer
runtime/debuglog.go:64:21: possible misuse of unsafe.Pointer
runtime/debuglog.go:86:27: possible misuse of unsafe.Pointer
runtime/debuglog.go:658:9: possible misuse of unsafe.Pointer
runtime/debuglog.go:694:20: possible misuse of unsafe.Pointer
runtime/heapdump.go:219:25: possible misuse of unsafe.Pointer
runtime/heapdump.go:275:15: possible misuse of unsafe.Pointer
runtime/heapdump.go:320:22: possible misuse of unsafe.Pointer
runtime/heapdump.go:378:27: possible misuse of unsafe.Pointer
runtime/heapdump.go:417:25: possible misuse of unsafe.Pointer
runtime/heapdump.go:427:15: possible misuse of unsafe.Pointer
runtime/heapdump.go:433:15: possible misuse of unsafe.Pointer
runtime/heapdump.go:445:10: possible misuse of unsafe.Pointer
runtime/heapdump.go:482:12: possible misuse of unsafe.Pointer
runtime/lfstack_64bit.go:52:20: possible misuse of unsafe.Pointer
runtime/lfstack_64bit.go:55:20: possible misuse of unsafe.Pointer
runtime/lfstack_64bit.go:57:19: possible misuse of unsafe.Pointer
runtime/lock_sema.go:153:19: possible misuse of unsafe.Pointer
runtime/malloc.go:593:33: possible misuse of unsafe.Pointer
runtime/malloc.go:640:19: possible misuse of unsafe.Pointer
runtime/malloc.go:793:10: possible misuse of unsafe.Pointer
runtime/malloc.go:799:11: possible misuse of unsafe.Pointer
runtime/malloc.go:801:20: possible misuse of unsafe.Pointer
runtime/malloc.go:815:11: possible misuse of unsafe.Pointer
runtime/malloc.go:819:12: possible misuse of unsafe.Pointer
runtime/malloc.go:821:10: possible misuse of unsafe.Pointer
runtime/malloc.go:1000:9: possible misuse of unsafe.Pointer
runtime/malloc.go:1013:8: possible misuse of unsafe.Pointer
runtime/malloc.go:1037:8: possible misuse of unsafe.Pointer
runtime/malloc.go:1039:26: possible misuse of unsafe.Pointer
runtime/malloc.go:1050:7: possible misuse of unsafe.Pointer
runtime/malloc.go:1373:23: possible misuse of unsafe.Pointer
runtime/malloc.go:1400:10: possible misuse of unsafe.Pointer
runtime/malloc.go:1401:11: possible misuse of unsafe.Pointer
runtime/malloc.go:1404:9: possible misuse of unsafe.Pointer
runtime/mbitmap.go:498:21: possible misuse of unsafe.Pointer
runtime/mbitmap.go:646:24: possible misuse of unsafe.Pointer
runtime/mbitmap.go:656:24: possible misuse of unsafe.Pointer
runtime/mbitmap.go:657:24: possible misuse of unsafe.Pointer
runtime/mbitmap.go:687:23: possible misuse of unsafe.Pointer
runtime/mbitmap.go:721:23: possible misuse of unsafe.Pointer
runtime/mbitmap.go:727:24: possible misuse of unsafe.Pointer
runtime/mbitmap.go:780:23: possible misuse of unsafe.Pointer
runtime/mbitmap.go:781:23: possible misuse of unsafe.Pointer
runtime/mbitmap.go:1039:21: possible misuse of unsafe.Pointer
runtime/mbitmap.go:1379:19: possible misuse of unsafe.Pointer
runtime/mbitmap.go:1436:24: possible misuse of unsafe.Pointer
runtime/mbitmap.go:1925:40: possible misuse of unsafe.Pointer
runtime/mcache.go:74:19: possible misuse of unsafe.Pointer
runtime/mfixalloc.go:84:7: possible misuse of unsafe.Pointer
runtime/mgcmark.go:814:21: possible misuse of unsafe.Pointer
runtime/mgcmark.go:1168:22: possible misuse of unsafe.Pointer
runtime/mgcmark.go:1260:22: possible misuse of unsafe.Pointer
runtime/mgcmark.go:1304:23: possible misuse of unsafe.Pointer
runtime/mgcmark.go:1344:22: possible misuse of unsafe.Pointer
runtime/mgcmark.go:1502:55: possible misuse of unsafe.Pointer
runtime/mgcscavenge.go:588:12: possible misuse of unsafe.Pointer
runtime/mgcsweep.go:278:21: possible misuse of unsafe.Pointer
runtime/mgcsweep.go:302:16: possible misuse of unsafe.Pointer
runtime/mgcsweep.go:305:18: possible misuse of unsafe.Pointer
runtime/mgcsweep.go:308:15: possible misuse of unsafe.Pointer
runtime/mgcsweep.go:311:15: possible misuse of unsafe.Pointer
runtime/mgcsweep.go:387:13: possible misuse of unsafe.Pointer
runtime/mgcwork.go:453:23: possible misuse of unsafe.Pointer
runtime/mheap.go:876:25: possible misuse of unsafe.Pointer
runtime/mheap.go:1229:11: possible misuse of unsafe.Pointer
runtime/mheap.go:1353:12: possible misuse of unsafe.Pointer
runtime/mpagealloc_64bit.go:177:10: possible misuse of unsafe.Pointer
runtime/mpagealloc_64bit.go:178:11: possible misuse of unsafe.Pointer
runtime/mwbbuf.go:151:21: possible misuse of unsafe.Pointer
runtime/netpoll.go:453:16: possible misuse of unsafe.Pointer
runtime/os_darwin.go:18:10: possible misuse of unsafe.Pointer
runtime/os_darwin.go:180:9: possible misuse of unsafe.Pointer
runtime/panic.go:244:43: possible misuse of unsafe.Pointer
runtime/panic.go:246:25: possible misuse of unsafe.Pointer
runtime/panic.go:594:42: possible misuse of unsafe.Pointer
runtime/panic.go:626:45: possible misuse of unsafe.Pointer
runtime/panic.go:716:8: possible misuse of unsafe.Pointer
runtime/panic.go:820:25: possible misuse of unsafe.Pointer
runtime/panic.go:836:27: possible misuse of unsafe.Pointer
runtime/panic.go:847:5: possible misuse of unsafe.Pointer
runtime/panic.go:851:13: possible misuse of unsafe.Pointer
runtime/panic.go:875:12: possible misuse of unsafe.Pointer
runtime/panic.go:877:10: possible misuse of unsafe.Pointer
runtime/panic.go:927:42: possible misuse of unsafe.Pointer
runtime/panic.go:972:13: possible misuse of unsafe.Pointer
runtime/panic.go:987:9: possible misuse of unsafe.Pointer
runtime/plugin.go:81:29: possible misuse of unsafe.Pointer
runtime/plugin.go:82:17: possible misuse of unsafe.Pointer
runtime/print.go:297:22: possible misuse of unsafe.Pointer
runtime/proc.go:1661:16: possible misuse of unsafe.Pointer
runtime/proc.go:1743:11: possible misuse of unsafe.Pointer
runtime/proc.go:3364:15: possible misuse of unsafe.Pointer
runtime/proc.go:3428:15: possible misuse of unsafe.Pointer
runtime/proc.go:3433:11: possible misuse of unsafe.Pointer
runtime/proc.go:3597:15: possible misuse of unsafe.Pointer
runtime/proc.go:3600:15: possible misuse of unsafe.Pointer
runtime/runtime1.go:470:31: possible misuse of unsafe.Pointer
runtime/runtime1.go:473:31: possible misuse of unsafe.Pointer
runtime/runtime2.go:259:43: possible misuse of unsafe.Pointer
runtime/runtime2.go:280:43: possible misuse of unsafe.Pointer
runtime/runtime2.go:297:43: possible misuse of unsafe.Pointer
runtime/signal_amd64.go:53:20: possible misuse of unsafe.Pointer
runtime/signal_amd64.go:68:44: possible misuse of unsafe.Pointer
runtime/signal_amd64.go:84:14: possible misuse of unsafe.Pointer
runtime/signal_darwin_amd64.go:66:22: possible misuse of unsafe.Pointer
runtime/signal_unix.go:383:18: possible misuse of unsafe.Pointer
runtime/signal_unix.go:888:15: possible misuse of unsafe.Pointer
runtime/stack.go:378:7: possible misuse of unsafe.Pointer
runtime/stack.go:401:7: possible misuse of unsafe.Pointer
runtime/stack.go:424:7: possible misuse of unsafe.Pointer
runtime/stack.go:607:28: possible misuse of unsafe.Pointer
runtime/stack.go:607:47: possible misuse of unsafe.Pointer
runtime/stack.go:641:18: possible misuse of unsafe.Pointer
runtime/stack.go:657:22: possible misuse of unsafe.Pointer
runtime/stack.go:664:26: possible misuse of unsafe.Pointer
runtime/stack.go:672:18: possible misuse of unsafe.Pointer
runtime/stack.go:697:22: possible misuse of unsafe.Pointer
runtime/stack.go:701:29: possible misuse of unsafe.Pointer
runtime/stack.go:765:12: possible misuse of unsafe.Pointer
runtime/stack.go:808:11: possible misuse of unsafe.Pointer
runtime/stack.go:808:35: possible misuse of unsafe.Pointer
runtime/stack.go:869:10: possible misuse of unsafe.Pointer
runtime/stack.go:869:40: possible misuse of unsafe.Pointer
runtime/stack.go:1061:8: possible misuse of unsafe.Pointer
runtime/stack.go:1063:8: possible misuse of unsafe.Pointer
runtime/stubs.go:145:9: possible misuse of unsafe.Pointer
runtime/symtab.go:379:46: possible misuse of unsafe.Pointer
runtime/symtab.go:380:45: possible misuse of unsafe.Pointer
runtime/symtab.go:591:31: possible misuse of unsafe.Pointer
runtime/sys_darwin.go:64:11: possible misuse of unsafe.Pointer
runtime/sys_darwin.go:75:11: possible misuse of unsafe.Pointer
runtime/sys_darwin.go:86:11: possible misuse of unsafe.Pointer
runtime/sys_darwin.go:97:11: possible misuse of unsafe.Pointer
runtime/sys_darwin.go:107:11: possible misuse of unsafe.Pointer
runtime/sys_darwin.go:115:11: possible misuse of unsafe.Pointer
runtime/sys_darwin.go:125:18: possible misuse of unsafe.Pointer
runtime/sys_darwin.go:132:18: possible misuse of unsafe.Pointer
runtime/sys_darwin.go:139:18: possible misuse of unsafe.Pointer
runtime/sys_darwin.go:146:18: possible misuse of unsafe.Pointer
runtime/sys_darwin.go:153:11: possible misuse of unsafe.Pointer
runtime/sys_darwin.go:160:11: possible misuse of unsafe.Pointer
runtime/sys_darwin.go:168:11: possible misuse of unsafe.Pointer
runtime/sys_darwin.go:186:11: possible misuse of unsafe.Pointer
runtime/sys_darwin.go:194:11: possible misuse of unsafe.Pointer
runtime/sys_darwin.go:201:11: possible misuse of unsafe.Pointer
runtime/sys_darwin.go:208:18: possible misuse of unsafe.Pointer
runtime/sys_darwin.go:214:19: possible misuse of unsafe.Pointer
runtime/sys_darwin.go:222:18: possible misuse of unsafe.Pointer
runtime/sys_darwin.go:232:11: possible misuse of unsafe.Pointer
runtime/sys_darwin.go:239:11: possible misuse of unsafe.Pointer
runtime/sys_darwin.go:246:18: possible misuse of unsafe.Pointer
runtime/sys_darwin.go:253:18: possible misuse of unsafe.Pointer
runtime/sys_darwin.go:264:11: possible misuse of unsafe.Pointer
runtime/sys_darwin.go:283:11: possible misuse of unsafe.Pointer
runtime/sys_darwin.go:291:11: possible misuse of unsafe.Pointer
runtime/sys_darwin.go:298:11: possible misuse of unsafe.Pointer
runtime/sys_darwin.go:312:11: possible misuse of unsafe.Pointer
runtime/sys_darwin.go:319:11: possible misuse of unsafe.Pointer
runtime/sys_darwin.go:326:11: possible misuse of unsafe.Pointer
runtime/sys_darwin.go:333:18: possible misuse of unsafe.Pointer
runtime/sys_darwin.go:340:18: possible misuse of unsafe.Pointer
runtime/sys_darwin.go:347:16: possible misuse of unsafe.Pointer
runtime/sys_darwin.go:355:18: possible misuse of unsafe.Pointer
runtime/sys_darwin.go:362:18: possible misuse of unsafe.Pointer
runtime/sys_darwin.go:369:18: possible misuse of unsafe.Pointer
runtime/sys_darwin.go:376:18: possible misuse of unsafe.Pointer
runtime/sys_darwin.go:383:18: possible misuse of unsafe.Pointer
runtime/sys_darwin.go:390:18: possible misuse of unsafe.Pointer
runtime/sys_darwin.go:397:18: possible misuse of unsafe.Pointer
runtime/sys_darwin.go:404:18: possible misuse of unsafe.Pointer
runtime/sys_darwin_64.go:17:11: possible misuse of unsafe.Pointer
runtime/sys_x86.go:20:15: possible misuse of unsafe.Pointer
runtime/sys_x86.go:23:14: possible misuse of unsafe.Pointer
runtime/trace.go:171:62: possible misuse of unsafe.Pointer
runtime/trace.go:348:11: possible misuse of unsafe.Pointer
runtime/trace.go:755:66: possible misuse of unsafe.Pointer
runtime/trace.go:920:82: possible misuse of unsafe.Pointer
runtime/traceback.go:156:27: possible misuse of unsafe.Pointer
runtime/traceback.go:159:39: possible misuse of unsafe.Pointer
runtime/traceback.go:246:29: possible misuse of unsafe.Pointer
runtime/traceback.go:251:41: possible misuse of unsafe.Pointer
runtime/traceback.go:439:29: possible misuse of unsafe.Pointer
runtime/traceback.go:496:21: possible misuse of unsafe.Pointer
runtime/traceback.go:612:34: possible misuse of unsafe.Pointer
runtime/traceback.go:616:25: possible misuse of unsafe.Pointer
runtime/type.go:197:24: possible misuse of unsafe.Pointer
runtime/type.go:252:18: possible misuse of unsafe.Pointer
runtime/type.go:309:9: possible misuse of unsafe.Pointer
runtime/type.go:533:18: possible misuse of unsafe.Pointer
runtime/type.go:555:19: possible misuse of unsafe.Pointer
runtime/export_test.go:476:13: possible misuse of unsafe.Pointer
# runtime_test
runtime/runtime_test.go:214:16: possible misuse of unsafe.Pointer
@josharian josharian added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. release-blocker labels Feb 4, 2020
@josharian josharian added this to the Go1.14 milestone Feb 4, 2020
@mvdan
Copy link
Member

mvdan commented Feb 5, 2020

cc @mdempsky @randall77 @aclements from https://go-review.googlesource.com/c/go/+/162237

@dmitshur
Copy link
Contributor

dmitshur commented Feb 5, 2020

Thanks for catching this @josharian. I can reproduce on master.

There are two parts to this. We should fix the vet issues.

Additionally, we used to have a misc-vet-vetall builder. As far as I can tell, it was transformed into a test that runs by all.bash in issue #31916. However, all.bash didn't catch this regression. I filed issue #37053 to investigate why the builders didn't catch this and fix them.

@aclements
Copy link
Member

@mvdan, I may be missing something, but why do you think this is related to https://go-review.googlesource.com/c/go/+/162237?

A lot of the lines it's flagging haven't changed in years... Why is it flagging them now?

@mvdan
Copy link
Member

mvdan commented Feb 5, 2020

@aclements my bad - I got confused between the compiler's -d=checkptr flag, enabled by -race, and vet's unsafeptr analysis, which has existed for much longer and seems to serve a similar purpose.

The code to decide what vet analyzers are enabled by default seems to have changed a couple of times around December, such as in https://go-review.googlesource.com/c/go/+/210937. Perhaps a regression was introduced around then.

@bcmills
Copy link
Contributor

bcmills commented Feb 5, 2020

This may be related to the fix for #35837.

I'm not sure that it is wrong, though: invoking go vet std explicitly should run all of the default go vet checks on all of the packages in std.

@bcmills
Copy link
Contributor

bcmills commented Feb 5, 2020

Yeah, this is probably from CL 210937. We had not been setting VetExplicit at all for the vet subcommand, and I changed it to always be set.

@bcmills bcmills self-assigned this Feb 5, 2020
@gopherbot
Copy link
Contributor

Change https://golang.org/cl/217897 mentions this issue: cmd/go/internal/vet: only set work.VetExplicit if the list of explicit flags is non-empty

@golang golang locked and limited conversation to collaborators Feb 4, 2021
@rsc rsc unassigned bcmills Jun 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. release-blocker
Projects
None yet
Development

No branches or pull requests

6 participants