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

runtime: SEGV in mapaccess2 (go1.23.2 darwin/amd64) #71123

Open
adonovan opened this issue Jan 4, 2025 · 6 comments
Open

runtime: SEGV in mapaccess2 (go1.23.2 darwin/amd64) #71123

adonovan opened this issue Jan 4, 2025 · 6 comments
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. gopls/telemetry-wins gopls Issues related to the Go language server, gopls. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. Tools This label describes issues relating to any tools in the x/tools repository.

Comments

@adonovan adonovan added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository. gopls/telemetry-wins labels Jan 4, 2025
@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label Jan 4, 2025
@adonovan adonovan changed the title runtime: SEGV in mapaccess2 runtime: SEGV in mapaccess2 (go1.23.2 darwin/amd64) Jan 4, 2025
@randall77
Copy link
Contributor

This is dying trying to hash a non-empty interface.
The itab field of the interface is non-nil, but segv's when dereferenced.
That should be impossible. All non-nil itab fields point to static locations in the binary or persistentalloc'd memory. Both should never segv.

So this looks like general corruption (nothing specifically to do with maps). One possibility is incorrect freeing of the object containing the interface.

I presume we don't have the segv address? If we had that, it might clarify somewhat.

@adonovan
Copy link
Member Author

adonovan commented Jan 4, 2025

I presume we don't have the segv address? If we had that, it might clarify somewhat.

Sadly not; all we have to go on is the line numbers in that telemetry link.

@prattmic
Copy link
Member

prattmic commented Jan 5, 2025

Why do you say the line numbers are suspicious? All the ones I looked at seem reasonable to me.

@adonovan
Copy link
Member Author

adonovan commented Jan 5, 2025

Why do you say the line numbers are suspicious? All the ones I looked at seem reasonable to me.

Because a load from a non-nil pointer "cannot fail", so I assumed the real problem was on an adjacent line (remembering our recent telemetry problems), but Keith's comment explains it: general corruption of memory. This is something that happens so rarely in Go that I was reluctant to jump to that conclusion. Also, I've been burned too many times by blaming compiler folks for my own bugs. ;-)

@prattmic
Copy link
Member

prattmic commented Jan 6, 2025

Usually bad cgo or unsafe code would be a top candidate for memory corruption, but since this is specifically the gopls binary, there should be very little of either.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. gopls/telemetry-wins gopls Issues related to the Go language server, gopls. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. Tools This label describes issues relating to any tools in the x/tools repository.
Projects
None yet
Development

No branches or pull requests

5 participants