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

x/debug/cmd/viewcore: panic on go1.12 #30631

Closed
pwaller opened this issue Mar 6, 2019 · 4 comments
Closed

x/debug/cmd/viewcore: panic on go1.12 #30631

pwaller opened this issue Mar 6, 2019 · 4 comments
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@pwaller
Copy link
Contributor

pwaller commented Mar 6, 2019

What version of Go are you using (go version)?

$ go version
go version go1.12 linux/amd64

Does this issue reproduce with the latest release?

Yes

What did you do?

  • Increase my ulimit for corefiles
  • Write a program with the line var foo *int; *foo = 1 to make it crash.
  • Run program with GOTRACEBACK=crash to produce file called core.
  • Run viewcore core.

What did you expect to see?

viewcore core should work. It does work with go1.11.5.

What did you see instead?

$ viewcore core --exe=./crasher
panic: bad int32 type uint8

goroutine 1 [running]:
golang.org/x/debug/internal/gocore.region.Int32(0xc0002de000, 0x62ba77, 0xc0000c0b90, 0x8b122b)
	/home/pwaller/.local/pkg/mod/golang.org/x/debug@v0.0.0-20181113171635-66907db09ddd/internal/gocore/region.go:82 +0xc6
golang.org/x/debug/internal/gocore.(*module).readFunc(0xc0002e3b90, 0xc0002de000, 0x62ba50, 0xc00056aa00, 0xc0002de000, 0x6e22c0, 0xc000366280, 0xc0000c0140)
	/home/pwaller/.local/pkg/mod/golang.org/x/debug@v0.0.0-20181113171635-66907db09ddd/internal/gocore/module.go:72 +0x4a0
golang.org/x/debug/internal/gocore.(*Process).readModule(0xc0002de000, 0xc0002de000, 0x6e22c0, 0xc000377180, 0x6e22c0)
	/home/pwaller/.local/pkg/mod/golang.org/x/debug@v0.0.0-20181113171635-66907db09ddd/internal/gocore/module.go:45 +0x4d4
golang.org/x/debug/internal/gocore.(*Process).readModules(0xc0002de000)
	/home/pwaller/.local/pkg/mod/golang.org/x/debug@v0.0.0-20181113171635-66907db09ddd/internal/gocore/module.go:26 +0x1a6
golang.org/x/debug/internal/gocore.Core(0xc00011c000, 0x4, 0x0, 0x0)
	/home/pwaller/.local/pkg/mod/golang.org/x/debug@v0.0.0-20181113171635-66907db09ddd/internal/gocore/process.go:155 +0x2be
main.readCore(0x8af649, 0x4, 0xc0000b6e68, 0x4)
	/home/pwaller/.local/pkg/mod/golang.org/x/debug@v0.0.0-20181113171635-66907db09ddd/cmd/viewcore/main.go:260 +0xd5
main.runRoot(0xc48ea0, 0xc00007ad50, 0x0, 0x1)
	/home/pwaller/.local/pkg/mod/golang.org/x/debug@v0.0.0-20181113171635-66907db09ddd/cmd/viewcore/main.go:282 +0x45
github.com/spf13/cobra.(*Command).execute(0xc48ea0, 0xc0000201a0, 0x1, 0x1, 0xc48ea0, 0xc0000201a0)
	/home/pwaller/.local/pkg/mod/github.com/spf13/cobra@v0.0.3/command.go:766 +0x2ae
github.com/spf13/cobra.(*Command).ExecuteC(0xc48ea0, 0x8af083, 0x1, 0xc0000dbf00)
	/home/pwaller/.local/pkg/mod/github.com/spf13/cobra@v0.0.3/command.go:852 +0x2c0
github.com/spf13/cobra.(*Command).Execute(...)
	/home/pwaller/.local/pkg/mod/github.com/spf13/cobra@v0.0.3/command.go:800
main.main()
	/home/pwaller/.local/pkg/mod/golang.org/x/debug@v0.0.0-20181113171635-66907db09ddd/cmd/viewcore/main.go:238 +0xba

/cc @randall77 @aclements

@gopherbot gopherbot added this to the Unreleased milestone Mar 6, 2019
@pwaller pwaller changed the title x/debug/viewcore x/debug/viewcore: panic on go1.12 Mar 6, 2019
@pwaller
Copy link
Contributor Author

pwaller commented Mar 11, 2019

I've bisected part of the breakage to 7b9c2c1: internal/cpu: add and use cpu.CacheLinePad for padding structs.

That commit results in the following stacktrace:

