robotgo icon indicating copy to clipboard operation
robotgo copied to clipboard

GetPid panic

Open qianlifeng opened this issue 1 year ago • 0 comments

  • Robotgo version (or commit ref): a780825c0931
  • Go version: 1.21.1
  • Gcc version: Apple clang version 15.0.0 (clang-1500.0.40.1)
  • Operating system and bit: macos arm64
  • Resolution:
  • Can you reproduce the bug
    • [x] Yes (provide example code)
    • [ ] No
    • [ ] Not relevant

Steps to reproduce:

  1. select some file on desktop in macos
  2. invoke robotgo.GetPid() in the background (in my case, hotkey to trigger)
  3. panic happen

panic log

SIGBUS: bus error
PC=0x18db6806c m=7 sigcode=1
signal arrived during cgo execution

goroutine 504 [syscall]:
runtime.cgocall(0x1007bd8ac, 0x140000ab908)
        /opt/homebrew/opt/go/libexec/src/runtime/cgocall.go:157 +0x44 fp=0x140000ab8d0 sp=0x140000ab890 pc=0x10028d384
github.com/go-vgo/robotgo._Cfunc_get_PID()
        _cgo_gotypes.go:540 +0x34 fp=0x140000ab900 sp=0x140000ab8d0 pc=0x100724f44
github.com/go-vgo/robotgo.GetPid()
        /Users/qianlifeng/go/pkg/mod/github.com/go-vgo/[email protected]/robotgo.go:1012 +0x20 fp=0x140000ab930 sp=0x140000ab900 pc=0x100725470

qianlifeng avatar Nov 02 '23 13:11 qianlifeng