Skip to content
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

run gops panic #159

Closed
raochq opened this issue Jan 10, 2022 · 3 comments
Closed

run gops panic #159

raochq opened this issue Jan 10, 2022 · 3 comments

Comments

@raochq
Copy link

raochq commented Jan 10, 2022

gops version: v0.3.22
go version: go1.17.5
os: macOS 12.1 , M1

 ~ gops
runtime: pipe failed with 1876242604
fatal error: runtime: pipe failed

goroutine 4 [running]:
runtime.throw({0x1008678ca, 0x14})
	/usr/local/go/src/runtime/panic.go:1198 +0x54 fp=0x1400003fdc0 sp=0x1400003fd90 pc=0x10076e574
runtime.netpollinit()
	/usr/local/go/src/runtime/netpoll_kqueue.go:35 +0x190 fp=0x1400003fe40 sp=0x1400003fdc0 pc=0x10076a160
runtime.netpollGenericInit()
	/usr/local/go/src/runtime/netpoll.go:128 +0x58 fp=0x1400003fe60 sp=0x1400003fe40 pc=0x1007694e8
runtime.doaddtimer(0x1400002b000, 0x1400010e000)
	/usr/local/go/src/runtime/time.go:286 +0x30 fp=0x1400003fec0 sp=0x1400003fe60 pc=0x10078f000
runtime.modtimer(0x1400010e000, 0x3bb95c958f70, 0x0, 0x1008d4380, {0x0, 0x0}, 0x0)
	/usr/local/go/src/runtime/time.go:492 +0x404 fp=0x1400003ff10 sp=0x1400003fec0 pc=0x10078fd64
runtime.resettimer(...)
	/usr/local/go/src/runtime/time.go:539
time.resetTimer(...)
	/usr/local/go/src/runtime/time.go:229
runtime.scavengeSleep(0xf9060)
	/usr/local/go/src/runtime/mgcscavenge.go:237 +0x8c fp=0x1400003ff70 sp=0x1400003ff10 pc=0x10075a97c
runtime.bgscavenge()
	/usr/local/go/src/runtime/mgcscavenge.go:366 +0x228 fp=0x1400003ffd0 sp=0x1400003ff70 pc=0x10075ac18
runtime.goexit()
	/usr/local/go/src/runtime/asm_arm64.s:1133 +0x4 fp=0x1400003ffd0 sp=0x1400003ffd0 pc=0x10079f3b4
created by runtime.gcenable
	/usr/local/go/src/runtime/mgc.go:182 +0x8c

goroutine 1 [semacquire]:
sync.runtime_Semacquire(0x1400013c838)
	/usr/local/go/src/runtime/sema.go:56 +0x38
sync.(*WaitGroup).Wait(0x1400013c830)
	/usr/local/go/src/sync/waitgroup.go:130 +0xa4
github.com/google/gops/goprocess.findAll({0x140001b6000, 0x222, 0x222}, 0x1008d40a8, 0xa)
	/Users/rao/go/pkg/mod/github.com/google/gops@v0.3.22/goprocess/gp.go:79 +0x114
github.com/google/gops/goprocess.FindAll()
	/Users/rao/go/pkg/mod/github.com/google/gops@v0.3.22/goprocess/gp.go:35 +0x58
main.processes()
	/Users/rao/go/pkg/mod/github.com/google/gops@v0.3.22/main.go:103 +0x28
main.main()
	/Users/rao/go/pkg/mod/github.com/google/gops@v0.3.22/main.go:49 +0x4a4

goroutine 19 [runnable]:
io.ReadAtLeast({0x1008d5420, 0x14001ba6d20}, {0x14006f57240, 0x10, 0x10}, 0x10)
	/usr/local/go/src/io/io.go:322 +0x19c
io.ReadFull(...)
	/usr/local/go/src/io/io.go:347
