mirror of
https://github.com/SignTools/SignTools.git
synced 2026-04-27 10:55:49 +03:00
[GH-ISSUE #39] iSH killed by iOS due to high CPU usage when installing app #27
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/SignTools#27
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 @ViRb3 on GitHub (Apr 9, 2021).
Original GitHub issue: https://github.com/SignTools/SignTools/issues/39
This only happens sometimes, likely with bigger files, and it could be attributed to either an out of memory error, or failure to emulate an instruction on ISH's side. More debugging is required.
@ViRb3 commented on GitHub (Apr 9, 2021):
To quote @42ism from #37:
@ViRb3 commented on GitHub (Apr 9, 2021):
@42ism can you please try this old version of the installation guide, which uses ngrok instead of cloudflared, and see if it changes anything? Note that step
3.1.2.1will NOT work as it will install the most recent script. You'll need to use this command instead:@rzbergme commented on GitHub (Apr 9, 2021):
Oh wait, I just realized I wasn't reading it correctly and you asked me to use an older version. I will give it a try soon and report back. Thanks!
@ViRb3 commented on GitHub (Apr 9, 2021):
I think I just figured out what the problem is. On your iOS device, if you go to Settings -> Privacy -> Analytics -> Analytics Data, you should see at least one iSH crash log. Open it up and check the content. Mine says the following:
So the issue is Apple kills apps that use the CPU too much in the background. One way around this is keeping iSH in the foreground, but that's obviously not ideal. We should benchmark cloudflared, ngrok, and ios-signer-service itself, and see which one uses the CPU too much to optimize it.
@42ism can you please check what your logs say?
@rzbergme commented on GitHub (Apr 9, 2021):
@ViRb3 that is exactly right. I was about to update you that I tried both versions (older ngrok and cloudflared) and noticed that in both cases if iSH was in the background (e.g. me staring at the Github page waiting for CI to complete) it crashed and the Analytics data shows CPU usage for all these crashes. But if I stay on iSH patiently until the process completes (both for CI and during the install itself) then they complete successfully without iSH crashing.
I think it is pretty reasonable to keep iSH in the foreground (can be a note on the readme). Maybe the ios-signer-service can output the status (complete etc.) to the console so that the user can know it is safe to switch back to Safari?
At this point, I am tempted to set up the signer using docker on my Unraid server and not worry too much about signing locally using iSH but it is good to have options.
@ViRb3 commented on GitHub (Apr 9, 2021):
@42ism Do you only get the crashes when you are installing an app, not when uploading? I am attempting to sign a 281MB app, and it crashes in the last stage of uploading. I think what happens is that, because ngrok/cloudflared is used, the file gets slowly transferred to them first, and only when that's done then they push the content to the signer app. I suspect it is in this last stage that the CPU usage raises significantly for me, causing the crash. We could implement some form of CPU or transfer speed throttling to combat this, but I can't figure out exactly what is causing the CPU usage. I tried using
topin iSH, but it doesn't seem to show accurate CPU usage. Do you have any ideas? Telling users to keep the app in the foreground will definitely work, but I want to investigate a bit more before committing to a solution.@rzbergme commented on GitHub (Apr 9, 2021):
As far as I know, I got the crashes while uploading (before CI started) as well as during the install. But I admit that I did not conduct clean tests, it is more of an anecdotal observation. I can try it again over the weekend and report back.
@ViRb3 commented on GitHub (Apr 9, 2021):
This would confirm my behavior, so it makes sense. I will do some more tests and reply here when I decide how to tackle the problem.
@ViRb3 commented on GitHub (Apr 9, 2021):
I sort of addressed this in v2.2.3 - logs are now much easier to read, and I added a notice in the installation instructions. This is only a temporary workaround, though, so I will leave this issue open until we find a better solution.
@rzbergme commented on GitHub (Apr 10, 2021):
I like the new formatted output. are the logs saved somewhere? I don't see a log in the iSH folders.
@ViRb3 commented on GitHub (Apr 10, 2021):
It's not being saved anywhere, no. You can always pipe the output to a file. If you have a specific use case feel free to open a new issue.
@ViRb3 commented on GitHub (Jun 2, 2022):
Closing since this is no longer a supported use case. Please use Heroku or self-host instead.