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

Fix Crash u_SetDictionary with LibraryViewModel multi-instance state #868

Merged
merged 2 commits into from
Jul 16, 2024

Conversation

BPerlakiH
Copy link
Collaborator

@BPerlakiH BPerlakiH commented Jul 14, 2024

Fixes: #852

Issue

The underlying parsing should be run only once at a time. If run from multiple threads at the same time it will crash as described in the issue.

Since we have 2 instances of the LibraryViewModel (one for the UI parts, one for background jobs - auto refresh), it was possible to crash in very rare cases, where the auto refresh kicked in the same time as a manual refresh.

Solution

store the progress state in a single place, and secure it for multi-threaded access.

@kelson42 kelson42 force-pushed the 852-crash-340-kiwix-u_setdatadirectory_73-+-48 branch from 9106677 to ec19c66 Compare July 16, 2024 05:39
@kelson42 kelson42 merged commit c6c0d33 into main Jul 16, 2024
4 checks passed
@kelson42 kelson42 deleted the 852-crash-340-kiwix-u_setdatadirectory_73-+-48 branch July 16, 2024 05:39
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

Successfully merging this pull request may close these issues.

Crash 3.4.0 - Kiwix: u_setDataDirectory_73 + 48
2 participants