encoding/binary.Read({0x1008d5420, 0x14001ba6d20}, {0x1008d9480, 0x1009de2b0}, {0x10089fde0, 0x14006f57230})
	/usr/local/go/src/encoding/binary/binary.go:256 +0xbd8
debug/macho.(*File).parseSymtab(0x1400043d380, {0x14000480000, 0xea720, 0xea720}, {0x14006a00000, 0x2c04d8, 0x2c04d8}, {0x1400374d728, 0x18, 0x6c0}, ...)
	/usr/local/go/src/debug/macho/file.go:467 +0x17c
debug/macho.NewFile({0x1008d5740, 0x14000318360})
	/usr/local/go/src/debug/macho/file.go:335 +0xa48
rsc.io/goversion/version.openExe({0x14000174440, 0x37})
	/Users/rao/go/pkg/mod/rsc.io/goversion@v1.2.0/version/exe.go:63 +0x39c
rsc.io/goversion/version.ReadExe({0x14000174440, 0x37})
	/Users/rao/go/pkg/mod/rsc.io/goversion@v1.2.0/version/read.go:30 +0x60
github.com/google/gops/goprocess.isGo({0x1008d8190, 0x14000170360})
	/Users/rao/go/pkg/mod/github.com/google/gops@v0.3.22/goprocess/gp.go:123 +0x90
github.com/google/gops/goprocess.findAll.func1(0x1400013c830, 0x1400013a480, 0x1008d40a8, 0x1400013a4e0)
	/Users/rao/go/pkg/mod/github.com/google/gops@v0.3.22/goprocess/gp.go:60 +0x94
created by github.com/google/gops/goprocess.findAll
	/Users/rao/go/pkg/mod/github.com/google/gops@v0.3.22/goprocess/gp.go:56 +0xf4

goroutine 20 [runnable]:
regexp.(*Regexp).doMatch(...)
	/usr/local/go/src/regexp/exec.go:514
regexp.(*Regexp).MatchString(...)
	/usr/local/go/src/regexp/regexp.go:525
rsc.io/goversion/version.ReadExe({0x140001745c0, 0x32})
	/Users/rao/go/pkg/mod/rsc.io/goversion@v1.2.0/version/read.go:67 +0x840
github.com/google/gops/goprocess.isGo({0x1008d8190, 0x14000170440})
	/Users/rao/go/pkg/mod/github.com/google/gops@v0.3.22/goprocess/gp.go:123 +0x90
github.com/google/gops/goprocess.findAll.func1(0x1400013c830, 0x1400013a480, 0x1008d40a8, 0x1400013a4e0)
	/Users/rao/go/pkg/mod/github.com/google/gops@v0.3.22/goprocess/gp.go:60 +0x94
created by github.com/google/gops/goprocess.findAll
	/Users/rao/go/pkg/mod/github.com/google/gops@v0.3.22/goprocess/gp.go:56 +0xf4

goroutine 21 [runnable]:
strings.Index({0x14000b26b60, 0x1f}, {0x100863346, 0x1})
	/usr/local/go/src/strings/strings.go:1024 +0x5c0
strings.Contains(...)
	/usr/local/go/src/strings/strings.go:62
debug/macho.(*File).parseSymtab(0x14008b40000, {0x1400b362000, 0x1411b0, 0x1411b0}, {0x1400af66000, 0x3fa8b0, 0x3fa8b0}, {0x14008b44728, 0x18, 0x6c0}, ...)
	/usr/local/go/src/debug/macho/file.go:487 +0x2ac
debug/macho.NewFile({0x1008d5740, 0x140003181c8})
	/usr/local/go/src/debug/macho/file.go:335 +0xa48
rsc.io/goversion/version.openExe({0x140001744c0, 0x37})
	/Users/rao/go/pkg/mod/rsc.io/goversion@v1.2.0/version/exe.go:63 +0x39c
rsc.io/goversion/version.ReadExe({0x140001744c0, 0x37})
	/Users/rao/go/pkg/mod/rsc.io/goversion@v1.2.0/version/read.go:30 +0x60
