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

fmt: index out of range (6) #11376

Closed
dvyukov opened this issue Jun 24, 2015 · 1 comment
Closed

fmt: index out of range (6) #11376

dvyukov opened this issue Jun 24, 2015 · 1 comment
Milestone

Comments

@dvyukov
Copy link
Member

dvyukov commented Jun 24, 2015

The following program crashes with the panic:

package main
import "fmt"
func main() {
    fmt.Printf("%*.100U\n", -100, 1)
}
panic: runtime error: index out of range

goroutine 1 [running]:
fmt.(*fmt).integer(0xc8200aa6d8, 0x1, 0x10, 0x0, 0x518b50, 0x10)
    go/src/fmt/format.go:271 +0x6a0
fmt.(*pp).fmtUnicode(0xc8200aa680, 0x1)
    go/src/fmt/print.go:406 +0xc1
fmt.(*pp).fmtInt64(0xc8200aa680, 0x1, 0xc800000055)
    go/src/fmt/print.go:375 +0x46
fmt.(*pp).printArg(0xc8200aa680, 0x4beac0, 0xc82000a430, 0x55, 0x0, 0x0)
    go/src/fmt/print.go:770 +0xe53
fmt.(*pp).doPrintf(0xc8200aa680, 0x50c850, 0x8, 0xc82007bf28, 0x2, 0x2)
    go/src/fmt/print.go:1197 +0x1e9d
fmt.Fprintf(0x7efe418ca1c0, 0xc820068010, 0x50c850, 0x8, 0xc82007bf28, 0x2, 0x2, 0x40b160, 0x0, 0x0)
    go/src/fmt/print.go:188 +0x74
fmt.Printf(0x50c850, 0x8, 0xc82007bf28, 0x2, 0x2, 0x12000a410, 0x0, 0x0)
    go/src/fmt/print.go:197 +0x94
main.main()
    fmt.go:4 +0x14d

go version devel +514014c Thu Jun 18 15:54:35 2015 +0200 linux/amd64

@gopherbot
Copy link

CL https://golang.org/cl/11405 mentions this issue.

@mikioh mikioh added this to the Go1.5 milestone Jun 25, 2015
@golang golang locked and limited conversation to collaborators Jun 25, 2016
@rsc rsc unassigned robpike Jun 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants