Skip to content

Commit

Permalink
cherry: camera: Force the server to use old C++ runtime
Browse files Browse the repository at this point in the history
There's some (there's a lot, actually, run valgrind and try not to cry)
undefined behaviour in our camera blobs that, when combined with the
6.0 era STL, makes them crash when stopping the preview:

pid: 251, tid: 2570, name: mm-qcamera-daem  >>> /system/bin/mm-qcamera-daemon <<<
signal 8 (SIGFPE), code -6 (SI_TKILL), fault addr 0xfb
    r0 00000000  r1 00000a0a  r2 00000008  r3 00000000
    r4 b6480980  r5 00000008  r6 b6480930  r7 0000010c
    r8 b823bd78  r9 00010002  sl b823d5e8  fp 00000001
    ip 00000000  sp b6480038  lr b6e6d745  pc b6e6fea8  cpsr 200f0010

backtrace:
    #00 pc 0004cea8  /system/lib/libc.so (tgkill+12)
    #1 pc 0004a741  /system/lib/libc.so (pthread_kill+36)
    #2 pc 0001b143  /system/lib/libc.so (raise+10)
    #3 pc 00078be0  /system/lib/libc++.so (__aeabi_ldiv0+8)
    #4 pc 00003775  /system/vendor/lib/libmmcamera2_cpp_module.so (cpp_module_set_clock_freq+540)
    #5 pc 00005e27  /system/vendor/lib/libmmcamera2_cpp_module.so (cpp_module_handle_streamoff_event+430)
    #06 pc 00003283  /system/vendor/lib/libmmcamera2_cpp_module.so (cpp_module_process_downstream_event+530)
...

Given the lack of source and the unbisectable mess that is the external/libcxx
git history, ship the prebuilt and renamed 5.1.1 libc++ and preload it
for the server.

Change-Id: Ia7dd6bd47230d24fa3801275c382ebf27939c88f
  • Loading branch information
u-ra authored and moetayuko committed Jan 30, 2016
1 parent 48dfc9c commit 0e61118
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions init.target.rc
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ service qcamerasvr /system/bin/mm-qcamera-daemon
class late_start
user camera
group camera system inet input graphics
setenv LD_PRELOAD /vendor/lib/libqcamerasvr-c++.so

#enable zram
on property:ro.config.zram=true
Expand Down
1 change: 1 addition & 0 deletions proprietary-files.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ vendor/lib/libmmipl.so
vendor/lib/libmmjpeg.so
vendor/lib/libmmqjpeg_codec.so
vendor/lib/liboemcamera.so
vendor/lib/libqcamerasvr-c++.so
vendor/lib/libqomx_jpegenc.so

# Camera Actuator
Expand Down

0 comments on commit 0e61118

Please sign in to comment.