github.com/google/gops/goprocess.isGo({0x1008d8190, 0x140001703a0})
	/Users/rao/go/pkg/mod/github.com/google/gops@v0.3.22/goprocess/gp.go:123 +0x90
github.com/google/gops/goprocess.findAll.func1(0x1400013c830, 0x1400013a480, 0x1008d40a8, 0x1400013a4e0)
	/Users/rao/go/pkg/mod/github.com/google/gops@v0.3.22/goprocess/gp.go:60 +0x94
created by github.com/google/gops/goprocess.findAll
	/Users/rao/go/pkg/mod/github.com/google/gops@v0.3.22/goprocess/gp.go:56 +0xf4

goroutine 22 [runnable]:
regexp.(*Regexp).tryBacktrack(0x140001403c0, 0x14004196210, {0x1008d8f78, 0x14004196290}, 0x1, 0x0)
	/usr/local/go/src/regexp/backtrack.go:140 +0xbf0
regexp.(*Regexp).backtrack(0x140001403c0, {0x0, 0x0, 0x0}, {0x1400081c721, 0x2d}, 0x0, 0x0, {0x1009de060, 0x0, ...})
	/usr/local/go/src/regexp/backtrack.go:326 +0x1b8
regexp.(*Regexp).doExecute(0x140001403c0, {0x0, 0x0}, {0x0, 0x0, 0x0}, {0x1400081c721, 0x2d}, 0x0, 0x0, ...)
	/usr/local/go/src/regexp/exec.go:535 +0x314
regexp.(*Regexp).doMatch(...)
	/usr/local/go/src/regexp/exec.go:514
regexp.(*Regexp).MatchString(...)
	/usr/local/go/src/regexp/regexp.go:525
rsc.io/goversion/version.ReadExe({0x14000174300, 0x39})
	/Users/rao/go/pkg/mod/rsc.io/goversion@v1.2.0/version/read.go:67 +0x84c
github.com/google/gops/goprocess.isGo({0x1008d8190, 0x14000170220})
	/Users/rao/go/pkg/mod/github.com/google/gops@v0.3.22/goprocess/gp.go:123 +0x90
github.com/google/gops/goprocess.findAll.func1(0x1400013c830, 0x1400013a480, 0x1008d40a8, 0x1400013a4e0)
	/Users/rao/go/pkg/mod/github.com/google/gops@v0.3.22/goprocess/gp.go:60 +0x94
created by github.com/google/gops/goprocess.findAll
	/Users/rao/go/pkg/mod/github.com/google/gops@v0.3.22/goprocess/gp.go:56 +0xf4

goroutine 24 [runnable]:
strings.Index({0x14000fee180, 0x2e}, {0x100863346, 0x1})
	/usr/local/go/src/strings/strings.go:1024 +0x5c0
strings.Contains(...)
	/usr/local/go/src/strings/strings.go:62
debug/macho.(*File).parseSymtab(0x14008bd0380, {0x14002124000, 0xd8f50, 0xd8f50}, {0x14001e92000, 0x291080, 0x291080}, {0x140001f5728, 0x18, 0x6c0}, ...)
	/usr/local/go/src/debug/macho/file.go:487 +0x2ac
debug/macho.NewFile({0x1008d5740, 0x1400040a1b0})
	/usr/local/go/src/debug/macho/file.go:335 +0xa48
rsc.io/goversion/version.openExe({0x14000174380, 0x38})
	/Users/rao/go/pkg/mod/rsc.io/goversion@v1.2.0/version/exe.go:63 +0x39c
rsc.io/goversion/version.ReadExe({0x14000174380, 0x38})
	/Users/rao/go/pkg/mod/rsc.io/goversion@v1.2.0/version/read.go:30 +0x60
github.com/google/gops/goprocess.isGo({0x1008d8190, 0x14000170300})
	/Users/rao/go/pkg/mod/github.com/google/gops@v0.3.22/goprocess/gp.go:123 +0x90
