-
Notifications
You must be signed in to change notification settings - Fork 255
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
slice bounds out of range on Windows #36
Comments
See yuin/goldmark#36 This reverts commit 8221912.
@bep I can not reproduce this. Could you provide stacktrace? |
I've tested following steps on Windows. $ wget https://raw.githubusercontent.com/gohugoio/hugo/master/hugolib/testdata/what-is-markdown.md markdown := New(WithRendererOptions(
html.WithXHTML(),
))
source, _ := ioutil.ReadFile("what-is-markdown.md")
var b bytes.Buffer
err := markdown.Convert(source, &b)
if err != nil {
t.Error(err.Error())
}
println(b.String()) And did not get crash. |
I'm guessing that it's one of the options/extensions that Hugo uses. See: Which should eventually fail on WIndows See the Travis build log for stack trace. I'm not normally using Windows (I have a VM if I ... have to). |
Stack trace: goroutine 5810 [running]:
runtime/debug.Stack(0x16e2f80, 0x1f58820, 0xc000246660)
C:/Users/travis/.gimme/versions/go1.13.1.windows.amd64/src/runtime/debug/stack.go:24 +0xa4
github.com/gohugoio/hugo/markup/goldmark.(*goldmarkConverter).Convert.func1(0xc000071680, 0xc007392000, 0x33d8d, 0x3909b, 0xc007390301, 0xc0073903f8)
C:/Users/travis/src/hugo/markup/goldmark/convert.go:162 +0x1f9
panic(0x13b11a0, 0xc00091e700)
C:/Users/travis/.gimme/versions/go1.13.1.windows.amd64/src/runtime/panic.go:679 +0x1c0
github.com/yuin/goldmark/text.(*Segment).TrimRightSpace(0xc00738ffd0, 0xc007392000, 0x33d8d, 0x3909b, 0x0, 0x16f3920, 0xc000668b60)
C:/Users/travis/gopath/pkg/mod/github.com/yuin/[email protected]/text/segment.go:76 +0xe3
github.com/yuin/goldmark/parser.(*parser).parseBlock(0xc000653500, 0x16f39e0, 0xc000e45740, 0x1708060, 0xc007402880, 0x16f3920, 0xc000668b60)
C:/Users/travis/gopath/pkg/mod/github.com/yuin/[email protected]/parser/parser.go:1168 +0x6fa
github.com/yuin/goldmark/parser.(*parser).Parse.func2(0x1708060, 0xc007402880)
C:/Users/travis/gopath/pkg/mod/github.com/yuin/[email protected]/parser/parser.go:822 +0x69
github.com/yuin/goldmark/parser.(*parser).walkBlock(0xc000653500, 0x1708060, 0xc007402880, 0xc007390238)
C:/Users/travis/gopath/pkg/mod/github.com/yuin/[email protected]/parser/parser.go:1072 +0xb7
github.com/yuin/goldmark/parser.(*parser).walkBlock(0xc000653500, 0x1707f40, 0xc0073fd680, 0xc007390238)
C:/Users/travis/gopath/pkg/mod/github.com/yuin/[email protected]/parser/parser.go:1070 +0x74
github.com/yuin/goldmark/parser.(*parser).walkBlock(0xc000653500, 0x1707e20, 0xc0073fd5f0, 0xc007390238)
C:/Users/travis/gopath/pkg/mod/github.com/yuin/[email protected]/parser/parser.go:1070 +0x74
github.com/yuin/goldmark/parser.(*parser).walkBlock(0xc000653500, 0x1707640, 0xc00737f600, 0xc007390238)
C:/Users/travis/gopath/pkg/mod/github.com/yuin/[email protected]/parser/parser.go:1070 +0x74
github.com/yuin/goldmark/parser.(*parser).Parse(0xc000653500, 0x16f34a0, 0xc000668bd0, 0xc0010761c8, 0x1, 0x1, 0x3fde8, 0x0)
C:/Users/travis/gopath/pkg/mod/github.com/yuin/[email protected]/parser/parser.go:821 +0x25d
github.com/gohugoio/hugo/markup/goldmark.(*goldmarkConverter).Convert(0xc000071680, 0xc007392000, 0x33d8d, 0x3909b, 0xef5801, 0x16af0a0, 0xc007383ef0, 0x0, 0x0)
C:/Users/travis/src/hugo/markup/goldmark/convert.go:175 +0x39a
github.com/gohugoio/hugo/hugolib.(*pageContentOutput).renderContent(0xc000d77a40, 0xc007392000, 0x33d8d, 0x3909b, 0xc000947e60, 0xc000da9040, 0x0, 0x16bb2e0)
C:/Users/travis/src/hugo/hugolib/page__per_output.go:333 +0x7b
github.com/gohugoio/hugo/hugolib.newPageContentOutput.func1.1(0x0, 0x0)
C:/Users/travis/src/hugo/hugolib/page__per_output.go:102 +0xa85
github.com/gohugoio/hugo/hugolib.newPageContentOutput.func1.3(0xc0073907a8, 0x40fef2, 0xc007390818, 0xc0006d6798)
C:/Users/travis/src/hugo/hugolib/page__per_output.go:188 +0x2d |
@bep I could not found what hugo test wrong is, but I saw same error in fuzzing. |
I will bump the Goldmark version in that PR and close this if that succeeds. |
The text was updated successfully, but these errors were encountered: