@@ -702,7 +702,7 @@ static void ReportUnsuspendedThreads(const SuspendedThreadsList &) {}
702
702
703
703
# else // !SANITIZER_FUCHSIA
704
704
705
- static void ReportUnsuspendedThreads (
705
+ static bool ReportUnsuspendedThreads (
706
706
const SuspendedThreadsList &suspended_threads) {
707
707
InternalMmapVector<tid_t > threads (suspended_threads.ThreadCount ());
708
708
for (uptr i = 0 ; i < suspended_threads.ThreadCount (); ++i)
@@ -713,13 +713,17 @@ static void ReportUnsuspendedThreads(
713
713
InternalMmapVector<tid_t > unsuspended;
714
714
GetRunningThreadsLocked (&unsuspended);
715
715
716
+ bool succeded = true ;
716
717
for (auto os_id : unsuspended) {
717
718
uptr i = InternalLowerBound (threads, os_id);
718
- if (i >= threads.size () || threads[i] != os_id)
719
+ if (i >= threads.size () || threads[i] != os_id) {
720
+ succeded = false ;
719
721
Report (
720
722
" Running thread %zu was not suspended. False leaks are possible.\n " ,
721
723
os_id);
724
+ }
722
725
}
726
+ return succeded;
723
727
}
724
728
725
729
# endif // !SANITIZER_FUCHSIA
@@ -729,7 +733,18 @@ static void CheckForLeaksCallback(const SuspendedThreadsList &suspended_threads,
729
733
CheckForLeaksParam *param = reinterpret_cast <CheckForLeaksParam *>(arg);
730
734
CHECK (param);
731
735
CHECK (!param->success );
732
- ReportUnsuspendedThreads (suspended_threads);
736
+ if (!ReportUnsuspendedThreads (suspended_threads)) {
737
+ switch (flags ()->thread_suspend_fail ) {
738
+ case 0 :
739
+ param->success = true ;
740
+ return ;
741
+ case 1 :
742
+ break ;
743
+ case 2 :
744
+ // Will crash on return.
745
+ return ;
746
+ }
747
+ }
733
748
ClassifyAllChunks (suspended_threads, ¶m->frontier , param->caller_tid ,
734
749
param->caller_sp );
735
750
ForEachChunk (CollectLeaksCb, ¶m->leaks );
0 commit comments