github.com/google/gops/goprocess.findAll.func1(0x1400013c830, 0x1400013a480, 0x1008d40a8, 0x1400013a4e0)
	/Users/rao/go/pkg/mod/github.com/google/gops@v0.3.22/goprocess/gp.go:60 +0x94
created by github.com/google/gops/goprocess.findAll
	/Users/rao/go/pkg/mod/github.com/google/gops@v0.3.22/goprocess/gp.go:56 +0xf4

goroutine 25 [runnable]:
debug/macho.cstring({0x1400809f1d7, 0x1f6781, 0x1f6781})
	/usr/local/go/src/debug/macho/file.go:568 +0x6c
debug/macho.(*File).parseSymtab(0x14008b41900, {0x14000de6000, 0xdd470, 0xdd470}, {0x14008000000, 0x295958, 0x295958}, {0x140046bd728, 0x18, 0x6c0}, ...)
	/usr/local/go/src/debug/macho/file.go:486 +0x27c
debug/macho.NewFile({0x1008d5740, 0x140002900e8})
	/usr/local/go/src/debug/macho/file.go:335 +0xa48
rsc.io/goversion/version.openExe({0x14000174400, 0x36})
	/Users/rao/go/pkg/mod/rsc.io/goversion@v1.2.0/version/exe.go:63 +0x39c
rsc.io/goversion/version.ReadExe({0x14000174400, 0x36})
	/Users/rao/go/pkg/mod/rsc.io/goversion@v1.2.0/version/read.go:30 +0x60
github.com/google/gops/goprocess.isGo({0x1008d8190, 0x14000170340})
	/Users/rao/go/pkg/mod/github.com/google/gops@v0.3.22/goprocess/gp.go:123 +0x90
github.com/google/gops/goprocess.findAll.func1(0x1400013c830, 0x1400013a480, 0x1008d40a8, 0x1400013a4e0)
	/Users/rao/go/pkg/mod/github.com/google/gops@v0.3.22/goprocess/gp.go:60 +0x94
created by github.com/google/gops/goprocess.findAll
	/Users/rao/go/pkg/mod/github.com/google/gops@v0.3.22/goprocess/gp.go:56 +0xf4

goroutine 26 [runnable]:
syscall.syscall6(0x1007c6da0, 0x26, 0x1400cc9a000, 0x400000, 0x3640000, 0x0, 0x0)
	/usr/local/go/src/runtime/sys_darwin.go:44 +0x1c
syscall.Pread(0x26, {0x1400cc9a000, 0x400000, 0x400000}, 0x3640000)
	/usr/local/go/src/syscall/zsyscall_darwin_arm64.go:1129 +0x68
internal/poll.(*FD).Pread(0x140000925a0, {0x1400cc9a000, 0x400000, 0x400000}, 0x3640000)
	/usr/local/go/src/internal/poll/fd_unix.go:193 +0x130
os.(*File).pread(...)
	/usr/local/go/src/os/file_posix.go:41
os.(*File).ReadAt(0x14000090020, {0x1400cc9a000, 0x400000, 0x400000}, 0x3640000)
	/usr/local/go/src/os/file.go:137 +0x1bc
io.(*SectionReader).ReadAt(0x1400011d260, {0x1400cc9a000, 0x400000, 0x400000}, 0x3640000)
	/usr/local/go/src/io/io.go:539 +0x110
rsc.io/goversion/version.(*machoExe).ReadData(0x14000012020, 0x103640000, 0x400000)
	/Users/rao/go/pkg/mod/rsc.io/goversion@v1.2.0/version/exe.go:278 +0x16c
rsc.io/goversion/version.findModuleInfo(0x14000315d90, {0x1008d9c10, 0x14000012020})
	/Users/rao/go/pkg/mod/rsc.io/goversion@v1.2.0/version/read.go:212 +0x9c
