原因:go test时,使用了-race选项,关闭该选项后,问题不再出现。
参考说明
具体问题如下:
| objc[15448]: Attempt to use unknown class 0x7ff85e800260.
| SIGABRT: abort
| PC=0x7ff81cfb8dfe m=0 sigcode=0
| signal arrived during cgo execution
| goroutine 1 [syscall, locked to thread]:
| runtime.cgocall(0x1001820, 0xc0001391f0, 0xc000130028)
| /Users/lianyz/.go/go1.16.2/src/runtime/cgocall.go:154 +0x7a fp=0xc0001391c0 sp=0xc000139188 pc=0x1044e9a
| os/user._Cfunc_mygetpwuid_r(0x1f5, 0xc00010e140, 0x2b808200, 0x1000, 0xc000130028, 0x0)
| _cgo_gotypes.go:181 +0x6b fp=0xc0001391f0 sp=0xc0001391c0 pc=0x141ffab
| os/user.lookupUnixUid.func1.1(0x1f5, 0xc00010e140, 0xc00011ae80, 0xc000130028, 0x1a43d00)
...