-
Notifications
You must be signed in to change notification settings - Fork 17.4k
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/link: crash in testshared #67635
Comments
My guess is that the closure is completely inlined and dead. But the symbol is still around. In all other build modes the linker will deadcode the symbol, and won't look at it. But for shared build mode we keep all symbols alive. This is probably the same issue that @dr2chase run into, for early deadcode closures in the compiler. Possible fixes are
|
Change https://go.dev/cl/588316 mentions this issue: |
I agree with Cherry's analysis. Working quickly before the freeze, what I came up with was, in dead code where it grabs all the symbols in the shared buildmode case, add a test for "actually not there" and skipping those. Cherry's proposed fix is probably more efficient, if it passes all the tests, a better choice. |
Change https://go.dev/cl/588455 mentions this issue: |
crashes with:
Note that the linker is dying in generatePctab calling SymSize on the line that says
return int64(r.Sym(li).Siz())
. Clearly r.Sym(li) is nil. The call site claims SymSize will return 0 for a bad symbol but that appears not to be the case.Applying this diff makes the problem go away:
That func wrapping was a dreg that needed to be removed, so no harm done, but we should probably understand the linker crash anyway.
The text was updated successfully, but these errors were encountered: