ish-app / ish

Linux shell for iOS
https://ish.app
Other
16.95k stars 892 forks source link

Python, pip and yt-dlp lock up an iSH session #2081

Open freebrowser1 opened 1 year ago

freebrowser1 commented 1 year ago

I installed Python 3.9 by apk add python3 python3-dev python3-pip which did work. But starting pip issued an error like ImportError: cannot import name 'InvalidSchemeCombination' from 'pip._internal.exceptions'. So I searched the internet and found instructions on this page. I followed the instructions strting after '9 answers' on this page:

https://stackoverflow.com/questions/67273590/pip-21-1-cant-import-invalidschemecombination

python3 get-pip.py resulted in a lock up while downloading of iSH, I had to restart iSH on the iPad.

python3 get-pip.py
Collecting pip
Downloading pip-23.0.1-py3-none-any.whl (2.1 MB)
----------------------------------------------- 1.9/2.1 MB 1.1 MB/s eta 0:00:01

And then iSH hangs. I repeated this action after restarting, same issue.

yt-dlp did install, because I could start downloading a Youtube video using it, but it also got stuck halfway down locking up iSH.

If you're reporting a crash, please include a crash dump. You can find them in Settings -> Privacy -> Analytics -> Analytics Data on iOS 12, or Settings -> Privacy -> Diagnostics and Usage on iOS 11. If this is a "Bad system call", "Illegal instruction", or "Segmentation fault", run dmesg to get a dump of the log messages and include the relevant output.

I could not find such an option on iOS 16, so I cannot provide a crash dump.

When I run dmesg right after restart after such a hanging python3 get-pip.py I only see:

113 stub syscall 383
113 stub syscall 383
113 stub syscall 383
113 stub syscall 383

dozens of times with sometimes FIXME socketcall 18 between these lines.

DJMo13 commented 1 year ago

Hi, I cannot confirm your issue because everything works for me. Maybe it got now fixed. And don't forget that everything is slow because it is an emulation of x86. Try python -v the next time, so you can see the current progress and where problems are.

freebrowser1 commented 1 year ago

Try python -v the next time, so you can see the current progress and where problems are.

The slowness (which I expect as it is indeed x86 emulation) is not the issue, my device is a new 2022 M1 powered iPad Air.

But it just locks up when downloading large YT videos using yt-dlp. The SSH connection gets lost and on the iPad itself I have to restart the app to re-enable the SSH server. The SSH connection is important for me as it is the only way to connect to the iPad from another device without its screen being on. What I did:

Memory is not the issue as this iPad had 8GB, but possibly only a limited amount of RAM is allocated to the VM. And then I cannot reconnect anymore, I have to restart the iSH app on the iPad itself and then I can reconnect again.

I did python -v:

This is running on an iPad Air 2.

iPad-Air-2:~# python -v
import _frozen_importlib # frozen
import _imp # builtin
import '_thread' # <class '_frozen_importlib.BuiltinImporter'>
import '_warnings' # <class '_frozen_importlib.BuiltinImporter'>
import '_weakref' # <class '_frozen_importlib.BuiltinImporter'>
import '_io' # <class '_frozen_importlib.BuiltinImporter'>
import 'marshal' # <class '_frozen_importlib.BuiltinImporter'>
import 'posix' # <class '_frozen_importlib.BuiltinImporter'>
import '_frozen_importlib_external' # <class '_frozen_importlib.FrozenImporter'>
# installing zipimport hook
import 'time' # <class '_frozen_importlib.BuiltinImporter'>
import 'zipimport' # <class '_frozen_importlib.FrozenImporter'>
# installed zipimport hook
# /usr/lib/python3.10/encodings/__pycache__/__init__.cpython-310.pyc matches /usr/lib/python3.10/encodings/__init__.py
# code object from '/usr/lib/python3.10/encodings/__pycache__/__init__.cpython-310.pyc'
# /usr/lib/python3.10/__pycache__/codecs.cpython-310.pyc matches /usr/lib/python3.10/codecs.py
# code object from '/usr/lib/python3.10/__pycache__/codecs.cpython-310.pyc'
import '_codecs' # <class '_frozen_importlib.BuiltinImporter'>
import 'codecs' # <_frozen_importlib_external.SourceFileLoader object at 0xf7b199a0>
# /usr/lib/python3.10/encodings/__pycache__/aliases.cpython-310.pyc matches /usr/lib/python3.10/encodings/aliases.py
# code object from '/usr/lib/python3.10/encodings/__pycache__/aliases.cpython-310.pyc'
import 'encodings.aliases' # <_frozen_importlib_external.SourceFileLoader object at 0xf7b35370>
import 'encodings' # <_frozen_importlib_external.SourceFileLoader object at 0xf7b198e0>
# /usr/lib/python3.10/encodings/__pycache__/utf_8.cpython-310.pyc matches /usr/lib/python3.10/encodings/utf_8.py
# code object from '/usr/lib/python3.10/encodings/__pycache__/utf_8.cpython-310.pyc'
import 'encodings.utf_8' # <_frozen_importlib_external.SourceFileLoader object at 0xf7b352b0>
import '_signal' # <class '_frozen_importlib.BuiltinImporter'>
# /usr/lib/python3.10/__pycache__/io.cpython-310.pyc matches /usr/lib/python3.10/io.py
# code object from '/usr/lib/python3.10/__pycache__/io.cpython-310.pyc'
# /usr/lib/python3.10/__pycache__/abc.cpython-310.pyc matches /usr/lib/python3.10/abc.py
# code object from '/usr/lib/python3.10/__pycache__/abc.cpython-310.pyc'
import '_abc' # <class '_frozen_importlib.BuiltinImporter'>
import 'abc' # <_frozen_importlib_external.SourceFileLoader object at 0xf7b355e0>
import 'io' # <_frozen_importlib_external.SourceFileLoader object at 0xf7b354c0>
# /usr/lib/python3.10/__pycache__/site.cpython-310.pyc matches /usr/lib/python3.10/site.py
# code object from '/usr/lib/python3.10/__pycache__/site.cpython-310.pyc'
# /usr/lib/python3.10/__pycache__/os.cpython-310.pyc matches /usr/lib/python3.10/os.py
# code object from '/usr/lib/python3.10/__pycache__/os.cpython-310.pyc'
# /usr/lib/python3.10/__pycache__/stat.cpython-310.pyc matches /usr/lib/python3.10/stat.py
# code object from '/usr/lib/python3.10/__pycache__/stat.cpython-310.pyc'
import '_stat' # <class '_frozen_importlib.BuiltinImporter'>
import 'stat' # <_frozen_importlib_external.SourceFileLoader object at 0xf7aa2490>
# /usr/lib/python3.10/__pycache__/_collections_abc.cpython-310.pyc matches /usr/lib/python3.10/_collections_abc.py
# code object from '/usr/lib/python3.10/__pycache__/_collections_abc.cpython-310.pyc'
import '_collections_abc' # <_frozen_importlib_external.SourceFileLoader object at 0xf7aa2670>
# /usr/lib/python3.10/__pycache__/posixpath.cpython-310.pyc matches /usr/lib/python3.10/posixpath.py
# code object from '/usr/lib/python3.10/__pycache__/posixpath.cpython-310.pyc'
# /usr/lib/python3.10/__pycache__/genericpath.cpython-310.pyc matches /usr/lib/python3.10/genericpath.py
# code object from '/usr/lib/python3.10/__pycache__/genericpath.cpython-310.pyc'
import 'genericpath' # <_frozen_importlib_external.SourceFileLoader object at 0xf7abd988>
import 'posixpath' # <_frozen_importlib_external.SourceFileLoader object at 0xf7aa2388>
import 'os' # <_frozen_importlib_external.SourceFileLoader object at 0xf7b35d00>
# /usr/lib/python3.10/__pycache__/_sitebuiltins.cpython-310.pyc matches /usr/lib/python3.10/_sitebuiltins.py
# code object from '/usr/lib/python3.10/__pycache__/_sitebuiltins.cpython-310.pyc'
import '_sitebuiltins' # <_frozen_importlib_external.SourceFileLoader object at 0xf7abdb38>
Processing user site-packages
Processing global site-packages
Adding directory: '/usr/lib/python3.10/site-packages'
Processing .pth file: '/usr/lib/python3.10/site-packages/distutils-precedence.pth'
# /usr/lib/python3.10/site-packages/_distutils_hack/__pycache__/__init__.cpython-310.pyc matches /usr/lib/python3.10/site-packages/_distutils_hack/__init__.py
# code object from '/usr/lib/python3.10/site-packages/_distutils_hack/__pycache__/__init__.cpython-310.pyc'
import '_distutils_hack' # <_frozen_importlib_external.SourceFileLoader object at 0xf7abdf10>
import 'site' # <_frozen_importlib_external.SourceFileLoader object at 0xf7b35aa8>
Python 3.10.11 (main, Apr  6 2023, 01:16:54) [GCC 12.2.1 20220924] on linux
Type "help", "copyright", "credits" or "license" for more information.
# extension module 'readline' loaded from '/usr/lib/python3.10/lib-dynload/readline.cpython-310-i386-linux-gnu.so'
# extension module 'readline' executed from '/usr/lib/python3.10/lib-dynload/readline.cpython-310-i386-linux-gnu.so'
import 'readline' # <_frozen_importlib_external.ExtensionFileLoader object at 0xf7abdd00>
import 'atexit' # <class '_frozen_importlib.BuiltinImporter'>
# /usr/lib/python3.10/__pycache__/rlcompleter.cpython-310.pyc matches /usr/lib/python3.10/rlcompleter.py
# code object from '/usr/lib/python3.10/__pycache__/rlcompleter.cpython-310.pyc'
# /usr/lib/python3.10/__pycache__/inspect.cpython-310.pyc matches /usr/lib/python3.10/inspect.py
# code object from '/usr/lib/python3.10/__pycache__/inspect.cpython-310.pyc'
# /usr/lib/python3.10/__pycache__/ast.cpython-310.pyc matches /usr/lib/python3.10/ast.py
# code object from '/usr/lib/python3.10/__pycache__/ast.cpython-310.pyc'
import '_ast' # <class '_frozen_importlib.BuiltinImporter'>
# /usr/lib/python3.10/__pycache__/contextlib.cpython-310.pyc matches /usr/lib/python3.10/contextlib.py
# code object from '/usr/lib/python3.10/__pycache__/contextlib.cpython-310.pyc'
# /usr/lib/python3.10/collections/__pycache__/__init__.cpython-310.pyc matches /usr/lib/python3.10/collections/__init__.py
# code object from '/usr/lib/python3.10/collections/__pycache__/__init__.cpython-310.pyc'
import 'itertools' # <class '_frozen_importlib.BuiltinImporter'>
# /usr/lib/python3.10/__pycache__/keyword.cpython-310.pyc matches /usr/lib/python3.10/keyword.py
# code object from '/usr/lib/python3.10/__pycache__/keyword.cpython-310.pyc'
import 'keyword' # <_frozen_importlib_external.SourceFileLoader object at 0xf7928d48>
# /usr/lib/python3.10/__pycache__/operator.cpython-310.pyc matches /usr/lib/python3.10/operator.py
# code object from '/usr/lib/python3.10/__pycache__/operator.cpython-310.pyc'
import '_operator' # <class '_frozen_importlib.BuiltinImporter'>
import 'operator' # <_frozen_importlib_external.SourceFileLoader object at 0xf7928da8>
# /usr/lib/python3.10/__pycache__/reprlib.cpython-310.pyc matches /usr/lib/python3.10/reprlib.py
# code object from '/usr/lib/python3.10/__pycache__/reprlib.cpython-310.pyc'
import 'reprlib' # <_frozen_importlib_external.SourceFileLoader object at 0xf7928fe8>
import '_collections' # <class '_frozen_importlib.BuiltinImporter'>
import 'collections' # <_frozen_importlib_external.SourceFileLoader object at 0xf7917e08>
# /usr/lib/python3.10/__pycache__/functools.cpython-310.pyc matches /usr/lib/python3.10/functools.py
# code object from '/usr/lib/python3.10/__pycache__/functools.cpython-310.pyc'
# /usr/lib/python3.10/__pycache__/types.cpython-310.pyc matches /usr/lib/python3.10/types.py
# code object from '/usr/lib/python3.10/__pycache__/types.cpython-310.pyc'
import 'types' # <_frozen_importlib_external.SourceFileLoader object at 0xf793ecd0>
import '_functools' # <class '_frozen_importlib.BuiltinImporter'>
import 'functools' # <_frozen_importlib_external.SourceFileLoader object at 0xf793e880>
import 'contextlib' # <_frozen_importlib_external.SourceFileLoader object at 0xf7917730>
# /usr/lib/python3.10/__pycache__/enum.cpython-310.pyc matches /usr/lib/python3.10/enum.py
# code object from '/usr/lib/python3.10/__pycache__/enum.cpython-310.pyc'
import 'enum' # <_frozen_importlib_external.SourceFileLoader object at 0xf78df4a8>
import 'ast' # <_frozen_importlib_external.SourceFileLoader object at 0xf7968148>
# /usr/lib/python3.10/__pycache__/dis.cpython-310.pyc matches /usr/lib/python3.10/dis.py
# code object from '/usr/lib/python3.10/__pycache__/dis.cpython-310.pyc'
# /usr/lib/python3.10/__pycache__/opcode.cpython-310.pyc matches /usr/lib/python3.10/opcode.py
# code object from '/usr/lib/python3.10/__pycache__/opcode.cpython-310.pyc'
# extension module '_opcode' loaded from '/usr/lib/python3.10/lib-dynload/_opcode.cpython-310-i386-linux-gnu.so'
# extension module '_opcode' executed from '/usr/lib/python3.10/lib-dynload/_opcode.cpython-310-i386-linux-gnu.so'
import '_opcode' # <_frozen_importlib_external.ExtensionFileLoader object at 0xf78f4508>
import 'opcode' # <_frozen_importlib_external.SourceFileLoader object at 0xf78f43b8>
import 'dis' # <_frozen_importlib_external.SourceFileLoader object at 0xf7968460>
# /usr/lib/python3.10/collections/__pycache__/abc.cpython-310.pyc matches /usr/lib/python3.10/collections/abc.py
# code object from '/usr/lib/python3.10/collections/__pycache__/abc.cpython-310.pyc'
import 'collections.abc' # <_frozen_importlib_external.SourceFileLoader object at 0xf78f46d0>
# /usr/lib/python3.10/importlib/__pycache__/__init__.cpython-310.pyc matches /usr/lib/python3.10/importlib/__init__.py
# code object from '/usr/lib/python3.10/importlib/__pycache__/__init__.cpython-310.pyc'
# /usr/lib/python3.10/__pycache__/warnings.cpython-310.pyc matches /usr/lib/python3.10/warnings.py
# code object from '/usr/lib/python3.10/__pycache__/warnings.cpython-310.pyc'
import 'warnings' # <_frozen_importlib_external.SourceFileLoader object at 0xf78f48c8>
import 'importlib' # <_frozen_importlib_external.SourceFileLoader object at 0xf78f4790>
# /usr/lib/python3.10/importlib/__pycache__/machinery.cpython-310.pyc matches /usr/lib/python3.10/importlib/machinery.py
# code object from '/usr/lib/python3.10/importlib/__pycache__/machinery.cpython-310.pyc'
import 'importlib.machinery' # <_frozen_importlib_external.SourceFileLoader object at 0xf78f4a78>
# /usr/lib/python3.10/__pycache__/linecache.cpython-310.pyc matches /usr/lib/python3.10/linecache.py
# code object from '/usr/lib/python3.10/__pycache__/linecache.cpython-310.pyc'
# /usr/lib/python3.10/__pycache__/tokenize.cpython-310.pyc matches /usr/lib/python3.10/tokenize.py
# code object from '/usr/lib/python3.10/__pycache__/tokenize.cpython-310.pyc'
# /usr/lib/python3.10/__pycache__/re.cpython-310.pyc matches /usr/lib/python3.10/re.py
# code object from '/usr/lib/python3.10/__pycache__/re.cpython-310.pyc'
# /usr/lib/python3.10/__pycache__/sre_compile.cpython-310.pyc matches /usr/lib/python3.10/sre_compile.py
# code object from '/usr/lib/python3.10/__pycache__/sre_compile.cpython-310.pyc'
import '_sre' # <class '_frozen_importlib.BuiltinImporter'>
# /usr/lib/python3.10/__pycache__/sre_parse.cpython-310.pyc matches /usr/lib/python3.10/sre_parse.py
# code object from '/usr/lib/python3.10/__pycache__/sre_parse.cpython-310.pyc'
# /usr/lib/python3.10/__pycache__/sre_constants.cpython-310.pyc matches /usr/lib/python3.10/sre_constants.py
# code object from '/usr/lib/python3.10/__pycache__/sre_constants.cpython-310.pyc'
import 'sre_constants' # <_frozen_importlib_external.SourceFileLoader object at 0xf78909a0>
import 'sre_parse' # <_frozen_importlib_external.SourceFileLoader object at 0xf7890670>
import 'sre_compile' # <_frozen_importlib_external.SourceFileLoader object at 0xf7890280>
import '_locale' # <class '_frozen_importlib.BuiltinImporter'>
# /usr/lib/python3.10/__pycache__/copyreg.cpython-310.pyc matches /usr/lib/python3.10/copyreg.py
# code object from '/usr/lib/python3.10/__pycache__/copyreg.cpython-310.pyc'
import 'copyreg' # <_frozen_importlib_external.SourceFileLoader object at 0xf78a8808>
import 're' # <_frozen_importlib_external.SourceFileLoader object at 0xf78f4e98>
# /usr/lib/python3.10/__pycache__/token.cpython-310.pyc matches /usr/lib/python3.10/token.py
# code object from '/usr/lib/python3.10/__pycache__/token.cpython-310.pyc'
import 'token' # <_frozen_importlib_external.SourceFileLoader object at 0xf78a8910>
import 'tokenize' # <_frozen_importlib_external.SourceFileLoader object at 0xf78f4bf8>
import 'linecache' # <_frozen_importlib_external.SourceFileLoader object at 0xf78f4b20>
import 'inspect' # <_frozen_importlib_external.SourceFileLoader object at 0xf7ad3370>
import 'rlcompleter' # <_frozen_importlib_external.SourceFileLoader object at 0xf7ad32b0>
>>> 
DJMo13 commented 1 year ago

Ah, did you have enabled the location service, so you can run anything in the background without the process getting shut of?

https://github.com/ish-app/ish/wiki/Running-in-background

Disclaimer: I'm not a professional nor part of the developer team

freebrowser1 commented 1 year ago

Ah, did you have enabled the location service, so you can run anything in the background without the process getting shut of?

https://github.com/ish-app/ish/wiki/Running-in-background

Disclaimer: I'm not a professional nor part of the developer team Yes, I did it already, according to the link, otherwise I cannot ssh into it. I see a blue icon on top right of the iPad screen which tells it is running in the background.