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

Commit 031c11b7 authored by Anton Ivanov's avatar Anton Ivanov
Browse files

Fix a race in NotifyPowerBoostTest.

There is a race on stack variables being used by the closure passed to
`mFlinger.scheduler()->replaceTouchTimer` and them going out of scope
and being destroyed.  This manifested in hwasan error as in the linked bug.
On a real device, I was able to reproduce as a deadlock or crash with

```
adb root; TEST=libsurfaceflinger_unittest; m $TEST && adb sync data && adb shell -t /data/nativetest64/$TEST/$TEST --gtest_filter=DisplayTransactionTest.notifyPowerBoostNotifiesTouchEvent  --gtest_repeat=20
```

With this patch, all runs complete successfully.

Bug: 432535792
Test: unit
Flag: EXEMPT test only
Change-Id: Ic8eeefc1afb0706ddc84e7e8c9c9998bf4e901be
parent 2e554a8b
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