runtime: fix out-of-bounds in stack debugging
runtime: fix out-of-bounds in stack debugging

Currently stackDebug=4 crashes as:

panic: runtime error: index out of range
fatal error: panic on system stack
runtime stack:
runtime.throw(0x607470, 0x15)
	src/runtime/panic.go:527 +0x96
runtime.gopanic(0x5ada00, 0xc82000a1d0)
	src/runtime/panic.go:354 +0xb9
runtime.panicindex()
	src/runtime/panic.go:12 +0x49
runtime.adjustpointers(0xc820065ac8, 0x7ffe58b56100, 0x7ffe58b56318, 0x0)
	src/runtime/stack1.go:428 +0x5fb
runtime.adjustframe(0x7ffe58b56200, 0x7ffe58b56318, 0x1)
	src/runtime/stack1.go:542 +0x780
runtime.gentraceback(0x487760, 0xc820065ac0, 0x0, 0xc820001080, 0x0, 0x0, 0x7fffffff, 0x6341b8, 0x7ffe58b56318, 0x0, ...)
	src/runtime/traceback.go:336 +0xa7e
runtime.copystack(0xc820001080, 0x1000)
	src/runtime/stack1.go:616 +0x3b1
runtime.newstack()
	src/runtime/stack1.go:801 +0xdde

Change-Id: If2d60960231480a9dbe545d87385fe650d6db808
Reviewed-on: https://go-review.googlesource.com/12763
Reviewed-by: Russ Cox <5ad239cb8a44f659eaaee0aa1ea5b94947abe557@golang.org>

