We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
go version
$ go version go version go1.17.8 linux/amd64
Yes, it reproduce with the master branch.
go env
$ go env Unrelated.
I added some export function in runtime/export_test.go and a testcase to show this bug.
go/src/runtime/export_test.go
var specialFuncs = map[string]funcInfo{ "runtime.rt0_go": findfunc(abi.FuncPCABI0(rt0_go)), "runtime.systemstack_switch": findfunc(abi.FuncPCABI0(systemstack_switch)), "runtime.systemstack": findfunc(abi.FuncPCABI0(systemstack)), } const ( FuncID_rt0_go = funcID_rt0_go FuncID_systemstack_switch = funcID_systemstack_switch FuncID_systemstack = funcID_systemstack ) func GetSpecialFuncInfo(name string) (funcInfo, bool) { f, ok := specialFuncs[name] return f, ok } func (f funcInfo) FuncID() funcID { return f.funcID }
go/src/runtime/funcinfo_test.go(wherever)
func Test_FuncID(t *testing.T) { cases := []struct { give string want uint8 }{ {"runtime.rt0_go", uint8(runtime.FuncID_rt0_go)}, {"runtime.systemstack_switch", uint8(runtime.FuncID_systemstack_switch)}, {"runtime.systemstack", uint8(runtime.FuncID_systemstack)}, } for _, cas := range cases { f, ok := runtime.GetSpecialFuncInfo(cas.give) if !ok { t.Fatal("can't get funcinfo of", cas.give) } got := f.FuncID() if uint8(got) != cas.want { t.Errorf("Check FuncInfo of %s failed, want %d, got %d", cas.give, cas.want, got) } } }
Then I use go test to run this testcase.
go test
This testcase passed.
=== RUN Test_FuncID funcinfo_test.go:20: Check FuncInfo of runtime.rt0_go failed, want 16, got 0 funcinfo_test.go:20: Check FuncInfo of runtime.systemstack_switch failed, want 21, got 0 --- FAIL: Test_FuncID (0.00s)
The funcIDs of runtime.rt0_go and runtime.systemstack_switch are set incorrectly at
go/src/cmd/internal/objabi/funcid.go
Line 58 in f5290ef
Line 70 in f5290ef
It seems like a typo.
The text was updated successfully, but these errors were encountered:
Change https://go.dev/cl/396797 mentions this issue: cmd/internal/objabi: fix FuncID of runtime.rt0_go and runtime.systemstack_switch
cmd/internal/objabi: fix FuncID of runtime.rt0_go and runtime.systemstack_switch
Sorry, something went wrong.
7c45daf
No branches or pull requests
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes, it reproduce with the master branch.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I added some export function in runtime/export_test.go and a testcase to show this bug.
go/src/runtime/export_test.go
go/src/runtime/funcinfo_test.go(wherever)
Then I use
go test
to run this testcase.What did you expect to see?
This testcase passed.
What did you see instead?
The funcIDs of runtime.rt0_go and runtime.systemstack_switch are set incorrectly at
go/src/cmd/internal/objabi/funcid.go
Line 58 in f5290ef
go/src/cmd/internal/objabi/funcid.go
Line 70 in f5290ef
It seems like a typo.
The text was updated successfully, but these errors were encountered: