Git Product home page Git Product logo

libhybris's People

Contributors

alfonsosanchezbeato avatar bhush9 avatar chrisccoulson avatar erfanoabdi avatar fkaleo avatar fredldotme avatar gfxstrand avatar giucam avatar groleo avatar heeen avatar herrie82 avatar krnlyng avatar kubiko avatar kvahlman avatar lbt avatar mariogrip avatar mickybart avatar mlehtima avatar morphis avatar notkit avatar peat-psuwit avatar philippedeswert avatar rsalveti avatar sharpneli avatar sledges avatar sletta avatar stskeeps avatar thp avatar tofee avatar vicamo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

libhybris's Issues

HWComposer test fails with PowerVR GPU

Hello! :)

I've spent quite a lot of time trying to get my phone's graphics work with Halium. Vibration and LEDs are fine, and the system is overall stable, but graphics is something I wouldn't mind :)

When I launch the test, it prints correct screen resolution, ((null)) OpenGL ES 2.0 version string, clears the screen and hangs.

The phone (ASUS ZenFone 5) comes with a PowerVR SGX 544MP GPU from Imagination Technologies (test_egl_configs output attached). With a previous libhybris version, the test was blaming undefined symbols, but with the latest version those messages are gone (seemingly this commit: d5183fe). Not sure if it means they are found now...

The kernel and the blobs I use are also used in a LineageOS build for this phone; graphics works there.

I contacted PowerVR, and they seemed quite friendly, but both of us just do not know what direction to research, so I feel libhybris is the best place for this report.

I also attach logcat output, dmesg, a complete strace of the running test and libhybris n linker's debug messages. Messages that I believe are relevant have drm, libEGL, IMGSRV and hwcomposer in them.

egl_configs.txt
logcat.txt
dmesg.txt
strace.zip
hybris-log.txt

fflush segfault

I porting this lib to Galaxy S7(a long and complicated story) and facing issue, when I run test_vibrator and test_lights, they do what they must do. But program crushes with segfault on fflush syscall.

Trace(not all):

EGL hooks.c:2404 (_hybris_hook_dlopen) DEBUG: filename /system/lib64/hw/vibrator.default.so flag 2
EGL hooks.c:2411 (_hybris_hook_dlsym) DEBUG: handle 0x238e1f29 symbol HMI
HOOKS hooks.c:2315 (_hybris_hook_strcmp) DEBUG: s1 'vibrator' s2 'vibrator'
HOOKS hooks.c:2102 (_hybris_hook_open) DEBUG: pathname '/sys/class/timed_output/vibrator/enable' flags 2
HOOKS hooks.c:2102 (_hybris_hook_open) DEBUG: pathname '/sys/class/timed_output/vibrator/enable' flags 2
HOOKS hooks.c:1555 (_hybris_hook_fwrite) DEBUG: ptr 0x7fc16fe110 size 1 nmemb 0 fp 0x7f86a67b98
HOOKS hooks.c:1426 (_hybris_hook_fflush) DEBUG: fp 0x7f86a67b98

GDB:

GNU gdb (GDB) 7.12.1
Copyright (C) 2017 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "aarch64-tizen-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from tests/.libs/test_vibrator...done.
(gdb) run
Starting program: /opt/usr/home/libhybris/hybris/tests/.libs/test_vibrator 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".

Program received signal SIGSEGV, Segmentation fault.
0x0000007fb7e31128 in __GI__IO_fflush (fp=0x7fb7fcfb98 <_hybris_hook_sF+152>) at iofflush.c:39
39	iofflush.c: No such file or directory.
(gdb) bt
#0  0x0000007fb7e31128 in __GI__IO_fflush (fp=0x7fb7fcfb98 <_hybris_hook_sF+152>) at iofflush.c:39
#1  0x0000007fb7a1362c in ?? ()
#2  0x0000040000100001 in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Strace(not all):

write(3, "EGL hooks.c:2411 (_hybris_hook_d"..., 74) = 74
write(3, "HOOKS hooks.c:2315 (_hybris_hook"..., 76) = 76
write(3, "HOOKS hooks.c:2102 (_hybris_hook"..., 105) = 105
openat(AT_FDCWD, "/sys/class/timed_output/vibrator/enable", O_RDWR) = 4
close(4)                                = 0
write(3, "HOOKS hooks.c:2102 (_hybris_hook"..., 105) = 105
openat(AT_FDCWD, "/sys/class/timed_output/vibrator/enable", O_RDWR) = 4
write(4, "1000\n", 5)                   = 5
close(4)                                = 0
write(3, "HOOKS hooks.c:1555 (_hybris_hook"..., 96) = 96
write(3, "HOOKS hooks.c:1426 (_hybris_hook"..., 64) = 64
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0x8} ---
+++ killed by SIGSEGV (core dumped) +++

According to strace file were closed rigth after data was writen to the file and fflush trying to flush data to already closed file.

Compiling single library?

Is it possible to use libhybris for using a single library?
I have got GLES for android, is possible to make a libGles.so working on ubuntu without recompiling all the other ubuntu libraries?

test_gps breaks the build.

Building master on mk802ii, debian jessie.

Used ./autogen.sh --prefix=/opt/hybris --with-android-headers=/opt/android-headers --enable-wayland --enable-mesa.

  CC       test_gps-test_gps.o
test_gps.c: In function 'agps_handle_status_callback':
test_gps.c:290:51: error: 'AGPS_APN_BEARER_IPV4' undeclared (first use in this function)
         AGps->data_conn_open(AGPS_TYPE_SUPL, apn, AGPS_APN_BEARER_IPV4);
                                                   ^
test_gps.c:290:51: note: each undeclared identifier is reported only once for each function it appears in
test_gps.c:290:9: warning: passing argument 1 of 'AGps->data_conn_open' makes pointer from integer without a cast [enabled by default]
         AGps->data_conn_open(AGPS_TYPE_SUPL, apn, AGPS_APN_BEARER_IPV4);
         ^
