commit | 9f88dcfcc761d2c523011dceec25c7a3cde05822 | [log] [tgz] |
---|---|---|
author | dimitry <dimitry@google.com> | Wed Aug 02 14:56:47 2023 +0200 |
committer | dimitry <dimitry@google.com> | Wed Aug 02 14:56:47 2023 +0200 |
tree | 53563afca980713325f3710bc0c6f1d4ad0ebdbd | |
parent | de43dbbf3dbabc2536f5ef25a682dea7356cec08 [diff] |
Force (host) bionic to update cached tid if necessary 1. Bionic `clone` implementation resets cached `tid` before syscall so that it does not get accidentally propagate to the child. 2. pthread_lock/unlock implementations do not call `gettid()` they instead access cached value directly from TLS. Which leads to a situation where cached `tid` is updated in the middle of `dlopen` and it fails to unlock the mutex because the ownership check fails. Subsequent `dlsym` (or any other dl* call) stops on locked mutex. By calling `gettid()` in ResetCurrentGuestThreadAfterFork we force bionic to set the cached value to the correct one. Bug: http://b/289744033 Test: run guest 32bit bionic-unit-tests Change-Id: Ia1c115c15ef3888bbcae02ebd342debc4af0103e (cherry picked from commit 1e8e02773e1ac5f63a3c2164441caab966d2955c) (cherry picked from commit 50633f794b153d4ddf8dd8208fe9a8632ca3979d)
Berberis: dynamic binary translator to run Android apps with riscv64 native code on x86_64 devices or emulators.