[all-commits] [llvm/llvm-project] bcc85f: [compiler-rt][asan][tests] Stabilize wchar tests o...

Yixuan Cao via All-commits all-commits at lists.llvm.org
Wed Oct 1 22:30:31 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: bcc85f76700d3f0aebc14bf8b981476c94892ef8
      https://github.com/llvm/llvm-project/commit/bcc85f76700d3f0aebc14bf8b981476c94892ef8
  Author: Yixuan Cao <caoyixuan2019 at email.szu.edu.cn>
  Date:   2025-10-01 (Wed, 01 Oct 2025)

  Changed paths:
    M compiler-rt/test/asan/TestCases/wcscat.cpp
    M compiler-rt/test/asan/TestCases/wcscpy.cpp
    M compiler-rt/test/asan/TestCases/wcsncat.cpp
    M compiler-rt/test/asan/TestCases/wcsncpy.cpp

  Log Message:
  -----------
  [compiler-rt][asan][tests] Stabilize wchar tests on Darwin/Android (#161624)

### Summary
Stabilize ASan wchar tests across Darwin and Android. NFC: test-only.
Follow-up to PR #160493 (adds wchar interceptors/tests).

### Motivation
- Darwin: The top frame often resolves to `libclang_rt.asan_*` rather
than a source file, so strict checks that include file/line can fail.
See Chromium issue
[448631142](https://g-issues.chromium.org/issues/448631142).
- Android: The “ERROR:” header can go to logcat instead of stderr, so
FileCheck may not see it; stdout/stderr reordering also makes pre-crash
markers racy. See Android Buildbot
[186/12821](https://lab.llvm.org/buildbot/#/builders/186/builds/12821).

### Changes
- Android:
- Force reports to stderr via `%env_asan_opts=log_to_stderr=1`, avoiding
the “ERROR:” header going to logcat.
- Print the pre-crash “Good so far.” to stderr and `fflush(stderr)` to
avoid stdout/stderr reordering.
- Darwin:
- Relax the stack-frame check to only require the function name
(`wcscpy/wcsncpy/wcscat/wcsncat`) to tolerate `libclang_rt.asan_*`
frames.
- Common:
  - Reuse FileCheck var `[[ADDR]]` instead of redefining.
- Make wide string literals `const wchar_t*` to silence
`-Wwritable-strings`.

### Risk
- NFC: test-only; no change to runtime behavior.

### References
- Follow-up to PR #160493.
- Chromium: [448631142](https://g-issues.chromium.org/issues/448631142)
(Darwin failures).
- Android Buildbot:
[186/12821](https://lab.llvm.org/buildbot/#/builders/186/builds/12821).

Signed-off-by: Yixuan Cao <caoyixuan2019 at email.szu.edu.cn>



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list