Closed Anonymous2716 closed 1 year ago
Technically this is not bug. You have a font file opened with mmap()
by Android OS and then trying to overwrite it. This fill cause SIGBUS in mmap()
and as result application failure.
Font file should NEVER BE overwritten but deleted and created again. So cat myfont.ttf > ~/.termux/font.ttf
is a no-no. Font installer should do rm -f ~/.termux/font.ttf; cp myfont.ttf ~/.termux/font.ttf
instead.
Report issue to https://github.com/notflawffles/termux-nerd-installer. Its copy() function needs to be rewritten.
Thanks. I already have .
Problem description
I was trying out this program:
https://github.com/notflawffles/termux-nerd-installer
https://github.com/NotFlawffles/termux-nerd-installer/blob/2dd1dbb56b24be7fd4e1003d46d74e01734fef9b/src/fontinstaller.c#L207
On setting font with
./termux-nerd-installer set <fontname>
termux crashes. Doesn't show any notifications with crashlog.I remember this happening when i installed https://github.com/romkatv/powerlevel10k in oh-my-zsh right when new fomt is set.
Termux doesn't crash when its on background and changed the font. But when it comes on foreground the app crashes. I checked this by delaying the operation with sleep command before it.
Here is the stacktrace I got from `logcat -d`
``` 06-20 06:50:23.451 21575 21575 E DrmMtkUtil/SecureTimer: open proc/uptime failed: [Permission denied]. 06-20 06:50:23.759 21585 21585 E com.termux.api: Not starting debugger since process cannot load the jdwp agent. 06-20 06:50:23.768 21585 21585 W re-initialized>: type=1400 audit(0.0:4067): avc: denied { read } for name="u:object_r:mtk_amslog_prop:s0" dev="tmpfs" ino=132 scontext=u:r:untrusted_app:s0:c113,c257,c512,c768 tcontext=u:object_r:mtk_amslog_prop:s0 tclass=file permissive=0 06-20 06:50:23.770 21585 21585 E libc : Access denied finding property "persist.vendor.sys.activitylog" 06-20 06:50:34.446 21634 21634 E DrmMtkUtil/SecureTimer: open proc/uptime failed: [Permission denied]. 06-20 06:50:34.746 21585 21585 I SurfaceFactory: [static] sSurfaceFactory = com.mediatek.view.impl.SurfaceFactoryImpl@ca1d7fa 06-20 06:50:34.853 21585 21650 I ConfigStore: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasWideColorDisplay retrieved: 0 06-20 06:50:34.854 21585 21650 I ConfigStore: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasHDRDisplay retrieved: 0 06-20 06:50:34.854 21585 21650 I OpenGLRenderer: Initialized EGL, version 1.4 06-20 06:50:34.901 21585 21650 E ion : ioctl c0044901 failed with code -1: Invalid argument 06-20 06:50:36.749 21585 21650 W libEGL : EGLNativeWindowType 0x76d93fc010 disconnect failed 06-20 06:50:45.916 21724 21724 E DrmMtkUtil/SecureTimer: open proc/uptime failed: [Permission denied]. 06-20 06:50:52.026 21224 21224 F libc : Fatal signal 7 (SIGBUS), code 2 (BUS_ADRERR), fault addr 0x76b294e000 in tid 21224 (com.termux), pid 21224 (com.termux) 06-20 06:50:52.128 21773 21773 I crash_dump64: obtaining output fd from tombstoned, type: kDebuggerdTombstone 06-20 06:50:52.141 21773 21773 I crash_dump64: performing dump of process 21224 (target tid = 21224) 06-20 06:50:52.163 21773 21773 F DEBUG : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** 06-20 06:50:52.164 21773 21773 F DEBUG : Build fingerprint: '"Inentinally removed' 06-20 06:50:52.164 21773 21773 F DEBUG : Revision: '0' 06-20 06:50:52.164 21773 21773 F DEBUG : ABI: 'arm64' 06-20 06:50:52.164 21773 21773 F DEBUG : pid: 21224, tid: 21224, name: com.termux >>> com.termux <<< 06-20 06:50:52.165 21773 21773 F DEBUG : signal 7 (SIGBUS), code 2 (BUS_ADRERR), fault addr 0x76b294e000 06-20 06:50:52.165 21773 21773 F DEBUG : x0 00000076b294e000 x1 0000000000000000 x2 00000076b1c6f2e0 x3 00000076e16d9a30 06-20 06:50:52.165 21773 21773 F DEBUG : x4 00000076e16d9a40 x5 0000000000000004 x6 0000007fca0404b8 x7 0000000000000000 06-20 06:50:52.165 21773 21773 F DEBUG : x8 0000007764e91e50 x9 0000000000000000 x10 00000076b294e000 x11 0000000000000004 06-20 06:50:52.165 21773 21773 F DEBUG : x12 00000000ffffffff x13 000000000000d800 x14 000000000000dc00 x15 00000000ffffdfd6 06-20 06:50:52.165 21773 21773 F DEBUG : x16 0000007764eb4d20 x17 0000007764e4bf60 x18 000000000000feff x19 00000076b1c6f2e0 06-20 06:50:52.165 21773 21773 F DEBUG : x20 0000000043424454 x21 00000076b1ca0fc0 x22 0000000000000000 x23 0000007762b7fc58 06-20 06:50:52.165 21773 21773 F DEBUG : x24 00000076d78c4d80 x25 0000000000000018 x26 0000007fca0404b8 x27 0000007762b7f000 06-20 06:50:52.165 21773 21773 F DEBUG : x28 00000076b1cfb900 x29 0000007fca03fe10 06-20 06:50:52.165 21773 21773 F DEBUG : sp 0000007fca03fdf0 lr 0000007764e52bfc pc 0000007764e52c0c 06-20 06:50:52.343 21773 21773 F DEBUG : 06-20 06:50:52.343 21773 21773 F DEBUG : backtrace: 06-20 06:50:52.343 21773 21773 F DEBUG : #00 pc 000000000000dc0c /system/lib64/libharfbuzz_ng.so (_hb_face_for_data_reference_table(hb_face_t*, unsigned int, void*)+68) 06-20 06:50:52.343 21773 21773 F DEBUG : #01 pc 000000000000df84 /system/lib64/libharfbuzz_ng.so (hb_face_reference_table+20) 06-20 06:50:52.343 21773 21773 F DEBUG : #02 pc 0000000000016694 /system/lib64/libminikin.so (minikin::Layout::doLayoutRun(unsigned short const*, unsigned long, unsigned long, unsigned long, bool, minikin::MinikinPaint const&, minikin::StartHyphenEdit, minikin::EndHyphenEdit)+1188) 06-20 06:50:52.343 21773 21773 F DEBUG : #03 pc 00000000000142d4 /system/lib64/libminikin.so (minikin::LayoutCacheKey::doLayout(minikin::Layout*, minikin::MinikinPaint const&) const+204) 06-20 06:50:52.343 21773 21773 F DEBUG : #04 pc 0000000000014048 /system/lib64/libminikin.so (void minikin::LayoutCache::getOrCreateI don't have adb access.
Might be related to : https://github.com/termux/termux-app/issues/1388 https://github.com/termux/termux-app/issues/1170
Steps to reproduce the behavior.
Replace font. And do
termux-reload-settings
with any program or script.Manually replacing
~/.termux/font.ttf
doesn't reproduce this behavior. And termix:styling also works fine.What is the expected behavior?
Replace fonts without any issues.
System information