termux / termux-packages

A package build system for Termux.
https://termux.dev
Other
13.02k stars 2.99k forks source link

installing lv2 builds lxml which causes device to crash #18973

Closed zavocc closed 8 months ago

zavocc commented 8 months ago

Problem description

Installing lv2 or packages depends on it would build lxml but during the installation, it takes a lot of resources causing the device to crash in the background, leading to unfinished installs in any packages.

What steps will reproduce the bug?

Install lv2

What is the expected behavior?

I believe lxml should be packaged as it is impractical to build such dependency that would cause the device to crash

Additionally it also causes such build error halfway through the installation if the Termux app was in the foreground (which causes the device to lag and system ui crashes) Screenshot_2024-01-14-21-11-59-52_84d3000e3f4017145260f7618db1d683

System information

termux-info:

Termux Variables:
TERMUX_API_VERSION=0.50.1
TERMUX_APK_RELEASE=F_DROID
TERMUX_APP_PACKAGE_MANAGER=apt
TERMUX_APP_PID=21712
TERMUX_IS_DEBUGGABLE_BUILD=0
TERMUX_MAIN_PACKAGE_FORMAT=debian
TERMUX_VERSION=0.118.0
TERMUX__USER_ID=0
Packages CPU architecture:
aarch64
Subscribed repositories:
# sources.list
deb https://packages-cf.termux.dev/apt/termux-main stable main
# x11-repo (sources.list.d/x11.list)
deb https://packages-cf.termux.dev/apt/termux-x11 x11 main
Updatable packages:
cmus/stable 2.10.0-7 aarch64 [upgradable from: 2.10.0-6]
command-not-found/stable 2.4.0-7 aarch64 [upgradable from: 2.4.0-6]
libdrm/stable 2.4.120 aarch64 [upgradable from: 2.4.119]
libpsl/stable 0.21.5 aarch64 [upgradable from: 0.21.2]
termux-tools version:
1.40.5
Android version:
11
Kernel build information:
Linux localhost 4.14.180-perf+ #2 SMP PREEMPT Sat Sep 3 23:17:03 CST 2022 aarch64 Android
Device manufacturer:
OPPO
Device model:
CPH1933
LD Variables:
LD_LIBRARY_PATH=
LD_PRELOAD=/data/data/com.termux/files/usr/lib/libtermux-exec.so
Installed termux plugins:
com.termux.api versionCode:51
com.termux.styling versionCode:31
com.termux.widget versionCode:13
licy183 commented 8 months ago

OK. It also crashed on my device. It seems that 6G RAM (~4.5GB free RAM) is not enough to compile lxml.

1) Add python-lxml. It will not take much space I suppose. 2) Remove lv2 and inkscape-extensions. They depend on lxml and install it in postinst.

Ping @sylirre @truboxl @2096779623 Any ideas?

sylirre commented 8 months ago

This issue exists for long time. lxml require a lot of RAM for building, up to 6 GB.

Never had crashes although my devices have 8 & 16 GB of memory.

Screenshot_20240115-185501~2

Screenshot_20240115-184520_Termux


Packaging python-lxml would solve this.

sylirre commented 8 months ago

I guess issue caused by -flto linker option.

Not sure if this relevant: https://github.com/lxml/lxml/blob/9a7804240a4d809c57d4be2cc2151cf0aa2b2ca3/pyproject.toml#L4-L26

licy183 commented 8 months ago

During the building, I found that the file generated by etree.pyx (etree.c) is about 12 MB, maybe this file is too large for some devices to compile...