Re: [go-nuts] Undocumented behaviour - panic exiting with exit code 2?

2018-03-06 Thread Rob Pike
Largely in agreement. Moved the conversation to the bug.


On Wed, Mar 7, 2018 at 11:08 AM, Ian Lance Taylor  wrote:

> On Tue, Mar 6, 2018 at 3:55 PM, Rob Pike  wrote:
> > That's poor. Exit code 2 is supposed to mean 'incorrect arguments' in the
> > Unix tradition.
> >
> > Something like 127 or 255 would be better.
>
> I think you actually set it to 2, back in June, 2008, in what is now
> known as git revision aeb43984ec7c86aee220cc56146e0127de4ce2e3.
>
> See the change to runtime.c in
> https://github.com/golang/go/commit/aeb43984ec7c86aee220cc56146e01
> 27de4ce2e3
> .
>
>
> I don't know what Supervisor is but if it is running on a Unix system
> I don't think it should treat exit code 2 as success.
>
> I don't think we should document the exit status of panic except to
> say that it is non-zero.
>
> Ian
>
>
>
> > On Wed, Mar 7, 2018 at 10:39 AM, cachvico 
> wrote:
> >>
> >> Curious why panic appears to exit with code 2
> >> (https://golang.org/src/runtime/panic.go line 757)
> >>
> >> I can't find any mention of this in the spec; this should probably be
> >> documented?
> >>
> >> For example Supervisor treats exit codes 2 (and 0) as "expected" by
> >> default, which leads to processes not restarting on a Go panic.
> >>
> >> Thanks,
> >>
> >> Darren
> >>
> >> --
> >> You received this message because you are subscribed to the Google
> Groups
> >> "golang-nuts" group.
> >> To unsubscribe from this group and stop receiving emails from it, send
> an
> >> email to golang-nuts+unsubscr...@googlegroups.com.
> >> For more options, visit https://groups.google.com/d/optout.
> >
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> > "golang-nuts" group.
> > To unsubscribe from this group and stop receiving emails from it, send an
> > email to golang-nuts+unsubscr...@googlegroups.com.
> > For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] Undocumented behaviour - panic exiting with exit code 2?

2018-03-06 Thread Ian Lance Taylor
On Tue, Mar 6, 2018 at 3:55 PM, Rob Pike  wrote:
> That's poor. Exit code 2 is supposed to mean 'incorrect arguments' in the
> Unix tradition.
>
> Something like 127 or 255 would be better.

I think you actually set it to 2, back in June, 2008, in what is now
known as git revision aeb43984ec7c86aee220cc56146e0127de4ce2e3.

See the change to runtime.c in
https://github.com/golang/go/commit/aeb43984ec7c86aee220cc56146e0127de4ce2e3
.


I don't know what Supervisor is but if it is running on a Unix system
I don't think it should treat exit code 2 as success.

I don't think we should document the exit status of panic except to
say that it is non-zero.

Ian



> On Wed, Mar 7, 2018 at 10:39 AM, cachvico  wrote:
>>
>> Curious why panic appears to exit with code 2
>> (https://golang.org/src/runtime/panic.go line 757)
>>
>> I can't find any mention of this in the spec; this should probably be
>> documented?
>>
>> For example Supervisor treats exit codes 2 (and 0) as "expected" by
>> default, which leads to processes not restarting on a Go panic.
>>
>> Thanks,
>>
>> Darren
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "golang-nuts" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to golang-nuts+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to golang-nuts+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] Undocumented behaviour - panic exiting with exit code 2?

2018-03-06 Thread Rob Pike
https://github.com/golang/go/issues/24284

On Wed, Mar 7, 2018 at 10:55 AM, Rob Pike  wrote:

> That's poor. Exit code 2 is supposed to mean 'incorrect arguments' in the
> Unix tradition.
>
> Something like 127 or 255 would be better.
>
> -rob
>
> On Wed, Mar 7, 2018 at 10:39 AM, cachvico 
> wrote:
>
>> Curious why panic appears to exit with code 2 (
>> https://golang.org/src/runtime/panic.go line 757)
>>
>> I can't find any mention of this in the spec; this should probably be
>> documented?
>>
>> For example Supervisor treats exit codes 2 (and 0) as "expected" by
>> default, which leads to processes not restarting on a Go panic.
>>
>> Thanks,
>>
>> Darren
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "golang-nuts" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to golang-nuts+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] Undocumented behaviour - panic exiting with exit code 2?

2018-03-06 Thread Rob Pike
That's poor. Exit code 2 is supposed to mean 'incorrect arguments' in the
Unix tradition.

Something like 127 or 255 would be better.

-rob

On Wed, Mar 7, 2018 at 10:39 AM, cachvico  wrote:

> Curious why panic appears to exit with code 2 (
> https://golang.org/src/runtime/panic.go line 757)
>
> I can't find any mention of this in the spec; this should probably be
> documented?
>
> For example Supervisor treats exit codes 2 (and 0) as "expected" by
> default, which leads to processes not restarting on a Go panic.
>
> Thanks,
>
> Darren
>
> --
> You received this message because you are subscribed to the Google Groups
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to golang-nuts+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Undocumented behaviour - panic exiting with exit code 2?

2018-03-06 Thread cachvico
Curious why panic appears to exit with code 2 
(https://golang.org/src/runtime/panic.go line 757)

I can't find any mention of this in the spec; this should probably be 
documented?

For example Supervisor treats exit codes 2 (and 0) as "expected" by 
default, which leads to processes not restarting on a Go panic.

Thanks,

Darren

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.