-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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: panic: runtime error: index out of range #30063
Comments
/cc @aclements @mknyszek |
This doesn't make much sense. There should always be at least one module. Can you add a few more prints:
That will let us know if the data is computed incorrectly to start, or whether it gets lost subsequently. The |
@randall77 thanks for your reply for me. runtime1.go
symtab.go
Here was the print results:
|
ping @randall77 |
The modules slice is getting corrupted somehow. I don't see how that's possible. The rest of this post is grasping at straws... Bug in GC?
That will provide another GC root that might keep the modules slice alive. You might also try 1.11 and 1.12, to see if that affects anything. |
@agnivade @randall77 thanks ,I will have a try. |
Timed out in state WaitingForInfo. Closing. (I am just a bot, though. Please speak up if this is a mistake or you have the requested information.) |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I build kube-proxy on my mathine ,and deliver it to aws virtural mathine which is centos 7(3.18.6-2.el7.centos.x86_64 #1 SMP Mon Oct 24 13:01:33 CST 2016 x86_64 x86_64 x86_64 GNU/Linux),it occur error when run kube-proxy,the errors were below:
output log
panic: runtime error: index out of rangegoroutine 1 [running]:
reflect.typelinks(0x12b9208, 0xa, 0xb, 0xc420908b00, 0xb, 0x20)
/usr/local/go/src/runtime/runtime1.go:474 +0x3b9
reflect.typesByString(0xc420908b00, 0xb, 0x1, 0x12b9208, 0xa)
/usr/local/go/src/reflect/type.go:1751 +0x34
reflect.(*rtype).ptrTo(0x14eafa0, 0xc420908ba8)
/usr/local/go/src/reflect/type.go:1437 +0xe4
reflect.PtrTo(0x179c460, 0x14eafa0, 0xc42058a400, 0x21ffd30)
/usr/local/go/src/reflect/type.go:1422 +0x3c
k8s.io/kubernetes/vendor/github.com/modern-go/reflect2.newUnsafeType(0xc420099610, 0x179c460, 0x14eafa0, 0x15e57a0)
/home/zhxq/go/src/k8s.io/kubernetes/_output/local/go/src/k8s.io/kubernetes/vendor/github.com/modern-go/reflect2/unsafe_type.go:21 +0x50
k8s.io/kubernetes/vendor/github.com/modern-go/reflect2.newUnsafePtrType(0xc420099610, 0x179c460, 0x14eafa0, 0xc420908c88)
/home/zhxq/go/src/k8s.io/kubernetes/_output/local/go/src/k8s.io/kubernetes/vendor/github.com/modern-go/reflect2/unsafe_ptr.go:14 +0x43
k8s.io/kubernetes/vendor/github.com/modern-go/reflect2.(*frozenConfig).wrapType(0xc420099610, 0x179c460, 0x14eafa0, 0x0, 0x0)
/home/zhxq/go/src/k8s.io/kubernetes/_output/local/go/src/k8s.io/kubernetes/vendor/github.com/modern-go/reflect2/reflect2.go:190 +0x1fe
k8s.io/kubernetes/vendor/github.com/modern-go/reflect2.(*frozenConfig).Type2(0xc420099610, 0x179c460, 0x14eafa0, 0x0, 0x0)
/home/zhxq/go/src/k8s.io/kubernetes/_output/local/go/src/k8s.io/kubernetes/vendor/github.com/modern-go/reflect2/reflect2.go:158 +0xa9
k8s.io/kubernetes/vendor/github.com/modern-go/reflect2.(*frozenConfig).TypeOf(0xc420099610, 0x14eafa0, 0xc4206d22c0, 0x46f500, 0x14eafa0)
/home/zhxq/go/src/k8s.io/kubernetes/_output/local/go/src/k8s.io/kubernetes/vendor/github.com/modern-go/reflect2/reflect2.go:149 +0xb9
k8s.io/kubernetes/vendor/github.com/modern-go/reflect2.TypeOf(0x14eafa0, 0xc4206d22c0, 0x0, 0x0)
/home/zhxq/go/src/k8s.io/kubernetes/_output/local/go/src/k8s.io/kubernetes/vendor/github.com/modern-go/reflect2/reflect2.go:208 +0x41
k8s.io/kubernetes/vendor/github.com/json-iterator/go.(*Iterator).ReadVal(0xc420011700, 0x14eafa0, 0xc4206d22c0)
/home/zhxq/go/src/k8s.io/kubernetes/_output/local/go/src/k8s.io/kubernetes/vendor/github.com/json-iterator/go/reflect.go:66 +0xe6
k8s.io/kubernetes/vendor/github.com/json-iterator/go.(*frozenConfig).Unmarshal(0xc42004a500, 0xc42095c000, 0x182, 0x2f8, 0x14eafa0, 0xc4206d22c0, 0x0, 0x0)
/home/zhxq/go/src/k8s.io/kubernetes/_output/local/go/src/k8s.io/kubernetes/vendor/github.com/json-iterator/go/config.go:345 +0xb0
i suspect the len of 'modules' in /usr/local/go/src/runtime/runtime1.go:474 is zero,so i print it:
the result is
modules is [0/0]0x0
Starting program: /usr/bin/kube-proxy --logtostderr=true --v=6 --kubeconfig=/etc/kubernetes/proxy-kubeconfig
modules is [1/1]0xc42000c000
modules is [1/1]0xc42000c000
modules is [1/1]0xc42000c000
modules is [1/1]0xc42000c000
modules is [1/1]0xc42000c000
modules is [1/1]0xc42000c000
modules is [1/1]0xc42000c000
modules is [1/1]0xc42000c000
modules is [1/1]0xc42000c000
modules is [1/1]0xc42000c000
modules is [1/1]0xc42000c000
modules is [1/1]0xc42000c000
I0202 16:13:41.003867 10469 flags.go:27] FLAG: --alsologtostderr="false"
I0202 16:13:41.003897 10469 flags.go:27] FLAG: --bind-address="0.0.0.0"
I0202 16:13:41.003902 10469 flags.go:27] FLAG: --cleanup="false"
I0202 16:13:41.003906 10469 flags.go:27] FLAG: --cleanup-iptables="false"
I0202 16:13:41.003909 10469 flags.go:27] FLAG: --cleanup-ipvs="true"
I0202 16:13:41.003912 10469 flags.go:27] FLAG: --cluster-cidr=""
I0202 16:13:41.003916 10469 flags.go:27] FLAG: --config=""
I0202 16:13:41.003919 10469 flags.go:27] FLAG: --config-sync-period="15m0s"
I0202 16:13:41.003926 10469 flags.go:27] FLAG: --conntrack-max="0"
I0202 16:13:41.003930 10469 flags.go:27] FLAG: --conntrack-max-per-core="32768"
I0202 16:13:41.003933 10469 flags.go:27] FLAG: --conntrack-min="131072"
I0202 16:13:41.003936 10469 flags.go:27] FLAG: --conntrack-tcp-timeout-close-wait="1h0m0s"
I0202 16:13:41.003939 10469 flags.go:27] FLAG: --conntrack-tcp-timeout-established="24h0m0s"
I0202 16:13:41.003943 10469 flags.go:27] FLAG: --feature-gates=""
I0202 16:13:41.003947 10469 flags.go:27] FLAG: --healthz-bind-address="0.0.0.0:10256"
I0202 16:13:41.003950 10469 flags.go:27] FLAG: --healthz-port="10256"
I0202 16:13:41.003953 10469 flags.go:27] FLAG: --help="false"
I0202 16:13:41.003956 10469 flags.go:27] FLAG: --hostname-override=""
I0202 16:13:41.003960 10469 flags.go:27] FLAG: --iptables-masquerade-bit="14"
I0202 16:13:41.003963 10469 flags.go:27] FLAG: --iptables-min-sync-period="0s"
I0202 16:13:41.003966 10469 flags.go:27] FLAG: --iptables-sync-period="30s"
I0202 16:13:41.003969 10469 flags.go:27] FLAG: --ipvs-min-sync-period="0s"
I0202 16:13:41.003972 10469 flags.go:27] FLAG: --ipvs-scheduler=""
I0202 16:13:41.003975 10469 flags.go:27] FLAG: --ipvs-sync-period="30s"
I0202 16:13:41.003978 10469 flags.go:27] FLAG: --kube-api-burst="10"
I0202 16:13:41.003981 10469 flags.go:27] FLAG: --kube-api-content-type="application/vnd.kubernetes.protobuf"
I0202 16:13:41.003984 10469 flags.go:27] FLAG: --kube-api-qps="5"
I0202 16:13:41.003989 10469 flags.go:27] FLAG: --kubeconfig="/etc/kubernetes/proxy-kubeconfig"
I0202 16:13:41.003992 10469 flags.go:27] FLAG: --log-backtrace-at=":0"
I0202 16:13:41.003997 10469 flags.go:27] FLAG: --log-dir=""
I0202 16:13:41.004000 10469 flags.go:27] FLAG: --log-flush-frequency="5s"
I0202 16:13:41.004003 10469 flags.go:27] FLAG: --logtostderr="true"
I0202 16:13:41.004006 10469 flags.go:27] FLAG: --masquerade-all="false"
I0202 16:13:41.004009 10469 flags.go:27] FLAG: --master=""
I0202 16:13:41.004012 10469 flags.go:27] FLAG: --metrics-bind-address="127.0.0.1:10249"
I0202 16:13:41.004016 10469 flags.go:27] FLAG: --nodeport-addresses="[]"
I0202 16:13:41.004021 10469 flags.go:27] FLAG: --oom-score-adj="-999"
I0202 16:13:41.004024 10469 flags.go:27] FLAG: --profiling="false"
I0202 16:13:41.004027 10469 flags.go:27] FLAG: --proxy-mode=""
I0202 16:13:41.004031 10469 flags.go:27] FLAG: --proxy-port-range=""
I0202 16:13:41.004035 10469 flags.go:27] FLAG: --resource-container="/kube-proxy"
I0202 16:13:41.004038 10469 flags.go:27] FLAG: --stderrthreshold="2"
I0202 16:13:41.004041 10469 flags.go:27] FLAG: --udp-timeout="250ms"
I0202 16:13:41.004044 10469 flags.go:27] FLAG: --v="6"
I0202 16:13:41.004047 10469 flags.go:27] FLAG: --version="false"
I0202 16:13:41.004051 10469 flags.go:27] FLAG: --vmodule=""
I0202 16:13:41.004055 10469 flags.go:27] FLAG: --write-config-to=""
W0202 16:13:41.004060 10469 server.go:195] WARNING: all flags other than --config, --write-config-to, and --cleanup are deprecated. Please begin using a config file ASAP.
I0202 16:13:41.004088 10469 feature_gate.go:226] feature gates: &{map[]}
Detaching after fork from child process 10494.
Detaching after fork from child process 10495.
I0202 16:13:41.005956 10469 iptables.go:590] couldn't get iptables-restore version; assuming it doesn't support --wait
I0202 16:13:41.006009 10469 conn.go:149] in Dial tr is %s&{0xc4200201d8 false}
I0202 16:13:41.006028 10469 conn.go:150] in Dial err is ====%s
I0202 16:13:41.006034 10469 conn.go:118] in SystemBusPrivate %s&{0xc420941bc0 0xc420855aa0 false [] {{0 0} 0 0 0 0} {0 0} 1 map[0:true] map[] {{0 0} 0 0 0 0} map[] {{0 0} 0 0 0 0} 0xc420363800 false {{0 0} 0 0 0 0} [] {0 0} {0 0}}
I0202 16:13:41.006571 10469 iptables.go:199] Could not connect to D-Bus system bus: runtime error: index out of range
[New LWP 10492]
Detaching after fork from child process 10496.
modules is [0/0]0x0
panic: runtime error: index out of range
I did the same work on my another server which was a virtual mathine(3.18.6-2.el7.centos.x86_64 #1 SMP Mon Oct 24 13:01:33 CST 2016 x86_64 x86_64 x86_64 GNU/Linux) , however the kube-proxy can work well:
so,is there any difference between on aws machine and mine(has the same os)? or the goland need some moudle which must installed???
gdb kube-proxy
set args --logtostderr=true --v=6 --kubeconfig=/etc/kubernetes/proxy-kubeconfig
run
Starting program: /home/zhxq/./kube-proxy --logtostderr=true --v=6 --kubeconfig=/etc/kubernetes/proxy-kubeconfig
modules is [1/1]0xc42000c000
modules is [1/1]0xc42000c000
modules is [1/1]0xc42000c000
modules is [1/1]0xc42000c000
modules is [1/1]0xc42000c000
modules is [1/1]0xc42000c000
modules is [1/1]0xc42000c000
modules is [1/1]0xc42000c000
modules is [1/1]0xc42000c000
modules is [1/1]0xc42000c000
modules is [1/1]0xc42000c000
modules is [1/1]0xc42000c000
I0202 16:15:26.889983 11754 flags.go:27] FLAG: --alsologtostderr="false"
I0202 16:15:26.890082 11754 flags.go:27] FLAG: --bind-address="0.0.0.0"
I0202 16:15:26.890093 11754 flags.go:27] FLAG: --cleanup="false"
I0202 16:15:26.890102 11754 flags.go:27] FLAG: --cleanup-iptables="false"
I0202 16:15:26.890109 11754 flags.go:27] FLAG: --cleanup-ipvs="true"
I0202 16:15:26.890115 11754 flags.go:27] FLAG: --cluster-cidr=""
I0202 16:15:26.890123 11754 flags.go:27] FLAG: --config=""
I0202 16:15:26.890129 11754 flags.go:27] FLAG: --config-sync-period="15m0s"
I0202 16:15:26.890137 11754 flags.go:27] FLAG: --conntrack-max="0"
I0202 16:15:26.890145 11754 flags.go:27] FLAG: --conntrack-max-per-core="32768"
I0202 16:15:26.890155 11754 flags.go:27] FLAG: --conntrack-min="131072"
I0202 16:15:26.890162 11754 flags.go:27] FLAG: --conntrack-tcp-timeout-close-wait="1h0m0s"
I0202 16:15:26.890169 11754 flags.go:27] FLAG: --conntrack-tcp-timeout-established="24h0m0s"
I0202 16:15:26.890176 11754 flags.go:27] FLAG: --feature-gates=""
I0202 16:15:26.890184 11754 flags.go:27] FLAG: --healthz-bind-address="0.0.0.0:10256"
I0202 16:15:26.890191 11754 flags.go:27] FLAG: --healthz-port="10256"
I0202 16:15:26.890198 11754 flags.go:27] FLAG: --help="false"
I0202 16:15:26.890204 11754 flags.go:27] FLAG: --hostname-override=""
I0202 16:15:26.890211 11754 flags.go:27] FLAG: --iptables-masquerade-bit="14"
I0202 16:15:26.890217 11754 flags.go:27] FLAG: --iptables-min-sync-period="0s"
I0202 16:15:26.890224 11754 flags.go:27] FLAG: --iptables-sync-period="30s"
I0202 16:15:26.890231 11754 flags.go:27] FLAG: --ipvs-min-sync-period="0s"
I0202 16:15:26.890237 11754 flags.go:27] FLAG: --ipvs-scheduler=""
I0202 16:15:26.890243 11754 flags.go:27] FLAG: --ipvs-sync-period="30s"
I0202 16:15:26.890250 11754 flags.go:27] FLAG: --kube-api-burst="10"
I0202 16:15:26.890256 11754 flags.go:27] FLAG: --kube-api-content-type="application/vnd.kubernetes.protobuf"
I0202 16:15:26.890263 11754 flags.go:27] FLAG: --kube-api-qps="5"
I0202 16:15:26.890272 11754 flags.go:27] FLAG: --kubeconfig="/etc/kubernetes/proxy-kubeconfig"
I0202 16:15:26.890279 11754 flags.go:27] FLAG: --log-backtrace-at=":0"
I0202 16:15:26.890288 11754 flags.go:27] FLAG: --log-dir=""
I0202 16:15:26.890295 11754 flags.go:27] FLAG: --log-flush-frequency="5s"
I0202 16:15:26.890302 11754 flags.go:27] FLAG: --logtostderr="true"
I0202 16:15:26.890309 11754 flags.go:27] FLAG: --masquerade-all="false"
I0202 16:15:26.890316 11754 flags.go:27] FLAG: --master=""
I0202 16:15:26.890322 11754 flags.go:27] FLAG: --metrics-bind-address="127.0.0.1:10249"
I0202 16:15:26.890329 11754 flags.go:27] FLAG: --nodeport-addresses="[]"
I0202 16:15:26.890340 11754 flags.go:27] FLAG: --oom-score-adj="-999"
I0202 16:15:26.890346 11754 flags.go:27] FLAG: --profiling="false"
I0202 16:15:26.890359 11754 flags.go:27] FLAG: --proxy-mode=""
I0202 16:15:26.890369 11754 flags.go:27] FLAG: --proxy-port-range=""
I0202 16:15:26.890376 11754 flags.go:27] FLAG: --resource-container="/kube-proxy"
I0202 16:15:26.890383 11754 flags.go:27] FLAG: --stderrthreshold="2"
I0202 16:15:26.890390 11754 flags.go:27] FLAG: --udp-timeout="250ms"
I0202 16:15:26.890397 11754 flags.go:27] FLAG: --v="6"
I0202 16:15:26.890404 11754 flags.go:27] FLAG: --version="false"
I0202 16:15:26.890412 11754 flags.go:27] FLAG: --vmodule=""
I0202 16:15:26.890421 11754 flags.go:27] FLAG: --write-config-to=""
W0202 16:15:26.890435 11754 server.go:195] WARNING: all flags other than --config, --write-config-to, and --cleanup are deprecated. Please begin using a config file ASAP.
I0202 16:15:26.890541 11754 feature_gate.go:226] feature gates: &{map[]}
Detaching after fork from child process 11768.
Detaching after fork from child process 11769.
I0202 16:15:26.893229 11754 iptables.go:590] couldn't get iptables-restore version; assuming it doesn't support --wait
[New LWP 11763]
Detaching after fork from child process 11770.
modules is [1/1]0xc42000c000
modules is [1/1]0xc42000c000
modules is [1/1]0xc42000c000
modules is [1/1]0xc42000c000
modules is [1/1]0xc42000c000
modules is [1/1]0xc42000c000
modules is [1/1]0xc42000c000
modules is [1/1]0xc42000c000
modules is [1/1]0xc42000c000
modules is [1/1]0xc42000c000
modules is [1/1]0xc42000c000
modules is [1/1]0xc42000c000
modules is [1/1]0xc42000c000
modules is [1/1]0xc42000c000
modules is [1/1]0xc42000c000
modules is [1/1]0xc42000c000
modules is [1/1]0xc42000c000
modules is [1/1]0xc42000c000
modules is [1/1]0xc42000c000
modules is [1/1]0xc42000c000
modules is [1/1]0xc42000c000
modules is [1/1]0xc42000c000
modules is [1/1]0xc42000c000
modules is [1/1]0xc42000c000
modules is [1/1]0xc42000c000
I0202 16:15:26.900709 11754 loader.go:357] Config loaded from file /etc/kubernetes/proxy-kubeconfig
W0202 16:15:26.901570 11754 server_others.go:290] Can't use ipvs proxier, trying iptables proxier
Detaching after fork from child process 11771.
I0202 16:15:26.902698 11754 server_others.go:140] Using iptables Proxier.
What did you expect to see?
the kube-proxy can work well
What did you see instead?
panic: runtime error: index out of range
The text was updated successfully, but these errors were encountered: