OpenArchive / Save-app-ios

Secure Mobile Media Preservation
https://open-archive.org/
GNU General Public License v3.0
10 stars 3 forks source link

DB race condition / deadlock issues during first run after space is added. #222

Closed johnhess closed 1 year ago

johnhess commented 2 years ago

I uninstalled to try to replicate and was able to get it to crash a second time. The second time, it crashed after selecting 2 images and clicking "done".

tladesignz commented 2 years ago

Hm. I don't see this.

What I see, though, is, that the app uses 105% of processor time on the first start, after a space is added.

This does not happen on subsequent starts.

Looks like some database race condition / locking issue. Stack dump doesn't show anything obvious, though. This will be a tough nut to crack.

johnhess commented 2 years ago

I just submitted a crash report for this issue under my email address.

tladesignz commented 2 years ago

Well, the crash report was not very telling (it showed a chain of memory allocations, so crash was probably due to stack exhaustion), but I found the issue anyway:

The MainViewController was instantiated twice on the first run. That led to high resource consumption, UI lag and random crashes. (That doubled the DB hooks and probably caused locking while the two waited for each other.)

Fix will be contained in TestFlight build 69!

purvi-ranawat commented 2 years ago

Unable to replicate the issue on Testflight build 69. Tested on iPhone XR iOS version 15.4.1