diff options
author | Benoit Jacob <benoitjacob@google.com> | 2022-07-12 03:53:52 +0300 |
---|---|---|
committer | Copybara-Service <copybara-worker@google.com> | 2022-07-12 03:54:32 +0300 |
commit | 0216f3e89ee60932f680c1c9434c533e55388c9f (patch) | |
tree | 765b99b25cf8e5eb40797a4e90ee163cea83abcf | |
parent | 841ea4172ba904fe3536789497f9565f2ef64129 (diff) |
Skip caches that have processor_count==0.test_460342347
Some crash reports on Android tell of segfaults at address
(null - 8, wrapped around) at the line below evaluating is_local,
which I guess would happen if processor_count==0.
PiperOrigin-RevId: 460342347
-rw-r--r-- | ruy/cpuinfo.cc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/ruy/cpuinfo.cc b/ruy/cpuinfo.cc index a3e75d7..8a0e912 100644 --- a/ruy/cpuinfo.cc +++ b/ruy/cpuinfo.cc @@ -56,6 +56,9 @@ void QueryCacheParams(CpuCacheParams* cache_params) { continue; // continue, not break, it is possible to have L1+L3 but no // L2. } + if (!cache->processor_count) { + continue; // crashes from Chrome on Android suggests that might happen? + } const bool is_local = cpuinfo_get_processor(cache->processor_start)->core == cpuinfo_get_processor(cache->processor_start + |