mirror of
https://github.com/devgianlu/go-librespot.git
synced 2026-04-25 21:05:47 +03:00
[GH-ISSUE #134] Crash when network is disconnected #83
Labels
No labels
bug
enhancement
pull-request
spotify-side
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/go-librespot#83
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @aykevl on GitHub (Nov 7, 2024).
Original GitHub issue: https://github.com/devgianlu/go-librespot/issues/134
I got this crash, I think when the network connection got disconnected:
And this crash, probably the same bug, when the network definitely got disconnected (I think there was some maintenance on the router).
I suspect the issue is here:
github.com/devgianlu/go-librespot@f2de517abc/ap/ap.go (L82)This is
ap.init, which is called fromap.connect, which is called fromap.reconnect. Looks like it setsap.connto nil when it can't connect resulting in the nil pointer dereference.(Also, I think
ap.connMushould have been used insidepongAckTimer?)I should also say it's quite impressive that the daemon had been running crash-free for over 10 days!
@devgianlu commented on GitHub (Nov 9, 2024):
I have mixed feelings about this: yes it should be held for reading, but at the same time if we end up waiting because it is held for writing and then call close on it we are probably closing a connection that has just been created. Citing my own comment:
github.com/devgianlu/go-librespot@095020537e/ap/ap.go (L53-L56)Main problem should be fixed with
095020537e, same issue as0b32df773c.@aykevl commented on GitHub (Nov 9, 2024):
It's still a data race, which is basically undefined behavior (though it might work well enough in practice since it's a pointer read, which will normally not be torn).
Maybe I'll take a stab at fixing this at some point.