-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
x/tools/go/packages, go/ast: NewPackage causes SIGSEGV #37202
Comments
I'm unable to reproduce the problem by using |
The bug was with my code, sorry.
Originally I had the |
Okay, i think it's fair to want Fset set when NeedSyntax is, but I'd like to see more demand for it before I make an API change. I'll close this issue for now, if you want to open an issue about setting Fset when NeedSyntax is set, we can see if there are others who want it. |
As a general point, I've definitely lost time debugging go/packages issues because I've failed to set NeedX when I've set NeedY and NeedY requires NeedX. I don't think I've hit this particular combination. |
When that's happened (NeedY requires NeedX), it's been a bug, and we've fixed it. The principle of the Need fields are that if a need field says it's going to populate a field, that field should be populated (which sounds obvious, but we've had a number of bugs where that didn't happen, and I think that's what you were running into @josharian). I think the difference here is that the documentation is correct, but inconvenient. |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
With
main.go
from https://play.golang.org/p/d0Nm2xOm74F, and in a directory with ago.mod
file:What did you expect to see?
The program to exit normally.
What did you see instead?
The following stacktrace:
With go1.13.7 the stack trace of goroutine 1 is a bit different:
The error seems to be in
The text was updated successfully, but these errors were encountered: