Hey! Is anyone here familiar with GOCV (OpenCV wrapper for Golang)?
I'm encountering this weird error. The code from screenshot 1 works great.
But when I try to use the gocv.PointVector struct, I get the following error
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x4c4b10]```
The full code is in screenshot 2. This is the complete log of the non-working code:
Starting
Read the image
Created points array
Created point vector
fatal error: unexpected signal during runtime execution
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x4c4b10]
runtime stack:
runtime.throw(0x50084b, 0x2a)
/usr/local/go/src/runtime/panic.go:1117 +0x72
runtime.sigpanic()
/usr/local/go/src/runtime/signal_unix.go:718 +0x2e5
goroutine 1 [syscall]:
runtime.cgocall(0x4bd310, 0xc00003fe28, 0x4ae737)
/usr/local/go/src/runtime/cgocall.go:154 +0x5b fp=0xc00003fdf8 sp=0xc00003fdc0 pc=0x41f9db
gocv.io/x/gocv._Cfunc_PointVector_Size(0x0, 0x0)
_cgo_gotypes.go:6541 +0x45 fp=0xc00003fe28 sp=0xc00003fdf8 pc=0x4ba165
gocv.io/x/gocv.PointVector.Size.func1(0x0, 0x0)
/go/pkg/mod/gocv.io/x/[email protected]/core.go:2074 +0x4d fp=0xc00003fe58 sp=0xc00003fe28 pc=0x4ba50d
gocv.io/x/gocv.PointVector.Size(0x0, 0xc000010018)
/go/pkg/mod/gocv.io/x/[email protected]/core.go:2074 +0x2b fp=0xc00003fe78 sp=0xc00003fe58 pc=0x4ba32b
main.main()
/usr/src/myapp/main.go:37 +0x296 fp=0xc00003ff88 sp=0xc00003fe78 pc=0x4ba976
runtime.main()
/usr/local/go/src/runtime/proc.go:225 +0x256 fp=0xc00003ffe0 sp=0xc00003ff88 pc=0x451ed6
runtime.goexit()
/usr/local/go/src/runtime/asm_amd64.s:1371 +0x1 fp=0xc00003ffe8 sp=0xc00003ffe0 pc=0x481361
I'm running the commands from Docker with the following commands
docker run --platform linux/amd64 --rm -v "$PWD":/usr/src/myapp -w /usr/src/myapp gocv/opencv sh -c "go build -o main main.go && ./main"
Thank you in advance!