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

xibo-player occasional crash while downloading files #256

Closed
dmitttri opened this issue Mar 26, 2022 · 3 comments
Closed

xibo-player occasional crash while downloading files #256

dmitttri opened this issue Mar 26, 2022 · 3 comments
Labels
Milestone

Comments

@dmitttri
Copy link
Contributor

While performing requiested file download, xibo-player may crash with "Segmentation Fault" or "douible free or corruption"

It happens occasionaly, and is not easy repeateble. To reproduce it, I've made a procedure to manually delete cached contents, remove cacheFile.xml and schedule.xml, then start xibo-player without watchdog, just to print logs to stdout. This way xibo-player is forced to request all cache files again form CMS. Sometimes we can observe segfaults, but most of the time download process goes fine.

Log sample:
[08:58:42.149] [28723] [debug]: [XMDS::RequiredFiles] Received
[08:58:47.513] [28762] [debug]: [jquery-1.11.1.min.js] Downloaded
[08:58:47.520] [28764] [debug]: [18.otf] Downloaded
[08:58:47.520] [28763] [debug]: [368.html] Downloaded
[08:58:47.521] [28765] [debug]: [369.html] Downloaded
[08:58:52.849] [28791] [debug]: [16.ttf] Downloaded
[08:58:52.878] [28792] [debug]: [14.otf] Downloaded
[08:58:52.885] [28793] [debug]: [xibo-countdown-render.js] Downloaded
[08:58:52.920] [28794] [debug]: [jquery-cycle-2.1.6.min.js] Downloaded
Segmentation fault

I seems we can trigger segfaults more often with CMS layouts which has lot of small files.

  • Linux Disto: Custom Buildroot Linux
  • Linux Desktop Environment: Weston
  • How the player was launched: compiled binaries
@dmitttri dmitttri added the bug label Mar 26, 2022
@dmitttri
Copy link
Contributor Author

dmitttri commented Mar 26, 2022

Further investigation shows that downloader threads will concurrently access FileCache_ object, more particular it's save() method, which saves files and updates cache. In particular, updating file cache was causing this issue.

I made a fix for this problem, by adding a mutex in the FileCacheImpl class, and ensure addToCache method uses it to protect file cache access.

For this fix I have submitted a pull request #255

@dasgarner dasgarner added this to the 1.8 R7 milestone Mar 26, 2022
@dasgarner
Copy link
Member

That's awesome thank you. I've merged that in and an AppImage should be building soon.

We're having some issues with our snap build environment (#253), but once those are fixed i'll push something up to beta with your fix included.

@dmitttri
Copy link
Contributor Author

Thanks for your kind words, I am happy I could controbute to your awsome project.

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

No branches or pull requests

2 participants