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

cmd/yacc: remove hardcoded limits TEMPSIZE and NSTATES #16144

Open
snadrus opened this issue Jun 22, 2016 · 2 comments
Open

cmd/yacc: remove hardcoded limits TEMPSIZE and NSTATES #16144

snadrus opened this issue Jun 22, 2016 · 2 comments
Labels
NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@snadrus
Copy link

snadrus commented Jun 22, 2016

1.5 & 1.7rc2 on amd64 mac

  1. What did you do?

go get github.com/snadrus/sqlin
cd $GOPATH/github.com/snadrus/sqlin/src/parse
go tool yacc -o parser.go -p parse parser.y

  1. What did you expect to see?
    sql2003 spec becoming parser.go, or an actionable error.
  2. What did you see instead?
    In Go 1.7rc2:
    panic: runtime error: index out of range

goroutine 1 [running]:
panic(0x1124a0, 0xc42000e150)
/usr/local/go/src/runtime/panic.go:500 +0x1a1
main.aryfil(0xc4200a6000, 0x7d0, 0x7d0, 0x883, 0x0)
/usr/local/go/src/cmd/yacc/yacc.go:1522 +0x41
main.stagen()
/usr/local/go/src/cmd/yacc/yacc.go:1781 +0x3f3
main.main()
/usr/local/go/src/cmd/yacc/yacc.go:359 +0x5d

@mikioh mikioh changed the title yacc panic: index out of range cmd/yacc: panic: runtime error: index out of range Jun 22, 2016
@ianlancetaylor
Copy link
Contributor

There are hard-coded limits in yacc that remain from when it was a C program. This should be fixed, but not for 1.7 (and see also #11229). For 1.7 I'll send a CL for an error rather than a panic.

@ianlancetaylor ianlancetaylor changed the title cmd/yacc: panic: runtime error: index out of range cmd/yacc: remove hardcoded limits TEMPSIZE and NSTATES Jun 22, 2016
@ianlancetaylor ianlancetaylor added this to the Unreleased milestone Jun 22, 2016
@gopherbot
Copy link

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

mk0x9 pushed a commit to mk0x9/go that referenced this issue Jun 23, 2016
I tried simply increasing the size of the slice but then I got an error
because NSTATES was too small. Leaving a real fix for after 1.7.

Update golang#16144.

Change-Id: I8676772cb79845dd4ca1619977d4d54a2ce6de59
Reviewed-on: https://go-review.googlesource.com/24321
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
@ALTree ALTree added the NeedsFix The path to resolution is known, but the work has not been done. label Jul 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

4 participants