jacobhaven/go,cloudflare/go,jdeng/go,ganboing/go-esx,shines77/go,derekmarcotte/go,zhangg/go,NunoEdgarGub1/go,Charlesdong/go-1,vishsingh/go,theif519/go,momchil-velikov/go,ichu501/go,vsdutka/go,sinuos/go,uileyar/go,JioCloud/go,cainiaocome/go,jonahglover/go,constantine001/go,ericsnowcurrently/go,jdeng/go,Samurais/go,leeric92/go,Cofyc/go,ichu501/go,polyverse-security/go,alex-zhang/go,CiscoCloud/go,g522342435/go,dterei/go,CodyGuo/go,golang/go,skatsuta/go,myPublicGit/go,kevinc0825/go,alash3al/go,rachtsingh/gogojuice,lihuanghai/go,nawawi/go,andrewchambers/go,shazow/go,miolini/go,goodlang/good,4ad/go,malvira/go,akutz/go,gohin/go,famorted/go,ImJasonH/go,andrewchambers/go,mgyenik/go,WIZARD-CXY/go,chinanjjohn2012/go,donnel6809/go,undergrowthlinear/go,myPublicGit/go,NunoEdgarGub1/go,rachtsingh/gogojuice,honsiorovskyi/go,Samurais/go,gohin/go,Young55555/go,CarterTsai/go,leeric92/go,gdey/go,GeorgiCodes/go,xiaobodu/go,joshsammut/go,nakedgc/go,constantine001/go,famorted/go,Young55555/go,cookerzhu/go,gohin/go,XuYunnan/go,springning/go,xiaobodu/go,dafyddcrosby/go,momchil-velikov/go,NichoZhang/go,danielsoro/go,derekmarcotte/go,snowsnail/go,AALEKH/go,jmptrader/go,uileyar/go,miolini/go,yuhengye/go,cyberroadie/go,monetate/go,roth1002/go,snowsnail/go,Badredapple/go,sndnvaps/go,ErikDubbelboer/go,XuYunnan/go,uileyar/go,golang/go,4ad/go,cyberroadie/go,jacobsa/go,kim-racktop/go,xiuzhifu/go,odeke-em/go,jameskumar/go,Charlesdong/go-1,suncycheng/go,dafyddcrosby/go,kakuhiroshi/go,vsekhar/elastic-go,fjballest/golang,dafyddcrosby/go,jonahglover/go,golang/go,jefby/go,Samurais/go,devpadawan/go,vanloswang/go,ganboing/go-esx,chinanjjohn2012/go,polyverse-security/go,ichu501/go,youprofit/go,samanalysis/go,mikekap/go,ifagnosticism/go,CodyGuo/go,Endika/go,ericsnowcurrently/go,xujianhai/go,skotti/go,mgyenik/go,CAFxX/go,skatsuta/go,momchil-velikov/go,kakuhiroshi/go,Jordanzuo/go,myPublicGit/go,sinuos/go,ichu501/go,CarterTsai/go,jacobxk/go,AALEKH/go,GeorgiCodes/go,cloudflare/go,jameskumar/go,famorted/go,CAFxX/go,dafyddcrosby/go,derekmarcotte/go,derekmarcotte/go,willjunspecial/go,vsdutka/go,jonathanmarvens/go,kakuhiroshi/go,kim-racktop/go,yasarkunduz/go,sndnvaps/go,xinhuang327/go,jonasi/go,mikekap/go,sinuos/go,albertjin/golang-go,ichu501/go,zhangg/go,undergrowthlinear/go,ImJasonH/go,deft-code/go,sinuos/go,stormltf/go,gohin/go,yangzhongj/go,xinhuang327/go,golang/go,zouchao2010/go,wangfakang/go-1,dafyddcrosby/go,youprofit/go,sndnvaps/go,jacobxk/go,yuhengye/go,xiaobodu/go,vishsingh/go,albertjin/golang-go,suncycheng/go,Charlesdong/go-1,CiscoCloud/go,yasarkunduz/go,Endika/go,undergrowthlinear/go,ganboing/go-esx,alex-zhang/go,yangzhongj/go,yuhengye/go,binarycrusader/go,xinhuang327/go,jonathanmarvens/go,ErikDubbelboer/go,codestation/go,Pulgafree/go,alex-zhang/go,theif519/go,jacobhaven/go,JioCloud/go,ImJasonH/go,ifagnosticism/go,dafyddcrosby/go,xinhuang327/go,beealone/go,ifagnosticism/go,GeorgiCodes/go,rentongzhang/go,mdp/go,zouchao2010/go,joshsammut/go,springning/go,Cofyc/go,NichoZhang/go,suncycheng/go,cyberroadie/go,CodyGuo/go,arschles/go-1,skatsuta/go,Jordanzuo/go,jonasi/go,linux-on-ibm-z/go,parkdy/go,xinhuang327/go,vishsingh/go,Young55555/go,jmptrader/go,monetate/go,zcwfeng/go,ObjectiveJoe/go,rachtsingh/gogojuice,sosop/go,zcwfeng/go,gdey/go,xiaobodu/go,binarycrusader/go,mbrukman/go,snowsnail/go,AALEKH/go,gohin/go,honsiorovskyi/go,devpadawan/go,qskycolor/go,xiuzhifu/go,golang/go,springning/go,CAFxX/go,honsiorovskyi/go,vsdutka/go,cainiaocome/go,jmptrader/go,monetate/go,ImJasonH/go,deft-code/go,odeke-em/go,Stan-Lin-/go,jonathanmarvens/go,Cofyc/go,beealone/go,josharian/go,4ad/go,mbrukman/go,CAFxX/go,vsekhar/elastic-go,kakuhiroshi/go,jdhenke/go,springning/go,Pulgafree/go,cookerzhu/go,yangzhongj/go,baiyunping333/go,xiuzhifu/go,jonathanmarvens/go,greyhwndz/go,danielsoro/go,sosop/go,springning/go,jasonxiong/go,CAFxX/go,mdp/go,malvira/go,Badredapple/go,theass/go,danycoro/go,jmptrader/go,dpatel06/go,kim-racktop/go,zhangg/go,Charlesdong/go-1,jdhenke/go,undergrowthlinear/go,alex-zhang/go,jdhenke/go,4ad/go,jonathanmarvens/go,b54898533/go,jonahglover/go,CiscoCloud/go,wangfakang/go-1,beealone/go,jdhenke/go,jacobsa/go,mbrukman/go,jacobxk/go,skotti/go,shines77/go,arschles/golang-go,NunoEdgarGub1/go,josharian/go,likesea/go,likesea/go,honsiorovskyi/go,zhangg/go,snowsnail/go,ganboing/go-esx,yuhengye/go,beealone/go,uileyar/go,joshsammut/go,malvira/go,sinuos/go,cookerzhu/go,Samurais/go,ifagnosticism/go,ObjectiveJoe/go,jonasi/go,dpatel06/go,zouchao2010/go,gohin/go,shazow/go,CodyGuo/go,shines77/go,xiaobodu/go,skotti/go,jacobxk/go,jonahglover/go,springning/go,jacobhaven/go,dterei/go,parkdy/go,shines77/go,Pulgafree/go,g522342435/go,g522342435/go,greyhwndz/go,linux-on-ibm-z/go,xujianhai/go,youprofit/go,b54898533/go,Stan-Lin-/go,codestation/go,springning/go,CarterTsai/go,AALEKH/go,kakuhiroshi/go,mgyenik/go,miolini/go,slavau/go,likesea/go,rachtsingh/gogojuice,vishsingh/go,JioCloud/go,theif519/go,josharian/go,cloudflare/go,goodlang/good,NichoZhang/go,cainiaocome/go,ifagnosticism/go,famorted/go,monetate/go,zouchao2010/go,Endika/go,kim-racktop/go,sndnvaps/go,vishsingh/go,joshsammut/go,uileyar/go,uileyar/go,vanloswang/go,gohin/go,ganboing/go-esx,alash3al/go,malvira/go,chinanjjohn2012/go,lihuanghai/go,arschles/go-1,jefby/go,CiscoCloud/go,jonathanmarvens/go,jameskumar/go,goodlang/good,xujianhai/go,cookerzhu/go,jacobhaven/go,Samurais/go,greyhwndz/go,snowsnail/go,qskycolor/go,arschles/golang-go,zcwfeng/go,alash3al/go,fjballest/golang,yasarkunduz/go,NichoZhang/go,likesea/go,odeke-em/go,joshsammut/go,myPublicGit/go,golang/go,Badredapple/go,alex-zhang/go,Jordanzuo/go,deft-code/go,kim-racktop/go,mikekap/go,dpatel06/go,jmptrader/go,Badredapple/go,gohin/go,nawawi/go,mikekap/go,binarycrusader/go,vanloswang/go,akutz/go,cloudflare/go,akutz/go,theif519/go,jdeng/go,ganboing/go-esx,momchil-velikov/go,baiyunping333/go,sinuos/go,sosop/go,greyhwndz/go,zhangg/go,linux-on-ibm-z/go,sndnvaps/go,Badredapple/go,AALEKH/go,polyverse-security/go,jdeng/go,rachtsingh/gogojuice,kakuhiroshi/go,mdp/go,arschles/golang-go,xiuzhifu/go,GeorgiCodes/go,vsdutka/go,vsdutka/go,jacobxk/go,AALEKH/go,cainiaocome/go,ichu501/go,alex-zhang/go,GeorgiCodes/go,ErikDubbelboer/go,danielsoro/go,jacobhaven/go,vsekhar/elastic-go,xinhuang327/go,mwhudson/go,Cofyc/go,qskycolor/go,cloudflare/go,monetate/go,Young55555/go,polyverse-security/go,baiyunping333/go,alex-zhang/go,nakedgc/go,baiyunping333/go,mdp/go,wangfakang/go-1,ganboing/go-esx,skatsuta/go,ifagnosticism/go,akutz/go,zhangg/go,parkdy/go,shazow/go,4ad/go,linux-on-ibm-z/go,ErikDubbelboer/go,wangfakang/go-1,myPublicGit/go,kevinc0825/go,baiyunping333/go,Stan-Lin-/go,Endika/go,jasonxiong/go,youprofit/go,qskycolor/go,zcwfeng/go,snowsnail/go,xiuzhifu/go,nawawi/go,ErikDubbelboer/go,dterei/go,ErikDubbelboer/go,suncycheng/go,monetate/go,xujianhai/go,nakedgc/go,vsekhar/elastic-go,goodlang/good,slavau/go,g522342435/go,arschles/go-1,odeke-em/go,gdey/go,cainiaocome/go,parkdy/go,xiuzhifu/go,likesea/go,WIZARD-CXY/go,jdeng/go,jameskumar/go,momchil-velikov/go,youprofit/go,chinanjjohn2012/go,ImJasonH/go,cainiaocome/go,snowsnail/go,Stan-Lin-/go,mbrukman/go,miolini/go,mbrukman/go,danycoro/go,willjunspecial/go,jefby/go,dterei/go,parkdy/go,willjunspecial/go,codestation/go,rentongzhang/go,Pulgafree/go,yangzhongj/go,mdp/go,mdp/go,Stan-Lin-/go,JioCloud/go,mgyenik/go,Charlesdong/go-1,jasonxiong/go,mgyenik/go,ObjectiveJoe/go,codestation/go,andrewchambers/go,jasonxiong/go,fjballest/golang,Young55555/go,willjunspecial/go,sinuos/go,polyverse-security/go,jdeng/go,suncycheng/go,rentongzhang/go,polyverse-security/go,skatsuta/go,andrewchambers/go,samanalysis/go,rachtsingh/gogojuice,g522342435/go,wangfakang/go-1,skatsuta/go,danycoro/go,b54898533/go,wangfakang/go-1,shines77/go,derekmarcotte/go,danycoro/go,jdeng/go,donnel6809/go,nakedgc/go,honsiorovskyi/go,jacobsa/go,vishsingh/go,vsekhar/elastic-go,samanalysis/go,CAFxX/go,christopher-henderson/Go,qskycolor/go,skatsuta/go,stormltf/go,yuhengye/go,famorted/go,jdhenke/go,vishsingh/go,kevinc0825/go,CAFxX/go,b54898533/go,xinhuang327/go,stormltf/go,WIZARD-CXY/go,suncycheng/go,cookerzhu/go,b54898533/go,cyberroadie/go,slavau/go,NunoEdgarGub1/go,zcwfeng/go,odeke-em/go,jdhenke/go,miolini/go,beealone/go,Charlesdong/go-1,CarterTsai/go,Cofyc/go,JioCloud/go,vanloswang/go,yangzhongj/go,theass/go,Young55555/go,ObjectiveJoe/go,dpatel06/go,samanalysis/go,nawawi/go,skotti/go,mdp/go,codestation/go,jefby/go,ichu501/go,fjballest/golang,vanloswang/go,akutz/go,beealone/go,ImJasonH/go,CiscoCloud/go,Cofyc/go,WIZARD-CXY/go,jasonxiong/go,arschles/go-1,akutz/go,4ad/go,b54898533/go,qskycolor/go,samanalysis/go,skotti/go,wangfakang/go-1,derekmarcotte/go,CAFxX/go,derekmarcotte/go,gdey/go,arschles/go-1,roth1002/go,yangzhongj/go,ericsnowcurrently/go,nawawi/go,odeke-em/go,linux-on-ibm-z/go,qskycolor/go,lihuanghai/go,alash3al/go,g522342435/go,b54898533/go,youprofit/go,mwhudson/go,myPublicGit/go,roth1002/go,jdeng/go,NichoZhang/go,mbrukman/go,slavau/go,shazow/go,vanloswang/go,CodyGuo/go,akutz/go,mwhudson/go,CarterTsai/go,kevinc0825/go,shines77/go,zouchao2010/go,alash3al/go,zhangg/go,yasarkunduz/go,yuhengye/go,Endika/go,jacobxk/go,constantine001/go,CiscoCloud/go,dterei/go,sndnvaps/go,zouchao2010/go,uileyar/go,xujianhai/go,famorted/go,cookerzhu/go,alex-zhang/go,skotti/go,jonathanmarvens/go,roth1002/go,baiyunping333/go,donnel6809/go,danielsoro/go,Cofyc/go,sndnvaps/go,ganboing/go-esx,zcwfeng/go,jonasi/go,arschles/golang-go,dterei/go,jefby/go,zcwfeng/go,Young55555/go,sinuos/go,yangzhongj/go,vsekhar/elastic-go,qskycolor/go,rentongzhang/go,malvira/go,mwhudson/go,undergrowthlinear/go,arschles/go-1,kakuhiroshi/go,ImJasonH/go,leeric92/go,famorted/go,lihuanghai/go,skatsuta/go,yasarkunduz/go,skotti/go,Samurais/go,malvira/go,jonasi/go,ifagnosticism/go,NichoZhang/go,shazow/go,Badredapple/go,momchil-velikov/go,ErikDubbelboer/go,shines77/go,devpadawan/go,theass/go,mwhudson/go,cainiaocome/go,andrewchambers/go,nakedgc/go,undergrowthlinear/go,akutz/go,cyberroadie/go,xinhuang327/go,Stan-Lin-/go,dpatel06/go,albertjin/golang-go,willjunspecial/go,youprofit/go,likesea/go,yuhengye/go,Endika/go,nakedgc/go,uileyar/go,devpadawan/go,golang/go,donnel6809/go,NunoEdgarGub1/go,jonahglover/go,mwhudson/go,stormltf/go,jmptrader/go,vsdutka/go,nakedgc/go,theass/go,goodlang/good,Pulgafree/go,constantine001/go,roth1002/go,cyberroadie/go,linux-on-ibm-z/go,jonasi/go,theif519/go,donnel6809/go,donnel6809/go,ObjectiveJoe/go,cookerzhu/go,ericsnowcurrently/go,linux-on-ibm-z/go,likesea/go,AALEKH/go,deft-code/go,rachtsingh/gogojuice,leeric92/go,jmptrader/go,rachtsingh/gogojuice,danielsoro/go,devpadawan/go,Pulgafree/go,GeorgiCodes/go,jameskumar/go,jacobxk/go,jonasi/go,binarycrusader/go,AALEKH/go,arschles/golang-go,yasarkunduz/go,donnel6809/go,mbrukman/go,jacobxk/go,cookerzhu/go,JioCloud/go,joshsammut/go,vanloswang/go,codestation/go,Jordanzuo/go,Jordanzuo/go,g522342435/go,miolini/go,myPublicGit/go,leeric92/go,suncycheng/go,joshsammut/go,roth1002/go,dafyddcrosby/go,samanalysis/go,4ad/go,skotti/go,slavau/go,danycoro/go,cyberroadie/go,devpadawan/go,jacobhaven/go,Cofyc/go,ObjectiveJoe/go,NichoZhang/go,theif519/go,sosop/go,4ad/go,ImJasonH/go,xujianhai/go,arschles/go-1,likesea/go,parkdy/go,CodyGuo/go,jacobhaven/go,NichoZhang/go,chinanjjohn2012/go,malvira/go,g522342435/go,snowsnail/go,andrewchambers/go,Samurais/go,cloudflare/go,jonahglover/go,mgyenik/go,arschles/golang-go,sosop/go,baiyunping333/go,fjballest/golang,rentongzhang/go,ObjectiveJoe/go,momchil-velikov/go,zcwfeng/go,danycoro/go,nawawi/go,Endika/go,NunoEdgarGub1/go,gdey/go,XuYunnan/go,kevinc0825/go,jacobsa/go,jacobsa/go,malvira/go,danielsoro/go,slavau/go,xiaobodu/go,lihuanghai/go,vsdutka/go,XuYunnan/go,albertjin/golang-go,joshsammut/go,sosop/go,Pulgafree/go,golang/go,Samurais/go,kevinc0825/go,arschles/golang-go,cyberroadie/go,jasonxiong/go,odeke-em/go,theass/go,honsiorovskyi/go,monetate/go,greyhwndz/go,chinanjjohn2012/go,zouchao2010/go,Badredapple/go,jameskumar/go,Endika/go,jonasi/go,cainiaocome/go,theass/go,ericsnowcurrently/go,stormltf/go,rentongzhang/go,wangfakang/go-1,jonathanmarvens/go,ericsnowcurrently/go,Stan-Lin-/go,linux-on-ibm-z/go,albertjin/golang-go,vsekhar/elastic-go,samanalysis/go,mgyenik/go,slavau/go,GeorgiCodes/go,XuYunnan/go,nawawi/go,ericsnowcurrently/go,suncycheng/go,derekmarcotte/go,gdey/go,stormltf/go,mbrukman/go,JioCloud/go,theif519/go,jameskumar/go,deft-code/go,ErikDubbelboer/go,josharian/go,binarycrusader/go,undergrowthlinear/go,miolini/go,beealone/go,shazow/go,Charlesdong/go-1,Jordanzuo/go,CarterTsai/go,mdp/go,GeorgiCodes/go,devpadawan/go,kim-racktop/go,alash3al/go,ifagnosticism/go,Jordanzuo/go,deft-code/go,sosop/go,andrewchambers/go,leeric92/go,lihuanghai/go,CodyGuo/go,mwhudson/go,greyhwndz/go,vanloswang/go,monetate/go,odeke-em/go,youprofit/go,CarterTsai/go,roth1002/go,XuYunnan/go,yasarkunduz/go,dpatel06/go,baiyunping333/go,jmptrader/go,goodlang/good,chinanjjohn2012/go,lihuanghai/go,mikekap/go,mikekap/go,gdey/go,xiuzhifu/go,Jordanzuo/go,springning/go,goodlang/good,honsiorovskyi/go,jdhenke/go,ichu501/go,binarycrusader/go,cloudflare/go,danycoro/go,binarycrusader/go,jonahglover/go,ObjectiveJoe/go,albertjin/golang-go,undergrowthlinear/go,CiscoCloud/go,alash3al/go,xujianhai/go,sosop/go,CiscoCloud/go,constantine001/go,jasonxiong/go,cloudflare/go,XuYunnan/go,danielsoro/go,lihuanghai/go,sndnvaps/go,josharian/go,binarycrusader/go,myPublicGit/go,greyhwndz/go,momchil-velikov/go,jasonxiong/go,devpadawan/go,leeric92/go,shazow/go,roth1002/go,zouchao2010/go,honsiorovskyi/go,kevinc0825/go,alash3al/go,jonahglover/go,polyverse-security/go,yasarkunduz/go,willjunspecial/go,constantine001/go,b54898533/go,goodlang/good,willjunspecial/go,arschles/go-1,albertjin/golang-go,theass/go,rentongzhang/go,Badredapple/go,NunoEdgarGub1/go,mikekap/go,vishsingh/go,WIZARD-CXY/go,parkdy/go,mgyenik/go,danycoro/go,jacobhaven/go,parkdy/go,vsdutka/go,jacobsa/go,greyhwndz/go,JioCloud/go,jacobsa/go,CodyGuo/go,yangzhongj/go,xiaobodu/go,rentongzhang/go,josharian/go,dafyddcrosby/go,CarterTsai/go,kakuhiroshi/go,XuYunnan/go,polyverse-security/go,slavau/go,jefby/go,beealone/go,stormltf/go,nawawi/go,yuhengye/go,mwhudson/go,jefby/go,chinanjjohn2012/go,WIZARD-CXY/go,arschles/golang-go,vsekhar/elastic-go,samanalysis/go,stormltf/go,shines77/go,albertjin/golang-go,jacobsa/go,danielsoro/go,zhangg/go,deft-code/go,codestation/go,josharian/go,miolini/go,nakedgc/go,fjballest/golang,Pulgafree/go,kevinc0825/go,mikekap/go,Charlesdong/go-1,willjunspecial/go,jefby/go,constantine001/go,theass/go,xiaobodu/go,gdey/go,dterei/go,dterei/go,NunoEdgarGub1/go,kim-racktop/go,theif519/go,xiuzhifu/go,dpatel06/go,leeric92/go,jameskumar/go,shazow/go,deft-code/go,dpatel06/go,donnel6809/go,fjballest/golang,WIZARD-CXY/go,constantine001/go,WIZARD-CXY/go,josharian/go,ericsnowcurrently/go,andrewchambers/go,kim-racktop/go,fjballest/golang,xujianhai/go,Stan-Lin-/go,codestation/go,famorted/go,jdhenke/go,Young55555/go