-
Notifications
You must be signed in to change notification settings - Fork 485
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't use termux-battery-info in C program via system(3) call #252
Comments
I also got the logcat -d "W:*" but it doesn't contain any termux-related stuff (except some linker warnings about unused entries) |
Did you run the compiled binary through termux-elf-cleaner? BTW, Android 5 requires a separate cleaner. |
|
@Quasic Looks like problem still exist but only on some ROMs. I was able to reproduce it on Android 6 (arm). How to fix
- put this thing to your .bashrc (or something similar) and restart Termux. This is problem related to termux-exec and possible bug in system libc and there no workaround other than completely disable termux-exec. |
Thank you! It seems that this library is inside loaded modules (
I'll try to localize the issue and update OS at another Shield to 7.0 as it has (As I understood from NDK changelogs and discussion in this issue ). |
Problem description
Recently I noticed that
termux-battery-status
doesn't work anymore if I called it via system() function. It worked in August 2018, but seems to be broken after this milestone (I deduced it from my Telegram bot which running at tablet and using Termux API for battery info).Steps to reproduce
clang test_system_termux_battery_status.c
./a.out
Expected behavior
Some output like:
Actual behavior
Additional information
termux-info
:adb logcat -s termux:* termux-api:*
(from Windows Cmd):Output if app debugged under GDB:
Output then app is launched under
strace
(it shows some weird SIGSEGVs inside SIGCHLD signal, which means that the inferior process created bysystem()
has been crashed: https://gist.github.com/leha-bot/6ed4e1055b4073fb8ccb271c3c7a3e76The text was updated successfully, but these errors were encountered: