From ff869fd7c78604bb2a7a9b3784723e9af27023ec Mon Sep 17 00:00:00 2001 From: Paul Keith Date: Fri, 17 Aug 2018 20:55:36 +0200 Subject: [PATCH] msm8976-common: Hex-edit libmmcamera2_isp_modules for P's mutex restrictions * Google has been tightening up mutexes by disallowing calling pthread_mutex_destroy on an already destroyed mutex in P * This normally isn't an issue, but Qualcomm, in their infinite wisdom, decided to destroy a mutex in a loop in isp_module_stop_session when they were freeing some related memory allocations * This results in a SIGABRT in mm-qcamera-daemon from a __fortify_fatal call in HandleUsingDestroyedMutex in libc * To work around this, the CBNZ instruction (aka, the break condition) in the loop was moved before the call to phtread_mutex_destroy so that the during the 2nd (and final) iteration of the loop, it exits *before* rather than *after* the calls to pthread_mutex_destroy * ASM instructions: - Before: https://gist.github.com/javelinanddart/9afdc8577134bf8ecd48b15213d66491 - After: https://gist.github.com/javelinanddart/789ba3bde8494ff4ba0b7967c93daa14 Change-Id: I36dfab9f3afb8c9e010da8c6b02c2d9eff856c07 --- .../vendor/lib/libmmcamera2_isp_modules.so | Bin 245560 -> 245560 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/msm8976-common/proprietary/vendor/lib/libmmcamera2_isp_modules.so b/msm8976-common/proprietary/vendor/lib/libmmcamera2_isp_modules.so index 14d98ae87cd0f6838ba7c534ac00ec8bcda315c4..6f7bc1549317237683b977a8f4cd59c5efba4ea4 100644 GIT binary patch delta 65 zcmdn-k8j66z74-})#mJEo5Aqa-5|#D-*>LJY_pkx>;!{<-&x+W&0+$wBf#utg}io! PJVqd9+OCktED;C*6fPW> delta 65 zcmdn-k8j66z74-})!1e*e04X7G5GhL=Plc8W*|EO$Yy)XHj4?!jsUZHb~Y>IwJYQ? N0x{Eeg*;}7Kmhrx90ULW