Comments (4)
I haven't seen that one myself but it definitely smells like a bug somewhere. I don't think I'll be able to spend much time on it right now.
from go-libspotify.
Hi Örjan,
Let me take a step back.
Do you think this a correct algorithm to load all playlists/tracks?
fabiofalci@7cde1d3
It throws an error most of the time (attached at the end) and very occasionally the panic: sync: negative WaitGroup counter
problem.
Because I need to load all playlist/tracks to show to the user on my system there is a similar algorithm which works most of the time, it doesn't throw the same attached error but sometimes I get the panic: sync: negative WaitGroup counter
problem too:
https://github.com/fabiofalci/sconsify/blob/master/spotify/spotify_playlists.go#L10
Thanks
fatal error: unexpected signal during runtime execution
[signal 0xb code=0x1 addr=0x0 pc=0x7ff70b5d2a68]
runtime stack:
runtime.gothrow(0x5d5eb0, 0x2a)
/usr/lib/go/src/runtime/panic.go:503 +0x8e
runtime.sigpanic()
/usr/lib/go/src/runtime/sigpanic_unix.go:14 +0x5e
goroutine 7 [syscall, locked to thread]:
runtime.cgocall_errno(0x40b800, 0xc208019df8, 0x0)
/usr/lib/go/src/runtime/cgocall.go:130 +0xf5 fp=0xc208019dd8 sp=0xc208019db0
github.com/op/go-libspotify/spotify._Cfunc_sp_session_process_events(0x153cec0, 0xc208019e30, 0x0)
/home/fabio/go/src/github.com/op/go-libspotify/spotify/:905 +0x43 fp=0xc208019df8 sp=0xc208019dd8
github.com/op/go-libspotify/spotify.(*Session).processEvents(0xc208078180)
/home/fabio/go/src/github.com/op/go-libspotify/spotify/libspotify.go:878 +0xd6 fp=0xc208019f50 sp=0xc208019df8
github.com/op/go-libspotify/spotify.func·001()
/home/fabio/go/src/github.com/op/go-libspotify/spotify/libspotify.go:243 +0x141 fp=0xc208019fe0 sp=0xc208019f50
runtime.goexit()
/usr/lib/go/src/runtime/asm_amd64.s:2232 +0x1 fp=0xc208019fe8 sp=0xc208019fe0
created by github.com/op/go-libspotify/spotify.NewSession
/home/fabio/go/src/github.com/op/go-libspotify/spotify/libspotify.go:244 +0x819
goroutine 1 [syscall, locked to thread]:
github.com/op/go-libspotify/spotify._Cfunc_sp_session_playlistcontainer(0x153cec0, 0x0)
/home/fabio/go/src/github.com/op/go-libspotify/spotify/:887 +0x44
github.com/op/go-libspotify/spotify.newPlaylistContainer(0xc208078180, 0x0, 0x0, 0x0)
/home/fabio/go/src/github.com/op/go-libspotify/spotify/libspotify.go:1337 +0x196
github.com/op/go-libspotify/spotify.(*Session).Playlists(0xc208078180, 0x1, 0x0, 0x0)
/home/fabio/go/src/github.com/op/go-libspotify/spotify/libspotify.go:532 +0x3a
main.main()
/home/fabio/go/src/github.com/op/go-libspotify/examples/portaudio/portaudio.go:320 +0xb4f
goroutine 5 [syscall]:
os/signal.loop()
/usr/lib/go/src/os/signal/signal_unix.go:21 +0x1f
created by os/signal.init·1
/usr/lib/go/src/os/signal/signal_unix.go:27 +0x35
goroutine 17 [syscall, locked to thread]:
runtime.goexit()
/usr/lib/go/src/runtime/asm_amd64.s:2232 +0x1
goroutine 6 [select]:
main.(*audioWriter).streamWriter(0xc20803a540, 0xc20801e300)
/home/fabio/go/src/github.com/op/go-libspotify/examples/portaudio/portaudio.go:114 +0x3fc
created by main.newAudioWriter
/home/fabio/go/src/github.com/op/go-libspotify/examples/portaudio/portaudio.go:78 +0x174
goroutine 9 [select]:
github.com/op/go-libspotify/spotify.(*Session).processBackground(0xc208078180)
/home/fabio/go/src/github.com/op/go-libspotify/spotify/libspotify.go:900 +0x2ad
created by github.com/op/go-libspotify/spotify.NewSession
/home/fabio/go/src/github.com/op/go-libspotify/spotify/libspotify.go:250 +0x8c8
goroutine 10 [chan receive]:
main.func·001()
/home/fabio/go/src/github.com/op/go-libspotify/examples/portaudio/portaudio.go:302 +0x5a
created by main.main
/home/fabio/go/src/github.com/op/go-libspotify/examples/portaudio/portaudio.go:305 +0x8cc
goroutine 18 [syscall, locked to thread]:
runtime.goexit()
/usr/lib/go/src/runtime/asm_amd64.s:2232 +0x1
from go-libspotify.
Sorry, I've been so busy lately and have not had the time to look at this.
Without diving into the code, maybe the wg.Done() calls can be wrapped with a sync.Once to make sure they are only decreased once? If that'd solve the problem, I'd be more than happy to merge it.
I also wish there would be an easy way to write tests for these kinds of things. That'd be an awesome future thing to do as well.
from go-libspotify.
Yeah, I've been using this version with Once
and it's working fine: fabiofalci@2100480
Alright I'll try to organise a pull request in the next few days.
Thanks
from go-libspotify.
Related Issues (9)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go-libspotify.