Skip to content
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

liblog.so: cannot open shared object file #3

Closed
SDRausty opened this issue May 11, 2018 · 5 comments
Closed

liblog.so: cannot open shared object file #3

SDRausty opened this issue May 11, 2018 · 5 comments

Comments

@SDRausty
Copy link

SDRausty commented May 11, 2018

Shared memory appears to be important in many issues:

  1. Sudo is non functional SDRausty/termux-archlinux#4
  2. Succesfully Modified Stock 'makepkg'... SDRausty/TermuxArch#38
  3. WebKit Browsers Showing Nothing instead of Web Content SDRausty/TermuxArch#55
  4. A few questions about Arch Linux in Termux PRoot SDRausty/TermuxArch#59 (comment)
  5. Chromium, Firefox, Epiphany, Libreoffice, localectl, timedatectl... SDRausty/TermuxArch#68

Arch Linux in Termux PRoot:

[19:09 libandroid-shmem ]$ make
cc -fpic -shared -std=c11 -Wall -Wextra -Wl,--version-script=exports.txt  shmem.c -llog -o libandroid-shmem.so
shmem.c:1:10: fatal error: android/log.h: No such file or directory
 #include <android/log.h>
          ^~~~~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:4: libandroid-shmem.so] Error 1
[19:09 libandroid-shmem ]$ l android/log.h
-rw-r--r-- 1 e 4452 Nov 9 09:57 android/log.h
[19:09 libandroid-shmem ]$ cd test/ 
[19:11 test ]$ make
cc -Wall -Wextra -Werror -std=c99 -DSYSV_ASHMEM_TEST_SYSTEM error-codes.c -o test-error-codes
./test-error-codes
shmget: Permission denied
make: *** [Makefile:19: testcase-error-codes] Error 1

Termux:

[21:40 libandroid-shmem ]$ make install cc -fpic -shared -std=c11 -Wall -Wextra -Wl,--version-script=exports.txt shmem.c -llog -o libandroid-shmem.so
install -D libandroid-shmem.so /data/data/com.termux/files/usr/lib/libandroid-shmem.so
install -D shm.h /data/data/com.termux/files/usr/include/sys/shm.h

The Arch Linux in Termux PRoot sudo error has changed:

[23:16 data ]$ env LD_PRELOAD=/data/data/com.termux/files/usr/lib/libandroid-shmem.so startarch su user sudo
sudo: error in /etc/sudo.conf, line 0 while loading plugin "sudoers_policy"
sudo: unable to load /usr/lib/sudo/sudoers.so: /usr/lib/sudo/sudoers.so: cannot stat shared object: Bad file descriptor
sudo: fatal error, unable to load plugins
[23:16 data ]$ env LD_PRELOAD=/data/data/com.termux/files/usr/lib/libandroid-shmem.so startarch l user
Welcome to Arch Linux in Termux!
Install a package: pacman -S package
More  information: pacman [-D|F|Q|R|S|T|U]h
Search   packages: pacman -Ss query
Upgrade  packages: pacman -Syu

Chat: https://gitter.im/termux
Help: info query and man query
IRC:  wiki.archlinux.org/index.php/IRC_channel

[23:17 ~ ]$ sudo
sudo: error in /etc/sudo.conf, line 0 while loading plugin "sudoers_policy"
sudo: unable to load /usr/lib/sudo/sudoers.so: /usr/lib/sudo/sudoers.so: cannot stat shared object: Bad file descriptor
sudo: fatal error, unable to load plugins
[23:17 ~ ]$ env LD_PRELOAD=/data/data/com.termux/files/usr/lib/libandroid-shmem.so sudo
sudo: error while loading shared libraries: liblog.so: cannot open shared object file: No such file or directory
@SDRausty

This comment was marked as spam.

@SDRausty

This comment was marked as spam.

@SDRausty

This comment was marked as spam.

@SDRausty SDRausty reopened this Sep 12, 2018
@andymwat
Copy link

andymwat commented Feb 2, 2019

I'm having the same issue. I downloaded liblog.so from https://github.com/innogames/android-ndk/blob/master/platforms/android-24/arch-arm64/usr/lib/liblog.so, but when I added it to my LD_PRELOAD path, the error changes to:
/bin/sh: error while loading shared libraries: /usr/lib/aarch64-linux-gnu/libc.so: invalid ELF header
When I replace the libc.so in that folder with the one from that repository, it segfaults.

@ghost
Copy link

ghost commented Apr 29, 2019

Regarding use of libandroid-shmem in chroot'ed environments, answer is in #6 (comment) (in short: current version cannot be used).

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants