Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fatal error: unexpected signal during runtime execution #29

Closed
aklinkert opened this issue May 1, 2019 · 4 comments
Closed

fatal error: unexpected signal during runtime execution #29

aklinkert opened this issue May 1, 2019 · 4 comments

Comments

@aklinkert
Copy link

aklinkert commented May 1, 2019

Hi,

I'm using this library to read an audio stream (of a click track) and determine when a click happens to start a playback of a light show. Unfortunately the program crashed every now and then, but not in a reproducible interval. The error thrown is the following - any idea what's going on there? :(

fatal error: unexpected signal during runtime execution
[signal SIGSEGV: segmentation violation code=0x1 addr=0xb pc=0x76cc3e4c]
runtime stack:
runtime.throw(0x469cbf, 0x2a)
       /usr/local/go/src/runtime/panic.go:617 +0x5c
runtime.sigpanic()
       /usr/local/go/src/runtime/signal_unix.go:374 +0x3fc
goroutine 93703 [syscall]:
runtime.cgocall(0x39fcf0, 0xc285b4, 0xd5c784)
       /usr/local/go/src/runtime/cgocall.go:128 +0x5c fp=0xc2859c sp=0xc28584 pc=0x150fc
github.com/StageAutoControl/controller/vendor/github.com/gordonklaus/portaudio._Cfunc_Pa_OpenStream(0xd5c784, 0xcf35e0, 0x0, 0x0, 0x40e58880, 0x40, 0x0, 0x0, 0x15, 0x0)
       _cgo_gotypes.go:498 +0x38 fp=0xc285b0 sp=0xc2859c pc=0x1f5e60
github.com/StageAutoControl/controller/vendor/github.com/gordonklaus/portaudio.OpenStream.func1(0xd5c780, 0xcf0100, 0x1, 0x213766b, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
       /etc/controller/src/github.com/StageAutoControl/controller/vendor/github.com/gordonklaus/portaudio/portaudio.go:641 +0x168 fp=0xc285fc sp=0xc285b0 pc=0x1f9480
github.com/StageAutoControl/controller/vendor/github.com/gordonklaus/portaudio.OpenStream(0xcf0100, 0x1, 0x213766b, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x40e58880, ...)
       /etc/controller/src/github.com/StageAutoControl/controller/vendor/github.com/gordonklaus/portaudio/portaudio.go:641 +0xa4 fp=0xc2865c sp=0xc285fc pc=0x1f7360
github.com/StageAutoControl/controller/vendor/github.com/gordonklaus/portaudio.OpenDefaultStream(0x1, 0x0, 0x0, 0x40e58880, 0x40, 0x100bd40, 0x1, 0x1, 0x40007, 0x0, ...)
       /etc/controller/src/github.com/StageAutoControl/controller/vendor/github.com/gordonklaus/portaudio/portaudio.go:677 +0xa0 fp=0xc286dc sp=0xc2865c pc=0x1f74d4
github.com/StageAutoControl/controller/pkg/cntl/waiter.(*Audio).start(0xcf9aa0, 0xb, 0xc0ab80)
       /etc/controller/src/github.com/StageAutoControl/controller/pkg/cntl/waiter/audio.go:37 +0x17c fp=0xc28734 sp=0xc286dc pc=0x1fb604
github.com/StageAutoControl/controller/pkg/cntl/waiter.(*Audio).Wait(0xcf9aa0, 0xe58a00, 0xe58a40, 0x8082d4, 0x0)
       /etc/controller/src/github.com/StageAutoControl/controller/pkg/cntl/waiter/audio.go:87 +0x20 fp=0xc287bc sp=0xc28734 pc=0x1fba78
github.com/StageAutoControl/controller/pkg/cntl/playback.(*Player).wait.func2(0x100bd38, 0xe58a00, 0xe58a40, 0xcf9ad0)
       /etc/controller/src/github.com/StageAutoControl/controller/pkg/cntl/playback/player.go:83 +0x38 fp=0xc287dc sp=0xc287bc pc=0x1fe0cc
runtime.goexit()
       /usr/local/go/src/runtime/asm_arm.s:868 +0x4 fp=0xc287dc sp=0xc287dc pc=0x6fc78
created by github.com/StageAutoControl/controller/pkg/cntl/playback.(*Player).wait
       /etc/controller/src/github.com/StageAutoControl/controller/pkg/cntl/playback/player.go:82 +0xe4
goroutine 1 [IO wait]:
internal/poll.runtime_pollWait(0x635c0ef8, 0x72, 0x0)
       /usr/local/go/src/runtime/netpoll.go:182 +0x48
internal/poll.(*pollDesc).wait(0xd5d874, 0x72, 0x0, 0x0, 0x456184)
       /usr/local/go/src/internal/poll/fd_poll_runtime.go:87 +0x80
internal/poll.(*pollDesc).waitRead(...)
       /usr/local/go/src/internal/poll/fd_poll_runtime.go:92
internal/poll.(*FD).Accept(0xd5d860, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
       /usr/local/go/src/internal/poll/fd_unix.go:384 +0x1b0
net.(*netFD).accept(0xd5d860, 0xfed9253, 0xcabf6ecc, 0x898)
       /usr/local/go/src/net/fd_unix.go:238 +0x20
net.(*TCPListener).accept(0xc10f08, 0x0, 0x1, 0x13bbc)
       /usr/local/go/src/net/tcpsock_posix.go:139 +0x20
net.(*TCPListener).AcceptTCP(0xc10f08, 0x10926a0, 0xc96f8900, 0x49e98)
       /usr/local/go/src/net/tcpsock.go:247 +0x40
net/http.tcpKeepAliveListener.Accept(0xc10f08, 0xdc6cb0, 0xc, 0xc000e0, 0x3185c0)
       /usr/local/go/src/net/http/server.go:3264 +0x1c
net/http.(*Server).Serve(0xd50400, 0x4fbc08, 0xc10f08, 0x0, 0x0)
       /usr/local/go/src/net/http/server.go:2859 +0x1e4
net/http.(*Server).ListenAndServe(0xd50400, 0x4, 0x45b23e)
       /usr/local/go/src/net/http/server.go:2797 +0xd4
github.com/StageAutoControl/controller/pkg/api/server.(*Server).Run(0xcf80f0, 0x4fc1e8, 0xcf2840, 0xc183d0, 0xc, 0xc18301, 0x0)
       /etc/controller/src/github.com/StageAutoControl/controller/pkg/api/server/server.go:110 +0x3e0
github.com/StageAutoControl/controller/cmd.glob..func4(0x7c79d8, 0xd00170, 0x0, 0x2)
       /etc/controller/src/github.com/StageAutoControl/controller/cmd/server.go:46 +0x304
github.com/StageAutoControl/controller/vendor/github.com/spf13/cobra.(*Command).execute(0x7c79d8, 0xd00140, 0x2, 0x2, 0x7c79d8, 0xd00140)
       /etc/controller/src/github.com/StageAutoControl/controller/vendor/github.com/spf13/cobra/command.go:766 +0x204
github.com/StageAutoControl/controller/vendor/github.com/spf13/cobra.(*Command).ExecuteC(0x7c78a8, 0xc6a030, 0x0, 0x1)
       /etc/controller/src/github.com/StageAutoControl/controller/vendor/github.com/spf13/cobra/command.go:850 +0x1f0
github.com/StageAutoControl/controller/vendor/github.com/spf13/cobra.(*Command).Execute(...)
       /etc/controller/src/github.com/StageAutoControl/controller/vendor/github.com/spf13/cobra/command.go:800
github.com/StageAutoControl/controller/cmd.Execute()
       /etc/controller/src/github.com/StageAutoControl/controller/cmd/root.go:64 +0x24
main.main()
       /etc/controller/src/github.com/StageAutoControl/controller/main.go:12 +0x14
goroutine 19 [syscall, 124 minutes]:
os/signal.signal_recv(0x0)
       /usr/local/go/src/runtime/sigqueue.go:139 +0x130
os/signal.loop()
       /usr/local/go/src/os/signal/signal_unix.go:23 +0x14
created by os/signal.init.0
       /usr/local/go/src/os/signal/signal_unix.go:29 +0x30
goroutine 35 [chan receive, 124 minutes]:
github.com/StageAutoControl/controller/vendor/github.com/apinnecke/go-exitcontext.NewWithContext.func1(0xcf06c0, 0xcf6220)
       /etc/controller/src/github.com/StageAutoControl/controller/vendor/github.com/apinnecke/go-exitcontext/context.go:23 +0x24
created by github.com/StageAutoControl/controller/vendor/github.com/apinnecke/go-exitcontext.NewWithContext
       /etc/controller/src/github.com/StageAutoControl/controller/vendor/github.com/apinnecke/go-exitcontext/context.go:22 +0xc8
goroutine 4 [chan receive, 124 minutes]:
github.com/StageAutoControl/controller/cmd.glob..func2.1()
       /etc/controller/src/github.com/StageAutoControl/controller/cmd/root.go:46 +0x40
created by github.com/StageAutoControl/controller/cmd.glob..func2
       /etc/controller/src/github.com/StageAutoControl/controller/cmd/root.go:45 +0x1cc
goroutine 5 [chan receive, 124 minutes]:
github.com/StageAutoControl/controller/pkg/process.(*manager).listenExit(0xc0c660)
       /etc/controller/src/github.com/StageAutoControl/controller/pkg/process/manager.go:37 +0x3c
created by github.com/StageAutoControl/controller/pkg/process.NewManager
       /etc/controller/src/github.com/StageAutoControl/controller/pkg/process/manager.go:31 +0x90
goroutine 6 [select]:
github.com/StageAutoControl/controller/vendor/github.com/jsimonetti/go-artnet.(*Node).pollReplyLoop(0xd56000)
       /etc/controller/src/github.com/StageAutoControl/controller/vendor/github.com/jsimonetti/go-artnet/node.go:132 +0xf0
created by github.com/StageAutoControl/controller/vendor/github.com/jsimonetti/go-artnet.(*Node).Start
       /etc/controller/src/github.com/StageAutoControl/controller/vendor/github.com/jsimonetti/go-artnet/node.go:110 +0x5c4
goroutine 7 [select]:
github.com/StageAutoControl/controller/vendor/github.com/jsimonetti/go-artnet.(*Node).recvLoop(0xd56000)
       /etc/controller/src/github.com/StageAutoControl/controller/vendor/github.com/jsimonetti/go-artnet/node.go:222 +0x9c
created by github.com/StageAutoControl/controller/vendor/github.com/jsimonetti/go-artnet.(*Node).Start
       /etc/controller/src/github.com/StageAutoControl/controller/vendor/github.com/jsimonetti/go-artnet/node.go:111 +0x5e0
goroutine 8 [select]:
github.com/StageAutoControl/controller/vendor/github.com/jsimonetti/go-artnet.(*Node).sendLoop(0xd56000)
       /etc/controller/src/github.com/StageAutoControl/controller/vendor/github.com/jsimonetti/go-artnet/node.go:158 +0x80
created by github.com/StageAutoControl/controller/vendor/github.com/jsimonetti/go-artnet.(*Node).Start
       /etc/controller/src/github.com/StageAutoControl/controller/vendor/github.com/jsimonetti/go-artnet/node.go:112 +0x5fc
goroutine 21 [IO wait]:
internal/poll.runtime_pollWait(0x635c0f7c, 0x72, 0x0)
       /usr/local/go/src/runtime/netpoll.go:182 +0x48
internal/poll.(*pollDesc).wait(0xd5d7d4, 0x72, 0x1000, 0x1000, 0x0)
       /usr/local/go/src/internal/poll/fd_poll_runtime.go:87 +0x80
internal/poll.(*pollDesc).waitRead(...)
       /usr/local/go/src/internal/poll/fd_poll_runtime.go:92
internal/poll.(*FD).ReadFrom(0xd5d7c0, 0xd32f70, 0x1000, 0x1000, 0x0, 0x0, 0x0, 0x0, 0x0)
       /usr/local/go/src/internal/poll/fd_unix.go:219 +0x16c
net.(*netFD).readFrom(0xd5d7c0, 0xd32f70, 0x1000, 0x1000, 0x1, 0x1, 0x3fe14, 0x75a78, 0x176c30)
       /usr/local/go/src/net/fd_unix.go:208 +0x38
net.(*UDPConn).readFrom(0xc10e58, 0xd32f70, 0x1000, 0x1000, 0x178304, 0xc1807c, 0x4, 0x4)
       /usr/local/go/src/net/udpsock_posix.go:47 +0x38
net.(*UDPConn).ReadFromUDP(0xc10e58, 0xd32f70, 0x1000, 0x1000, 0x4, 0x4, 0x1, 0x0)
       /usr/local/go/src/net/udpsock.go:109 +0x44
github.com/StageAutoControl/controller/vendor/github.com/jsimonetti/go-artnet.(*Node).recvLoop.func1(0xd56000)
       /etc/controller/src/github.com/StageAutoControl/controller/vendor/github.com/jsimonetti/go-artnet/node.go:189 +0x6c
created by github.com/StageAutoControl/controller/vendor/github.com/jsimonetti/go-artnet.(*Node).recvLoop
       /etc/controller/src/github.com/StageAutoControl/controller/vendor/github.com/jsimonetti/go-artnet/node.go:186 +0x30
goroutine 10 [select]:
github.com/StageAutoControl/controller/vendor/github.com/jsimonetti/go-artnet.(*Controller).pollLoop(0xc524c0)
       /etc/controller/src/github.com/StageAutoControl/controller/vendor/github.com/jsimonetti/go-artnet/controller.go:171 +0x190
created by github.com/StageAutoControl/controller/vendor/github.com/jsimonetti/go-artnet.(*Controller).Start
       /etc/controller/src/github.com/StageAutoControl/controller/vendor/github.com/jsimonetti/go-artnet/controller.go:130 +0x300
goroutine 11 [runnable]:
github.com/StageAutoControl/controller/vendor/github.com/jsimonetti/go-artnet.(*Controller).dmxUpdateLoop(0xc524c0)
       /etc/controller/src/github.com/StageAutoControl/controller/vendor/github.com/jsimonetti/go-artnet/controller.go:248 +0x730
created by github.com/StageAutoControl/controller/vendor/github.com/jsimonetti/go-artnet.(*Controller).Start
       /etc/controller/src/github.com/StageAutoControl/controller/vendor/github.com/jsimonetti/go-artnet/controller.go:131 +0x31c
goroutine 12 [chan receive, 3 minutes]:
github.com/StageAutoControl/controller/pkg/artnet.(*controller).sendBackground(0xc0c600)
       /etc/controller/src/github.com/StageAutoControl/controller/pkg/artnet/controller.go:106 +0x138
created by github.com/StageAutoControl/controller/pkg/artnet.(*controller).Start
       /etc/controller/src/github.com/StageAutoControl/controller/pkg/artnet/controller.go:65 +0x118
goroutine 13 [chan receive]:
github.com/StageAutoControl/controller/pkg/artnet.(*controller).debugDevices(0xc0c600)
       /etc/controller/src/github.com/StageAutoControl/controller/pkg/artnet/controller.go:127 +0x90
created by github.com/StageAutoControl/controller/pkg/artnet.(*controller).Start
       /etc/controller/src/github.com/StageAutoControl/controller/pkg/artnet/controller.go:66 +0x134
goroutine 14 [chan receive, 124 minutes]:
github.com/StageAutoControl/controller/pkg/api/server.(*Server).Run.func2(0x4fc1e8, 0xcf2840, 0xd50400, 0xcf80f0)
       /etc/controller/src/github.com/StageAutoControl/controller/pkg/api/server/server.go:102 +0x38
created by github.com/StageAutoControl/controller/pkg/api/server.(*Server).Run
       /etc/controller/src/github.com/StageAutoControl/controller/pkg/api/server/server.go:101 +0x358
goroutine 81119 [chan send, 11 minutes]:
github.com/StageAutoControl/controller/pkg/cntl/waiter.(*Audio).notifyWait(0xf40090)
       /etc/controller/src/github.com/StageAutoControl/controller/pkg/cntl/waiter/audio.go:81 +0x44
github.com/StageAutoControl/controller/pkg/cntl/waiter.(*Audio).checkForPeak(0xf40090)
       /etc/controller/src/github.com/StageAutoControl/controller/pkg/cntl/waiter/audio.go:73 +0x60
github.com/StageAutoControl/controller/pkg/cntl/waiter.(*Audio).readStream(0xf40090)
       /etc/controller/src/github.com/StageAutoControl/controller/pkg/cntl/waiter/audio.go:59 +0x3c
created by github.com/StageAutoControl/controller/pkg/cntl/waiter.(*Audio).start
       /etc/controller/src/github.com/StageAutoControl/controller/pkg/cntl/waiter/audio.go:46 +0x334
goroutine 53503 [chan send, 32 minutes]:
github.com/StageAutoControl/controller/pkg/cntl/waiter.(*Audio).notifyWait(0xf40b10)
       /etc/controller/src/github.com/StageAutoControl/controller/pkg/cntl/waiter/audio.go:81 +0x44
github.com/StageAutoControl/controller/pkg/cntl/waiter.(*Audio).checkForPeak(0xf40b10)
       /etc/controller/src/github.com/StageAutoControl/controller/pkg/cntl/waiter/audio.go:73 +0x60
github.com/StageAutoControl/controller/pkg/cntl/waiter.(*Audio).readStream(0xf40b10)
       /etc/controller/src/github.com/StageAutoControl/controller/pkg/cntl/waiter/audio.go:59 +0x3c
created by github.com/StageAutoControl/controller/pkg/cntl/waiter.(*Audio).start
       /etc/controller/src/github.com/StageAutoControl/controller/pkg/cntl/waiter/audio.go:46 +0x334
goroutine 31760 [chan send, 78 minutes]:
github.com/StageAutoControl/controller/pkg/cntl/waiter.(*Audio).notifyWait(0xcfc0c0)
       /etc/controller/src/github.com/StageAutoControl/controller/pkg/cntl/waiter/audio.go:81 +0x44
github.com/StageAutoControl/controller/pkg/cntl/waiter.(*Audio).checkForPeak(0xcfc0c0)
       /etc/controller/src/github.com/StageAutoControl/controller/pkg/cntl/waiter/audio.go:73 +0x60
github.com/StageAutoControl/controller/pkg/cntl/waiter.(*Audio).readStream(0xcfc0c0)
       /etc/controller/src/github.com/StageAutoControl/controller/pkg/cntl/waiter/audio.go:59 +0x3c
created by github.com/StageAutoControl/controller/pkg/cntl/waiter.(*Audio).start
       /etc/controller/src/github.com/StageAutoControl/controller/pkg/cntl/waiter/audio.go:46 +0x334
goroutine 577 [chan send, 117 minutes]:
github.com/StageAutoControl/controller/pkg/cntl/waiter.(*Audio).notifyWait(0xcfcb40)
       /etc/controller/src/github.com/StageAutoControl/controller/pkg/cntl/waiter/audio.go:81 +0x44
github.com/StageAutoControl/controller/pkg/cntl/waiter.(*Audio).checkForPeak(0xcfcb40)
       /etc/controller/src/github.com/StageAutoControl/controller/pkg/cntl/waiter/audio.go:73 +0x60
github.com/StageAutoControl/controller/pkg/cntl/waiter.(*Audio).readStream(0xcfcb40)
       /etc/controller/src/github.com/StageAutoControl/controller/pkg/cntl/waiter/audio.go:59 +0x3c
created by github.com/StageAutoControl/controller/pkg/cntl/waiter.(*Audio).start
       /etc/controller/src/github.com/StageAutoControl/controller/pkg/cntl/waiter/audio.go:46 +0x334
goroutine 10364 [chan send, 110 minutes]:
github.com/StageAutoControl/controller/pkg/cntl/waiter.(*Audio).notifyWait(0x1038ab0)
       /etc/controller/src/github.com/StageAutoControl/controller/pkg/cntl/waiter/audio.go:81 +0x44
github.com/StageAutoControl/controller/pkg/cntl/waiter.(*Audio).checkForPeak(0x1038ab0)
       /etc/controller/src/github.com/StageAutoControl/controller/pkg/cntl/waiter/audio.go:73 +0x60
github.com/StageAutoControl/controller/pkg/cntl/waiter.(*Audio).readStream(0x1038ab0)
       /etc/controller/src/github.com/StageAutoControl/controller/pkg/cntl/waiter/audio.go:59 +0x3c
created by github.com/StageAutoControl/controller/pkg/cntl/waiter.(*Audio).start
       /etc/controller/src/github.com/StageAutoControl/controller/pkg/cntl/waiter/audio.go:46 +0x334
goroutine 69747 [chan send, 18 minutes]:
github.com/StageAutoControl/controller/pkg/cntl/waiter.(*Audio).notifyWait(0x1038030)
       /etc/controller/src/github.com/StageAutoControl/controller/pkg/cntl/waiter/audio.go:81 +0x44
github.com/StageAutoControl/controller/pkg/cntl/waiter.(*Audio).checkForPeak(0x1038030)
       /etc/controller/src/github.com/StageAutoControl/controller/pkg/cntl/waiter/audio.go:73 +0x60
github.com/StageAutoControl/controller/pkg/cntl/waiter.(*Audio).readStream(0x1038030)
       /etc/controller/src/github.com/StageAutoControl/controller/pkg/cntl/waiter/audio.go:59 +0x3c
created by github.com/StageAutoControl/controller/pkg/cntl/waiter.(*Audio).start
       /etc/controller/src/github.com/StageAutoControl/controller/pkg/cntl/waiter/audio.go:46 +0x334
goroutine 47837 [chan send, 38 minutes]:
github.com/StageAutoControl/controller/pkg/cntl/waiter.(*Audio).notifyWait(0xc962d0)
       /etc/controller/src/github.com/StageAutoControl/controller/pkg/cntl/waiter/audio.go:81 +0x44
github.com/StageAutoControl/controller/pkg/cntl/waiter.(*Audio).checkForPeak(0xc962d0)
       /etc/controller/src/github.com/StageAutoControl/controller/pkg/cntl/waiter/audio.go:73 +0x60
github.com/StageAutoControl/controller/pkg/cntl/waiter.(*Audio).readStream(0xc962d0)
       /etc/controller/src/github.com/StageAutoControl/controller/pkg/cntl/waiter/audio.go:59 +0x3c
created by github.com/StageAutoControl/controller/pkg/cntl/waiter.(*Audio).start
       /etc/controller/src/github.com/StageAutoControl/controller/pkg/cntl/waiter/audio.go:46 +0x334
goroutine 34366 [chan send, 68 minutes]:
github.com/StageAutoControl/controller/pkg/cntl/waiter.(*Audio).notifyWait(0xcfc150)
       /etc/controller/src/github.com/StageAutoControl/controller/pkg/cntl/waiter/audio.go:81 +0x44
github.com/StageAutoControl/controller/pkg/cntl/waiter.(*Audio).checkForPeak(0xcfc150)
       /etc/controller/src/github.com/StageAutoControl/controller/pkg/cntl/waiter/audio.go:73 +0x60
github.com/StageAutoControl/controller/pkg/cntl/waiter.(*Audio).readStream(0xcfc150)
       /etc/controller/src/github.com/StageAutoControl/controller/pkg/cntl/waiter/audio.go:59 +0x3c
created by github.com/StageAutoControl/controller/pkg/cntl/waiter.(*Audio).start
       /etc/controller/src/github.com/StageAutoControl/controller/pkg/cntl/waiter/audio.go:46 +0x334
goroutine 49019 [chan send, 38 minutes]:
github.com/StageAutoControl/controller/pkg/cntl/waiter.(*Audio).notifyWait(0xff2210)
       /etc/controller/src/github.com/StageAutoControl/controller/pkg/cntl/waiter/audio.go:81 +0x44
github.com/StageAutoControl/controller/pkg/cntl/waiter.(*Audio).checkForPeak(0xff2210)
       /etc/controller/src/github.com/StageAutoControl/controller/pkg/cntl/waiter/audio.go:73 +0x60
github.com/StageAutoControl/controller/pkg/cntl/waiter.(*Audio).readStream(0xff2210)
       /etc/controller/src/github.com/StageAutoControl/controller/pkg/cntl/waiter/audio.go:59 +0x3c
created by github.com/StageAutoControl/controller/pkg/cntl/waiter.(*Audio).start
       /etc/controller/src/github.com/StageAutoControl/controller/pkg/cntl/waiter/audio.go:46 +0x334
goroutine 43926 [chan send, 41 minutes]:
github.com/StageAutoControl/controller/pkg/cntl/waiter.(*Audio).notifyWait(0xf40000)
       /etc/controller/src/github.com/StageAutoControl/controller/pkg/cntl/waiter/audio.go:81 +0x44
github.com/StageAutoControl/controller/pkg/cntl/waiter.(*Audio).checkForPeak(0xf40000)
       /etc/controller/src/github.com/StageAutoControl/controller/pkg/cntl/waiter/audio.go:73 +0x60
github.com/StageAutoControl/controller/pkg/cntl/waiter.(*Audio).readStream(0xf40000)
       /etc/controller/src/github.com/StageAutoControl/controller/pkg/cntl/waiter/audio.go:59 +0x3c
created by github.com/StageAutoControl/controller/pkg/cntl/waiter.(*Audio).start
       /etc/controller/src/github.com/StageAutoControl/controller/pkg/cntl/waiter/audio.go:46 +0x334
goroutine 93701 [select]:
github.com/StageAutoControl/controller/pkg/cntl/playback.(*Player).wait(0xcf9ad0, 0x4fc1e8, 0x10b6cc0, 0x0, 0x0)
       /etc/controller/src/github.com/StageAutoControl/controller/pkg/cntl/playback/player.go:89 +0x1b4
github.com/StageAutoControl/controller/pkg/cntl/playback.(*Player).PlaySong(0xcf9ad0, 0x4fc1e8, 0x10b6cc0, 0x10d2c30, 0x24, 0x0, 0x0)
       /etc/controller/src/github.com/StageAutoControl/controller/pkg/cntl/playback/player.go:112 +0x1c4
github.com/StageAutoControl/controller/pkg/cntl/playback.(*Process).Start(0xc53400, 0x4fc1e8, 0xcf2840, 0x10b0470, 0x6fc7c)
       /etc/controller/src/github.com/StageAutoControl/controller/pkg/cntl/playback/process.go:72 +0x370
github.com/StageAutoControl/controller/pkg/process.(*manager).Start.func1(0xc53440, 0xc0c660, 0x457548, 0x8)
       /etc/controller/src/github.com/StageAutoControl/controller/pkg/process/manager.go:94 +0x3c
created by github.com/StageAutoControl/controller/pkg/process.(*manager).Start
       /etc/controller/src/github.com/StageAutoControl/controller/pkg/process/manager.go:93 +0x1d0

This is the code which reads the stream (Initialize and Terminate are called once on programm start and exit), with the line throwing the error marked: https://github.com/StageAutoControl/controller/blob/master/pkg/cntl/waiter/audio.go#L37

Looking forward to any helpful input - and thanks in advance!
Alex

EDIT: Cleaned up log for readability, removing systemd infos.

@gordonklaus
Copy link
Owner

At first glance I see that there is no synchronization around Audio.fanOut. You might want to run with the race detector enabled to see if there any other such issues.

Also, are you sure Audio.Wait should call Audio.start? It seems like the stream ought to be started only once, and Wait should only sign up listeners.

@aklinkert
Copy link
Author

aklinkert commented May 1, 2019 via email

@aklinkert
Copy link
Author

So, assuming that the audio.go code is working as expected, any other suggestions regarding the portaudio error? 🤔 😐

@gordonklaus
Copy link
Owner

only one process / routine / method ever calls the audio.Wait method.

Regardless, in the output you posted I see many goroutines in Audio.notifyWait (which is only reachable from Audio.Wait). There is concurrency going on there without synchronization. Either you need to use a mutex around Audio.fanOut or you need to make sure those Audio.readStream goroutines exit before you return from Audio.Wait.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants