valgrind/asan: Make asan_symbolize compatible with Python 3.12

The asan_symbolize script crashes on Python 3.12 with a
ModuleNotFoundError because the distutils module has been removed.

This change replaces the deprecated distutils.spawn.find_executable with
its modern equivalent, shutil.which. This resolves the crash and ensures
the script remains functional on both older versions like Python 3.9 and
the newer Python 3.12.

This change only affects Chromium's downstream version of the script.
The call to find_executable() is a local modification, and the upstream
LLVM script [1] does not contain this logic. Therefore, this fix will
not create merge conflicts with future LLVM rolls.

[1]https://github.com/llvm/llvm-project/blob/main/compiler-rt/lib/asan/scripts/asan_symbolize.py

Bug: None
Test: Switch between Python 3.9 and 3.12, try to symbolize a msan report.
Change-Id: Ice2e5e928bede79a50542d494d101ebb58002c26
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6733724
Reviewed-by: Nico Weber <[email protected]>
Commit-Queue: Di Wu <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1487311}
NOKEYCHECK=True
GitOrigin-RevId: 43da29531406c54ceed0c8cc3009fd86fb1b4582
1 file changed
tree: b58e1be2d0e13c9165d983ea8fbe4cdc87ece026
  1. asan/
  2. OWNERS
  3. README