Skip to content

Random crash on Mac OS after running few minutes #31

@nvdhau-v2cloud

Description

@nvdhau-v2cloud

I tried the precompiled for Mac OS. It works but randomly crashes after a few minutes.

Command: cam2ip' -bind-addr :62001 -delay 100
OS: Mac OS 11.2.3

Logs:

Listening on :62001
fatal error: unexpected signal during runtime execution
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x7fff274a81c9]
runtime stack:
runtime.throw(0x49a96c4, 0x2a)
/home/milann/go/src/runtime/panic.go:774 +0x72
runtime.sigpanic()
/home/milann/go/src/runtime/signal_unix.go:378 +0x47c
goroutine 40 [syscall]:
runtime.cgocall(0x43b7fe0, 0xc00025f7a0, 0x1)
/home/milann/go/src/runtime/cgocall.go:128 +0x5b fp=0xc00025f770 sp=0xc00025f738 pc=0x40058eb
github.com/gen2brain/go-opencv/opencv._Cfunc_cvGrabFrame(0x52056c0, 0x0)
_cgo_gotypes.go:2108 +0x49 fp=0xc00025f7a0 sp=0xc00025f770 pc=0x4200649
github.com/gen2brain/go-opencv/opencv.(*Capture).GrabFrame.func1(0x52056c0, 0xc000092e00)
/home/milann/golang/pkg/mod/github.com/gen2brain/go-opencv@v0.0.0-20191005190506-bf186fc94f7a/opencv/highgui.go:497 +0x56 fp=0xc00025f7d8 sp=0xc00025f7a0 pc=0x4207c06
github.com/gen2brain/go-opencv/opencv.(*Capture).GrabFrame(0x52056c0, 0xc000146030)
/home/milann/golang/pkg/mod/github.com/gen2brain/go-opencv@v0.0.0-20191005190506-bf186fc94f7a/opencv/highgui.go:497 +0x2b fp=0xc00025f7f8 sp=0xc00025f7d8 pc=0x42056ab
github.com/gen2brain/cam2ip/camera.(*Camera).Read(0xc000086580, 0xc00025f960, 0x4a2f480, 0xc0000a2140, 0x0)
/home/milann/Projects/cam2ip/camera/camera_cv2.go:43 +0x44 fp=0xc00025f8a8 sp=0xc00025f7f8 pc=0x42099a4
github.com/gen2brain/cam2ip/handlers.(*MJPEG).ServeHTTP(0xc0000a2520, 0x4a385a0, 0xc0003e4000, 0xc0003d2000)
/home/milann/Projects/cam2ip/handlers/mjpeg.go:59 +0x5cf fp=0xc00025faf0 sp=0xc00025f8a8 pc=0x43b0e2f
github.com/gen2brain/cam2ip/server.newAuthHandler.func1(0x4a385a0, 0xc0003e4000, 0xc0003d2000)
/home/milann/Projects/cam2ip/server/server.go:85 +0x71 fp=0xc00025fb90 sp=0xc00025faf0 pc=0x43b1f51
net/http.HandlerFunc.ServeHTTP(0xc0000a2540, 0x4a385a0, 0xc0003e4000, 0xc0003d2000)
/home/milann/go/src/net/http/server.go:2007 +0x44 fp=0xc00025fbb8 sp=0xc00025fb90 pc=0x4369b64
net/http.(*ServeMux).ServeHTTP(0x4d9d6a0, 0x4a385a0, 0xc0003e4000, 0xc0003d2000)
/home/milann/go/src/net/http/server.go:2387 +0x1bd fp=0xc00025fc18 sp=0xc00025fbb8 pc=0x436ba3d
net/http.serverHandler.ServeHTTP(0xc000118000, 0x4a385a0, 0xc0003e4000, 0xc0003d2000)
/home/milann/go/src/net/http/server.go:2802 +0xa4 fp=0xc00025fc48 sp=0xc00025fc18 pc=0x436cfb4
net/http.(*conn).serve(0xc0003b8000, 0x4a39120, 0xc0003ca000)
/home/milann/go/src/net/http/server.go:1890 +0x875 fp=0xc00025ffc8 sp=0xc00025fc48 pc=0x4368955
runtime.goexit()
/home/milann/go/src/runtime/asm_amd64.s:1357 +0x1 fp=0xc00025ffd0 sp=0xc00025ffc8 pc=0x405c781
created by net/http.(*Server).Serve
/home/milann/go/src/net/http/server.go:2927 +0x38e
goroutine 1 [IO wait]:
internal/poll.runtime_pollWait(0x50b6f68, 0x72, 0x0)
/home/milann/go/src/runtime/netpoll.go:184 +0x55
internal/poll.(*pollDesc).wait(0xc0000f8098, 0x72, 0x0, 0x0, 0x4999adc)
/home/milann/go/src/internal/poll/fd_poll_runtime.go:87 +0x45
internal/poll.(*pollDesc).waitRead(...)
/home/milann/go/src/internal/poll/fd_poll_runtime.go:92
internal/poll.(*FD).Accept(0xc0000f8080, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
/home/milann/go/src/internal/poll/fd_unix.go:384 +0x1f8
net.(*netFD).accept(0xc0000f8080, 0xc0c882361d, 0x6d6cc882361d, 0x100000001)
/home/milann/go/src/net/fd_unix.go:238 +0x42
net.(*TCPListener).accept(0xc0000a25e0, 0x608200f4, 0xc000050bd8, 0x40b5c56)
/home/milann/go/src/net/tcpsock_posix.go:139 +0x32
net.(*TCPListener).Accept(0xc0000a25e0, 0xc000050c28, 0x18, 0xc000000180, 0x436d47e)
/home/milann/go/src/net/tcpsock.go:261 +0x47
net/http.(*Server).Serve(0xc000118000, 0x4a382e0, 0xc0000a25e0, 0x0, 0x0)
/home/milann/go/src/net/http/server.go:2896 +0x286
github.com/gen2brain/cam2ip/server.(*Server).ListenAndServe(0xc0000b4120, 0xc0000aa008, 0x499c9b4)
/home/milann/Projects/cam2ip/server/server.go:71 +0x3e8
main.main()
/home/milann/Projects/cam2ip/cmd/cam2ip/main_cv.go:80 +0x66e
goroutine 52 [IO wait, 2 minutes]:
internal/poll.runtime_pollWait(0x50b6e98, 0x72, 0xffffffffffffffff)
/home/milann/go/src/runtime/netpoll.go:184 +0x55
internal/poll.(*pollDesc).wait(0xc0003d6018, 0x72, 0x0, 0x1, 0xffffffffffffffff)
/home/milann/go/src/internal/poll/fd_poll_runtime.go:87 +0x45
internal/poll.(*pollDesc).waitRead(...)
/home/milann/go/src/internal/poll/fd_poll_runtime.go:92
internal/poll.(*FD).Read(0xc0003d6000, 0xc0003c8041, 0x1, 0x1, 0x0, 0x0, 0x0)
/home/milann/go/src/internal/poll/fd_unix.go:169 +0x22b
net.(*netFD).Read(0xc0003d6000, 0xc0003c8041, 0x1, 0x1, 0x0, 0x0, 0x0)
/home/milann/go/src/net/fd_unix.go:202 +0x4f
net.(*conn).Read(0xc0000aa088, 0xc0003c8041, 0x1, 0x1, 0x0, 0x0, 0x0)
/home/milann/go/src/net/net.go:184 +0x68
net/http.(*connReader).backgroundRead(0xc0003c8030)
/home/milann/go/src/net/http/server.go:677 +0x58
created by net/http.(*connReader).startBackgroundRead
/home/milann/go/src/net/http/server.go:673 +0xd4

Do you have any ideas about the issue?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions