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 #10745

Closed
dvyukov opened this issue May 7, 2015 · 1 comment
Closed

fmt: index out of range #10745

dvyukov opened this issue May 7, 2015 · 1 comment
Assignees
Milestone

Comments

@dvyukov
Copy link
Member

@dvyukov dvyukov commented May 7, 2015

The following program crashes with a panic:

package main

import "fmt"

func main() {
    fmt.Sprintf("%.80U", 42)
}
panic: runtime error: index out of range

goroutine 1 [running]:
runtime.gopanic(0x4e4740, 0xc20800a1c0)
    src/runtime/panic.go:477 +0x3fe fp=0xc20803f828 sp=0xc20803f7a8
runtime.panicindex()
    src/runtime/panic.go:12 +0x50 fp=0xc20803f850 sp=0xc20803f828
fmt.(*fmt).integer(0xc208052538, 0x2a, 0x10, 0x40e300, 0x51b1d0, 0x10)
    src/fmt/format.go:257 +0x5d0 fp=0xc20803f900 sp=0xc20803f850
fmt.(*pp).fmtUnicode(0xc2080524e0, 0x2a)
    src/fmt/print.go:406 +0xc4 fp=0xc20803f948 sp=0xc20803f900
fmt.(*pp).fmtInt64(0xc2080524e0, 0x2a, 0xc200000055)
    src/fmt/print.go:375 +0x49 fp=0xc20803f980 sp=0xc20803f948
fmt.(*pp).printArg(0xc2080524e0, 0x4c03a0, 0xc20800a420, 0x55, 0x0, 0x0)
    src/fmt/print.go:770 +0xe56 fp=0xc20803fb08 sp=0xc20803f980
fmt.(*pp).doPrintf(0xc2080524e0, 0x5062e0, 0x5, 0xc20803ff60, 0x1, 0x1)
    src/fmt/print.go:1197 +0x217b fp=0xc20803fec0 sp=0xc20803fb08
fmt.Sprintf(0x5062e0, 0x5, 0xc20803ff60, 0x1, 0x1, 0x0, 0x0)
    src/fmt/print.go:203 +0x72 fp=0xc20803ff10 sp=0xc20803fec0
main.main()
    /tmp/fmt.go:6 +0xde fp=0xc20803ff90 sp=0xc20803ff10

on commit d4bb72b

@dvyukov dvyukov added this to the Go1.5 milestone May 7, 2015
@gopherbot
Copy link

@gopherbot gopherbot commented May 7, 2015

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

@robpike robpike closed this in c6688b7 May 7, 2015
@golang golang locked and limited conversation to collaborators Jun 25, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.