Re: [go-nuts] Curious about this snippet in /src/runtime/proc.go

2017-06-20 Thread Tyler Compton
Sent in a CL for some documentation on this. https://github.com/golang/go/issues/20717 https://go-review.googlesource.com/#/c/46212/ On Mon, Jun 19, 2017 at 10:56 AM wrote: > It won't blank as much as it can get it's hands on. The default value for > the pointer will be

Re: [go-nuts] Curious about this snippet in /src/runtime/proc.go

2017-06-19 Thread n . s . glynn
It won't blank as much as it can get it's hands on. The default value for the pointer will be nil so it will try and assign (causing a panic() hopefully) to force an exit -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this

Re: [go-nuts] Curious about this snippet in /src/runtime/proc.go

2017-06-19 Thread 'Thomas Bushnell, BSG' via golang-nuts
Something similar at https://sourceware.org/git/?p=glibc.git;a=blob;f=stdlib/abort.c;h=19882f3e3dc1ab830431506329c94dcf1d7cc252;hb=HEAD#l138 in the GNU C library. Sometimes you just need to be absolutely certain that a function doesn't return. On Thu, Jun 15, 2017 at 2:16 PM Rob Pike

Re: [go-nuts] Curious about this snippet in /src/runtime/proc.go

2017-06-15 Thread Rob Pike
Code comments can be helpful with unusual situations like this. -rob On Fri, Jun 16, 2017 at 4:25 AM, Goodwin Lawlor wrote: > Thanks for the explanation. > > My random guess was that it's the compiler version of deleting your > browser cache... If exit fails, blank

Re: [go-nuts] Curious about this snippet in /src/runtime/proc.go

2017-06-15 Thread Goodwin Lawlor
Thanks for the explanation. My random guess was that it's the compiler version of deleting your browser cache... If exit fails, blank as much memory as we can get our hands on.  On 15 Jun 2017 6:34 pm, "Ian Lance Taylor" wrote: > On Thu, Jun 15, 2017 at 10:28 AM, Tyler

Re: [go-nuts] Curious about this snippet in /src/runtime/proc.go

2017-06-15 Thread Tyler Compton
Very interesting. I'm not used to looking at Go code from the perspective of an implementer of Go. Somebody should contribute a comment about this upstream :) On Thu, Jun 15, 2017 at 10:34 AM Ian Lance Taylor wrote: > On Thu, Jun 15, 2017 at 10:28 AM, Tyler Compton

Re: [go-nuts] Curious about this snippet in /src/runtime/proc.go

2017-06-15 Thread Ian Lance Taylor
On Thu, Jun 15, 2017 at 10:28 AM, Tyler Compton wrote: > Why not just panic, though? And why the infinite loop, I wonder? The runtime is a special case in many ways, and this is among the more special parts. This loop exists to catch problems while testing new ports. If that

Re: [go-nuts] Curious about this snippet in /src/runtime/proc.go

2017-06-15 Thread Aldrin Leal
I don't know. On Jun 15, 2017 12:29, "Tyler Compton" wrote: > Why not just panic, though? And why the infinite loop, I wonder? > > On Thu, Jun 15, 2017 at 9:56 AM Aldrin Leal wrote: > >> Force a panic in case exit fails? >> >> -- >> -- Aldrin Leal,

Re: [go-nuts] Curious about this snippet in /src/runtime/proc.go

2017-06-15 Thread Tyler Compton
Why not just panic, though? And why the infinite loop, I wonder? On Thu, Jun 15, 2017 at 9:56 AM Aldrin Leal wrote: > Force a panic in case exit fails? > > -- > -- Aldrin Leal, / http://about.me/aldrinleal > > On Thu, Jun 15, 2017 at 4:54 AM,

Re: [go-nuts] Curious about this snippet in /src/runtime/proc.go

2017-06-15 Thread Aldrin Leal
Force a panic in case exit fails? -- -- Aldrin Leal, / http://about.me/aldrinleal On Thu, Jun 15, 2017 at 4:54 AM, wrote: > Hey, > > Learning golang at the moment and came across this at the end of func > main() in proc.go in the golang source

[go-nuts] Curious about this snippet in /src/runtime/proc.go

2017-06-15 Thread goodwin . lawlor
Hey, Learning golang at the moment and came across this at the end of func main() in proc.go in the golang source tree. exit(0) for { var x *int32 *x = 0 } Ln 198 - 202 https://golang.org/src/runtime/proc.go How is the for loop ever reached and what's the purpose of the infinite loop,