Are you making an explicit call to panic(), or is it a crash from inside 
some cgo?  If you are calling panic() is it from somewhere unusual like a 
signal handler?

I tried a small cgo program to fault and it still exited with code 1 (under 
macOS anyway) - incidentally the word "panic" doesn't appear in the output.
>
>
package main

// typedef int (*intFunc) ();
//
// int
// bridge_int_func()
// {
// return ((intFunc)0)();
// }
import "C"
import "fmt"

func main() {
fmt.Println(int(C.bridge_int_func()))
}

And this one exits with code 2:

package main

// int
// bridge_int_func()
// {
// return *(volatile int *)0;
// }
import "C"
import "fmt"

func main() {
fmt.Println(int(C.bridge_int_func()))
}

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/ecfa791d-8c3d-430d-8588-588253143f1ao%40googlegroups.com.

Reply via email to