test_gps.c:290:9: note: expected 'const char *' but argument is of type 'int'
test_gps.c:290:9: error: too many arguments to function 'AGps->data_conn_open'
make[2]: *** [test_gps-test_gps.o] Error 1
make[2]: Leaving directory `/root/hybris/android/libhybris/hybris/tests'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/root/hybris/android/libhybris/hybris'
make: *** [all] Error 2

Commenting out test_gps from hybris/tests/Makefile.am helps, and everything compiles nicely.

Mali device driver does not respond properly to rockchip version check

W/libEGL (21081): eglInitialize(0x1) failed (EGL_BAD_ALLOC)
D/libEGL (21097): loaded /system/lib/egl/libEGL_mali.so
D/libEGL (21097): loaded /system/lib/egl/libGLESv1_CM_mali.so
D/libEGL (21097): loaded /system/lib/egl/libGLESv2_mali.so
E/ (21097): Mali device driver does not respond properly to rockchip version check
W/libEGL (21097): eglInitialize(0x1) failed (EGL_BAD_ALLOC)

I have compiled jelly bean source and extracted headers and system then built libhybris but when i try to run the tests, this is what it says...

can not generate 'makefile' after I ran './configure'

checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports nested variables... (cached) yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define EXTENSIONS... yes
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking how to print strings... printf
checking for a sed that does not truncate output... /bin/sed
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert i686-pc-linux-gnu file names to i686-pc-linux-gnu format... func_convert_file_noop
checking how to convert i686-pc-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @file support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for mt... mt
checking if mt is a manifest tool... no
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
checking how to run the C++ preprocessor... g++ -E
checking for ld used by g++... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking whether the g++ linker (/usr/bin/ld) supports shared libraries... yes
checking for g++ option to produce PIC... -fPIC -DPIC
checking if g++ PIC flag -fPIC -DPIC works... yes
checking if g++ static flag -static works... yes
checking if g++ supports -c -o file.o... yes
checking if g++ supports -c -o file.o... (cached) yes
checking whether the g++ linker (/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... (cached) GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for dlopen in -ldl... yes
checking for clock_gettime in -lrt... yes
checking for ANDROID_HEADERS... no

how to deal with it?thx!

Should dlerror return NULL if no errors

According standard libc, dlerror should return NULL if no errors have occurred;
Bug libhybris hooked dlerror always returns a char buffer.
This may lead to possible failure if dlerror is used to check error in bionic.

Q: Virtualized kernel for vendor blobs to allow free kernel version upgrades?

I am not sure if this is the right place to ask this question, but after realising yet again that my device had too old a kernel for what I wanted, I got the idea of using a VM to enable two separate kernels running. One stripped down minimum memory kernel for the binary blobs from various HW vendors and one kernel for the main OS that can be freely upgraded. Not sure which should be host and which should be guest, both directions could be done, but I guess some sort of HW pass-through would be required regardless.

Is this doable, or am I completely off base?

exit mali-hist-dump thread problem

I am now running libribris on ubuntu andriod graphics library, in libhybris implementation, because the thread mali-hist-dump will cause a process error, so I quit the thread mali-hist-dump to solve this problem, which may Performance is affected, the thread mali-hist-dump in the library what role?
If I do not exit the thread mali-hist-dump, by tracking the PC address, the program is found in the function malioc_release_outputs segment error, there are other ways to solve this problem?

about __pthread_gettid and __pthread_settid

Libhybris can't handle bionic's "__pthread_gettid" and "__pthread_settid".
get_hooked_symbol printout "__pthread_gettid -2".

/* Return the kernel thread ID for a pthread.

  • This is only defined for implementations where pthread <-> kernel is 1:1, which this is.
  • Not the same as pthread_getthreadid_np, which is commonly defined to be opaque.
  • Internal, not an NDK API.
    */

pid_t __pthread_gettid(pthread_t thid)
{
pthread_internal_t* thread = (pthread_internal_t*)thid;
return thread->kernel_id;
}

int __pthread_settid(pthread_t thid, pid_t tid)
{
if (thid == 0)
return EINVAL;

pthread_internal_t* thread = (pthread_internal_t*)thid;
thread->kernel_id = tid;

return 0;

}

libhybris + kwin crash on Qt 5.11

Hello,

Just opening this as tracker, I am having weird crasher with the halium 7 and libhybris along with Qt 5.11

Thread 10 (Thread 0xeb4da2e0 (LWP 5818)):
#0  0xf69f9bf0 in ?? ()
#1  0x00000000 in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Thread 9 (Thread 0xeccff2e0 (LWP 5809)):
#0  0xf69f9bf0 in ?? ()
#1  0x00000000 in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Thread 8 (Thread 0xed6622e0 (LWP 5799)):
#0  0xf73e9454 in ?? ()
#1  0xf73e503a in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Thread 7 (Thread 0xede622e0 (LWP 5797)):
#0  nanosleep () at bionic/libc/arch-arm/syscalls/nanosleep.S:9
#1  0xf263298c in sleep (seconds=4) at bionic/libc/upstream-freebsd/lib/libc/gen/sleep.c:58
#2  0xf27390d8 in android::egl_cache_t::setBlob(void const*, long, void const*, long)::DeferredSaveThread::threadLoop() (this=<optimized out>)
    at frameworks/native/opengl/libs/EGL/egl_cache.cpp:153
#3  0xf276e43e in android::Thread::_threadLoop (user=0x1ac218) at system/core/libutils/Threads.cpp:754
#4  0xf73e05b4 in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Thread 6 (Thread 0xef2f22e0 (LWP 5796)):
#0  __ppoll () at bionic/libc/arch-arm/syscalls/__ppoll.S:15
#1  0xf26210ca in poll (fds=0xef2f1a90, fds@entry=0x0, fd_count=fd_count@entry=6, ms=<optimized out>, ms@entry=-1) at bionic/libc/bionic/poll.cpp:47
#2  0xf0140626 in poll (timeout=-1, fd_count=6, fds=0x0) at bionic/libc/include/poll.h:66
#3  qhwc::vsync_loop (param=0x7c8e8) at hardware/qcom/display/msm8994/libhwcomposer/hwc_vsync.cpp:168
#4  0xf73e05b4 in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Thread 5 (Thread 0xefaf22e0 (LWP 5795)):
#0  __ppoll () at bionic/libc/arch-arm/syscalls/__ppoll.S:15
#1  0xf26210ca in poll (fds=0xefaf1c3c, fd_count=1, ms=<optimized out>) at bionic/libc/bionic/poll.cpp:47
#2  0xf0100770 in poll (fds=0xefaf1c3c, fd_count=1, timeout=-1) at bionic/libc/include/poll.h:57
#3  uevent_next_event (buffer=<optimized out>, buffer_length=<optimized out>) at hardware/libhardware_legacy/uevent/uevent.c:83
#4  0xf01400b4 in qhwc::uevent_loop (param=0x7c8e8) at hardware/qcom/display/msm8994/libhwcomposer/hwc_uevents.cpp:223
#5  0xf73e05b4 in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Thread 4 (Thread 0xf09ff2e0 (LWP 5793)):
#0  0xf69f9bf0 in ?? ()
#1  0x00000000 in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Thread 3 (Thread 0xf13ff2e0 (LWP 5792)):
#0  0xf69f9bf0 in ?? ()
#1  0x00000000 in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Thread 2 (Thread 0xf1d9c2e0 (LWP 5791)):
#0  0xf69f9bf0 in ?? ()
#1  0x00000000 in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Thread 1 (Thread 0xf2888000 (LWP 5787)):
#0  0xf5e933f4 in ?? ()
#1  0xf5e95a70 in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

It might be issue with halium, but I am not sure how to debug this further, I believe @Tofee also have similar issue on Halium 5.1 and Qt 5.11.

Want to create custom audio effect in native c/c++ for android

I am working on project which deals with audio video playback in Android KitKat. I am able to play video using video view and it's MediaPlayer helps to modify the audio track of video. I know about Playbackparams which can be used for pitch and tempo shifting but it's available from API 23.

I heard about a library called Sound touch which can be used for pitch and tempo pitching but the source code available for the same shows that it works for WAV files.

I am interested in using sound touch library as a audio effect library which I can place in Android's /system/etc/audio_effects.conf and place the SO file in /system/lib.

But I don't know how to turn this sound touch library in order to make it read audio from Android MediaPlayer as I am planning to call this library in the same as we use presetreverb/equalizer?

Kindly help me out if anyone has done such an implementation.

I get EGL_NOT_INITIALIZED when calling eglChooseConfig(...) in test_egl and test_glesv2

Hi, there!

I compiled the latest libhybris version using these android headers http://ubuntuone.com/6PwRhU0CN1MZFrBUNJFnHL and using this /system folder http://ubuntuone.com/64JdjdWVq9F2E5p6gMQE1J (both files are .tar.xz archives). When I run test_egl or test_glesv2 I get assertion errors at test_egl.c:51 or test_glesv2:112. In both cases I do get EGL_NOT_INITIALIZED (0x3001) instead of EGL_SUCCESS (0x3000) after calling eglChoseConfig.

I'm using EGL_PLATFORM=fbdev, have read and write access to /dev/ump (and modules ump and disp_ump are loaded).

My distribution is Arch Linux (armv7 with hard float, kernel version is 3.0.57) running on a Cubieboard.

Has anyone an idea what went wrong?

Thanks for your help!

Regards,
maribu

test_sensors: warning: format '%s' expects argument of type 'char *', but argument 2 has type 'int' [-Wformat=]

.././hybris/tests/test_sensors.c: In function 'main':
.././hybris/tests/test_sensors.c:130:17: warning: format '%s' expects argument of type 'char *', but argument 2 has type 'int' [-Wformat=]
                 printf("Could not set delay: %s\n", strerror(-res));
                 ^
.././hybris/tests/test_sensors.c:134:17: warning: format '%s' expects argument of type 'char *', but argument 2 has type 'int' [-Wformat=]
                 printf("Could not activate sensor: %s\n", strerror(-res));
                 ^
.././hybris/tests/test_sensors.c:152:21: warning: format '%s' expects argument of type 'char *', but argument 2 has type 'int' [-Wformat=]
                     printf("Could not deactivate sensor: %s\n", strerror(-res));
                     ^

BGRA texture support

Original topic name: Symbol search continues after successful lookup

I re-enabled missing symbol output to check if all the symbols are located.

In the list of missing symbols, I found eglLockSurfaceKHR.

I decided to follow its search process and enabled HYBRIS_LD_DEBUG=3.

Filtering the log by eglLockSurfaceKHR, I got this:

DEBUG: /system/lib/libEGL.so: looking up eglLockSurfaceKHR in /system/lib/libGLESv2.so (from local group)
SEARCH eglLockSurfaceKHR in /system/lib/libGLESv2.so@0xb7091000 (gnu)
NOT FOUND eglLockSurfaceKHR in /system/lib/libGLESv2.so@0xb7091000
DEBUG: /system/lib/libEGL.so: looking up eglLockSurfaceKHR in /system/lib/libcutils.so (from local group)
SEARCH eglLockSurfaceKHR in /system/lib/libcutils.so@0xb7071000 (gnu)
NOT FOUND eglLockSurfaceKHR in /system/lib/libcutils.so@0xb7071000
DEBUG: /system/lib/libEGL.so: looking up eglLockSurfaceKHR in /system/lib/libutils.so (from local group)
SEARCH eglLockSurfaceKHR in /system/lib/libutils.so@0xb704c000 (gnu)
NOT FOUND eglLockSurfaceKHR in /system/lib/libutils.so@0xb704c000
DEBUG: /system/lib/libEGL.so: looking up eglLockSurfaceKHR in /system/lib/liblog.so (from local group)
SEARCH eglLockSurfaceKHR in /system/lib/liblog.so@0xb703b000 (gnu)
NOT FOUND eglLockSurfaceKHR in /system/lib/liblog.so@0xb703b000
DEBUG: /system/lib/libEGL.so: looking up eglLockSurfaceKHR in /system/lib/libEGL.so (from local group)
SEARCH eglLockSurfaceKHR in /system/lib/libEGL.so@0xb7015000 (gnu)
FOUND eglLockSurfaceKHR in /system/lib/libEGL.so (0x124b0) 291
si /system/lib/libEGL.so sym eglLockSurfaceKHR s->st_value = 0x124b0, found in /system/lib/libEGL.so, base = 0xb7015000, load bias = 0xb7013000
RELO R_386_32 b7036910 <- +b70254b0 eglLockSurfaceKHR
DEBUG: /system/lib/libEGL.so: looking up eglLockSurfaceKHR in /system/lib/libGLESv2.so (from local group)
SEARCH eglLockSurfaceKHR in /system/lib/libGLESv2.so@0xb7091000 (gnu)
NOT FOUND eglLockSurfaceKHR in /system/lib/libGLESv2.so@0xb7091000
DEBUG: /system/lib/libEGL.so: looking up eglLockSurfaceKHR in /system/lib/libcutils.so (from local group)
SEARCH eglLockSurfaceKHR in /system/lib/libcutils.so@0xb7071000 (gnu)
NOT FOUND eglLockSurfaceKHR in /system/lib/libcutils.so@0xb7071000
DEBUG: /system/lib/libEGL.so: looking up eglLockSurfaceKHR in /system/lib/libutils.so (from local group)
SEARCH eglLockSurfaceKHR in /system/lib/libutils.so@0xb704c000 (gnu)
NOT FOUND eglLockSurfaceKHR in /system/lib/libutils.so@0xb704c000
DEBUG: /system/lib/libEGL.so: looking up eglLockSurfaceKHR in /system/lib/liblog.so (from local group)
SEARCH eglLockSurfaceKHR in /system/lib/liblog.so@0xb703b000 (gnu)
NOT FOUND eglLockSurfaceKHR in /system/lib/liblog.so@0xb703b000
DEBUG: /system/lib/libEGL.so: looking up eglLockSurfaceKHR in /system/lib/libEGL.so (from local group)
SEARCH eglLockSurfaceKHR in /system/lib/libEGL.so@0xb7015000 (gnu)
FOUND eglLockSurfaceKHR in /system/lib/libEGL.so (0x124b0) 291
si /system/lib/libEGL.so sym eglLockSurfaceKHR s->st_value = 0x124b0, found in /system/lib/libEGL.so, base = 0xb7015000, load bias = 0xb7013000
RELO JMP_SLOT       0xb7036f54 <-       0xb70254b0 eglLockSurfaceKHR
SEARCH eglLockSurfaceKHR in /system/vendor/lib/egl/libEGL_POWERVR_SGX544_115.so@0xb6bc4000 h=a72d262(elf) 64
NOT FOUND eglLockSurfaceKHR in /system/vendor/lib/egl/libEGL_POWERVR_SGX544_115.so@0xb6bc4000 a72d262 64
SEARCH eglLockSurfaceKHR in /system/lib/libc.so@0xb6e21000 (gnu)
NOT FOUND eglLockSurfaceKHR in /system/lib/libc.so@0xb6e21000
SEARCH eglLockSurfaceKHR in /system/lib/libdl.so@0xb7012000 (gnu)
NOT FOUND eglLockSurfaceKHR in /system/lib/libdl.so@0xb7012000
SEARCH eglLockSurfaceKHR in /system/lib/libcutils.so@0xb7071000 (gnu)
NOT FOUND eglLockSurfaceKHR in /system/lib/libcutils.so@0xb7071000
SEARCH eglLockSurfaceKHR in /system/vendor/lib/libIMGegl.so@0xb62c4000 h=a72d262(elf) 80
NOT FOUND eglLockSurfaceKHR in /system/vendor/lib/libIMGegl.so@0xb62c4000 a72d262 80
SEARCH eglLockSurfaceKHR in /system/lib/liblog.so@0xb703b000 (gnu)
NOT FOUND eglLockSurfaceKHR in /system/lib/liblog.so@0xb703b000
SEARCH eglLockSurfaceKHR in /system/lib/libc++.so@0xb6f1f000 (gnu)
NOT FOUND eglLockSurfaceKHR in /system/lib/libc++.so@0xb6f1f000
SEARCH eglLockSurfaceKHR in /system/lib/libm.so@0xb6de9000 (gnu)
NOT FOUND eglLockSurfaceKHR in /system/lib/libm.so@0xb6de9000
SEARCH eglLockSurfaceKHR in /system/vendor/lib/libsrv_um.so@0xb70e6000 h=a72d262(elf) 127
NOT FOUND eglLockSurfaceKHR in /system/vendor/lib/libsrv_um.so@0xb70e6000 a72d262 127
SEARCH eglLockSurfaceKHR in /system/lib/libhardware.so@0xb6cf3000 (gnu)
NOT FOUND eglLockSurfaceKHR in /system/lib/libhardware.so@0xb6cf3000
SEARCH eglLockSurfaceKHR in /system/lib/libsync.so@0xb6cf0000 (gnu)
NOT FOUND eglLockSurfaceKHR in /system/lib/libsync.so@0xb6cf0000
SEARCH eglLockSurfaceKHR in /system/lib/libdrm.so@0xb70be000 (gnu)
NOT FOUND eglLockSurfaceKHR in /system/lib/libdrm.so@0xb70be000
undefined symbol: eglLockSurfaceKHR

As I can see, the symbol is successfully located:
FOUND eglLockSurfaceKHR in /system/lib/libEGL.so (0x124b0) 291
But after some time (log lines 19190 - 458417) the search continues, to print that undefined symbol message in the end.

So I wonder if the symbol is properly located and used, and what makes the search restart after successfull lookup. Same applies to some other symbols as well.

mm.so segfault

Hello! :)

I am porting Halium to ASUS ZenFone 5 (A501CG, x86) and facing this issue when running test_egl_configs:

Starting test (EGL_PLATFORM=(null))
WARNING: linker /system/vendor/lib/egl/libEGL_POWERVR_ROGUE.so: unused DT entry: type 0x1d arg 0x559
WARNING: linker /system/vendor/lib/libIMGegl.so: unused DT entry: type 0x1d arg 0x7cc
WARNING: linker /system/vendor/lib/libsrv_um.so: unused DT entry: type 0x1d arg 0xbcc
Segmentation fault

GDB stack trace:

Program received signal SIGSEGV, Segmentation fault.
0xb7ba2840 in soinfo::call_constructors (this=0xb77ca23c) at linker.cpp:2228
2228    linker.cpp: No such file or directory.
(gdb) bt                                                                                     
#0  0xb7ba2840 in soinfo::call_constructors (this=0xb77ca23c) at linker.cpp:2228             
#1  0xb7ba62b7 in do_dlopen (name=0x8057898 "/vendor/lib/egl/libEGL_POWERVR_ROGUE.so", flags=0, extinfo=0x0) at linker.cpp:1634
#2  0xb7b9f508 in dlopen_ext (filename=0x8057898 "/vendor/lib/egl/libEGL_POWERVR_ROGUE.so", flags=0, extinfo=0x0) at dlfcn.cpp:95
#3  0xb7dc4672 in _hybris_hook_dlopen (filename=0x8057898 "/vendor/lib/egl/libEGL_POWERVR_ROGUE.so", flag=0) at hooks.c:2401
#4  0xb7b8718b in ?? ()                                                                      
#5  0xb7b86adc in ?? ()                                                                      
#6  0xb7b80514 in ?? ()                                                                      
#7  0xb7b807ca in ?? ()                                                                      
#8  0xb7fcae2b in eglGetDisplay (display_id=0x0) at egl.c:193
#9  0x0804874b in main (argc=1, argv=0xbffff7f4) at test_egl_configs.c:96

strace:

execve("/usr/bin/test_egl_configs", ["test_egl_configs"], [/* 15 vars */]) = 0
brk(NULL)                               = 0x80f6000
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
mmap2(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7795000
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=27739, ...}) = 0
mmap2(NULL, 27739, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb778e000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/usr/lib/i386-linux-gnu/libhybris-egl/libEGL.so.1", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\0\26\0\0004\0\0\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0644, st_size=30180, ...}) = 0
mmap2(NULL, 33552, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb7785000
mmap2(0xb778c000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x6000) = 0xb778c000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/i386-linux-gnu/libpthread.so.0", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\260O\0\0004\0\0\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=134864, ...}) = 0
mmap2(NULL, 115296, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb7768000
mmap2(0xb7781000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x18000) = 0xb7781000
mmap2(0xb7783000, 4704, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb7783000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/i386-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\1\1\1\3\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\320\207\1\0004\0\0\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=1786484, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7767000
mmap2(NULL, 1792540, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb75b1000
mmap2(0xb7761000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1af000) = 0xb7761000
mmap2(0xb7764000, 10780, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb7764000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/i386-linux-gnu/libdl.so.2", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0000\n\0\0004\0\0\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0644, st_size=13828, ...}) = 0
mmap2(NULL, 16488, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb75ac000
mmap2(0xb75af000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2000) = 0xb75af000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/usr/lib/i386-linux-gnu/libhybris-common.so.1", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0@^\0\0004\0\0\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0644, st_size=198580, ...}) = 0
mmap2(NULL, 201936, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb757a000
mmap2(0xb75a9000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2e000) = 0xb75a9000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/usr/lib/i386-linux-gnu/libstdc++.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\1\1\1\3\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0`\303\6\0004\0\0\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0644, st_size=1521032, ...}) = 0
mmap2(NULL, 1532512, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb7403000
mprotect(0xb7570000, 4096, PROT_NONE)   = 0
mmap2(0xb7571000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x16d000) = 0xb7571000
mmap2(0xb7577000, 8800, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb7577000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/i386-linux-gnu/librt.so.1", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0@\30\0\0004\0\0\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0644, st_size=30660, ...}) = 0
mmap2(NULL, 33304, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb73fa000
mmap2(0xb7401000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x6000) = 0xb7401000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/usr/lib/i386-linux-gnu/libandroid-properties.so.1", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0000\r\0\0004\0\0\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0644, st_size=13824, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb73f9000
mmap2(NULL, 24676, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb73f2000
mmap2(0xb73f5000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2000) = 0xb73f5000
mmap2(0xb73f7000, 4196, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb73f7000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/i386-linux-gnu/libm.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\1\1\1\3\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\220E\0\0004\0\0\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0644, st_size=341948, ...}) = 0
mmap2(NULL, 344144, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb739d000
mmap2(0xb73f0000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x52000) = 0xb73f0000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/i386-linux-gnu/libgcc_s.so.1", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\200 \0\0004\0\0\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0644, st_size=114560, ...}) = 0
mmap2(NULL, 117652, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb7380000
mmap2(0xb739c000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1b000) = 0xb739c000
close(3)                                = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb737f000
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb737e000
set_thread_area({entry_number:-1, base_addr:0xb737e740, limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0, useable:1}) = 0 (entry_number:6)
mprotect(0xb7761000, 8192, PROT_READ)   = 0
mprotect(0xb73f0000, 4096, PROT_READ)   = 0
mprotect(0xb73f5000, 4096, PROT_READ)   = 0
mprotect(0xb7781000, 4096, PROT_READ)   = 0
mprotect(0xb7401000, 4096, PROT_READ)   = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb737d000
mprotect(0xb7571000, 20480, PROT_READ)  = 0
mprotect(0xb75af000, 4096, PROT_READ)   = 0
mprotect(0xb75a9000, 4096, PROT_READ)   = 0
mprotect(0xb778c000, 4096, PROT_READ)   = 0
mprotect(0x804a000, 4096, PROT_READ)    = 0
mprotect(0xb77ba000, 4096, PROT_READ)   = 0
munmap(0xb778e000, 27739)               = 0
set_tid_address(0xb737e7a8)             = 2361
set_robust_list(0xb737e7b0, 12)         = 0
rt_sigaction(SIGRTMIN, {0xb776c9c0, [], SA_SIGINFO}, NULL, 8) = 0
rt_sigaction(SIGRT_1, {0xb776ca40, [], SA_RESTART|SA_SIGINFO}, NULL, 8) = 0
rt_sigprocmask(SIG_UNBLOCK, [RTMIN RT_1], NULL, 8) = 0
ugetrlimit(RLIMIT_STACK, {rlim_cur=8192*1024, rlim_max=RLIM_INFINITY}) = 0
uname({sysname="Linux", nodename="localhost", ...}) = 0
brk(NULL)                               = 0x80f6000
brk(0x811b000)                          = 0x811b000
write(2, "Starting test (EGL_PLATFORM=(nul"..., 36Starting test (EGL_PLATFORM=(null))
) = 36
socket(PF_LOCAL, SOCK_STREAM, 0)        = 3
connect(3, {sa_family=AF_LOCAL, sun_path="/dev/socket/property_service"}, 31) = -1 ENOENT (No such file or directory)
close(3)                                = 0
open("/system/build.prop", O_RDONLY)    = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=3190, ...}) = 0
fstat64(3, {st_mode=S_IFREG|0644, st_size=3190, ...}) = 0
read(3, "\n# begin build properties\n# auto"..., 4096) = 3190
read(3, "", 4096)                       = 0
open("/proc/cmdline", O_RDONLY)         = 4
read(4, "init=/init pci=noearly console=t"..., 1023) = 487
close(4)                                = 0
close(3)                                = 0
futex(0xb75b0040, FUTEX_WAKE_PRIVATE, 2147483647) = 0
open("/usr/lib/i386-linux-gnu/libhybris/linker/mm.so", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\1\1\1\3\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0``\0\0004\0\0\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0644, st_size=158096, ...}) = 0
mmap2(NULL, 161676, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb7355000
mprotect(0xb737a000, 4096, PROT_NONE)   = 0
mmap2(0xb737b000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x25000) = 0xb737b000
close(3)                                = 0
mprotect(0xb737b000, 4096, PROT_READ)   = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, 0, 0) = 0xb7794000
prctl(0x53564d41 /* PR_??? */, 0, 0xb7794000, 0x1000, 0xb7370638) = 0
open("/vendor/lib/libEGL.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/system/lib/libEGL.so", O_RDONLY|O_CLOEXEC) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=136736, ...}) = 0
readlink("/proc/self/fd/3", "/system/lib/libEGL.so", 4096) = 21
pread64(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\0\0\0\0004\0\0\0"..., 52, 0) = 52
mmap2(NULL, 4096, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7793000
mmap2(NULL, 155648, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb732f000
mmap2(0xb732f000, 126772, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0) = 0xb732f000
mmap2(0xb734f000, 8200, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x1f000) = 0xb734f000
mmap2(0xb7352000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb7352000
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, 0, 0) = 0xb7792000
prctl(0x53564d41 /* PR_??? */, 0, 0xb7792000, 0x1000, 0xb7370638) = 0
munmap(0xb7793000, 4096)                = 0
close(3)                                = 0
open("/vendor/lib/libbinder.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/system/lib/libbinder.so", O_RDONLY|O_CLOEXEC) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=538148, ...}) = 0
readlink("/proc/self/fd/3", "/system/lib/libbinder.so", 4096) = 24
pread64(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\0\0\0\0004\0\0\0"..., 52, 0) = 52
mmap2(NULL, 4096, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7793000
mmap2(NULL, 544768, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb72aa000
mmap2(0xb72aa000, 496676, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0) = 0xb72aa000
mmap2(0xb7325000, 36872, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x7a000) = 0xb7325000
munmap(0xb7793000, 4096)                = 0
close(3)                                = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, 0, 0) = 0xb7793000
prctl(0x53564d41 /* PR_??? */, 0, 0xb7793000, 0x1000, 0xb7370638) = 0
open("/vendor/lib/libcutils.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/system/lib/libcutils.so", O_RDONLY|O_CLOEXEC) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=124772, ...}) = 0
readlink("/proc/self/fd/3", "/system/lib/libcutils.so", 4096) = 24
pread64(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\0\0\0\0004\0\0\0"..., 52, 0) = 52
mmap2(NULL, 4096, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7791000
mmap2(NULL, 131072, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb728a000
mmap2(0xb728a000, 117488, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0) = 0xb728a000
mmap2(0xb72a8000, 4476, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x1d000) = 0xb72a8000
munmap(0xb7791000, 4096)                = 0
close(3)                                = 0
open("/vendor/lib/libutils.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/system/lib/libutils.so", O_RDONLY|O_CLOEXEC) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=144944, ...}) = 0
readlink("/proc/self/fd/3", "/system/lib/libutils.so", 4096) = 23
pread64(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\0\0\0\0004\0\0\0"..., 52, 0) = 52
mmap2(NULL, 4096, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7791000
mmap2(NULL, 151552, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7265000
mmap2(0xb7265000, 139224, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0) = 0xb7265000
mmap2(0xb7288000, 4120, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x22000) = 0xb7288000
munmap(0xb7791000, 4096)                = 0
close(3)                                = 0
open("/vendor/lib/liblog.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/system/lib/liblog.so", O_RDONLY|O_CLOEXEC) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=63280, ...}) = 0
readlink("/proc/self/fd/3", "/system/lib/liblog.so", 4096) = 21
pread64(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\0\0\0\0004\0\0\0"..., 52, 0) = 52
mmap2(NULL, 4096, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7791000
mmap2(NULL, 69632, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7254000
mmap2(0xb7254000, 59324, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0) = 0xb7254000
mmap2(0xb7263000, 4428, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0xe000) = 0xb7263000
munmap(0xb7791000, 4096)                = 0
close(3)                                = 0
open("/vendor/lib/libui.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/system/lib/libui.so", O_RDONLY|O_CLOEXEC) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=120360, ...}) = 0
readlink("/proc/self/fd/3", "/system/lib/libui.so", 4096) = 20
pread64(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\0\0\0\0004\0\0\0"..., 52, 0) = 52
mmap2(NULL, 4096, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7791000
mmap2(NULL, 126976, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7235000
mmap2(0xb7235000, 114740, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0) = 0xb7235000
mmap2(0xb7252000, 4112, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x1c000) = 0xb7252000
munmap(0xb7791000, 4096)                = 0
close(3)                                = 0
open("/vendor/lib/libc++.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/system/lib/libc++.so", O_RDONLY|O_CLOEXEC) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=984696, ...}) = 0
readlink("/proc/self/fd/3", "/system/lib/libc++.so", 4096) = 21
pread64(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\0\0\0\0004\0\0\0"..., 52, 0) = 52
mmap2(NULL, 4096, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7791000
mmap2(NULL, 995328, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7142000
mmap2(0xb7142000, 965420, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0) = 0xb7142000
mmap2(0xb722f000, 16424, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0xec000) = 0xb722f000
mmap2(0xb7234000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb7234000
munmap(0xb7791000, 4096)                = 0
close(3)                                = 0
open("/vendor/lib/libc.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/system/lib/libc.so", O_RDONLY|O_CLOEXEC) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=1150748, ...}) = 0
readlink("/proc/self/fd/3", "/system/lib/libc.so", 4096) = 19
pread64(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\0\0\0\0004\0\0\0"..., 52, 0) = 52
mmap2(NULL, 4096, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7791000
mmap2(NULL, 1044480, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7043000
mmap2(0xb7043000, 984964, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0) = 0xb7043000
mmap2(0xb7135000, 18376, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0xf1000) = 0xb7135000
mmap2(0xb713a000, 32768, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb713a000
munmap(0xb7791000, 4096)                = 0
close(3)                                = 0
open("/vendor/lib/libm.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/system/lib/libm.so", O_RDONLY|O_CLOEXEC) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=222724, ...}) = 0
readlink("/proc/self/fd/3", "/system/lib/libm.so", 4096) = 19
pread64(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\0\0\0\0004\0\0\0"..., 52, 0) = 52
mmap2(NULL, 4096, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7791000
mmap2(NULL, 229376, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb700b000
mmap2(0xb700b000, 216896, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0) = 0xb700b000
mmap2(0xb7041000, 4148, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x35000) = 0xb7041000
munmap(0xb7791000, 4096)                = 0
close(3)                                = 0
open("/vendor/lib/libbacktrace.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/system/lib/libbacktrace.so", O_RDONLY|O_CLOEXEC) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=75244, ...}) = 0
readlink("/proc/self/fd/3", "/system/lib/libbacktrace.so", 4096) = 27
pread64(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\0\0\0\0004\0\0\0"..., 52, 0) = 52
mmap2(NULL, 4096, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7791000
mmap2(NULL, 81920, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb6ff7000
mmap2(0xb6ff7000, 68956, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0) = 0xb6ff7000
mmap2(0xb7009000, 4100, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x11000) = 0xb7009000
munmap(0xb7791000, 4096)                = 0
close(3)                                = 0
open("/vendor/lib/libhardware.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/system/lib/libhardware.so", O_RDONLY|O_CLOEXEC) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=9608, ...}) = 0
readlink("/proc/self/fd/3", "/system/lib/libhardware.so", 4096) = 26
pread64(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\0\0\0\0004\0\0\0"..., 52, 0) = 52
mmap2(NULL, 4096, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7791000
mmap2(NULL, 16384, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb6ff3000
mmap2(0xb6ff3000, 3824, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0) = 0xb6ff3000
mmap2(0xb6ff5000, 4100, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x1000) = 0xb6ff5000
munmap(0xb7791000, 4096)                = 0
close(3)                                = 0
open("/vendor/lib/libsync.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/system/lib/libsync.so", O_RDONLY|O_CLOEXEC) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=5508, ...}) = 0
readlink("/proc/self/fd/3", "/system/lib/libsync.so", 4096) = 22
pread64(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\0\0\0\0004\0\0\0"..., 52, 0) = 52
mmap2(NULL, 4096, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7791000
mmap2(NULL, 12288, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb778e000
mmap2(0xb778e000, 3068, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0) = 0xb778e000
mmap2(0xb778f000, 4100, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0) = 0xb778f000
munmap(0xb7791000, 4096)                = 0
close(3)                                = 0
open("/vendor/lib/libbase.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/system/lib/libbase.so", O_RDONLY|O_CLOEXEC) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=46624, ...}) = 0
readlink("/proc/self/fd/3", "/system/lib/libbase.so", 4096) = 22
pread64(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\0\0\0\0004\0\0\0"..., 52, 0) = 52
mmap2(NULL, 4096, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7791000
mmap2(NULL, 53248, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb6fe6000
mmap2(0xb6fe6000, 43988, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0) = 0xb6fe6000
mmap2(0xb6ff1000, 4104, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0xa000) = 0xb6ff1000
munmap(0xb7791000, 4096)                = 0
close(3)                                = 0
open("/vendor/lib/libunwind.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/system/lib/libunwind.so", O_RDONLY|O_CLOEXEC) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=116244, ...}) = 0
readlink("/proc/self/fd/3", "/system/lib/libunwind.so", 4096) = 24
pread64(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\0\0\0\0004\0\0\0"..., 52, 0) = 52
mmap2(NULL, 4096, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7791000
mmap2(NULL, 184320, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb6fb9000
mmap2(0xb6fb9000, 110080, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0) = 0xb6fb9000
mmap2(0xb6fd5000, 4140, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x1b000) = 0xb6fd5000
mmap2(0xb6fd7000, 61440, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb6fd7000
munmap(0xb7791000, 4096)                = 0
close(3)                                = 0
open("/vendor/lib/liblzma.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/system/lib/liblzma.so", O_RDONLY|O_CLOEXEC) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=173504, ...}) = 0
readlink("/proc/self/fd/3", "/system/lib/liblzma.so", 4096) = 22
pread64(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\0\0\0\0004\0\0\0"..., 52, 0) = 52
mmap2(NULL, 4096, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7791000
mmap2(NULL, 204800, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb6f87000
mmap2(0xb6f87000, 169172, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0) = 0xb6f87000
mmap2(0xb6fb1000, 4116, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x29000) = 0xb6fb1000
mmap2(0xb6fb3000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb6fb3000
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, 0, 0) = 0xb6f86000
prctl(0x53564d41 /* PR_??? */, 0, 0xb6f86000, 0x1000, 0xb7370638) = 0
munmap(0xb7791000, 4096)                = 0
close(3)                                = 0
sysinfo({uptime=301, loads=[84512, 71296, 34400], totalram=2073436160, freeram=1528061952, sharedram=0, bufferram=44638208, totalswap=0, freeswap=0, procs=219, totalhigh=1242509312, freehigh=798248960, mem_unit=1}) = 0
mprotect(0xb734f000, 8192, PROT_READ)   = 0
mprotect(0xb7325000, 36864, PROT_READ)  = 0
mprotect(0xb72a8000, 4096, PROT_READ)   = 0
mprotect(0xb7288000, 4096, PROT_READ)   = 0
mprotect(0xb7263000, 4096, PROT_READ)   = 0
mprotect(0xb7252000, 4096, PROT_READ)   = 0
mprotect(0xb722f000, 16384, PROT_READ)  = 0
mprotect(0xb7135000, 12288, PROT_READ)  = 0
mprotect(0xb7041000, 4096, PROT_READ)   = 0
mprotect(0xb7009000, 4096, PROT_READ)   = 0
mprotect(0xb6ff5000, 4096, PROT_READ)   = 0
mprotect(0xb778f000, 4096, PROT_READ)   = 0
mprotect(0xb6ff1000, 4096, PROT_READ)   = 0
mprotect(0xb6fd5000, 4096, PROT_READ)   = 0
mprotect(0xb6fb1000, 4096, PROT_READ)   = 0
futex(0xb713c078, FUTEX_WAKE_PRIVATE, 2147483647) = 0
futex(0xb73547c0, FUTEX_WAKE_PRIVATE, 2147483647) = 0
mprotect(0xb6f86000, 4096, PROT_READ)   = 0
mprotect(0xb7792000, 4096, PROT_READ)   = 0
mprotect(0xb7793000, 4096, PROT_READ)   = 0
mprotect(0xb6f86000, 4096, PROT_READ|PROT_WRITE) = 0
mprotect(0xb7792000, 4096, PROT_READ|PROT_WRITE) = 0
mprotect(0xb7793000, 4096, PROT_READ|PROT_WRITE) = 0
open("/vendor/lib/libGLESv2.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/system/lib/libGLESv2.so", O_RDONLY|O_CLOEXEC) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=83276, ...}) = 0
readlink("/proc/self/fd/3", "/system/lib/libGLESv2.so", 4096) = 24
pread64(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\0\0\0\0004\0\0\0"..., 52, 0) = 52
mmap2(NULL, 4096, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7791000
mmap2(NULL, 90112, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb6f70000
mmap2(0xb6f70000, 79580, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0) = 0xb6f70000
mmap2(0xb6f84000, 4100, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x13000) = 0xb6f84000
munmap(0xb7791000, 4096)                = 0
close(3)                                = 0
mprotect(0xb6f84000, 4096, PROT_READ)   = 0
mprotect(0xb6f86000, 4096, PROT_READ)   = 0
mprotect(0xb7792000, 4096, PROT_READ)   = 0
mprotect(0xb7793000, 4096, PROT_READ)   = 0
socket(PF_LOCAL, SOCK_STREAM, 0)        = 3
connect(3, {sa_family=AF_LOCAL, sun_path="/dev/socket/property_service"}, 31) = -1 ENOENT (No such file or directory)
close(3)                                = 0
open("/system/build.prop", O_RDONLY)    = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=3190, ...}) = 0
close(3)                                = 0
socket(PF_LOCAL, SOCK_STREAM, 0)        = 3
connect(3, {sa_family=AF_LOCAL, sun_path="/dev/socket/property_service"}, 31) = -1 ENOENT (No such file or directory)
close(3)                                = 0
open("/system/build.prop", O_RDONLY)    = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=3190, ...}) = 0
close(3)                                = 0
socket(PF_LOCAL, SOCK_STREAM, 0)        = 3
connect(3, {sa_family=AF_LOCAL, sun_path="/dev/socket/property_service"}, 31) = -1 ENOENT (No such file or directory)
close(3)                                = 0
open("/system/build.prop", O_RDONLY)    = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=3190, ...}) = 0
close(3)                                = 0
socket(PF_LOCAL, SOCK_STREAM, 0)        = 3
connect(3, {sa_family=AF_LOCAL, sun_path="/dev/socket/property_service"}, 31) = -1 ENOENT (No such file or directory)
close(3)                                = 0
open("/system/build.prop", O_RDONLY)    = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=3190, ...}) = 0
close(3)                                = 0
access("/vendor/lib/egl/libGLES.so", R_OK) = -1 ENOENT (No such file or directory)
access("/system/lib/egl/libGLES.so", R_OK) = -1 ENOENT (No such file or directory)
open("/vendor/lib/egl", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC) = 3
fstat64(3, {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
getdents(3, /* 8 entries */, 32768)     = 284
getdents(3, /* 0 entries */, 32768)     = 0
close(3)                                = 0
open("/system/lib/egl", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC) = 3
fstat64(3, {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
getdents(3, /* 3 entries */, 32768)     = 52
getdents(3, /* 0 entries */, 32768)     = 0
close(3)                                = 0
socket(PF_LOCAL, SOCK_STREAM, 0)        = 3
connect(3, {sa_family=AF_LOCAL, sun_path="/dev/socket/property_service"}, 31) = -1 ENOENT (No such file or directory)
close(3)                                = 0
open("/system/build.prop", O_RDONLY)    = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=3190, ...}) = 0
close(3)                                = 0
socket(PF_LOCAL, SOCK_STREAM, 0)        = 3
connect(3, {sa_family=AF_LOCAL, sun_path="/dev/socket/property_service"}, 31) = -1 ENOENT (No such file or directory)
close(3)                                = 0
open("/system/build.prop", O_RDONLY)    = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=3190, ...}) = 0
close(3)                                = 0
access("/vendor/lib/egl/libEGL.so", R_OK) = -1 ENOENT (No such file or directory)
access("/system/lib/egl/libEGL.so", R_OK) = -1 ENOENT (No such file or directory)
open("/vendor/lib/egl", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC) = 3
fstat64(3, {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
getdents(3, /* 8 entries */, 32768)     = 284
close(3)                                = 0
mprotect(0xb6f86000, 4096, PROT_READ|PROT_WRITE) = 0
mprotect(0xb7792000, 4096, PROT_READ|PROT_WRITE) = 0
mprotect(0xb7793000, 4096, PROT_READ|PROT_WRITE) = 0
open("/vendor/lib/egl/libEGL_POWERVR_ROGUE.so", O_RDONLY|O_CLOEXEC) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=13444, ...}) = 0
readlink("/proc/self/fd/3", "/system/vendor/lib/egl/libEGL_PO"..., 4096) = 46
pread64(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\0\0\0\0004\0\0\0"..., 52, 0) = 52
mmap2(NULL, 4096, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7791000
mmap2(NULL, 20480, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb6f6b000
mmap2(0xb6f6b000, 8120, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0) = 0xb6f6b000
mmap2(0xb6f6e000, 4100, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x2000) = 0xb6f6e000
write(2, "WARNING: linker /system/vendor/l"..., 100WARNING: linker /system/vendor/lib/egl/libEGL_POWERVR_ROGUE.so: unused DT entry: type 0x1d arg 0x559) = 100
write(2, "\n", 1
)                       = 1
munmap(0xb7791000, 4096)                = 0
close(3)                                = 0
open("/vendor/lib/libIMGegl.so", O_RDONLY|O_CLOEXEC) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=136428, ...}) = 0
readlink("/proc/self/fd/3", "/system/vendor/lib/libIMGegl.so", 4096) = 31
pread64(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\0\0\0\0004\0\0\0"..., 52, 0) = 52
mmap2(NULL, 4096, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7791000
mmap2(NULL, 143360, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb6f48000
mmap2(0xb6f48000, 130868, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0) = 0xb6f48000
mmap2(0xb6f69000, 4114, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x20000) = 0xb6f69000
write(2, "WARNING: linker /system/vendor/l"..., 85WARNING: linker /system/vendor/lib/libIMGegl.so: unused DT entry: type 0x1d arg 0x7cc) = 85
write(2, "\n", 1
)                       = 1
munmap(0xb7791000, 4096)                = 0
close(3)                                = 0
open("/vendor/lib/libsrv_um.so", O_RDONLY|O_CLOEXEC) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=324872, ...}) = 0
readlink("/proc/self/fd/3", "/system/vendor/lib/libsrv_um.so", 4096) = 31
pread64(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\0\0\0\0004\0\0\0"..., 52, 0) = 52
mmap2(NULL, 4096, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7791000
mmap2(NULL, 331776, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb6ef7000
mmap2(0xb6ef7000, 318228, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0) = 0xb6ef7000
mmap2(0xb6f45000, 8230, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x4d000) = 0xb6f45000
write(2, "WARNING: linker /system/vendor/l"..., 85WARNING: linker /system/vendor/lib/libsrv_um.so: unused DT entry: type 0x1d arg 0xbcc) = 85
write(2, "\n", 1
)                       = 1
munmap(0xb7791000, 4096)                = 0
close(3)                                = 0
open("/vendor/lib/libdrm.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/system/lib/libdrm.so", O_RDONLY|O_CLOEXEC) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=71144, ...}) = 0
readlink("/proc/self/fd/3", "/system/lib/libdrm.so", 4096) = 21
pread64(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\0\0\0\0004\0\0\0"..., 52, 0) = 52
mmap2(NULL, 4096, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7791000
mmap2(NULL, 77824, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb6ee4000
mmap2(0xb6ee4000, 65940, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0) = 0xb6ee4000
mmap2(0xb6ef5000, 4100, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x10000) = 0xb6ef5000
munmap(0xb7791000, 4096)                = 0
close(3)                                = 0
mprotect(0xb6f6e000, 4096, PROT_READ)   = 0
mprotect(0xb6f69000, 4096, PROT_READ)   = 0
mprotect(0xb6f45000, 8192, PROT_READ)   = 0
mprotect(0xb6ef5000, 4096, PROT_READ)   = 0
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0} ---
+++ killed by SIGSEGV +++
Segmentation fault

Seems to be a bug in libhybris.

pthread counter

the pthread counter implementation has one problem, there are a lot of functions which are called *android*pthread* which should be relatively safe to leave unhooked and there are internal functions in the blobs which also have pthread in their name, like osal_cs_init(pthread_mutex_t*) or _Z12osal_cs_initP15pthread_mutex_t when mangled.

which solution should be picked or is there an even better one?

here is an example of a crash due to such a function:

...
calling hooked method: pthread_mutex_lock@0xf7318561
HOOKS hooks.c:1841 (get_hooked_symbol) DEBUG: _Z15osal_cs_destroyP15pthread_mutex_t -5

HOOKS hooks.c:1841 (get_hooked_symbol) DEBUG: _Z13osal_cs_enterP15pthread_mutex_t -6

HOOKS hooks.c:1841 (get_hooked_symbol) DEBUG: _Z13osal_cs_leaveP15pthread_mutex_t -7

HOOKS hooks.c:1841 (get_hooked_symbol) DEBUG: _Z12osal_cs_initP15pthread_mutex_t -8

calling unhooked method: __aeabi_atexit@0xf6f56a35
calling hooked method: __cxa_atexit@0xf73b3375
calling unhooked method: _ZN4llvm3sys9MutexImplC2Eb@0xf4a2597b
calling unhooked method: __aeabi_atexit@0xf6f56a35
calling hooked method: __cxa_atexit@0xf73b3375
calling unhooked method: __aeabi_atexit@0xf6f56a35
calling hooked method: __cxa_atexit@0xf73b3375
calling unhooked method: _ZN4llvm3sys9MutexImplC2Eb@0xf4a2597b
calling unhooked method: __aeabi_atexit@0xf6f56a35
calling hooked method: __cxa_atexit@0xf73b3375
calling unhooked method: __aeabi_atexit@0xf6f56a35
calling hooked method: __cxa_atexit@0xf73b3375
calling unhooked method: __aeabi_atexit@0xf6f56a35
calling hooked method: __cxa_atexit@0xf73b3375
calling unhooked method: _ZN4llvm3sys9TimeValue9normalizeEv@0xf4a2ce59
calling unhooked method: _ZN4llvm3sys9TimeValue9normalizeEv@0xf4a2ce59
calling unhooked method: _ZN4llvm3sys9TimeValue9normalizeEv@0xf4a2ce59
calling unhooked method: _ZN4llvm3sys9TimeValue9normalizeEv@0xf4a2ce59
calling unhooked method: _ZN4llvm3sys9TimeValue9normalizeEv@0xf4a2ce59
calling unhooked method: _ZN4llvm12cl_exc_stateC1Ev@0xf4a2d12b
calling hooked method: _Z12osal_cs_initP15pthread_mutex_t@0xfffffff8
Segmentation fault

Will hybris_alloc_init_mutex cause memory leak?

In my_pthread_mutex_lock:
if (value <= ANDROID_TOP_ADDR_VALUE_MUTEX) {
realmutex = hybris_alloc_init_mutex(value);
...
}

But the malloced memory is not freed when unlock,
will this cause memory leak?

hwcomposer bug?

It seems newer versions of msm hwcomposer have a bug: https://android.googlesource.com/platform/hardware/qcom/display/+/60d8ef4548bfafa3795ac71fdedac7e5173f843e/msm8996/sdm/libs/core/fb/hw_device.cpp#453

This sync_handle is never referenced anywhere else in the code and it is never closed either.

In android they "solve" this by weird commits increasing the amount of allowed open fds it seems.
In surfaceflinger this will probably eventually cause tearing once enough fds have been leaked, because failed dup()'s are not checked for their return values. In lipstick it is more severe since we abort() as soon as we cannot open any files anymore.
Can somebody confirm that this is a bug in hwc?

I propose the following workaround for now/existing blobs until this is fixed upstream:

diff --git a/libhybris/hybris/common/hooks.c b/libhybris/hybris/common/hooks.c
index a1b8c1a..5b8c8de 100644
--- a/libhybris/hybris/common/hooks.c
+++ b/libhybris/hybris/common/hooks.c
@@ -2494,7 +2494,31 @@ static int _hybris_hook_my_printf(const char *tmp, ...)
     return fprintf(stderr, "%d:%s", syscall(__NR_gettid), buff);
 }
 
+static __thread int stored_fd = -1;
+
+static void debug_hwc_info(void *s, int debug_tag, const char *format, ...)
+{
+    va_list args;
+    va_start(args, format);
+    if(strstr(format, "Commit Input") != NULL)
+    {
+        // this means hwcomposer is leaving the function Commit soon. the last fd that was dupped is leaked (and never used) so close it.
+        close(stored_fd);
+    }
+    va_end(args);
+}
+
+int _hybris_hook_dup(int fd)
+{
+    stored_fd = dup(fd);
+    return stored_fd;
+}
+
 static struct _hook hooks_common[] = {
+    /* funky hwcomposer workaround */
+    HOOK_TO(_ZN3sdm15HWCDebugHandler4InfoENS_8DebugTagEPKcz, debug_hwc_info),
+    HOOK_INDIRECT(dup),
+
 #ifdef WANT_INITIALIZE_BIONIC
     HOOK_TO(glibc_malloc, malloc),
     HOOK_INDIRECT(my_printf),

PLATFORM_VERSION optimization

extract-headers.sh extracts PLATFORM_VERSION parameter from Android's version_defaults.mk. So libhybris uses costructions like #if (ANDROID_VERSION_MAJOR == 4 && ANDROID_VERSION_MINOR >= 1) || (ANDROID_VERSION_MAJOR >= 5) to use correct constructions right to current android source. But it can be optimized to #if ANDROID_VERSION > 17 if script would extract PLATFORM_SDK_VERSION instead of PLATFORM_VERSION.

Bionic patch for lollipop ( 5.0.0 )?

Is it just me or is there no Bionic patch for lollipop?

Also, would this kernel boot up Android after patching Bionic? or do we just need to compile it to get the system directory?

My goal is to access the PowerVR Rogue gpu drivers in the Asus Zenfone 2 from an Arch x86_64 chroot.

compiling libhybris error with arch=x86

Hello,

I want to run libhybris on my x86 device. However after I ran "./autogen.sh --prefix=$HOME/hybris_rootfs --with-android-headers=$ANDROID_HEADERS --enable-arch=x86 --enable-wayland" and "make", I got the following error:
dlfcn.c:203:7: error: initializer element is not constant
st_value: (Elf32_Addr) &android_dlopen,
^
It seems the C99 spec doesn't allow initializing a global varible with a non constant value.

I'm confused as it seems I'm the only person who met such problem. I can't find the solution anywhere through the internet. Or maybe this issue is too simple to be an issue. But with my limited compiler knowledge, I can't figure out the way to walk around it.

Please Help!!! @stskeeps

Segmentation fault when printing a float

EDIT: This issue seems to be present in a bunch of tests. This issue was written only with test_input in mind! (I was debugging that one and found the issue)

Printing a float, like printf("float: %f\n", 1.0); in the function on_new_event results in a Segmentation fault. Doing the same in the main function, everything works as expected.

Showcase: z3ntu@ea24333
Output of that:

root@localhost:~/libhybris/hybris/tests# ./test_input 
This will work:
float: 1.000000
<note: pressed the touchscreen there>
This won't work:
Segmentation fault

gdb backtrace - mirror of the paste is here

This problem causes the test_input test to crash: https://github.com/libhybris/libhybris/blob/master/hybris/tests/test_input.c#L51-L54 .

Casting the two variables into an integer and printing them works around the issue. Sample patch: z3ntu@5773400

typo in hybris hook function table

  • {"pthread_mutexattr_getttype", pthread_mutexattr_gettype},
  • {"pthread_mutexattr_gettype", pthread_mutexattr_gettype},
  • {"pthread_attr_setscope", my_pthread_attr_getscope},
  • {"pthread_attr_getscope", my_pthread_attr_getscope},

@zm112211mz

libhybris glESv2 crash when using c++11 futures

It seems that waiting for c++11 futures mangles the egl/gl context,

glFlush(); //<--this is fine no crashes
a_future.wait();
glFlush(); //<--- crashes inside libhybris - it seems a null function pointer was called

Code which shows the issue, compiled as:
g++ -std=c++11 futures-egl-issue.cpp -o futures-egl-issue -rdynamic -lEGL -lGLESv2

#include <EGL/egl.h>
#include <GLES2/gl2.h>

#include <stdexcept>
#include <iostream>
#include <future>
int main()
{
    EGLDisplay egl_display = eglGetDisplay(EGL_DEFAULT_DISPLAY);
    if (egl_display == EGL_NO_DISPLAY)
        throw std::runtime_error("Failed to get EGL display");

    if (eglInitialize(egl_display, NULL, NULL) != EGL_TRUE)
        throw std::runtime_error("Failed to initialize egl");

    EGLint const attribs[] = {
        EGL_SURFACE_TYPE, EGL_PBUFFER_BIT,
        EGL_RED_SIZE, 8,
        EGL_GREEN_SIZE, 8,
        EGL_BLUE_SIZE, 8,
        EGL_ALPHA_SIZE, 8,
        EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
        EGL_NONE
    };
    int n_configs = 0;
    EGLConfig egl_config;

    if (eglChooseConfig(egl_display, attribs, &egl_config, 1, &n_configs) != EGL_TRUE)
        throw std::runtime_error("Failed to obtain egl config");
    if (n_configs == 0)
        throw std::runtime_error("no egl configs available");

    EGLint const surf_attribs[] = {
        EGL_WIDTH, 256,
        EGL_HEIGHT, 256,
        EGL_LARGEST_PBUFFER, EGL_TRUE,
        EGL_TEXTURE_FORMAT, EGL_TEXTURE_RGBA,
        EGL_TEXTURE_TARGET, EGL_TEXTURE_2D,
        EGL_NONE
    };
    EGLSurface egl_surface = eglCreatePbufferSurface(egl_display, egl_config, surf_attribs);
    if (egl_surface == EGL_NO_SURFACE)
        throw std::runtime_error("Failed creating egl surface");

    EGLint const ctx_attribs[] = {
        EGL_CONTEXT_CLIENT_VERSION, 2,
        EGL_NONE
    };
    EGLContext egl_ctx = eglCreateContext(egl_display, egl_config, EGL_NO_CONTEXT, ctx_attribs);
    if (egl_ctx == EGL_NO_CONTEXT)
         throw std::runtime_error("Failed creating egl context");

    if (eglMakeCurrent(egl_display, egl_surface, egl_surface, egl_ctx) != EGL_TRUE)
         throw std::runtime_error("Failed making egl context current");

    std::future<void> a_future = std::async(std::launch::deferred, []{});

    glFlush();
    std::cout << "Just called glFlush.." << std::endl;

    a_future.wait();
    std::cout << "After waiting for future...calling glFlush" << std::endl;
    glFlush();

    std::cout << "The end!" << std::endl;
    return 0;
}

Having problems with LibHybris on Nexus 7 2013

Hello,
I'm trying to run LibHybris on my Nexus 7 2013, running Arch Linux, in order to get hardware acceleration and maybe get wayland running. (https://github.com/crondog/arch-flo)

I followed the steps I've seen around the web in order to build it.
In particular I followed this guide: http://linux-rockchip.info/mw/index.php?title=LibHybris
and I used these PKGBUILD to install everything as a package: http://archlinuxarm.org/forum/viewtopic.php?f=33&t=5951

I built Android (I'm using the CyanogenMod source), patched bionic, rebuilt it, extracted /system and the headers, pushed them and installed them to the tablet, then built libhybris. (you can find my /system and headers here: http://download.tuxfamily.org/davidedduos/arch-flo/ )

LibHybris builds, but whenever I try to run almost any of the tests (gps and lights seem to work/not to crash) they either segfault or simply crash. This is their output: https://gist.github.com/Davideddu/779420a5a7393929df05

What can I do to troubleshoot this?

P.S.: I'm using CM nightly, which is 4.4.4 KitKat. The bionic patch applied without complaining, so I guessed it was ok. I'm asking because I saw the version of android you normally use is 4.2.2, which is not available on the Nexus 7 2013 as it started being sold after 4.3 was released.

my_pthread_mutex_lock race condition issue

#1 static int my_pthread_mutex_lock(pthread_mutex_t *__mutex)
#2{

 ……

#3 if (value <= ANDROID_TOP_ADDR_VALUE_MUTEX) {
#4 realmutex = hybris_alloc_init_mutex(value);
#5 *((unsigned int *)__mutex) = (unsigned int) realmutex;
#6 }
#7 return pthread_mutex_lock(realmutex);
#8}

consider the following scenario, two threads try to call pthread_mutex_lock at the same time, as the order shown below:

Thread A: finish Line#4; [allocate realmutex for mutex(value)]
Thread B: begin to execute, finish Line#4; [allocate another realmutex for same mutex(value)]

then there is two realmutex for one single mutex(value),
thus, A & B will lock on different realmutex

the above scenario is not easy to be exposed. I added on sleep(1) between Line4 & Line5, and write one simple test(two threads call pthread_mutex_lock), to trigger this scenario.
#4 realmutex = hybris_alloc_init_mutex(value);

      sleep(1);

#5 *((unsigned int *)__mutex) = (unsigned int) realmutex;

possible solution, use one lock or use RMW instruction when updating *(__mutex), if update failure, another thread must have alloc realmutex, this thread free the realmutex and reload __mutex;

Coverity issues

** CID 1171468: Infinite loop (INFINITE_LOOP)
/tests/test_nfc.c: 183 in testNfc()
/tests/test_nfc.c: 320 in testNfc()

** CID 1171469: Resource leak (RESOURCE_LEAK)
/egl/platforms/hwcomposer/hwcomposer_window.cpp: 455 in HWComposerNativeWindow::setBufferCount(int)()

** CID 1171470: Uninitialized scalar variable (UNINIT)
/common/hooks.c: 1377 in hook_find()

** CID 1171471: Uninitialized pointer field (UNINIT_CTOR)
/egl/platforms/hwcomposer/hwcomposer_window.cpp: 80 in HWComposerNativeWindow::HWComposerNativeWindow(unsigned int, unsigned int, unsigned int)()


*** CID 1171468: Infinite loop (INFINITE_LOOP)
/tests/test_nfc.c: 183 in testNfc()
177 printf("Initializing NFC stack.\n");
178 NFCSTATUS callbackStatus = 0xFFFF;
179 status = phLibNfc_Mgt_Initialize(hwRef, initializeCallback, &callbackStatus);
180 assert(status == NFCSTATUS_PENDING);
181
182 pthread_mutex_lock(&mut);

CID 1171468:  Infinite loop  (INFINITE_LOOP)
If "callbackStatus == 65535" is initially true then it will remain true.

183 while (callbackStatus == 0xFFFF)
184 pthread_cond_wait(&cond, &mut);
185 pthread_mutex_unlock(&mut);
186
187 assert(callbackStatus == NFCSTATUS_SUCCESS);
188
/tests/test_nfc.c: 320 in testNfc()
314 printf("Deinitializing NFC stack.\n");
315 callbackStatus = 0xFFFF;
316 status = phLibNfc_Mgt_DeInitialize(hwRef, initializeCallback, &callbackStatus);
317 assert(status == NFCSTATUS_PENDING);
318
319 pthread_mutex_lock(&mut);
CID 1171468: Infinite loop (INFINITE_LOOP)
If "callbackStatus == 65535" is initially true then it will remain true.
320 while (callbackStatus == 0xFFFF)
321 pthread_cond_wait(&cond, &mut);
322 pthread_mutex_unlock(&mut);
323
324 assert(callbackStatus == NFCSTATUS_SUCCESS);
325


*** CID 1171469: Resource leak (RESOURCE_LEAK)
/egl/platforms/hwcomposer/hwcomposer_window.cpp: 455 in HWComposerNativeWindow::setBufferCount(int)()
449 strerror(-fbnb->status), fbnb->handle, fbnb->stride);
450
451 if (fbnb->status)
452 {
453 fbnb->common.decRef(&fbnb->common);
454 fprintf(stderr,"WARNING: %s: allocated only %d buffers out of %d\n", PRETTY_FUNCTION, m_freeBufs, cnt);

CID 1171469:  Resource leak  (RESOURCE_LEAK)
Variable "fbnb" going out of scope leaks the storage it points to.

455 break;
456 }
457
458 m_freeBufs++;
459 m_bufList.push_back(fbnb);
460 }


*** CID 1171470: Uninitialized scalar variable (UNINIT)
/common/hooks.c: 1377 in hook_find()
1371 }
1372
1373 void* hook_find(const char *func_name)
1374 {
1375 ENTRY e, *ep=NULL;
1376 e.key = func_name;

CID 1171470:  Uninitialized scalar variable  (UNINIT)
Using uninitialized value "e": field "e"."data" is uninitialized when calling "hsearch_r(ENTRY, ACTION, ENTRY **, struct hsearch_data *)".

1377 int rv = hsearch_r(e, FIND, &ep, htab);
1378 if (!rv) {
1379 return NULL;
1380 }
1381
1382 LOGD("FOUND:%s",func_name,ep->data);


*** CID 1171471: Uninitialized pointer field (UNINIT_CTOR)
/egl/platforms/hwcomposer/hwcomposer_window.cpp: 80 in HWComposerNativeWindow::HWComposerNativeWindow(unsigned int, unsigned int, unsigned int)()
74 m_alloc = NULL;
75 m_width = width;
76 m_height = height;
77 m_bufFormat = format;
78 m_usage = GRALLOC_USAGE_HW_COMPOSER|GRALLOC_USAGE_HW_FB;
79 m_frontBuf = NULL;

CID 1171471:  Uninitialized pointer field  (UNINIT_CTOR)
Non-static class member "m_freeBufs" is not initialized in this constructor nor in any functions that it calls.

80 }
81
82 void HWComposerNativeWindow::setup(gralloc_module_t* gralloc, alloc_device_t* alloc)
83 {
84 m_alloc = alloc;
85 setBufferCount(2);

Vendor libEGL and libGLESv2 symbols unresolved without env var

This issue tracks the only problem left from #368.

Some time ago, when Libhybris failed to locate symbols from vendor graphics libraries on my device, I set LIBGLESV2 and LIBEGL to point to them. The solution with env vars definition worked nicely for a while, but now it turns out it is still wrong. As I understand now, libEGL and libGLESv2 act as loaders and wrappers for proprietary libs, so they should be able to locate and load them automatically. And they actually do, so this has to be a Libhybris problem.

The problem is that some symbols (e.g. eglCreateImageKHR) are actually implemented in wrappers. So if I have both variables set, I get KWin crashing if Qt Quick hardware acceleration is enabled:

_my_eglCreateImageKHR (dpy=0x1, ctx=0x0, target=12757, buffer=0x804d5c10, attrib_list=0xbfffdc70) at egl.c:376

Before d5183fe, I could see that symbol missing in linker output.

eglCreateImageKHR is implemented in open source libEGL. If I unset LIBEGL variable, the symbol is found, and I get glEGLImageTargetTexture2DOES missing (implemented in open source libGLESv2).

Unsetting LIBGLESv2, however, would bring me back where I started with most of GL ES symbols undefined.

So, as I see it, Libhybris should look up symbols in both wrappers and vendor libraries...

Would it be ok to split some things?

As per: mer-hybris/droid-hal-device#185 (comment)

Would it be ok to split libhybris/compat off into a seperate libhybris-compat (or even hybris-compat) repository?
Only if it doesn't introduce any big problems. (Changing a manifest.xml to a different URL doesn't count as big :P).

On mer side there are usually no dependencies from hybris-hal to libhybris, which complicates things. A split would help, and would fit better in my opinion since: "repositories which are required to be built with both Android.mk and Makefile.am are kind of weird ;)".

There is a workaround so if someone is absolutely against this, please let me know.

Libhybris on NEXUS 10 with FB backend

Hi. Recently i have experimented with libhybris on Nexus 10 android 4.4.2. I was targeted on launching Weston. I found this kind of support for libhybris in weston related to FB backend. After some struggling with HAL fb on modern platform, i successfully launched weston but get only a black screen. It turned out, that WaylandNativeWindow constructor setBufferCount to 3, and there are three distinct buffers app renders to. Finish swap callback for wayland window had sent the one of this graphical buffers to compositor, but it seems that it was empty (zero data), so the app texture was stored in other buffer. As a workaround i added logic to send all of buffers from WaylandNativeWindowBuffer queue in finish swap callback and that worked for me ok. Actually, i don't even know if this is an issue or a problem in my head. So if anybody understand what i'am talking about and see some kind of problem in this, please let me know.

Incorrect TLS slot values

Hello! :)

I am porting Halium to an x86 phone and facing many issues related to architecture support. One of them is in libhybris: the library uses custom TLS slot values that do not work with x86.

https://github.com/libhybris/libhybris/blob/master/hybris/common/mm/bionic/libc/private/bionic_tls.h

So far me and all the other x86 port developers have been using their own values, but now I'm facing weird issues and think these constants may be the problem. What are these slots, what are they supposed to affect, why do they need to be changed for libhybris and how do I need to change them to be correct?

test_egl fails if libhybris is not compiled with wayland support

From test_egl.c:

	if (strstr(eglQueryString(display, EGL_EXTENSIONS), "EGL_HYBRIS_native_buffer") != NULL)
{

From eglplatformcommon.cpp:

extern "C" const char *eglplatformcommon_eglQueryString(EGLDisplay dpy, EGLint name, const char *(*real_eglQueryString)(EGLDisplay dpy, EGLint name))
{
#ifdef WANT_WAYLAND
	if (name == EGL_EXTENSIONS)
	{
		const char *ret = (*real_eglQueryString)(dpy, name);
		static char eglextensionsbuf[1024];
		snprintf(eglextensionsbuf, 1022, "%sEGL_HYBRIS_native_buffer2 EGL_HYBRIS_WL_acquire_native_buffer %s", ret ? ret : "",
#ifdef WANT_WAYLAND
			"EGL_WL_bind_wayland_display "
#else
			""
#endif

Obviously the #ifdef will allow the native buffer capability only to be patched with the EGL_HYBRIS_native_buffer2 string if WANT_WAYLAND is set. This prevents the test_egl code to execute properly.

Behaviour of WaylandNativeWindowBuffer on pmem based android device

Im just documenting the issue here incase anyone has ideas about it. This is the the best of my current knowledge, but far from complete.

What I believe the issue to be is:
1)Kernel boots up and allocates ~32MB of graphics memory using PMEM
2)Qt/SFOS loas and requests a window buffer of size width*height etc
3)PMEM receives a request for a buffer of size 32MB and allocates it ok
4)User loads a program and another request is made for a window buffer
5)PMEM fails the allocation as there is no more memory.

I have worked around this in the HTC ACE kernel by:
1)When the first successful allocation is made, remember the address
2)When a subsequent request fails, return the address of the original request

Obviously this results in apps overwriting the buffers of other apps, and has the negative result in that on SFOS, cover windows get corrupted, and the on-screen-keyboard cannot be displayed at the same time as another window (which is really quite annoying.

I have tried changing the amount of memory allocated at boot, but no matter what it is changed to, the request is always for the full amount.

I have tried forcing the size inside PMEM to width_height_depth, but it fails later when the size is different to the size of the MMAP.

Does anyone have any better ideas?

I wondered if inside libhybris, I could allocate the graphics memory at the start, then manually allocate areas to different buffers, but it doesnt sound like a great idea!

Server-side wayland buffers fail on some devices

Recently it was noticed that server-side wayland buffers do not work on devices which use QCOM_BSP. This makes using applications impossible, however disabling server-side wayland buffers can be used as a workaround which makes everything working again. So far 3 devices have shown a similar problem and using QCOM_BSP seems to be connecting the devices. On my device (iyokan, Xperia Pro) journal log shows "failed to register buffer" errors and logcat shows:

E/qdmemalloc( 4234): ION_IOC_ALLOC failed with error - Operation not permitted
E/qdgralloc( 4234): gralloc failed err=Operation not permitted
D/qdgralloc( 4310): Invalid gralloc handle (at 0x4e3e8580): ver(12/12) ints(16/12) fds(0/2) magic(@���/gmsm)
W/Adreno-EGLSUB( 4310): SyncBackBuffer:3112: invalid memory type for fd=1077311239 offs=17, flags=ffffffff
W/Adreno-ES20( 4310): <gl2_surface_swap:43>: GL_OUT_OF_MEMORY
W/Adreno-EGL( 4310): <qeglDrvAPI_eglSwapBuffers:3665>: EGL_BAD_ALLOC
I'm investigating if the server-side buffers can be fixed on devices with QCOM_BSP.

linker issue: RTLD_DEFAULT & RTLD_NEXT has different value between bionic and glibc.

RTLD_DEFAULT & RTLD_NEXT has different value between bionic and glibc.

bionic

define RTLD_DEFAULT ((void*) 0xffffffff)

define RTLD_NEXT ((void*) 0xfffffffe)

glibc

define RTLD_NEXT ((void *) -1l)

define RTLD_DEFAULT ((void *) 0)

Hybris linker includes glibc headfile and thus use the RTLD_DEFAULT, RTLD_NEXT from glib;
this leads to difference when bionic built code call dlopen with RTLD_DEFAULT/RTLD_NEXT

the possible fix is to use the definition from bionic

Failed to compile libhybris against android headers of API level 15

Configured with ./hybris/autogen.sh --prefix=/usr --with-default-egl-platform=hwcomposer --enable-debug --enable-trace --with-default-hybris-ld-library-path=/system/lib:/vendor/lib --with-android-headers=/home/vicamo/work/android/aosp/platform/headers/android-15.

Error messages:

make[2]: Entering directory '/home/vicamo/work/canonical/ubuntu-phone/packages/libhybris/git/libhybris/libnfc_nxp'
  CC       libnfc_nxp_la-libnfc_nxp.lo
In file included from .././hybris/libnfc_nxp/libnfc_nxp.c:57:0:
.././hybris/libnfc_nxp/libnfc_nxp.c:141:50: error: conflicting types for 'phLibNfc_Llcp_Bind'
 HYBRIS_IMPLEMENT_FUNCTION3(libnfc_so, NFCSTATUS, phLibNfc_Llcp_Bind, phLibNfc_Handle, uint8_t, phNfc_sData_t *);
                                                  ^
.././hybris/include/hybris/common/binding.h:98:17: note: in definition of macro 'HYBRIS_IMPLEMENT_FUNCTION3'
     return_type symbol(a1 n1, a2 n2, a3 n3) \
                 ^
In file included from .././hybris/libnfc_nxp/libnfc_nxp.c:28:0:
/home/vicamo/work/android/aosp/platform/headers/android-15/libnfc-nxp/phLibNfc.h:2703:18: note: previous declaration of 'phLibNfc_Llcp_Bind' was here
 extern NFCSTATUS phLibNfc_Llcp_Bind( phLibNfc_Handle hSocket,
                  ^
In file included from .././hybris/libnfc_nxp/libnfc_nxp.c:57:0:
.././hybris/libnfc_nxp/libnfc_nxp.c:142:50: error: conflicting types for 'phFriNfc_LlcpTransport_Bind'
 HYBRIS_IMPLEMENT_FUNCTION3(libnfc_so, NFCSTATUS, phFriNfc_LlcpTransport_Bind, phFriNfc_LlcpTransport_Socket_t *, uint8_t, phNfc_sData_t *);
                                                  ^
.././hybris/include/hybris/common/binding.h:98:17: note: in definition of macro 'HYBRIS_IMPLEMENT_FUNCTION3'
     return_type symbol(a1 n1, a2 n2, a3 n3) \
                 ^
In file included from /home/vicamo/work/android/aosp/platform/headers/android-15/libnfc-nxp/phLibNfc_Internal.h:41:0,
                 from .././hybris/libnfc_nxp/libnfc_nxp.c:31:
/home/vicamo/work/android/aosp/platform/headers/android-15/libnfc-nxp/phFriNfc_LlcpTransport.h:401:11: note: previous declaration of 'phFriNfc_LlcpTransport_Bind' was here
 NFCSTATUS phFriNfc_LlcpTransport_Bind(phFriNfc_LlcpTransport_Socket_t    *pLlcpSocket,
           ^
In file included from .././hybris/libnfc_nxp/libnfc_nxp.c:57:0:
.././hybris/libnfc_nxp/libnfc_nxp.c:143:50: error: conflicting types for 'phLibNfc_Llcp_Listen'
 HYBRIS_IMPLEMENT_FUNCTION3(libnfc_so, NFCSTATUS, phLibNfc_Llcp_Listen, phLibNfc_Handle, pphLibNfc_LlcpSocketListenCb_t, void *);
                                                  ^
.././hybris/include/hybris/common/binding.h:98:17: note: in definition of macro 'HYBRIS_IMPLEMENT_FUNCTION3'
     return_type symbol(a1 n1, a2 n2, a3 n3) \
                 ^
In file included from .././hybris/libnfc_nxp/libnfc_nxp.c:28:0:
/home/vicamo/work/android/aosp/platform/headers/android-15/libnfc-nxp/phLibNfc.h:2737:18: note: previous declaration of 'phLibNfc_Llcp_Listen' was here
 extern NFCSTATUS phLibNfc_Llcp_Listen( phLibNfc_Handle                  hSocket,
                  ^
In file included from .././hybris/libnfc_nxp/libnfc_nxp.c:57:0:
.././hybris/libnfc_nxp/libnfc_nxp.c:144:50: error: conflicting types for 'phFriNfc_LlcpTransport_Listen'
 HYBRIS_IMPLEMENT_FUNCTION3(libnfc_so, NFCSTATUS, phFriNfc_LlcpTransport_Listen, phFriNfc_LlcpTransport_Socket_t *, pphFriNfc_LlcpTransportSocketListenCb_t, void *);
                                                  ^
.././hybris/include/hybris/common/binding.h:98:17: note: in definition of macro 'HYBRIS_IMPLEMENT_FUNCTION3'
     return_type symbol(a1 n1, a2 n2, a3 n3) \
                 ^
In file included from /home/vicamo/work/android/aosp/platform/headers/android-15/libnfc-nxp/phLibNfc_Internal.h:41:0,
                 from .././hybris/libnfc_nxp/libnfc_nxp.c:31:
/home/vicamo/work/android/aosp/platform/headers/android-15/libnfc-nxp/phFriNfc_LlcpTransport.h:429:11: note: previous declaration of 'phFriNfc_LlcpTransport_Listen' was here
 NFCSTATUS phFriNfc_LlcpTransport_Listen(phFriNfc_LlcpTransport_Socket_t*          pLlcpSocket,
           ^
In file included from .././hybris/libnfc_nxp/libnfc_nxp.c:57:0:
.././hybris/libnfc_nxp/libnfc_nxp.c:187:50: error: conflicting types for 'phLibNfc_ConvertToReadOnlyNdef'
 HYBRIS_IMPLEMENT_FUNCTION4(libnfc_so, NFCSTATUS, phLibNfc_ConvertToReadOnlyNdef, phLibNfc_Handle, phNfc_sData_t *, pphLibNfc_RspCb_t, void *);
                                                  ^
.././hybris/include/hybris/common/binding.h:107:17: note: in definition of macro 'HYBRIS_IMPLEMENT_FUNCTION4'
     return_type symbol(a1 n1, a2 n2, a3 n3, a4 n4) \
                 ^
In file included from .././hybris/libnfc_nxp/libnfc_nxp.c:28:0:
/home/vicamo/work/android/aosp/platform/headers/android-15/libnfc-nxp/phLibNfc.h:2040:11: note: previous declaration of 'phLibNfc_ConvertToReadOnlyNdef' was here
 NFCSTATUS phLibNfc_ConvertToReadOnlyNdef (phLibNfc_Handle       hRemoteDevice,
           ^
Makefile:453: recipe for target 'libnfc_nxp_la-libnfc_nxp.lo' failed
make[2]: *** [libnfc_nxp_la-libnfc_nxp.lo] Error 1

cannot locate '__srget'

Hi !

I've been trying to use libhybris to call to a native arm android library from a linux box.
But the android_dlopen("mylib.so", RTLD_LAZY) call fails with the following error :

Cannot load library: reloc_library[1353]: 0 cannot locate '__srget'...

Basically, I compiled libhybris with android headers 22, created a c program that loads my library and put libc.so, liblog.so, libstdc++.so and libm.so under /system/lib/.

I'm not sure of anything, is this right ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.