写了个CGO的调用,用到了crypto这个库,但是程序有时候会正常运行,有时候又会崩溃,都是在同一个地方崩溃。崩溃的情况下报了这个错误:
fatal error: unexpected signal during runtime execution
[signal 0xb code=0x1 addr=0xfffffffff80011c0 pc=0x3dd1c6a437]
runtime stack:
runtime.gothrow(0x6fd250, 0x2a)
/usr/local/go/src/runtime/panic.go:503 +0x8e
runtime.sigpanic()
/usr/local/go/src/runtime/sigpanic_unix.go:14 +0x5e
goroutine 1 [syscall, locked to thread]:
runtime.cgocall_errno(0x401a30, 0xc20807ada0, 0x0)
/usr/local/go/src/runtime/cgocall.go:130 +0xf5 fp=0xc20807ad80 sp=0xc20807ad58
mendicant/check._Cfunc_check_sign(0x7f80f80008c0, 0x7f80f8000a30, 0x7f80000000ae, 0xc200000000)
mendicant/check/_obj/_cgo_gotypes.go:34 +0x43 fp=0xc20807ada0 sp=0xc20807ad80
mendicant/check.CheckModule()
/home/csy/goitem/src/mendicant/check/check.go:54 +0xaae fp=0xc20807af78 sp=0xc20807ada0
main.Test_Check()
/home/csy/goitem/src/mendicant/test/testmain.go:28 +0x1b fp=0xc20807af80 sp=0xc20807af78
main.main()
/home/csy/goitem/src/mendicant/test/testmain.go:20 +0x2f fp=0xc20807af98 sp=0xc20807af80
runtime.main()
/usr/local/go/src/runtime/proc.go:63 +0xf3 fp=0xc20807afe0 sp=0xc20807af98
runtime.goexit()
/usr/local/go/src/runtime/asm_amd64.s:2232 +0x1 fp=0xc20807afe8 sp=0xc20807afe0
goroutine 17 [syscall, locked to thread]:
runtime.goexit()
/usr/local/go/src/runtime/asm_amd64.s:2232 +0x1
有疑问加站长微信联系(非本文作者)