panic: address 205400051f4e0 is not mapped in the core file

goroutine 1 [running]:
golang.org/x/debug/internal/core.(*Process).ReadUint64(0xc00011c000, 0x205400051f4e0, 0x8af8f3)
	/home/pwaller/.local/pkg/mod/golang.org/x/debug@v0.0.0-20181113171635-66907db09ddd/internal/core/read.go:81 +0x264
golang.org/x/debug/internal/core.(*Process).ReadUintptr(0xc00011c000, 0x205400051f4e0, 0x40db88)
	/home/pwaller/.local/pkg/mod/golang.org/x/debug@v0.0.0-20181113171635-66907db09ddd/internal/core/read.go:120 +0x62
golang.org/x/debug/internal/gocore.region.Uintptr(0xc0004a6000, 0x205400051f4e0, 0xc0000c01e0, 0x8af8f3)
	/home/pwaller/.local/pkg/mod/golang.org/x/debug@v0.0.0-20181113171635-66907db09ddd/internal/gocore/region.go:40 +0x52
golang.org/x/debug/internal/gocore.(*module).readFunc(0xc00076af90, 0xc0004a6000, 0x205400051f4e0, 0xc00052c6e0, 0xc0004a6000, 0x5961c0, 0xc00029aff0, 0xc0000c01e0)
	/home/pwaller/.local/pkg/mod/golang.org/x/debug@v0.0.0-20181113171635-66907db09ddd/internal/gocore/module.go:60 +0xdc
golang.org/x/debug/internal/gocore.(*Process).readModule(0xc0004a6000, 0xc0004a6000, 0x5961c0, 0xc00029af00, 0x5961c0)
	/home/pwaller/.local/pkg/mod/golang.org/x/debug@v0.0.0-20181113171635-66907db09ddd/internal/gocore/module.go:45 +0x4d4
golang.org/x/debug/internal/gocore.(*Process).readModules(0xc0004a6000)
	/home/pwaller/.local/pkg/mod/golang.org/x/debug@v0.0.0-20181113171635-66907db09ddd/internal/gocore/module.go:26 +0x1a6
golang.org/x/debug/internal/gocore.Core(0xc00011c000, 0x4, 0x0, 0x0)
	/home/pwaller/.local/pkg/mod/golang.org/x/debug@v0.0.0-20181113171635-66907db09ddd/internal/gocore/process.go:155 +0x2be
main.readCore(0x3, 0x3, 0xc00008c4b0, 0xc00000e440)
	/home/pwaller/.local/pkg/mod/golang.org/x/debug@v0.0.0-20181113171635-66907db09ddd/cmd/viewcore/main.go:260 +0xd5
main.runMappings(0xc49360, 0xc6de98, 0x0, 0x0)
	/home/pwaller/.local/pkg/mod/golang.org/x/debug@v0.0.0-20181113171635-66907db09ddd/cmd/viewcore/main.go:389 +0x37
github.com/spf13/cobra.(*Command).execute(0xc49360, 0xc6de98, 0x0, 0x0, 0xc49360, 0xc6de98)
	/home/pwaller/.local/pkg/mod/github.com/spf13/cobra@v0.0.3/command.go:766 +0x2ae
github.com/spf13/cobra.(*Command).ExecuteC(0xc48ea0, 0x8af083, 0x1, 0xc0000dbf00)
	/home/pwaller/.local/pkg/mod/github.com/spf13/cobra@v0.0.3/command.go:852 +0x2c0
github.com/spf13/cobra.(*Command).Execute(...)
	/home/pwaller/.local/pkg/mod/github.com/spf13/cobra@v0.0.3/command.go:800
main.main()
	/home/pwaller/.local/pkg/mod/golang.org/x/debug@v0.0.0-20181113171635-66907db09ddd/cmd/viewcore/main.go:238 +0xba

@bcmills
Copy link
Contributor

bcmills commented Apr 12, 2019

CC @martisch @bradfitz

@bcmills bcmills added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Apr 12, 2019
@bcmills bcmills changed the title x/debug/viewcore: panic on go1.12 x/debug/cmd/viewcore: panic on go1.12 Apr 15, 2019
@gopherbot
Copy link

Change https://golang.org/cl/170863 mentions this issue: cmd/gopherbot: CC triaged issues to owners

@gopherbot
Copy link

Change https://golang.org/cl/175497 mentions this issue: internal/gocore: update to handle 1.12 core files

@golang golang locked and limited conversation to collaborators May 14, 2020
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.
Projects
None yet
Development

No branches or pull requests

3 participants