golang/go

fmt: Printf loops on invalid verb spec

dvyukov opened this issue · 2 comments

The following program hangs in Execute.

package main

import (
    "text/template"
    "io/ioutil"
)

func main() {
    t, err := template.New("foo").Parse(data)
    if err != nil {
        return
    }
    t.Execute(ioutil.Discard, nil)
}

var data = "{{printf \"%017091901790959340919092959340919017929593813360\" 0}}"
SIGABRT: abort
goroutine 1 [running]:
    goroutine running on other thread; stack unavailable

go version devel +fbb4c74 Sat May 2 02:48:32 2015 +0000 darwin/amd64

This reproduces the hang.
package main

import "fmt"

func main() {
fmt.Printf("%017091901790959340919092959340919017929593813360", 0)
}

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