opc icon indicating copy to clipboard operation
opc copied to clipboard

Higher versions of Golang will crash

Open eddielth opened this issue 7 months ago • 4 comments

At that time, I was using a higher version of Golang (Version>=1.14),when this method is executed, an error will be reported and the program will crash. D:\go\pkg\mod\github.com\go-ole\[email protected]\oleutil\oleutil.go

func CallMethod(disp *ole.IDispatch, name string, params ...interface{}) (result *ole.VARIANT, err error) { return disp.InvokeWithOptionalArgs(name, ole.DISPATCH_METHOD, params) }

The panic error such as blows: textual

  • textual.color
  • textual.number
  • textual.random
  • textual.weekday Exception 0xc0000005 0x0 0x566a7d10 0x1f51b1d9 PC=0x1f51b1d9

runtime.cgocall(0x887d20, 0xd81c20) D:/software/go/src/runtime/cgocall.go:158 +0x4a fp=0xc000129a28 sp=0xc0001299f0 pc=0x8248ea syscall.SyscallN(0x0?, {0xc000129ac0?, 0x0?, 0xd81960?}) D:/software/go/src/runtime/syscall_windows.go:557 +0x109 fp=0xc000129aa0 sp=0xc000129a28 pc=0x882f69 syscall.Syscall9(0xc000000000?, 0x824987?, 0xc000046000?, 0xc000129bb8?, 0x882f9c?, 0x887d20?, 0xd81c20?, 0xc000129bd8?, 0x882f9c?, 0xc000129c70, ...) D:/software/go/src/runtime/syscall_windows.go:507 +0x78 fp=0xc000129b18 sp=0xc000129aa0 pc=0x882e38 github.com/go-ole/go-ole.invoke(0x26b566a7a20, 0x6002000b, 0x1, {0xc000129db0, 0x2, 0x26b566a7a20?}) D:/go/pkg/mod/github.com/go-ole/[email protected]/idispatch_windows.go:175 +0x14e6 fp=0xc000129d00 sp=0xc000129b18 pc=0x92da66 github.com/go-ole/go-ole.(*IDispatch).Invoke(...) D:/go/pkg/mod/github.com/go-ole/[email protected]/idispatch.go:27 github.com/go-ole/go-ole.(*IDispatch).InvokeWithOptionalArgs(0x9?, {0xb2145e?, 0x11?}, 0x94e0?, {0xc000129db0, 0x2, 0x2}) D:/go/pkg/mod/github.com/go-ole/[email protected]/idispatch.go:71 +0x85 fp=0xc000129d48 sp=0xc000129d00 pc=0x92c005 github.com/go-ole/go-ole/oleutil.CallMethod(...) D:/go/pkg/mod/github.com/go-ole/[email protected]/oleutil/oleutil.go:51 github.com/konimarti/opc.(*AutomationItems).addSingle(0xc0000538c0, {0xc000076a20, 0xd}) D:/go/src/github.com/konimarti/opc/connection_windows.go:263 +0xb5 fp=0xc000129de0 sp=0xc000129d48 pc=0xaa6ad5 github.com/konimarti/opc.(*AutomationItems).Add(0xac94e0?, {0xc00005e400?, 0x4, 0xc000052220?}) D:/go/src/github.com/konimarti/opc/connection_windows.go:275 +0xe5 fp=0xc000129e40 sp=0xc000129de0 pc=0xaa6d05 github.com/konimarti/opc.NewConnection({0xb24e62, 0x11}, {0xc000052220, 0x1, 0x1}, {0xc00005e400, 0x4, 0x4}) D:/go/src/github.com/konimarti/opc/connection_windows.go:473 +0xcb fp=0xc000129ee8 sp=0xc000129e40 pc=0xaa84eb main.main() D:/go/src/github.com/konimarti/opc/example/browser.go:26 +0xd6 fp=0xc000129f80 sp=0xc000129ee8 pc=0xaa9e36 runtime.main() D:/software/go/src/runtime/proc.go:250 +0x1fe fp=0xc000129fe0 sp=0xc000129f80 pc=0x85ba3e runtime.goexit() D:/software/go/src/runtime/asm_amd64.s:1594 +0x1 fp=0xc000129fe8 sp=0xc000129fe0 pc=0x886461

goroutine 2 [force gc (idle)]: runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?) D:/software/go/src/runtime/proc.go:363 +0xd6 fp=0xc000049fb0 sp=0xc000049f90 pc=0x85bdd6 runtime.goparkunlock(...) D:/software/go/src/runtime/proc.go:369 runtime.forcegchelper() D:/software/go/src/runtime/proc.go:302 +0xb1 fp=0xc000049fe0 sp=0xc000049fb0 pc=0x85bc71 runtime.goexit() D:/software/go/src/runtime/asm_amd64.s:1594 +0x1 fp=0xc000049fe8 sp=0xc000049fe0 pc=0x886461 created by runtime.init.6 D:/software/go/src/runtime/proc.go:290 +0x25

goroutine 3 [GC sweep wait]: runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?) D:/software/go/src/runtime/proc.go:363 +0xd6 fp=0xc00004bf90 sp=0xc00004bf70 pc=0x85bdd6 runtime.goparkunlock(...) D:/software/go/src/runtime/proc.go:369 runtime.bgsweep(0x0?) D:/software/go/src/runtime/mgcsweep.go:278 +0x8e fp=0xc00004bfc8 sp=0xc00004bf90 pc=0x84552e runtime.gcenable.func1() D:/software/go/src/runtime/mgc.go:178 +0x26 fp=0xc00004bfe0 sp=0xc00004bfc8 pc=0x83a0c6 runtime.goexit() D:/software/go/src/runtime/asm_amd64.s:1594 +0x1 fp=0xc00004bfe8 sp=0xc00004bfe0 pc=0x886461 created by runtime.gcenable D:/software/go/src/runtime/mgc.go:178 +0x6b

eddielth avatar Nov 28 '23 02:11 eddielth