[roll] Roll fuchsia [adb] Fix asan test flake in teardown observer

This change fixes a use-after-free flake in adb-test where the
ObserveTeardown callback in UsbAdbImpl was accessing the Adb
instance after it had been destroyed during test teardown.

To fix this:
1. Added a shared_ptr to a callback (`teardown_callback_`) in Adb.
2. In StartUsbAdbImpl, the ObserveTeardown lambda captures a copy of
   this shared_ptr instead of capturing `this`.
3. In the Adb destructor, we clear the callback in the shared state
   (`*teardown_callback_ = nullptr`).
4. When teardown completes, the lambda checks if the callback is still
   valid before executing it. This ensures we don't access the
   destroyed Adb instance.

Also fixed the teardown order in `AdbRealmTest::TearDown` to ensure
the realm is torn down before `AdbTest::TearDown` destroys the
FakeAdb instance.

Original-Bug: 500597818
Test: fx test adb-test
Multiply: adb-test
Original-Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/1570481
Original-Revision: 8bd0e214e22d9b033edf396efdfa2b1868eb3c67
GitOrigin-RevId: e2b3cc8182538c0894a80d49f466772d0ba51026
Change-Id: If4eea64a244197862c19bd55d0b4e221a2aeef36
1 file changed
tree: 7b11e282e873686d1f13146a1afa81905f2dbf96
  1. ctf/
  2. git-hooks/
  3. infra/
  4. third_party/
  5. cobalt
  6. flower
  7. jiri.lock
  8. MILESTONE
  9. minimal
  10. prebuilts
  11. README.md
  12. stem
  13. test_durations
README.md

Integration

This repository contains Fuchsia's Global Integration manifest files.

Making changes

All changes should be made to the internal version of this repository. Our infrastructure automatically updates this version when the internal one changes.

Currently all changes must be made by a Google employee. Non-Google employees wishing to make a change can ask for assistance in one of the communication channels documented at get involved.

Obtaining the source

First install Jiri.

Next run:

$ jiri init
$ jiri import minimal https://fuchsia.googlesource.com/integration
$ jiri update

Third party

Third party projects should have their own subdirectory in ./third_party.