rsc.io/goversion/version.ReadExe({0x14000174800, 0x32})
	/Users/rao/go/pkg/mod/rsc.io/goversion@v1.2.0/version/read.go:79 +0x198
github.com/google/gops/goprocess.isGo({0x1008d8190, 0x140001982c0})
	/Users/rao/go/pkg/mod/github.com/google/gops@v0.3.22/goprocess/gp.go:123 +0x90
github.com/google/gops/goprocess.findAll.func1(0x1400013c830, 0x1400013a480, 0x1008d40a8, 0x1400013a4e0)
	/Users/rao/go/pkg/mod/github.com/google/gops@v0.3.22/goprocess/gp.go:60 +0x94
created by github.com/google/gops/goprocess.findAll
	/Users/rao/go/pkg/mod/github.com/google/gops@v0.3.22/goprocess/gp.go:56 +0xf4

goroutine 28 [runnable]:
debug/macho.cstring({0x1400313df1a, 0x551be, 0x551be})
	/usr/local/go/src/debug/macho/file.go:568 +0x6c
debug/macho.(*File).parseSymtab(0x140002a6100, {0x14003280000, 0x302fc0, 0x302fc0}, {0x14002cc0000, 0x4d30d8, 0x4d30d8}, {0x14000432398, 0x18, 0xc50}, ...)
	/usr/local/go/src/debug/macho/file.go:486 +0x27c
debug/macho.NewFile({0x1008d5740, 0x14000290000})
	/usr/local/go/src/debug/macho/file.go:335 +0xa48
rsc.io/goversion/version.openExe({0x140001360c0, 0x2d})
	/Users/rao/go/pkg/mod/rsc.io/goversion@v1.2.0/version/exe.go:63 +0x39c
rsc.io/goversion/version.ReadExe({0x140001360c0, 0x2d})
	/Users/rao/go/pkg/mod/rsc.io/goversion@v1.2.0/version/read.go:30 +0x60
github.com/google/gops/goprocess.isGo({0x1008d8190, 0x14000170d40})
	/Users/rao/go/pkg/mod/github.com/google/gops@v0.3.22/goprocess/gp.go:123 +0x90
github.com/google/gops/goprocess.findAll.func1(0x1400013c830, 0x1400013a480, 0x1008d40a8, 0x1400013a4e0)
	/Users/rao/go/pkg/mod/github.com/google/gops@v0.3.22/goprocess/gp.go:60 +0x94
created by github.com/google/gops/goprocess.findAll
	/Users/rao/go/pkg/mod/github.com/google/gops@v0.3.22/goprocess/gp.go:56 +0xf4
tklauser added a commit that referenced this issue May 4, 2022
Use package debug/buildinfo [1] introduced in Go 1.18 [2] when possible.
This should avoid previous issues with rsc.io/goversion where Go
processes were no longer listed.

[1] https://pkg.go.dev/debug/buildinfo
[2] https://go.dev/doc/go1.18#debug/buildinfo

For #102
For #159
For #160
tklauser added a commit that referenced this issue May 4, 2022
Use package debug/buildinfo [1] introduced in Go 1.18 [2] when possible.
This should avoid previous issues with rsc.io/goversion where Go
processes were no longer listed.

[1] https://pkg.go.dev/debug/buildinfo
[2] https://go.dev/doc/go1.18#debug/buildinfo

For #102
For #159
For #160
@tklauser
Copy link
Collaborator

tklauser commented May 4, 2022

I think #166 should fix this issue, at least when building gops using Go 1.18.

@raochq could you please check whether gops built from latest master branch using Go 1.18 works as expected for you?

@raochq
Copy link
Author

raochq commented May 16, 2022

I only have this problem once. It never happened again。

@tklauser
Copy link
Collaborator

Thanks for confirming. I'll thus close this issue. Please feel free to comment here or open a new issue in case you see it happening again.

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

No branches or pull requests

2 participants