Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6b065e7d authored by Abdelrahman Daim's avatar Abdelrahman Daim Committed by Steven Moreland
Browse files

RefBase: add counter sanity checks for incStrong / incWeak



Summary: If there's a severe leak of RefBase objects like `AIBinder*`, catch the issue on
incrementing ref counters in addition to decrementing. This will prevent
cases when a leak happens in one place where it always increments the
counter, and then all of a sudden in different place someone releases a
reference will result in crash.

Test: Manually verified that if AIBinder significantly leaks ref counter, the process will crash
and the call stack will clearly indicate leaking source, with the following abort message:

```
Abort message: incWeak called on 0x7e033207c0 too many times, weak refs = 1048576
```

Change-Id: I1b58d5b851ef0e6abfbedc7f710ce49215bb2def
Signed-off-by: default avatarAbdelrahman Daim <adaim@meta.com>
parent d436c6a1
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment