mirror of
https://github.com/librespot-org/librespot.git
synced 2026-04-27 08:15:50 +03:00
[GH-ISSUE #348] Librespot fails to startup due to missing entropy #231
Labels
No labels
A-Alsa
SpotifyAPI
Tokio 1.0
audio
bug
can't reproduce
compilation
dependencies
duplicate
enhancement
good first issue
help wanted
high priority
imported
imported
invalid
new api
pull-request
question
reverse engineering
wiki
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/librespot#231
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 @matthijskooijman on GitHub (Jul 13, 2019).
Original GitHub issue: https://github.com/librespot-org/librespot/issues/348
I've found that librespot under Max2play on a rpi sometimes fails to start at system boot. At least a few times, I've captured a backtrace (on a Zero W) of this behaviour, which suggests that there is insufficient entropy available in the system, causing startup to fail. Restarting it manually fixes it, though I've seen that it fails again until a few minutes later when (I guess) more entropy is available.
The actual problem is of course beyond librespot's control, but I wonder if librespot could perhaps switch to a different random generated (e.g.
urandomvsrandom, though it might be already usinggetrandomwhich AFAIU returns random values without consuming extra entropy, provided some startup entropy is available, which probably best of both).Alternatively, librespot could perhaps wait and retry until sufficient entropy is available? That would at least allow unattended startup to complete, even after some time.
Here's the backtrace:
@matthijskooijman commented on GitHub (Jul 13, 2019):
One more note, this was with a self-compiled git master version (
github.com/librespot-org/librespot@4e3576ba7c).@willstott101 commented on GitHub (Nov 2, 2019):
The error itself seems completely contradictory:
thread 'main' panicked at 'could not initialize thread_rng: All entropy sources failed (permanently unavailable); cause: getrandom not ready (not ready yet); cThe version you link doesn't have
getrandomin Cargo.lock so must have been making the syscall from the rand crate. I suspect the use of the cross-platformgetrandomcrate, asranddoes now will improve things.As far as I can tell
getrandomis supposed to block until it can get the requested bytes. And should only panic if it can't ever return random bytes - or is interrupted by the OS.Have you seen this issue with a newer build of librespot?
@matthijskooijman commented on GitHub (Nov 2, 2019):
I have not been using librespot since I reported this (I needed it for a specific event, I'm not using it daily currently).