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

Systematic crash at start after update to 3.3 #675

Closed
kelson42 opened this issue Feb 29, 2024 · 10 comments · Fixed by #687
Closed

Systematic crash at start after update to 3.3 #675

kelson42 opened this issue Feb 29, 2024 · 10 comments · Fixed by #687
Assignees
Milestone

Comments

@kelson42
Copy link
Contributor

After updating from 3.1 (App store version) to Testflight 3.3 on my macOS 12.6.6, the app just crash at launch every time.

@kelson42
Copy link
Contributor Author

@BPerlakiH How would look ike the procedure to share all my local Kiwix config so you can test and reproduce the bug?

@BPerlakiH
Copy link
Collaborator

I am not sure, it might be down to the macOS version, but might as well be related to the other crash issue.
Unfortunately TestFlight is not really helpful, and not providing at the moment any details of crashes, or even installs at the moment (according to the "help buble" on developer.appple.com it can take up to 72 hours things to appear.
At this stage, I would recommend to retest this once we have this PR merged.

@BPerlakiH
Copy link
Collaborator

I've just started the Testflight process for the latest main branch (as the above PR was merged).
Once available, it should be re-tested on a clean environment, which can be achieved the following way:

  • Open Applications -> Move Kiwix to Trash
  • Empty Trash
  • from the command line run: rm -rf ~/Library/Containers/self.Kiwix

@kelson42
Copy link
Contributor Author

kelson42 commented Mar 9, 2024

@BPerlakiH Stll crashing with testflight version of last night

@BPerlakiH
Copy link
Collaborator

I have found some main thread issues while testing my other PR for custom apps. So I think it will be worth to re-test it with this merged:
#688

@BPerlakiH
Copy link
Collaborator

BPerlakiH commented Mar 12, 2024

I managed to re-create this one, it seems to be related to the largest file:
"canadianprepper_en_all_2023-11.zim"
it was downloading on my side for quite some time, so I am not sure if it's not corrupted in some way,

shasum -a 256 canadianprepper_en_all_2023-11.zim 
d1f3d64db5690f30333f3d7bd7b602a7f2cf27eb08d4f219345537af1546dafd  canadianprepper_en_all_2023-11.zim

nevertheless, it causes the same kind of crash.
The exception thrown by libzim (9.1) in ZimFileService:

+ (ZimFileMetaData *)getMetaDataWithFileURL:(NSURL *)url {
    ZimFileMetaData *metaData = nil;
    [url startAccessingSecurityScopedResource];
    try {
        kiwix::Book book = kiwix::Book();
        zim::Archive archive = zim::Archive([url fileSystemRepresentation]); // <---- crash is here
        book.update(archive);
        metaData = [[ZimFileMetaData alloc] initWithBook: &book];
    } catch (std::exception e) { }
    [url stopAccessingSecurityScopedResource];
    return metaData;
}

// Thread 1: Swift runtime failure: unhandled C++ / Objective-C exception

cannot be caught, and crashes the application.

It might be out of memory / disk error as well, as the file is quite large.
I will look into the C++ source code as well. At the moment it seems that there's not much more the objective-c swift code can do about this, it's already in try / catch.

@BPerlakiH
Copy link
Collaborator

Did found some further details, seems like an allocation error. Issue opened for LibZIM:
openzim/libzim#866

@kelson42 kelson42 added upstream and removed bug labels Mar 31, 2024
@kelson42
Copy link
Contributor Author

Root cause of this behaviour is openzim/libzim#866. Keeping this ticket open for tracking.

@kelson42
Copy link
Contributor Author

@BPerlakiH Can you please check if it works now and close if fixed?

@BPerlakiH
Copy link
Collaborator

@kelson42 I am happy to close this, it seems to be working as expected.

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

Successfully merging a pull request may close this issue.

2 participants