File: | var/lib/jenkins/workspace/firefox-scan-build/obj-x86_64-pc-linux-gnu/dist/include/mozilla/UniquePtr.h |
Warning: | line 287, column 25 Use of memory after it is freed |
Press '?' to see keyboard shortcuts
Keyboard shortcuts:
1 | /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ | |||
2 | /* vim: set ts=8 sts=2 et sw=2 tw=80: */ | |||
3 | /* This Source Code Form is subject to the terms of the Mozilla Public | |||
4 | * License, v. 2.0. If a copy of the MPL was not distributed with this file, | |||
5 | * You can obtain one at http://mozilla.org/MPL/2.0/. */ | |||
6 | ||||
7 | #include "BaseProfiler.h" | |||
8 | ||||
9 | #include "mozilla/Attributes.h" | |||
10 | #include "mozilla/BaseAndGeckoProfilerDetail.h" | |||
11 | #include "mozilla/BaseProfileJSONWriter.h" | |||
12 | #include "mozilla/BaseProfilerDetail.h" | |||
13 | #include "mozilla/FailureLatch.h" | |||
14 | #include "mozilla/FloatingPoint.h" | |||
15 | #include "mozilla/NotNull.h" | |||
16 | #include "mozilla/ProgressLogger.h" | |||
17 | #include "mozilla/ProportionValue.h" | |||
18 | ||||
19 | #ifdef MOZ_GECKO_PROFILER1 | |||
20 | # include "mozilla/BaseProfilerMarkerTypes.h" | |||
21 | # include "mozilla/leb128iterator.h" | |||
22 | # include "mozilla/ModuloBuffer.h" | |||
23 | # include "mozilla/mozalloc.h" | |||
24 | # include "mozilla/PowerOfTwo.h" | |||
25 | # include "mozilla/ProfileBufferChunk.h" | |||
26 | # include "mozilla/ProfileBufferChunkManagerSingle.h" | |||
27 | # include "mozilla/ProfileBufferChunkManagerWithLocalLimit.h" | |||
28 | # include "mozilla/ProfileBufferControlledChunkManager.h" | |||
29 | # include "mozilla/ProfileChunkedBuffer.h" | |||
30 | # include "mozilla/Vector.h" | |||
31 | #endif // MOZ_GECKO_PROFILER | |||
32 | ||||
33 | #if defined(_MSC_VER) || defined(__MINGW32__) | |||
34 | # include <windows.h> | |||
35 | # include <mmsystem.h> | |||
36 | # include <process.h> | |||
37 | #else | |||
38 | # include <errno(*__errno_location ()).h> | |||
39 | # include <time.h> | |||
40 | #endif | |||
41 | ||||
42 | #include <algorithm> | |||
43 | #include <atomic> | |||
44 | #include <iostream> | |||
45 | #include <random> | |||
46 | #include <thread> | |||
47 | #include <type_traits> | |||
48 | #include <utility> | |||
49 | ||||
50 | void TestFailureLatch() { | |||
51 | printf("TestFailureLatch...\n"); | |||
52 | ||||
53 | // Test infallible latch. | |||
54 | { | |||
55 | mozilla::FailureLatchInfallibleSource& infallibleLatch = | |||
56 | mozilla::FailureLatchInfallibleSource::Singleton(); | |||
57 | ||||
58 | MOZ_RELEASE_ASSERT(!infallibleLatch.Fallible())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!infallibleLatch.Fallible())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!infallibleLatch.Fallible()) )), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!infallibleLatch.Fallible()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 58); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!infallibleLatch.Fallible()" ")"); do { *((volatile int*)__null) = 58; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
59 | MOZ_RELEASE_ASSERT(!infallibleLatch.Failed())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!infallibleLatch.Failed())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!infallibleLatch.Failed()))) , 0))) { do { } while (false); MOZ_ReportAssertionFailure("!infallibleLatch.Failed()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 59); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!infallibleLatch.Failed()" ")"); do { *((volatile int*)__null) = 59; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
60 | MOZ_RELEASE_ASSERT(!infallibleLatch.GetFailure())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!infallibleLatch.GetFailure())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!infallibleLatch.GetFailure( )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("!infallibleLatch.GetFailure()", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 60); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!infallibleLatch.GetFailure()" ")"); do { *((volatile int*)__null) = 60; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
61 | MOZ_RELEASE_ASSERT(&infallibleLatch.SourceFailureLatch() ==do { static_assert( mozilla::detail::AssertionConditionType< decltype(&infallibleLatch.SourceFailureLatch() == &mozilla ::FailureLatchInfallibleSource::Singleton())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(&infallibleLatch.SourceFailureLatch () == &mozilla::FailureLatchInfallibleSource::Singleton() ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "&infallibleLatch.SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 62); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&infallibleLatch.SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()" ")"); do { *((volatile int*)__null) = 62; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
62 | &mozilla::FailureLatchInfallibleSource::Singleton())do { static_assert( mozilla::detail::AssertionConditionType< decltype(&infallibleLatch.SourceFailureLatch() == &mozilla ::FailureLatchInfallibleSource::Singleton())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(&infallibleLatch.SourceFailureLatch () == &mozilla::FailureLatchInfallibleSource::Singleton() ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "&infallibleLatch.SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 62); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&infallibleLatch.SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()" ")"); do { *((volatile int*)__null) = 62; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
63 | MOZ_RELEASE_ASSERT(&std::as_const(infallibleLatch).SourceFailureLatch() ==do { static_assert( mozilla::detail::AssertionConditionType< decltype(&std::as_const(infallibleLatch).SourceFailureLatch () == &mozilla::FailureLatchInfallibleSource::Singleton() )>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(&std::as_const(infallibleLatch).SourceFailureLatch () == &mozilla::FailureLatchInfallibleSource::Singleton() ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "&std::as_const(infallibleLatch).SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 64); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&std::as_const(infallibleLatch).SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()" ")"); do { *((volatile int*)__null) = 64; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
64 | &mozilla::FailureLatchInfallibleSource::Singleton())do { static_assert( mozilla::detail::AssertionConditionType< decltype(&std::as_const(infallibleLatch).SourceFailureLatch () == &mozilla::FailureLatchInfallibleSource::Singleton() )>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(&std::as_const(infallibleLatch).SourceFailureLatch () == &mozilla::FailureLatchInfallibleSource::Singleton() ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "&std::as_const(infallibleLatch).SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 64); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&std::as_const(infallibleLatch).SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()" ")"); do { *((volatile int*)__null) = 64; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
65 | } | |||
66 | ||||
67 | // Test failure latch basic functions. | |||
68 | { | |||
69 | mozilla::FailureLatchSource failureLatch; | |||
70 | ||||
71 | MOZ_RELEASE_ASSERT(failureLatch.Fallible())do { static_assert( mozilla::detail::AssertionConditionType< decltype(failureLatch.Fallible())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(failureLatch.Fallible()))), 0 ))) { do { } while (false); MOZ_ReportAssertionFailure("failureLatch.Fallible()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 71); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "failureLatch.Fallible()" ")"); do { *((volatile int*)__null) = 71; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
72 | MOZ_RELEASE_ASSERT(!failureLatch.Failed())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!failureLatch.Failed())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!failureLatch.Failed()))), 0 ))) { do { } while (false); MOZ_ReportAssertionFailure("!failureLatch.Failed()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 72); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!failureLatch.Failed()" ")"); do { *((volatile int*)__null) = 72; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
73 | MOZ_RELEASE_ASSERT(!failureLatch.GetFailure())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!failureLatch.GetFailure())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!failureLatch.GetFailure())) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!failureLatch.GetFailure()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 73); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!failureLatch.GetFailure()" ")"); do { *((volatile int*)__null) = 73; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
74 | MOZ_RELEASE_ASSERT(&failureLatch.SourceFailureLatch() == &failureLatch)do { static_assert( mozilla::detail::AssertionConditionType< decltype(&failureLatch.SourceFailureLatch() == &failureLatch )>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(&failureLatch.SourceFailureLatch() == &failureLatch ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "&failureLatch.SourceFailureLatch() == &failureLatch" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 74); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&failureLatch.SourceFailureLatch() == &failureLatch" ")"); do { *((volatile int*)__null) = 74; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
75 | MOZ_RELEASE_ASSERT(&std::as_const(failureLatch).SourceFailureLatch() ==do { static_assert( mozilla::detail::AssertionConditionType< decltype(&std::as_const(failureLatch).SourceFailureLatch( ) == &failureLatch)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(&std::as_const(failureLatch ).SourceFailureLatch() == &failureLatch))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("&std::as_const(failureLatch).SourceFailureLatch() == &failureLatch" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 76); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&std::as_const(failureLatch).SourceFailureLatch() == &failureLatch" ")"); do { *((volatile int*)__null) = 76; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
76 | &failureLatch)do { static_assert( mozilla::detail::AssertionConditionType< decltype(&std::as_const(failureLatch).SourceFailureLatch( ) == &failureLatch)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(&std::as_const(failureLatch ).SourceFailureLatch() == &failureLatch))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("&std::as_const(failureLatch).SourceFailureLatch() == &failureLatch" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 76); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&std::as_const(failureLatch).SourceFailureLatch() == &failureLatch" ")"); do { *((volatile int*)__null) = 76; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
77 | ||||
78 | failureLatch.SetFailure("error"); | |||
79 | ||||
80 | MOZ_RELEASE_ASSERT(failureLatch.Fallible())do { static_assert( mozilla::detail::AssertionConditionType< decltype(failureLatch.Fallible())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(failureLatch.Fallible()))), 0 ))) { do { } while (false); MOZ_ReportAssertionFailure("failureLatch.Fallible()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 80); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "failureLatch.Fallible()" ")"); do { *((volatile int*)__null) = 80; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
81 | MOZ_RELEASE_ASSERT(failureLatch.Failed())do { static_assert( mozilla::detail::AssertionConditionType< decltype(failureLatch.Failed())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(failureLatch.Failed()))), 0) )) { do { } while (false); MOZ_ReportAssertionFailure("failureLatch.Failed()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 81); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "failureLatch.Failed()" ")"); do { *((volatile int*)__null) = 81; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
82 | MOZ_RELEASE_ASSERT(failureLatch.GetFailure())do { static_assert( mozilla::detail::AssertionConditionType< decltype(failureLatch.GetFailure())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(failureLatch.GetFailure()))) , 0))) { do { } while (false); MOZ_ReportAssertionFailure("failureLatch.GetFailure()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 82); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "failureLatch.GetFailure()" ")"); do { *((volatile int*)__null) = 82; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
83 | MOZ_RELEASE_ASSERT(strcmp(failureLatch.GetFailure(), "error") == 0)do { static_assert( mozilla::detail::AssertionConditionType< decltype(strcmp(failureLatch.GetFailure(), "error") == 0)> ::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(strcmp(failureLatch.GetFailure(), "error") == 0))), 0 ))) { do { } while (false); MOZ_ReportAssertionFailure("strcmp(failureLatch.GetFailure(), \"error\") == 0" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 83); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "strcmp(failureLatch.GetFailure(), \"error\") == 0" ")"); do { *((volatile int*)__null) = 83; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
84 | ||||
85 | failureLatch.SetFailure("later error"); | |||
86 | ||||
87 | MOZ_RELEASE_ASSERT(failureLatch.Fallible())do { static_assert( mozilla::detail::AssertionConditionType< decltype(failureLatch.Fallible())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(failureLatch.Fallible()))), 0 ))) { do { } while (false); MOZ_ReportAssertionFailure("failureLatch.Fallible()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 87); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "failureLatch.Fallible()" ")"); do { *((volatile int*)__null) = 87; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
88 | MOZ_RELEASE_ASSERT(failureLatch.Failed())do { static_assert( mozilla::detail::AssertionConditionType< decltype(failureLatch.Failed())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(failureLatch.Failed()))), 0) )) { do { } while (false); MOZ_ReportAssertionFailure("failureLatch.Failed()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 88); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "failureLatch.Failed()" ")"); do { *((volatile int*)__null) = 88; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
89 | MOZ_RELEASE_ASSERT(failureLatch.GetFailure())do { static_assert( mozilla::detail::AssertionConditionType< decltype(failureLatch.GetFailure())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(failureLatch.GetFailure()))) , 0))) { do { } while (false); MOZ_ReportAssertionFailure("failureLatch.GetFailure()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 89); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "failureLatch.GetFailure()" ")"); do { *((volatile int*)__null) = 89; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
90 | MOZ_RELEASE_ASSERT(strcmp(failureLatch.GetFailure(), "error") == 0)do { static_assert( mozilla::detail::AssertionConditionType< decltype(strcmp(failureLatch.GetFailure(), "error") == 0)> ::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(strcmp(failureLatch.GetFailure(), "error") == 0))), 0 ))) { do { } while (false); MOZ_ReportAssertionFailure("strcmp(failureLatch.GetFailure(), \"error\") == 0" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 90); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "strcmp(failureLatch.GetFailure(), \"error\") == 0" ")"); do { *((volatile int*)__null) = 90; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
91 | } | |||
92 | ||||
93 | // Test SetFailureFrom. | |||
94 | { | |||
95 | mozilla::FailureLatchSource failureLatch; | |||
96 | ||||
97 | MOZ_RELEASE_ASSERT(!failureLatch.Failed())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!failureLatch.Failed())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!failureLatch.Failed()))), 0 ))) { do { } while (false); MOZ_ReportAssertionFailure("!failureLatch.Failed()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 97); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!failureLatch.Failed()" ")"); do { *((volatile int*)__null) = 97; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
98 | failureLatch.SetFailureFrom(failureLatch); | |||
99 | MOZ_RELEASE_ASSERT(!failureLatch.Failed())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!failureLatch.Failed())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!failureLatch.Failed()))), 0 ))) { do { } while (false); MOZ_ReportAssertionFailure("!failureLatch.Failed()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 99); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!failureLatch.Failed()" ")"); do { *((volatile int*)__null) = 99; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
100 | MOZ_RELEASE_ASSERT(!failureLatch.GetFailure())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!failureLatch.GetFailure())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!failureLatch.GetFailure())) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!failureLatch.GetFailure()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 100); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!failureLatch.GetFailure()" ")"); do { *((volatile int*)__null) = 100; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
101 | ||||
102 | // SetFailureFrom with no error. | |||
103 | { | |||
104 | mozilla::FailureLatchSource failureLatchInnerOk; | |||
105 | MOZ_RELEASE_ASSERT(!failureLatchInnerOk.Failed())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!failureLatchInnerOk.Failed())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!failureLatchInnerOk.Failed( )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("!failureLatchInnerOk.Failed()", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 105); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!failureLatchInnerOk.Failed()" ")"); do { *((volatile int*)__null) = 105; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
106 | MOZ_RELEASE_ASSERT(!failureLatchInnerOk.GetFailure())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!failureLatchInnerOk.GetFailure())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!failureLatchInnerOk.GetFailure ()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("!failureLatchInnerOk.GetFailure()", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 106); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!failureLatchInnerOk.GetFailure()" ")"); do { *((volatile int*)__null) = 106; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
107 | ||||
108 | MOZ_RELEASE_ASSERT(!failureLatch.Failed())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!failureLatch.Failed())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!failureLatch.Failed()))), 0 ))) { do { } while (false); MOZ_ReportAssertionFailure("!failureLatch.Failed()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 108); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!failureLatch.Failed()" ")"); do { *((volatile int*)__null) = 108; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
109 | failureLatch.SetFailureFrom(failureLatchInnerOk); | |||
110 | MOZ_RELEASE_ASSERT(!failureLatch.Failed())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!failureLatch.Failed())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!failureLatch.Failed()))), 0 ))) { do { } while (false); MOZ_ReportAssertionFailure("!failureLatch.Failed()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 110); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!failureLatch.Failed()" ")"); do { *((volatile int*)__null) = 110; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
111 | ||||
112 | MOZ_RELEASE_ASSERT(!failureLatchInnerOk.Failed())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!failureLatchInnerOk.Failed())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!failureLatchInnerOk.Failed( )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("!failureLatchInnerOk.Failed()", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 112); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!failureLatchInnerOk.Failed()" ")"); do { *((volatile int*)__null) = 112; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
113 | MOZ_RELEASE_ASSERT(!failureLatchInnerOk.GetFailure())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!failureLatchInnerOk.GetFailure())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!failureLatchInnerOk.GetFailure ()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("!failureLatchInnerOk.GetFailure()", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 113); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!failureLatchInnerOk.GetFailure()" ")"); do { *((volatile int*)__null) = 113; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
114 | } | |||
115 | MOZ_RELEASE_ASSERT(!failureLatch.Failed())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!failureLatch.Failed())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!failureLatch.Failed()))), 0 ))) { do { } while (false); MOZ_ReportAssertionFailure("!failureLatch.Failed()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 115); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!failureLatch.Failed()" ")"); do { *((volatile int*)__null) = 115; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
116 | MOZ_RELEASE_ASSERT(!failureLatch.GetFailure())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!failureLatch.GetFailure())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!failureLatch.GetFailure())) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!failureLatch.GetFailure()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 116); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!failureLatch.GetFailure()" ")"); do { *((volatile int*)__null) = 116; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
117 | ||||
118 | // SetFailureFrom with error. | |||
119 | { | |||
120 | mozilla::FailureLatchSource failureLatchInnerError; | |||
121 | MOZ_RELEASE_ASSERT(!failureLatchInnerError.Failed())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!failureLatchInnerError.Failed())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!failureLatchInnerError.Failed ()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("!failureLatchInnerError.Failed()", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 121); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!failureLatchInnerError.Failed()" ")"); do { *((volatile int*)__null) = 121; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
122 | MOZ_RELEASE_ASSERT(!failureLatchInnerError.GetFailure())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!failureLatchInnerError.GetFailure())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!failureLatchInnerError.GetFailure ()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("!failureLatchInnerError.GetFailure()", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 122); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!failureLatchInnerError.GetFailure()" ")"); do { *((volatile int*)__null) = 122; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
123 | ||||
124 | failureLatchInnerError.SetFailure("inner error"); | |||
125 | MOZ_RELEASE_ASSERT(failureLatchInnerError.Failed())do { static_assert( mozilla::detail::AssertionConditionType< decltype(failureLatchInnerError.Failed())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(failureLatchInnerError.Failed ()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("failureLatchInnerError.Failed()", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 125); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "failureLatchInnerError.Failed()" ")"); do { *((volatile int*)__null) = 125; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
126 | MOZ_RELEASE_ASSERT(do { static_assert( mozilla::detail::AssertionConditionType< decltype(strcmp(failureLatchInnerError.GetFailure(), "inner error" ) == 0)>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(strcmp(failureLatchInnerError.GetFailure(), "inner error" ) == 0))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("strcmp(failureLatchInnerError.GetFailure(), \"inner error\") == 0" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 127); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "strcmp(failureLatchInnerError.GetFailure(), \"inner error\") == 0" ")"); do { *((volatile int*)__null) = 127; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
127 | strcmp(failureLatchInnerError.GetFailure(), "inner error") == 0)do { static_assert( mozilla::detail::AssertionConditionType< decltype(strcmp(failureLatchInnerError.GetFailure(), "inner error" ) == 0)>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(strcmp(failureLatchInnerError.GetFailure(), "inner error" ) == 0))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("strcmp(failureLatchInnerError.GetFailure(), \"inner error\") == 0" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 127); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "strcmp(failureLatchInnerError.GetFailure(), \"inner error\") == 0" ")"); do { *((volatile int*)__null) = 127; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
128 | ||||
129 | MOZ_RELEASE_ASSERT(!failureLatch.Failed())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!failureLatch.Failed())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!failureLatch.Failed()))), 0 ))) { do { } while (false); MOZ_ReportAssertionFailure("!failureLatch.Failed()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 129); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!failureLatch.Failed()" ")"); do { *((volatile int*)__null) = 129; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
130 | failureLatch.SetFailureFrom(failureLatchInnerError); | |||
131 | MOZ_RELEASE_ASSERT(failureLatch.Failed())do { static_assert( mozilla::detail::AssertionConditionType< decltype(failureLatch.Failed())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(failureLatch.Failed()))), 0) )) { do { } while (false); MOZ_ReportAssertionFailure("failureLatch.Failed()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 131); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "failureLatch.Failed()" ")"); do { *((volatile int*)__null) = 131; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
132 | ||||
133 | MOZ_RELEASE_ASSERT(failureLatchInnerError.Failed())do { static_assert( mozilla::detail::AssertionConditionType< decltype(failureLatchInnerError.Failed())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(failureLatchInnerError.Failed ()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("failureLatchInnerError.Failed()", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 133); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "failureLatchInnerError.Failed()" ")"); do { *((volatile int*)__null) = 133; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
134 | MOZ_RELEASE_ASSERT(do { static_assert( mozilla::detail::AssertionConditionType< decltype(strcmp(failureLatchInnerError.GetFailure(), "inner error" ) == 0)>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(strcmp(failureLatchInnerError.GetFailure(), "inner error" ) == 0))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("strcmp(failureLatchInnerError.GetFailure(), \"inner error\") == 0" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 135); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "strcmp(failureLatchInnerError.GetFailure(), \"inner error\") == 0" ")"); do { *((volatile int*)__null) = 135; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
135 | strcmp(failureLatchInnerError.GetFailure(), "inner error") == 0)do { static_assert( mozilla::detail::AssertionConditionType< decltype(strcmp(failureLatchInnerError.GetFailure(), "inner error" ) == 0)>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(strcmp(failureLatchInnerError.GetFailure(), "inner error" ) == 0))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("strcmp(failureLatchInnerError.GetFailure(), \"inner error\") == 0" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 135); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "strcmp(failureLatchInnerError.GetFailure(), \"inner error\") == 0" ")"); do { *((volatile int*)__null) = 135; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
136 | } | |||
137 | MOZ_RELEASE_ASSERT(failureLatch.Failed())do { static_assert( mozilla::detail::AssertionConditionType< decltype(failureLatch.Failed())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(failureLatch.Failed()))), 0) )) { do { } while (false); MOZ_ReportAssertionFailure("failureLatch.Failed()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 137); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "failureLatch.Failed()" ")"); do { *((volatile int*)__null) = 137; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
138 | MOZ_RELEASE_ASSERT(strcmp(failureLatch.GetFailure(), "inner error") == 0)do { static_assert( mozilla::detail::AssertionConditionType< decltype(strcmp(failureLatch.GetFailure(), "inner error") == 0 )>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(strcmp(failureLatch.GetFailure(), "inner error") == 0 ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "strcmp(failureLatch.GetFailure(), \"inner error\") == 0", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 138); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "strcmp(failureLatch.GetFailure(), \"inner error\") == 0" ")"); do { *((volatile int*)__null) = 138; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
139 | ||||
140 | failureLatch.SetFailureFrom(failureLatch); | |||
141 | MOZ_RELEASE_ASSERT(failureLatch.Failed())do { static_assert( mozilla::detail::AssertionConditionType< decltype(failureLatch.Failed())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(failureLatch.Failed()))), 0) )) { do { } while (false); MOZ_ReportAssertionFailure("failureLatch.Failed()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 141); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "failureLatch.Failed()" ")"); do { *((volatile int*)__null) = 141; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
142 | MOZ_RELEASE_ASSERT(strcmp(failureLatch.GetFailure(), "inner error") == 0)do { static_assert( mozilla::detail::AssertionConditionType< decltype(strcmp(failureLatch.GetFailure(), "inner error") == 0 )>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(strcmp(failureLatch.GetFailure(), "inner error") == 0 ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "strcmp(failureLatch.GetFailure(), \"inner error\") == 0", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 142); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "strcmp(failureLatch.GetFailure(), \"inner error\") == 0" ")"); do { *((volatile int*)__null) = 142; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
143 | ||||
144 | // SetFailureFrom with error again, ignored. | |||
145 | { | |||
146 | mozilla::FailureLatchSource failureLatchInnerError; | |||
147 | failureLatchInnerError.SetFailure("later inner error"); | |||
148 | MOZ_RELEASE_ASSERT(failureLatchInnerError.Failed())do { static_assert( mozilla::detail::AssertionConditionType< decltype(failureLatchInnerError.Failed())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(failureLatchInnerError.Failed ()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("failureLatchInnerError.Failed()", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 148); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "failureLatchInnerError.Failed()" ")"); do { *((volatile int*)__null) = 148; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
149 | MOZ_RELEASE_ASSERT(strcmp(failureLatchInnerError.GetFailure(),do { static_assert( mozilla::detail::AssertionConditionType< decltype(strcmp(failureLatchInnerError.GetFailure(), "later inner error" ) == 0)>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(strcmp(failureLatchInnerError.GetFailure(), "later inner error" ) == 0))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("strcmp(failureLatchInnerError.GetFailure(), \"later inner error\") == 0" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 150); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "strcmp(failureLatchInnerError.GetFailure(), \"later inner error\") == 0" ")"); do { *((volatile int*)__null) = 150; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
150 | "later inner error") == 0)do { static_assert( mozilla::detail::AssertionConditionType< decltype(strcmp(failureLatchInnerError.GetFailure(), "later inner error" ) == 0)>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(strcmp(failureLatchInnerError.GetFailure(), "later inner error" ) == 0))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("strcmp(failureLatchInnerError.GetFailure(), \"later inner error\") == 0" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 150); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "strcmp(failureLatchInnerError.GetFailure(), \"later inner error\") == 0" ")"); do { *((volatile int*)__null) = 150; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
151 | ||||
152 | MOZ_RELEASE_ASSERT(failureLatch.Failed())do { static_assert( mozilla::detail::AssertionConditionType< decltype(failureLatch.Failed())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(failureLatch.Failed()))), 0) )) { do { } while (false); MOZ_ReportAssertionFailure("failureLatch.Failed()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 152); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "failureLatch.Failed()" ")"); do { *((volatile int*)__null) = 152; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
153 | failureLatch.SetFailureFrom(failureLatchInnerError); | |||
154 | MOZ_RELEASE_ASSERT(failureLatch.Failed())do { static_assert( mozilla::detail::AssertionConditionType< decltype(failureLatch.Failed())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(failureLatch.Failed()))), 0) )) { do { } while (false); MOZ_ReportAssertionFailure("failureLatch.Failed()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 154); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "failureLatch.Failed()" ")"); do { *((volatile int*)__null) = 154; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
155 | ||||
156 | MOZ_RELEASE_ASSERT(failureLatchInnerError.Failed())do { static_assert( mozilla::detail::AssertionConditionType< decltype(failureLatchInnerError.Failed())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(failureLatchInnerError.Failed ()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("failureLatchInnerError.Failed()", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 156); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "failureLatchInnerError.Failed()" ")"); do { *((volatile int*)__null) = 156; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
157 | MOZ_RELEASE_ASSERT(strcmp(failureLatchInnerError.GetFailure(),do { static_assert( mozilla::detail::AssertionConditionType< decltype(strcmp(failureLatchInnerError.GetFailure(), "later inner error" ) == 0)>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(strcmp(failureLatchInnerError.GetFailure(), "later inner error" ) == 0))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("strcmp(failureLatchInnerError.GetFailure(), \"later inner error\") == 0" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 158); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "strcmp(failureLatchInnerError.GetFailure(), \"later inner error\") == 0" ")"); do { *((volatile int*)__null) = 158; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
158 | "later inner error") == 0)do { static_assert( mozilla::detail::AssertionConditionType< decltype(strcmp(failureLatchInnerError.GetFailure(), "later inner error" ) == 0)>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(strcmp(failureLatchInnerError.GetFailure(), "later inner error" ) == 0))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("strcmp(failureLatchInnerError.GetFailure(), \"later inner error\") == 0" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 158); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "strcmp(failureLatchInnerError.GetFailure(), \"later inner error\") == 0" ")"); do { *((volatile int*)__null) = 158; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
159 | } | |||
160 | MOZ_RELEASE_ASSERT(failureLatch.Failed())do { static_assert( mozilla::detail::AssertionConditionType< decltype(failureLatch.Failed())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(failureLatch.Failed()))), 0) )) { do { } while (false); MOZ_ReportAssertionFailure("failureLatch.Failed()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 160); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "failureLatch.Failed()" ")"); do { *((volatile int*)__null) = 160; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
161 | MOZ_RELEASE_ASSERT(strcmp(failureLatch.GetFailure(), "inner error") == 0)do { static_assert( mozilla::detail::AssertionConditionType< decltype(strcmp(failureLatch.GetFailure(), "inner error") == 0 )>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(strcmp(failureLatch.GetFailure(), "inner error") == 0 ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "strcmp(failureLatch.GetFailure(), \"inner error\") == 0", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 161); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "strcmp(failureLatch.GetFailure(), \"inner error\") == 0" ")"); do { *((volatile int*)__null) = 161; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
162 | } | |||
163 | ||||
164 | // Test FAILURELATCH_IMPL_PROXY | |||
165 | { | |||
166 | class Proxy final : public mozilla::FailureLatch { | |||
167 | public: | |||
168 | explicit Proxy(mozilla::FailureLatch& aFailureLatch) | |||
169 | : mFailureLatch(WrapNotNull(&aFailureLatch)) {} | |||
170 | ||||
171 | void Set(mozilla::FailureLatch& aFailureLatch) { | |||
172 | mFailureLatch = WrapNotNull(&aFailureLatch); | |||
173 | } | |||
174 | ||||
175 | FAILURELATCH_IMPL_PROXY(*mFailureLatch)[[nodiscard]] bool Fallible() const final { return static_cast <const ::mozilla::FailureLatch&>(*mFailureLatch) .Fallible (); } void SetFailure(std::string aReason) final { static_cast <::mozilla::FailureLatch&>(*mFailureLatch) .SetFailure (std::move(aReason)); } [[nodiscard]] bool Failed() const final { return static_cast<const ::mozilla::FailureLatch&> (*mFailureLatch) .Failed(); } [[nodiscard]] const char* GetFailure () const final { return static_cast<const ::mozilla::FailureLatch &>(*mFailureLatch) .GetFailure(); } [[nodiscard]] const FailureLatch& SourceFailureLatch() const final { return static_cast <const ::mozilla::FailureLatch&>(*mFailureLatch) .SourceFailureLatch (); } [[nodiscard]] FailureLatch& SourceFailureLatch() final { return static_cast<::mozilla::FailureLatch&>(*mFailureLatch ) .SourceFailureLatch(); } | |||
176 | ||||
177 | private: | |||
178 | mozilla::NotNull<mozilla::FailureLatch*> mFailureLatch; | |||
179 | }; | |||
180 | ||||
181 | Proxy proxy{mozilla::FailureLatchInfallibleSource::Singleton()}; | |||
182 | ||||
183 | MOZ_RELEASE_ASSERT(!proxy.Fallible())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!proxy.Fallible())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!proxy.Fallible()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!proxy.Fallible()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 183); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!proxy.Fallible()" ")"); do { *((volatile int*)__null) = 183; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
184 | MOZ_RELEASE_ASSERT(!proxy.Failed())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!proxy.Failed())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!proxy.Failed()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!proxy.Failed()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 184); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!proxy.Failed()" ")"); do { *((volatile int*)__null) = 184; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
185 | MOZ_RELEASE_ASSERT(!proxy.GetFailure())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!proxy.GetFailure())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!proxy.GetFailure()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!proxy.GetFailure()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 185); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!proxy.GetFailure()" ")"); do { *((volatile int*)__null) = 185; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
186 | MOZ_RELEASE_ASSERT(&proxy.SourceFailureLatch() ==do { static_assert( mozilla::detail::AssertionConditionType< decltype(&proxy.SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource ::Singleton())>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(!!(&proxy.SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()))), 0 ))) { do { } while (false); MOZ_ReportAssertionFailure("&proxy.SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 187); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&proxy.SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()" ")"); do { *((volatile int*)__null) = 187; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
187 | &mozilla::FailureLatchInfallibleSource::Singleton())do { static_assert( mozilla::detail::AssertionConditionType< decltype(&proxy.SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource ::Singleton())>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(!!(&proxy.SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()))), 0 ))) { do { } while (false); MOZ_ReportAssertionFailure("&proxy.SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 187); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&proxy.SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()" ")"); do { *((volatile int*)__null) = 187; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
188 | MOZ_RELEASE_ASSERT(&std::as_const(proxy).SourceFailureLatch() ==do { static_assert( mozilla::detail::AssertionConditionType< decltype(&std::as_const(proxy).SourceFailureLatch() == & mozilla::FailureLatchInfallibleSource::Singleton())>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(&std::as_const(proxy).SourceFailureLatch() == &mozilla ::FailureLatchInfallibleSource::Singleton()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("&std::as_const(proxy).SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 189); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&std::as_const(proxy).SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()" ")"); do { *((volatile int*)__null) = 189; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
189 | &mozilla::FailureLatchInfallibleSource::Singleton())do { static_assert( mozilla::detail::AssertionConditionType< decltype(&std::as_const(proxy).SourceFailureLatch() == & mozilla::FailureLatchInfallibleSource::Singleton())>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(&std::as_const(proxy).SourceFailureLatch() == &mozilla ::FailureLatchInfallibleSource::Singleton()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("&std::as_const(proxy).SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 189); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&std::as_const(proxy).SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()" ")"); do { *((volatile int*)__null) = 189; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
190 | ||||
191 | // Error from proxy. | |||
192 | { | |||
193 | mozilla::FailureLatchSource failureLatch; | |||
194 | proxy.Set(failureLatch); | |||
195 | MOZ_RELEASE_ASSERT(proxy.Fallible())do { static_assert( mozilla::detail::AssertionConditionType< decltype(proxy.Fallible())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(proxy.Fallible()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("proxy.Fallible()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 195); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "proxy.Fallible()" ")"); do { *((volatile int*)__null) = 195; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
196 | MOZ_RELEASE_ASSERT(!proxy.Failed())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!proxy.Failed())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!proxy.Failed()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!proxy.Failed()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 196); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!proxy.Failed()" ")"); do { *((volatile int*)__null) = 196; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
197 | MOZ_RELEASE_ASSERT(!proxy.GetFailure())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!proxy.GetFailure())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!proxy.GetFailure()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!proxy.GetFailure()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 197); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!proxy.GetFailure()" ")"); do { *((volatile int*)__null) = 197; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
198 | MOZ_RELEASE_ASSERT(&proxy.SourceFailureLatch() == &failureLatch)do { static_assert( mozilla::detail::AssertionConditionType< decltype(&proxy.SourceFailureLatch() == &failureLatch )>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(&proxy.SourceFailureLatch() == &failureLatch ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "&proxy.SourceFailureLatch() == &failureLatch", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 198); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&proxy.SourceFailureLatch() == &failureLatch" ")"); do { *((volatile int*)__null) = 198; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
199 | MOZ_RELEASE_ASSERT(&std::as_const(proxy).SourceFailureLatch() ==do { static_assert( mozilla::detail::AssertionConditionType< decltype(&std::as_const(proxy).SourceFailureLatch() == & failureLatch)>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(!!(&std::as_const(proxy).SourceFailureLatch () == &failureLatch))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("&std::as_const(proxy).SourceFailureLatch() == &failureLatch" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 200); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&std::as_const(proxy).SourceFailureLatch() == &failureLatch" ")"); do { *((volatile int*)__null) = 200; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
200 | &failureLatch)do { static_assert( mozilla::detail::AssertionConditionType< decltype(&std::as_const(proxy).SourceFailureLatch() == & failureLatch)>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(!!(&std::as_const(proxy).SourceFailureLatch () == &failureLatch))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("&std::as_const(proxy).SourceFailureLatch() == &failureLatch" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 200); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&std::as_const(proxy).SourceFailureLatch() == &failureLatch" ")"); do { *((volatile int*)__null) = 200; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
201 | ||||
202 | proxy.SetFailure("error"); | |||
203 | MOZ_RELEASE_ASSERT(proxy.Failed())do { static_assert( mozilla::detail::AssertionConditionType< decltype(proxy.Failed())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(proxy.Failed()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("proxy.Failed()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 203); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "proxy.Failed()" ")"); do { *((volatile int*)__null) = 203; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
204 | MOZ_RELEASE_ASSERT(strcmp(proxy.GetFailure(), "error") == 0)do { static_assert( mozilla::detail::AssertionConditionType< decltype(strcmp(proxy.GetFailure(), "error") == 0)>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(strcmp(proxy.GetFailure(), "error") == 0))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("strcmp(proxy.GetFailure(), \"error\") == 0" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 204); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "strcmp(proxy.GetFailure(), \"error\") == 0" ")"); do { *((volatile int*)__null) = 204; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
205 | MOZ_RELEASE_ASSERT(failureLatch.Failed())do { static_assert( mozilla::detail::AssertionConditionType< decltype(failureLatch.Failed())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(failureLatch.Failed()))), 0) )) { do { } while (false); MOZ_ReportAssertionFailure("failureLatch.Failed()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 205); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "failureLatch.Failed()" ")"); do { *((volatile int*)__null) = 205; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
206 | MOZ_RELEASE_ASSERT(strcmp(failureLatch.GetFailure(), "error") == 0)do { static_assert( mozilla::detail::AssertionConditionType< decltype(strcmp(failureLatch.GetFailure(), "error") == 0)> ::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(strcmp(failureLatch.GetFailure(), "error") == 0))), 0 ))) { do { } while (false); MOZ_ReportAssertionFailure("strcmp(failureLatch.GetFailure(), \"error\") == 0" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 206); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "strcmp(failureLatch.GetFailure(), \"error\") == 0" ")"); do { *((volatile int*)__null) = 206; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
207 | ||||
208 | // Don't forget to stop pointing at soon-to-be-destroyed object. | |||
209 | proxy.Set(mozilla::FailureLatchInfallibleSource::Singleton()); | |||
210 | } | |||
211 | ||||
212 | // Error from proxy's origin. | |||
213 | { | |||
214 | mozilla::FailureLatchSource failureLatch; | |||
215 | proxy.Set(failureLatch); | |||
216 | MOZ_RELEASE_ASSERT(proxy.Fallible())do { static_assert( mozilla::detail::AssertionConditionType< decltype(proxy.Fallible())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(proxy.Fallible()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("proxy.Fallible()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 216); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "proxy.Fallible()" ")"); do { *((volatile int*)__null) = 216; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
217 | MOZ_RELEASE_ASSERT(!proxy.Failed())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!proxy.Failed())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!proxy.Failed()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!proxy.Failed()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 217); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!proxy.Failed()" ")"); do { *((volatile int*)__null) = 217; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
218 | MOZ_RELEASE_ASSERT(!proxy.GetFailure())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!proxy.GetFailure())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!proxy.GetFailure()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!proxy.GetFailure()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 218); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!proxy.GetFailure()" ")"); do { *((volatile int*)__null) = 218; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
219 | MOZ_RELEASE_ASSERT(&proxy.SourceFailureLatch() == &failureLatch)do { static_assert( mozilla::detail::AssertionConditionType< decltype(&proxy.SourceFailureLatch() == &failureLatch )>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(&proxy.SourceFailureLatch() == &failureLatch ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "&proxy.SourceFailureLatch() == &failureLatch", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 219); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&proxy.SourceFailureLatch() == &failureLatch" ")"); do { *((volatile int*)__null) = 219; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
220 | MOZ_RELEASE_ASSERT(&std::as_const(proxy).SourceFailureLatch() ==do { static_assert( mozilla::detail::AssertionConditionType< decltype(&std::as_const(proxy).SourceFailureLatch() == & failureLatch)>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(!!(&std::as_const(proxy).SourceFailureLatch () == &failureLatch))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("&std::as_const(proxy).SourceFailureLatch() == &failureLatch" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 221); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&std::as_const(proxy).SourceFailureLatch() == &failureLatch" ")"); do { *((volatile int*)__null) = 221; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
221 | &failureLatch)do { static_assert( mozilla::detail::AssertionConditionType< decltype(&std::as_const(proxy).SourceFailureLatch() == & failureLatch)>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(!!(&std::as_const(proxy).SourceFailureLatch () == &failureLatch))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("&std::as_const(proxy).SourceFailureLatch() == &failureLatch" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 221); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&std::as_const(proxy).SourceFailureLatch() == &failureLatch" ")"); do { *((volatile int*)__null) = 221; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
222 | ||||
223 | failureLatch.SetFailure("error"); | |||
224 | MOZ_RELEASE_ASSERT(proxy.Failed())do { static_assert( mozilla::detail::AssertionConditionType< decltype(proxy.Failed())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(proxy.Failed()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("proxy.Failed()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 224); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "proxy.Failed()" ")"); do { *((volatile int*)__null) = 224; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
225 | MOZ_RELEASE_ASSERT(strcmp(proxy.GetFailure(), "error") == 0)do { static_assert( mozilla::detail::AssertionConditionType< decltype(strcmp(proxy.GetFailure(), "error") == 0)>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(strcmp(proxy.GetFailure(), "error") == 0))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("strcmp(proxy.GetFailure(), \"error\") == 0" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 225); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "strcmp(proxy.GetFailure(), \"error\") == 0" ")"); do { *((volatile int*)__null) = 225; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
226 | MOZ_RELEASE_ASSERT(failureLatch.Failed())do { static_assert( mozilla::detail::AssertionConditionType< decltype(failureLatch.Failed())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(failureLatch.Failed()))), 0) )) { do { } while (false); MOZ_ReportAssertionFailure("failureLatch.Failed()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 226); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "failureLatch.Failed()" ")"); do { *((volatile int*)__null) = 226; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
227 | MOZ_RELEASE_ASSERT(strcmp(failureLatch.GetFailure(), "error") == 0)do { static_assert( mozilla::detail::AssertionConditionType< decltype(strcmp(failureLatch.GetFailure(), "error") == 0)> ::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(strcmp(failureLatch.GetFailure(), "error") == 0))), 0 ))) { do { } while (false); MOZ_ReportAssertionFailure("strcmp(failureLatch.GetFailure(), \"error\") == 0" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 227); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "strcmp(failureLatch.GetFailure(), \"error\") == 0" ")"); do { *((volatile int*)__null) = 227; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
228 | ||||
229 | // Don't forget to stop pointing at soon-to-be-destroyed object. | |||
230 | proxy.Set(mozilla::FailureLatchInfallibleSource::Singleton()); | |||
231 | } | |||
232 | ||||
233 | MOZ_RELEASE_ASSERT(!proxy.Fallible())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!proxy.Fallible())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!proxy.Fallible()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!proxy.Fallible()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 233); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!proxy.Fallible()" ")"); do { *((volatile int*)__null) = 233; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
234 | MOZ_RELEASE_ASSERT(!proxy.Failed())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!proxy.Failed())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!proxy.Failed()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!proxy.Failed()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 234); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!proxy.Failed()" ")"); do { *((volatile int*)__null) = 234; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
235 | MOZ_RELEASE_ASSERT(!proxy.GetFailure())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!proxy.GetFailure())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!proxy.GetFailure()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!proxy.GetFailure()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 235); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!proxy.GetFailure()" ")"); do { *((volatile int*)__null) = 235; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
236 | MOZ_RELEASE_ASSERT(&proxy.SourceFailureLatch() ==do { static_assert( mozilla::detail::AssertionConditionType< decltype(&proxy.SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource ::Singleton())>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(!!(&proxy.SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()))), 0 ))) { do { } while (false); MOZ_ReportAssertionFailure("&proxy.SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 237); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&proxy.SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()" ")"); do { *((volatile int*)__null) = 237; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
237 | &mozilla::FailureLatchInfallibleSource::Singleton())do { static_assert( mozilla::detail::AssertionConditionType< decltype(&proxy.SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource ::Singleton())>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(!!(&proxy.SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()))), 0 ))) { do { } while (false); MOZ_ReportAssertionFailure("&proxy.SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 237); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&proxy.SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()" ")"); do { *((volatile int*)__null) = 237; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
238 | MOZ_RELEASE_ASSERT(&std::as_const(proxy).SourceFailureLatch() ==do { static_assert( mozilla::detail::AssertionConditionType< decltype(&std::as_const(proxy).SourceFailureLatch() == & mozilla::FailureLatchInfallibleSource::Singleton())>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(&std::as_const(proxy).SourceFailureLatch() == &mozilla ::FailureLatchInfallibleSource::Singleton()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("&std::as_const(proxy).SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 239); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&std::as_const(proxy).SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()" ")"); do { *((volatile int*)__null) = 239; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
239 | &mozilla::FailureLatchInfallibleSource::Singleton())do { static_assert( mozilla::detail::AssertionConditionType< decltype(&std::as_const(proxy).SourceFailureLatch() == & mozilla::FailureLatchInfallibleSource::Singleton())>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(&std::as_const(proxy).SourceFailureLatch() == &mozilla ::FailureLatchInfallibleSource::Singleton()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("&std::as_const(proxy).SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 239); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&std::as_const(proxy).SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()" ")"); do { *((volatile int*)__null) = 239; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
240 | } | |||
241 | ||||
242 | // Test FAILURELATCH_IMPL_PROXY_OR_INFALLIBLE | |||
243 | { | |||
244 | class ProxyOrNull final : public mozilla::FailureLatch { | |||
245 | public: | |||
246 | ProxyOrNull() = default; | |||
247 | ||||
248 | void Set(mozilla::FailureLatch* aFailureLatchOrNull) { | |||
249 | mFailureLatchOrNull = aFailureLatchOrNull; | |||
250 | } | |||
251 | ||||
252 | FAILURELATCH_IMPL_PROXY_OR_INFALLIBLE(mFailureLatchOrNull, ProxyOrNull)[[nodiscard]] bool Fallible() const final { return mFailureLatchOrNull ? static_cast<const ::mozilla::FailureLatch*>(mFailureLatchOrNull ) ->Fallible() : false; } void SetFailure(std::string aReason ) final { if (mFailureLatchOrNull) { static_cast<::mozilla ::FailureLatch*>(mFailureLatchOrNull) ->SetFailure(std:: move(aReason)); } else { do { static_assert( mozilla::detail:: AssertionConditionType<decltype(false)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(false))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("false" " (" "SetFailure in infallible " "ProxyOrNull" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 252); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "false" ") (" "SetFailure in infallible " "ProxyOrNull" ")"); do { * ((volatile int*)__null) = 252; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); } } [[nodiscard]] bool Failed() const final { return mFailureLatchOrNull ? static_cast <const ::mozilla::FailureLatch*>(mFailureLatchOrNull) -> Failed() : false; } [[nodiscard]] const char* GetFailure() const final { return mFailureLatchOrNull ? static_cast<const :: mozilla::FailureLatch*>(mFailureLatchOrNull) ->GetFailure () : nullptr; } [[nodiscard]] const FailureLatch& SourceFailureLatch () const final { return mFailureLatchOrNull ? static_cast< const ::mozilla::FailureLatch*>(mFailureLatchOrNull) -> SourceFailureLatch() : ::mozilla::FailureLatchInfallibleSource ::Singleton(); } [[nodiscard]] FailureLatch& SourceFailureLatch () final { return mFailureLatchOrNull ? static_cast<::mozilla ::FailureLatch*>(mFailureLatchOrNull) ->SourceFailureLatch () : ::mozilla::FailureLatchInfallibleSource::Singleton(); } | |||
253 | ||||
254 | private: | |||
255 | mozilla::FailureLatch* mFailureLatchOrNull = nullptr; | |||
256 | }; | |||
257 | ||||
258 | ProxyOrNull proxy; | |||
259 | ||||
260 | MOZ_RELEASE_ASSERT(!proxy.Fallible())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!proxy.Fallible())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!proxy.Fallible()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!proxy.Fallible()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 260); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!proxy.Fallible()" ")"); do { *((volatile int*)__null) = 260; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
261 | MOZ_RELEASE_ASSERT(!proxy.Failed())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!proxy.Failed())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!proxy.Failed()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!proxy.Failed()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 261); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!proxy.Failed()" ")"); do { *((volatile int*)__null) = 261; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
262 | MOZ_RELEASE_ASSERT(!proxy.GetFailure())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!proxy.GetFailure())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!proxy.GetFailure()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!proxy.GetFailure()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 262); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!proxy.GetFailure()" ")"); do { *((volatile int*)__null) = 262; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
263 | MOZ_RELEASE_ASSERT(&proxy.SourceFailureLatch() ==do { static_assert( mozilla::detail::AssertionConditionType< decltype(&proxy.SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource ::Singleton())>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(!!(&proxy.SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()))), 0 ))) { do { } while (false); MOZ_ReportAssertionFailure("&proxy.SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 264); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&proxy.SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()" ")"); do { *((volatile int*)__null) = 264; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
264 | &mozilla::FailureLatchInfallibleSource::Singleton())do { static_assert( mozilla::detail::AssertionConditionType< decltype(&proxy.SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource ::Singleton())>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(!!(&proxy.SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()))), 0 ))) { do { } while (false); MOZ_ReportAssertionFailure("&proxy.SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 264); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&proxy.SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()" ")"); do { *((volatile int*)__null) = 264; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
265 | MOZ_RELEASE_ASSERT(&std::as_const(proxy).SourceFailureLatch() ==do { static_assert( mozilla::detail::AssertionConditionType< decltype(&std::as_const(proxy).SourceFailureLatch() == & mozilla::FailureLatchInfallibleSource::Singleton())>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(&std::as_const(proxy).SourceFailureLatch() == &mozilla ::FailureLatchInfallibleSource::Singleton()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("&std::as_const(proxy).SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 266); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&std::as_const(proxy).SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()" ")"); do { *((volatile int*)__null) = 266; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
266 | &mozilla::FailureLatchInfallibleSource::Singleton())do { static_assert( mozilla::detail::AssertionConditionType< decltype(&std::as_const(proxy).SourceFailureLatch() == & mozilla::FailureLatchInfallibleSource::Singleton())>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(&std::as_const(proxy).SourceFailureLatch() == &mozilla ::FailureLatchInfallibleSource::Singleton()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("&std::as_const(proxy).SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 266); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&std::as_const(proxy).SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()" ")"); do { *((volatile int*)__null) = 266; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
267 | ||||
268 | // Error from proxy. | |||
269 | { | |||
270 | mozilla::FailureLatchSource failureLatch; | |||
271 | proxy.Set(&failureLatch); | |||
272 | MOZ_RELEASE_ASSERT(proxy.Fallible())do { static_assert( mozilla::detail::AssertionConditionType< decltype(proxy.Fallible())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(proxy.Fallible()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("proxy.Fallible()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 272); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "proxy.Fallible()" ")"); do { *((volatile int*)__null) = 272; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
273 | MOZ_RELEASE_ASSERT(!proxy.Failed())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!proxy.Failed())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!proxy.Failed()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!proxy.Failed()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 273); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!proxy.Failed()" ")"); do { *((volatile int*)__null) = 273; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
274 | MOZ_RELEASE_ASSERT(!proxy.GetFailure())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!proxy.GetFailure())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!proxy.GetFailure()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!proxy.GetFailure()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 274); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!proxy.GetFailure()" ")"); do { *((volatile int*)__null) = 274; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
275 | MOZ_RELEASE_ASSERT(&proxy.SourceFailureLatch() == &failureLatch)do { static_assert( mozilla::detail::AssertionConditionType< decltype(&proxy.SourceFailureLatch() == &failureLatch )>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(&proxy.SourceFailureLatch() == &failureLatch ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "&proxy.SourceFailureLatch() == &failureLatch", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 275); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&proxy.SourceFailureLatch() == &failureLatch" ")"); do { *((volatile int*)__null) = 275; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
276 | MOZ_RELEASE_ASSERT(&std::as_const(proxy).SourceFailureLatch() ==do { static_assert( mozilla::detail::AssertionConditionType< decltype(&std::as_const(proxy).SourceFailureLatch() == & failureLatch)>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(!!(&std::as_const(proxy).SourceFailureLatch () == &failureLatch))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("&std::as_const(proxy).SourceFailureLatch() == &failureLatch" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 277); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&std::as_const(proxy).SourceFailureLatch() == &failureLatch" ")"); do { *((volatile int*)__null) = 277; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
277 | &failureLatch)do { static_assert( mozilla::detail::AssertionConditionType< decltype(&std::as_const(proxy).SourceFailureLatch() == & failureLatch)>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(!!(&std::as_const(proxy).SourceFailureLatch () == &failureLatch))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("&std::as_const(proxy).SourceFailureLatch() == &failureLatch" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 277); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&std::as_const(proxy).SourceFailureLatch() == &failureLatch" ")"); do { *((volatile int*)__null) = 277; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
278 | ||||
279 | proxy.SetFailure("error"); | |||
280 | MOZ_RELEASE_ASSERT(proxy.Failed())do { static_assert( mozilla::detail::AssertionConditionType< decltype(proxy.Failed())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(proxy.Failed()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("proxy.Failed()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 280); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "proxy.Failed()" ")"); do { *((volatile int*)__null) = 280; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
281 | MOZ_RELEASE_ASSERT(strcmp(proxy.GetFailure(), "error") == 0)do { static_assert( mozilla::detail::AssertionConditionType< decltype(strcmp(proxy.GetFailure(), "error") == 0)>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(strcmp(proxy.GetFailure(), "error") == 0))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("strcmp(proxy.GetFailure(), \"error\") == 0" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 281); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "strcmp(proxy.GetFailure(), \"error\") == 0" ")"); do { *((volatile int*)__null) = 281; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
282 | MOZ_RELEASE_ASSERT(failureLatch.Failed())do { static_assert( mozilla::detail::AssertionConditionType< decltype(failureLatch.Failed())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(failureLatch.Failed()))), 0) )) { do { } while (false); MOZ_ReportAssertionFailure("failureLatch.Failed()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 282); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "failureLatch.Failed()" ")"); do { *((volatile int*)__null) = 282; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
283 | MOZ_RELEASE_ASSERT(strcmp(failureLatch.GetFailure(), "error") == 0)do { static_assert( mozilla::detail::AssertionConditionType< decltype(strcmp(failureLatch.GetFailure(), "error") == 0)> ::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(strcmp(failureLatch.GetFailure(), "error") == 0))), 0 ))) { do { } while (false); MOZ_ReportAssertionFailure("strcmp(failureLatch.GetFailure(), \"error\") == 0" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 283); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "strcmp(failureLatch.GetFailure(), \"error\") == 0" ")"); do { *((volatile int*)__null) = 283; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
284 | ||||
285 | // Don't forget to stop pointing at soon-to-be-destroyed object. | |||
286 | proxy.Set(nullptr); | |||
287 | } | |||
288 | ||||
289 | // Error from proxy's origin. | |||
290 | { | |||
291 | mozilla::FailureLatchSource failureLatch; | |||
292 | proxy.Set(&failureLatch); | |||
293 | MOZ_RELEASE_ASSERT(proxy.Fallible())do { static_assert( mozilla::detail::AssertionConditionType< decltype(proxy.Fallible())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(proxy.Fallible()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("proxy.Fallible()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 293); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "proxy.Fallible()" ")"); do { *((volatile int*)__null) = 293; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
294 | MOZ_RELEASE_ASSERT(!proxy.Failed())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!proxy.Failed())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!proxy.Failed()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!proxy.Failed()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 294); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!proxy.Failed()" ")"); do { *((volatile int*)__null) = 294; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
295 | MOZ_RELEASE_ASSERT(!proxy.GetFailure())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!proxy.GetFailure())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!proxy.GetFailure()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!proxy.GetFailure()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 295); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!proxy.GetFailure()" ")"); do { *((volatile int*)__null) = 295; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
296 | MOZ_RELEASE_ASSERT(&proxy.SourceFailureLatch() == &failureLatch)do { static_assert( mozilla::detail::AssertionConditionType< decltype(&proxy.SourceFailureLatch() == &failureLatch )>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(&proxy.SourceFailureLatch() == &failureLatch ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "&proxy.SourceFailureLatch() == &failureLatch", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 296); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&proxy.SourceFailureLatch() == &failureLatch" ")"); do { *((volatile int*)__null) = 296; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
297 | MOZ_RELEASE_ASSERT(&std::as_const(proxy).SourceFailureLatch() ==do { static_assert( mozilla::detail::AssertionConditionType< decltype(&std::as_const(proxy).SourceFailureLatch() == & failureLatch)>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(!!(&std::as_const(proxy).SourceFailureLatch () == &failureLatch))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("&std::as_const(proxy).SourceFailureLatch() == &failureLatch" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 298); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&std::as_const(proxy).SourceFailureLatch() == &failureLatch" ")"); do { *((volatile int*)__null) = 298; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
298 | &failureLatch)do { static_assert( mozilla::detail::AssertionConditionType< decltype(&std::as_const(proxy).SourceFailureLatch() == & failureLatch)>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(!!(&std::as_const(proxy).SourceFailureLatch () == &failureLatch))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("&std::as_const(proxy).SourceFailureLatch() == &failureLatch" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 298); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&std::as_const(proxy).SourceFailureLatch() == &failureLatch" ")"); do { *((volatile int*)__null) = 298; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
299 | ||||
300 | failureLatch.SetFailure("error"); | |||
301 | MOZ_RELEASE_ASSERT(proxy.Failed())do { static_assert( mozilla::detail::AssertionConditionType< decltype(proxy.Failed())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(proxy.Failed()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("proxy.Failed()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 301); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "proxy.Failed()" ")"); do { *((volatile int*)__null) = 301; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
302 | MOZ_RELEASE_ASSERT(strcmp(proxy.GetFailure(), "error") == 0)do { static_assert( mozilla::detail::AssertionConditionType< decltype(strcmp(proxy.GetFailure(), "error") == 0)>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(strcmp(proxy.GetFailure(), "error") == 0))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("strcmp(proxy.GetFailure(), \"error\") == 0" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 302); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "strcmp(proxy.GetFailure(), \"error\") == 0" ")"); do { *((volatile int*)__null) = 302; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
303 | MOZ_RELEASE_ASSERT(failureLatch.Failed())do { static_assert( mozilla::detail::AssertionConditionType< decltype(failureLatch.Failed())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(failureLatch.Failed()))), 0) )) { do { } while (false); MOZ_ReportAssertionFailure("failureLatch.Failed()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 303); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "failureLatch.Failed()" ")"); do { *((volatile int*)__null) = 303; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
304 | MOZ_RELEASE_ASSERT(strcmp(failureLatch.GetFailure(), "error") == 0)do { static_assert( mozilla::detail::AssertionConditionType< decltype(strcmp(failureLatch.GetFailure(), "error") == 0)> ::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(strcmp(failureLatch.GetFailure(), "error") == 0))), 0 ))) { do { } while (false); MOZ_ReportAssertionFailure("strcmp(failureLatch.GetFailure(), \"error\") == 0" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 304); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "strcmp(failureLatch.GetFailure(), \"error\") == 0" ")"); do { *((volatile int*)__null) = 304; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
305 | ||||
306 | // Don't forget to stop pointing at soon-to-be-destroyed object. | |||
307 | proxy.Set(nullptr); | |||
308 | } | |||
309 | ||||
310 | MOZ_RELEASE_ASSERT(!proxy.Fallible())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!proxy.Fallible())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!proxy.Fallible()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!proxy.Fallible()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 310); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!proxy.Fallible()" ")"); do { *((volatile int*)__null) = 310; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
311 | MOZ_RELEASE_ASSERT(!proxy.Failed())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!proxy.Failed())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!proxy.Failed()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!proxy.Failed()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 311); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!proxy.Failed()" ")"); do { *((volatile int*)__null) = 311; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
312 | MOZ_RELEASE_ASSERT(!proxy.GetFailure())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!proxy.GetFailure())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!proxy.GetFailure()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!proxy.GetFailure()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 312); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!proxy.GetFailure()" ")"); do { *((volatile int*)__null) = 312; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
313 | MOZ_RELEASE_ASSERT(&proxy.SourceFailureLatch() ==do { static_assert( mozilla::detail::AssertionConditionType< decltype(&proxy.SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource ::Singleton())>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(!!(&proxy.SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()))), 0 ))) { do { } while (false); MOZ_ReportAssertionFailure("&proxy.SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 314); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&proxy.SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()" ")"); do { *((volatile int*)__null) = 314; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
314 | &mozilla::FailureLatchInfallibleSource::Singleton())do { static_assert( mozilla::detail::AssertionConditionType< decltype(&proxy.SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource ::Singleton())>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(!!(&proxy.SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()))), 0 ))) { do { } while (false); MOZ_ReportAssertionFailure("&proxy.SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 314); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&proxy.SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()" ")"); do { *((volatile int*)__null) = 314; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
315 | MOZ_RELEASE_ASSERT(&std::as_const(proxy).SourceFailureLatch() ==do { static_assert( mozilla::detail::AssertionConditionType< decltype(&std::as_const(proxy).SourceFailureLatch() == & mozilla::FailureLatchInfallibleSource::Singleton())>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(&std::as_const(proxy).SourceFailureLatch() == &mozilla ::FailureLatchInfallibleSource::Singleton()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("&std::as_const(proxy).SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 316); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&std::as_const(proxy).SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()" ")"); do { *((volatile int*)__null) = 316; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
316 | &mozilla::FailureLatchInfallibleSource::Singleton())do { static_assert( mozilla::detail::AssertionConditionType< decltype(&std::as_const(proxy).SourceFailureLatch() == & mozilla::FailureLatchInfallibleSource::Singleton())>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(&std::as_const(proxy).SourceFailureLatch() == &mozilla ::FailureLatchInfallibleSource::Singleton()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("&std::as_const(proxy).SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 316); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&std::as_const(proxy).SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()" ")"); do { *((volatile int*)__null) = 316; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
317 | } | |||
318 | ||||
319 | printf("TestFailureLatch done\n"); | |||
320 | } | |||
321 | ||||
322 | void TestProfilerUtils() { | |||
323 | printf("TestProfilerUtils...\n"); | |||
324 | ||||
325 | { | |||
326 | using mozilla::baseprofiler::BaseProfilerProcessId; | |||
327 | using Number = BaseProfilerProcessId::NumberType; | |||
328 | static constexpr Number scMaxNumber = std::numeric_limits<Number>::max(); | |||
329 | ||||
330 | static_assert( | |||
331 | BaseProfilerProcessId{}.ToNumber() == 0, | |||
332 | "These tests assume that the unspecified process id number is 0; " | |||
333 | "if this fails, please update these tests accordingly"); | |||
334 | ||||
335 | static_assert(!BaseProfilerProcessId{}.IsSpecified()); | |||
336 | static_assert(!BaseProfilerProcessId::FromNumber(0).IsSpecified()); | |||
337 | static_assert(BaseProfilerProcessId::FromNumber(1).IsSpecified()); | |||
338 | static_assert(BaseProfilerProcessId::FromNumber(123).IsSpecified()); | |||
339 | static_assert(BaseProfilerProcessId::FromNumber(scMaxNumber).IsSpecified()); | |||
340 | ||||
341 | static_assert(BaseProfilerProcessId::FromNumber(Number(1)).ToNumber() == | |||
342 | Number(1)); | |||
343 | static_assert(BaseProfilerProcessId::FromNumber(Number(123)).ToNumber() == | |||
344 | Number(123)); | |||
345 | static_assert(BaseProfilerProcessId::FromNumber(scMaxNumber).ToNumber() == | |||
346 | scMaxNumber); | |||
347 | ||||
348 | static_assert(BaseProfilerProcessId{} == BaseProfilerProcessId{}); | |||
349 | static_assert(BaseProfilerProcessId::FromNumber(Number(123)) == | |||
350 | BaseProfilerProcessId::FromNumber(Number(123))); | |||
351 | static_assert(BaseProfilerProcessId{} != | |||
352 | BaseProfilerProcessId::FromNumber(Number(123))); | |||
353 | static_assert(BaseProfilerProcessId::FromNumber(Number(123)) != | |||
354 | BaseProfilerProcessId{}); | |||
355 | static_assert(BaseProfilerProcessId::FromNumber(Number(123)) != | |||
356 | BaseProfilerProcessId::FromNumber(scMaxNumber)); | |||
357 | static_assert(BaseProfilerProcessId::FromNumber(scMaxNumber) != | |||
358 | BaseProfilerProcessId::FromNumber(Number(123))); | |||
359 | ||||
360 | // Verify trivial-copyability by memcpy'ing to&from same-size storage. | |||
361 | static_assert(std::is_trivially_copyable_v<BaseProfilerProcessId>); | |||
362 | BaseProfilerProcessId pid; | |||
363 | MOZ_RELEASE_ASSERT(!pid.IsSpecified())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!pid.IsSpecified())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!pid.IsSpecified()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!pid.IsSpecified()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 363); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!pid.IsSpecified()" ")"); do { *((volatile int*)__null) = 363; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
364 | Number pidStorage; | |||
365 | static_assert(sizeof(pidStorage) == sizeof(pid)); | |||
366 | // Copy from BaseProfilerProcessId to storage. Note: We cannot assume that | |||
367 | // this is equal to what ToNumber() gives us. All we can do is verify that | |||
368 | // copying from storage back to BaseProfilerProcessId works as expected. | |||
369 | std::memcpy(&pidStorage, &pid, sizeof(pidStorage)); | |||
370 | BaseProfilerProcessId pid2 = BaseProfilerProcessId::FromNumber(2); | |||
371 | MOZ_RELEASE_ASSERT(pid2.IsSpecified())do { static_assert( mozilla::detail::AssertionConditionType< decltype(pid2.IsSpecified())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(pid2.IsSpecified()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("pid2.IsSpecified()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 371); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "pid2.IsSpecified()" ")"); do { *((volatile int*)__null) = 371; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
372 | std::memcpy(&pid2, &pidStorage, sizeof(pid)); | |||
373 | MOZ_RELEASE_ASSERT(!pid2.IsSpecified())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!pid2.IsSpecified())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!pid2.IsSpecified()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!pid2.IsSpecified()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 373); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!pid2.IsSpecified()" ")"); do { *((volatile int*)__null) = 373; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
374 | ||||
375 | pid = BaseProfilerProcessId::FromNumber(123); | |||
376 | std::memcpy(&pidStorage, &pid, sizeof(pidStorage)); | |||
377 | pid2 = BaseProfilerProcessId{}; | |||
378 | MOZ_RELEASE_ASSERT(!pid2.IsSpecified())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!pid2.IsSpecified())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!pid2.IsSpecified()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!pid2.IsSpecified()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 378); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!pid2.IsSpecified()" ")"); do { *((volatile int*)__null) = 378; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
379 | std::memcpy(&pid2, &pidStorage, sizeof(pid)); | |||
380 | MOZ_RELEASE_ASSERT(pid2.IsSpecified())do { static_assert( mozilla::detail::AssertionConditionType< decltype(pid2.IsSpecified())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(pid2.IsSpecified()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("pid2.IsSpecified()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 380); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "pid2.IsSpecified()" ")"); do { *((volatile int*)__null) = 380; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
381 | MOZ_RELEASE_ASSERT(pid2.ToNumber() == 123)do { static_assert( mozilla::detail::AssertionConditionType< decltype(pid2.ToNumber() == 123)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(pid2.ToNumber() == 123))), 0 ))) { do { } while (false); MOZ_ReportAssertionFailure("pid2.ToNumber() == 123" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 381); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "pid2.ToNumber() == 123" ")"); do { *((volatile int*)__null) = 381; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
382 | ||||
383 | // No conversions to/from numbers. | |||
384 | static_assert(!std::is_constructible_v<BaseProfilerProcessId, Number>); | |||
385 | static_assert(!std::is_assignable_v<BaseProfilerProcessId, Number>); | |||
386 | static_assert(!std::is_constructible_v<Number, BaseProfilerProcessId>); | |||
387 | static_assert(!std::is_assignable_v<Number, BaseProfilerProcessId>); | |||
388 | ||||
389 | static_assert( | |||
390 | std::is_same_v< | |||
391 | decltype(mozilla::baseprofiler::profiler_current_process_id()), | |||
392 | BaseProfilerProcessId>); | |||
393 | MOZ_RELEASE_ASSERT(do { static_assert( mozilla::detail::AssertionConditionType< decltype(mozilla::baseprofiler::profiler_current_process_id() .IsSpecified())>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(!!(mozilla::baseprofiler::profiler_current_process_id ().IsSpecified()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("mozilla::baseprofiler::profiler_current_process_id().IsSpecified()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 394); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::profiler_current_process_id().IsSpecified()" ")"); do { *((volatile int*)__null) = 394; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
394 | mozilla::baseprofiler::profiler_current_process_id().IsSpecified())do { static_assert( mozilla::detail::AssertionConditionType< decltype(mozilla::baseprofiler::profiler_current_process_id() .IsSpecified())>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(!!(mozilla::baseprofiler::profiler_current_process_id ().IsSpecified()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("mozilla::baseprofiler::profiler_current_process_id().IsSpecified()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 394); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::profiler_current_process_id().IsSpecified()" ")"); do { *((volatile int*)__null) = 394; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
395 | } | |||
396 | ||||
397 | { | |||
398 | mozilla::baseprofiler::profiler_init_main_thread_id(); | |||
399 | ||||
400 | using mozilla::baseprofiler::BaseProfilerThreadId; | |||
401 | using Number = BaseProfilerThreadId::NumberType; | |||
402 | static constexpr Number scMaxNumber = std::numeric_limits<Number>::max(); | |||
403 | ||||
404 | static_assert( | |||
405 | BaseProfilerThreadId{}.ToNumber() == 0, | |||
406 | "These tests assume that the unspecified thread id number is 0; " | |||
407 | "if this fails, please update these tests accordingly"); | |||
408 | ||||
409 | static_assert(!BaseProfilerThreadId{}.IsSpecified()); | |||
410 | static_assert(!BaseProfilerThreadId::FromNumber(0).IsSpecified()); | |||
411 | static_assert(BaseProfilerThreadId::FromNumber(1).IsSpecified()); | |||
412 | static_assert(BaseProfilerThreadId::FromNumber(123).IsSpecified()); | |||
413 | static_assert(BaseProfilerThreadId::FromNumber(scMaxNumber).IsSpecified()); | |||
414 | ||||
415 | static_assert(BaseProfilerThreadId::FromNumber(Number(1)).ToNumber() == | |||
416 | Number(1)); | |||
417 | static_assert(BaseProfilerThreadId::FromNumber(Number(123)).ToNumber() == | |||
418 | Number(123)); | |||
419 | static_assert(BaseProfilerThreadId::FromNumber(scMaxNumber).ToNumber() == | |||
420 | scMaxNumber); | |||
421 | ||||
422 | static_assert(BaseProfilerThreadId{} == BaseProfilerThreadId{}); | |||
423 | static_assert(BaseProfilerThreadId::FromNumber(Number(123)) == | |||
424 | BaseProfilerThreadId::FromNumber(Number(123))); | |||
425 | static_assert(BaseProfilerThreadId{} != | |||
426 | BaseProfilerThreadId::FromNumber(Number(123))); | |||
427 | static_assert(BaseProfilerThreadId::FromNumber(Number(123)) != | |||
428 | BaseProfilerThreadId{}); | |||
429 | static_assert(BaseProfilerThreadId::FromNumber(Number(123)) != | |||
430 | BaseProfilerThreadId::FromNumber(scMaxNumber)); | |||
431 | static_assert(BaseProfilerThreadId::FromNumber(scMaxNumber) != | |||
432 | BaseProfilerThreadId::FromNumber(Number(123))); | |||
433 | ||||
434 | // Verify trivial-copyability by memcpy'ing to&from same-size storage. | |||
435 | static_assert(std::is_trivially_copyable_v<BaseProfilerThreadId>); | |||
436 | BaseProfilerThreadId tid; | |||
437 | MOZ_RELEASE_ASSERT(!tid.IsSpecified())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!tid.IsSpecified())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!tid.IsSpecified()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!tid.IsSpecified()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 437); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!tid.IsSpecified()" ")"); do { *((volatile int*)__null) = 437; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
438 | Number tidStorage; | |||
439 | static_assert(sizeof(tidStorage) == sizeof(tid)); | |||
440 | // Copy from BaseProfilerThreadId to storage. Note: We cannot assume that | |||
441 | // this is equal to what ToNumber() gives us. All we can do is verify that | |||
442 | // copying from storage back to BaseProfilerThreadId works as expected. | |||
443 | std::memcpy(&tidStorage, &tid, sizeof(tidStorage)); | |||
444 | BaseProfilerThreadId tid2 = BaseProfilerThreadId::FromNumber(2); | |||
445 | MOZ_RELEASE_ASSERT(tid2.IsSpecified())do { static_assert( mozilla::detail::AssertionConditionType< decltype(tid2.IsSpecified())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(tid2.IsSpecified()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("tid2.IsSpecified()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 445); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "tid2.IsSpecified()" ")"); do { *((volatile int*)__null) = 445; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
446 | std::memcpy(&tid2, &tidStorage, sizeof(tid)); | |||
447 | MOZ_RELEASE_ASSERT(!tid2.IsSpecified())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!tid2.IsSpecified())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!tid2.IsSpecified()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!tid2.IsSpecified()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 447); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!tid2.IsSpecified()" ")"); do { *((volatile int*)__null) = 447; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
448 | ||||
449 | tid = BaseProfilerThreadId::FromNumber(Number(123)); | |||
450 | std::memcpy(&tidStorage, &tid, sizeof(tidStorage)); | |||
451 | tid2 = BaseProfilerThreadId{}; | |||
452 | MOZ_RELEASE_ASSERT(!tid2.IsSpecified())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!tid2.IsSpecified())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!tid2.IsSpecified()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!tid2.IsSpecified()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 452); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!tid2.IsSpecified()" ")"); do { *((volatile int*)__null) = 452; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
453 | std::memcpy(&tid2, &tidStorage, sizeof(tid)); | |||
454 | MOZ_RELEASE_ASSERT(tid2.IsSpecified())do { static_assert( mozilla::detail::AssertionConditionType< decltype(tid2.IsSpecified())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(tid2.IsSpecified()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("tid2.IsSpecified()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 454); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "tid2.IsSpecified()" ")"); do { *((volatile int*)__null) = 454; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
455 | MOZ_RELEASE_ASSERT(tid2.ToNumber() == Number(123))do { static_assert( mozilla::detail::AssertionConditionType< decltype(tid2.ToNumber() == Number(123))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(tid2.ToNumber() == Number(123 )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("tid2.ToNumber() == Number(123)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 455); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "tid2.ToNumber() == Number(123)" ")"); do { *((volatile int*)__null) = 455; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
456 | ||||
457 | // No conversions to/from numbers. | |||
458 | static_assert(!std::is_constructible_v<BaseProfilerThreadId, Number>); | |||
459 | static_assert(!std::is_assignable_v<BaseProfilerThreadId, Number>); | |||
460 | static_assert(!std::is_constructible_v<Number, BaseProfilerThreadId>); | |||
461 | static_assert(!std::is_assignable_v<Number, BaseProfilerThreadId>); | |||
462 | ||||
463 | static_assert(std::is_same_v< | |||
464 | decltype(mozilla::baseprofiler::profiler_current_thread_id()), | |||
465 | BaseProfilerThreadId>); | |||
466 | BaseProfilerThreadId mainTestThreadId = | |||
467 | mozilla::baseprofiler::profiler_current_thread_id(); | |||
468 | MOZ_RELEASE_ASSERT(mainTestThreadId.IsSpecified())do { static_assert( mozilla::detail::AssertionConditionType< decltype(mainTestThreadId.IsSpecified())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(mainTestThreadId.IsSpecified ()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("mainTestThreadId.IsSpecified()", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 468); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mainTestThreadId.IsSpecified()" ")"); do { *((volatile int*)__null) = 468; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
469 | ||||
470 | BaseProfilerThreadId mainThreadId = | |||
471 | mozilla::baseprofiler::profiler_main_thread_id(); | |||
472 | MOZ_RELEASE_ASSERT(mainThreadId.IsSpecified())do { static_assert( mozilla::detail::AssertionConditionType< decltype(mainThreadId.IsSpecified())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(mainThreadId.IsSpecified())) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("mainThreadId.IsSpecified()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 472); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mainThreadId.IsSpecified()" ")"); do { *((volatile int*)__null) = 472; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
473 | ||||
474 | MOZ_RELEASE_ASSERT(mainThreadId == mainTestThreadId,do { static_assert( mozilla::detail::AssertionConditionType< decltype(mainThreadId == mainTestThreadId)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(mainThreadId == mainTestThreadId ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "mainThreadId == mainTestThreadId" " (" "Test should run on the main thread" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 475); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mainThreadId == mainTestThreadId" ") (" "Test should run on the main thread" ")"); do { *((volatile int*)__null) = 475; __attribute__((nomerge)) ::abort(); } while (false); } } while (false) | |||
475 | "Test should run on the main thread")do { static_assert( mozilla::detail::AssertionConditionType< decltype(mainThreadId == mainTestThreadId)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(mainThreadId == mainTestThreadId ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "mainThreadId == mainTestThreadId" " (" "Test should run on the main thread" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 475); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mainThreadId == mainTestThreadId" ") (" "Test should run on the main thread" ")"); do { *((volatile int*)__null) = 475; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | |||
476 | MOZ_RELEASE_ASSERT(mozilla::baseprofiler::profiler_is_main_thread())do { static_assert( mozilla::detail::AssertionConditionType< decltype(mozilla::baseprofiler::profiler_is_main_thread())> ::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(mozilla::baseprofiler::profiler_is_main_thread()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("mozilla::baseprofiler::profiler_is_main_thread()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 476); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::profiler_is_main_thread()" ")"); do { *((volatile int*)__null) = 476; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
477 | ||||
478 | std::thread testThread([&]() { | |||
479 | const BaseProfilerThreadId testThreadId = | |||
480 | mozilla::baseprofiler::profiler_current_thread_id(); | |||
481 | MOZ_RELEASE_ASSERT(testThreadId.IsSpecified())do { static_assert( mozilla::detail::AssertionConditionType< decltype(testThreadId.IsSpecified())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(testThreadId.IsSpecified())) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("testThreadId.IsSpecified()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 481); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "testThreadId.IsSpecified()" ")"); do { *((volatile int*)__null) = 481; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
482 | MOZ_RELEASE_ASSERT(testThreadId != mainThreadId)do { static_assert( mozilla::detail::AssertionConditionType< decltype(testThreadId != mainThreadId)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(testThreadId != mainThreadId ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "testThreadId != mainThreadId", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 482); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "testThreadId != mainThreadId" ")"); do { *((volatile int*)__null) = 482; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
483 | MOZ_RELEASE_ASSERT(!mozilla::baseprofiler::profiler_is_main_thread())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!mozilla::baseprofiler::profiler_is_main_thread())> ::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(!mozilla::baseprofiler::profiler_is_main_thread()))) , 0))) { do { } while (false); MOZ_ReportAssertionFailure("!mozilla::baseprofiler::profiler_is_main_thread()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 483); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!mozilla::baseprofiler::profiler_is_main_thread()" ")"); do { *((volatile int*)__null) = 483; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
484 | }); | |||
485 | testThread.join(); | |||
486 | } | |||
487 | ||||
488 | // No conversions between processes and threads. | |||
489 | static_assert( | |||
490 | !std::is_constructible_v<mozilla::baseprofiler::BaseProfilerThreadId, | |||
491 | mozilla::baseprofiler::BaseProfilerProcessId>); | |||
492 | static_assert( | |||
493 | !std::is_assignable_v<mozilla::baseprofiler::BaseProfilerThreadId, | |||
494 | mozilla::baseprofiler::BaseProfilerProcessId>); | |||
495 | static_assert( | |||
496 | !std::is_constructible_v<mozilla::baseprofiler::BaseProfilerProcessId, | |||
497 | mozilla::baseprofiler::BaseProfilerThreadId>); | |||
498 | static_assert( | |||
499 | !std::is_assignable_v<mozilla::baseprofiler::BaseProfilerProcessId, | |||
500 | mozilla::baseprofiler::BaseProfilerThreadId>); | |||
501 | ||||
502 | printf("TestProfilerUtils done\n"); | |||
503 | } | |||
504 | ||||
505 | void TestBaseAndProfilerDetail() { | |||
506 | printf("TestBaseAndProfilerDetail...\n"); | |||
507 | ||||
508 | { | |||
509 | using mozilla::profiler::detail::FilterHasPid; | |||
510 | ||||
511 | const auto pid123 = | |||
512 | mozilla::baseprofiler::BaseProfilerProcessId::FromNumber(123); | |||
513 | MOZ_RELEASE_ASSERT(FilterHasPid("pid:123", pid123))do { static_assert( mozilla::detail::AssertionConditionType< decltype(FilterHasPid("pid:123", pid123))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(FilterHasPid("pid:123", pid123 )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("FilterHasPid(\"pid:123\", pid123)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 513); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "FilterHasPid(\"pid:123\", pid123)" ")"); do { *((volatile int*)__null) = 513; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
514 | MOZ_RELEASE_ASSERT(!FilterHasPid("", pid123))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!FilterHasPid("", pid123))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!FilterHasPid("", pid123)))) , 0))) { do { } while (false); MOZ_ReportAssertionFailure("!FilterHasPid(\"\", pid123)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 514); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!FilterHasPid(\"\", pid123)" ")"); do { *((volatile int*)__null) = 514; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
515 | MOZ_RELEASE_ASSERT(!FilterHasPid(" ", pid123))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!FilterHasPid(" ", pid123))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!FilterHasPid(" ", pid123))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!FilterHasPid(\" \", pid123)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 515); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!FilterHasPid(\" \", pid123)" ")"); do { *((volatile int*)__null) = 515; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
516 | MOZ_RELEASE_ASSERT(!FilterHasPid("123", pid123))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!FilterHasPid("123", pid123))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!FilterHasPid("123", pid123) ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "!FilterHasPid(\"123\", pid123)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 516); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!FilterHasPid(\"123\", pid123)" ")"); do { *((volatile int*)__null) = 516; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
517 | MOZ_RELEASE_ASSERT(!FilterHasPid("pid", pid123))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!FilterHasPid("pid", pid123))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!FilterHasPid("pid", pid123) ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "!FilterHasPid(\"pid\", pid123)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 517); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!FilterHasPid(\"pid\", pid123)" ")"); do { *((volatile int*)__null) = 517; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
518 | MOZ_RELEASE_ASSERT(!FilterHasPid("pid:", pid123))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!FilterHasPid("pid:", pid123))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!FilterHasPid("pid:", pid123 )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("!FilterHasPid(\"pid:\", pid123)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 518); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!FilterHasPid(\"pid:\", pid123)" ")"); do { *((volatile int*)__null) = 518; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
519 | MOZ_RELEASE_ASSERT(!FilterHasPid("pid=123", pid123))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!FilterHasPid("pid=123", pid123))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!FilterHasPid("pid=123", pid123 )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("!FilterHasPid(\"pid=123\", pid123)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 519); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!FilterHasPid(\"pid=123\", pid123)" ")"); do { *((volatile int*)__null) = 519; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
520 | MOZ_RELEASE_ASSERT(!FilterHasPid("pid:123 ", pid123))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!FilterHasPid("pid:123 ", pid123))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!FilterHasPid("pid:123 ", pid123 )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("!FilterHasPid(\"pid:123 \", pid123)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 520); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!FilterHasPid(\"pid:123 \", pid123)" ")"); do { *((volatile int*)__null) = 520; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
521 | MOZ_RELEASE_ASSERT(!FilterHasPid("pid: 123", pid123))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!FilterHasPid("pid: 123", pid123))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!FilterHasPid("pid: 123", pid123 )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("!FilterHasPid(\"pid: 123\", pid123)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 521); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!FilterHasPid(\"pid: 123\", pid123)" ")"); do { *((volatile int*)__null) = 521; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
522 | MOZ_RELEASE_ASSERT(!FilterHasPid("pid:0123", pid123))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!FilterHasPid("pid:0123", pid123))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!FilterHasPid("pid:0123", pid123 )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("!FilterHasPid(\"pid:0123\", pid123)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 522); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!FilterHasPid(\"pid:0123\", pid123)" ")"); do { *((volatile int*)__null) = 522; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
523 | MOZ_RELEASE_ASSERT(!FilterHasPid("pid:0000000000000000000000123", pid123))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!FilterHasPid("pid:0000000000000000000000123", pid123 ))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(!FilterHasPid("pid:0000000000000000000000123", pid123 )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("!FilterHasPid(\"pid:0000000000000000000000123\", pid123)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 523); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!FilterHasPid(\"pid:0000000000000000000000123\", pid123)" ")"); do { *((volatile int*)__null) = 523; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
524 | MOZ_RELEASE_ASSERT(!FilterHasPid("pid:12", pid123))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!FilterHasPid("pid:12", pid123))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!FilterHasPid("pid:12", pid123 )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("!FilterHasPid(\"pid:12\", pid123)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 524); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!FilterHasPid(\"pid:12\", pid123)" ")"); do { *((volatile int*)__null) = 524; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
525 | MOZ_RELEASE_ASSERT(!FilterHasPid("pid:1234", pid123))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!FilterHasPid("pid:1234", pid123))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!FilterHasPid("pid:1234", pid123 )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("!FilterHasPid(\"pid:1234\", pid123)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 525); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!FilterHasPid(\"pid:1234\", pid123)" ")"); do { *((volatile int*)__null) = 525; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
526 | MOZ_RELEASE_ASSERT(!FilterHasPid("pid:0", pid123))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!FilterHasPid("pid:0", pid123))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!FilterHasPid("pid:0", pid123 )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("!FilterHasPid(\"pid:0\", pid123)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 526); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!FilterHasPid(\"pid:0\", pid123)" ")"); do { *((volatile int*)__null) = 526; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
527 | ||||
528 | using PidNumber = mozilla::baseprofiler::BaseProfilerProcessId::NumberType; | |||
529 | const PidNumber maxNumber = std::numeric_limits<PidNumber>::max(); | |||
530 | const auto maxPid = | |||
531 | mozilla::baseprofiler::BaseProfilerProcessId::FromNumber(maxNumber); | |||
532 | const std::string maxPidString = "pid:" + std::to_string(maxNumber); | |||
533 | MOZ_RELEASE_ASSERT(FilterHasPid(maxPidString.c_str(), maxPid))do { static_assert( mozilla::detail::AssertionConditionType< decltype(FilterHasPid(maxPidString.c_str(), maxPid))>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(FilterHasPid(maxPidString.c_str(), maxPid)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("FilterHasPid(maxPidString.c_str(), maxPid)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 533); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "FilterHasPid(maxPidString.c_str(), maxPid)" ")"); do { *((volatile int*)__null) = 533; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
534 | ||||
535 | const std::string tooBigPidString = maxPidString + "0"; | |||
536 | MOZ_RELEASE_ASSERT(!FilterHasPid(tooBigPidString.c_str(), maxPid))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!FilterHasPid(tooBigPidString.c_str(), maxPid))>:: isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(!FilterHasPid(tooBigPidString.c_str(), maxPid)))), 0 ))) { do { } while (false); MOZ_ReportAssertionFailure("!FilterHasPid(tooBigPidString.c_str(), maxPid)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 536); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!FilterHasPid(tooBigPidString.c_str(), maxPid)" ")"); do { *((volatile int*)__null) = 536; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
537 | } | |||
538 | ||||
539 | { | |||
540 | using mozilla::profiler::detail::FiltersExcludePid; | |||
541 | const auto pid123 = | |||
542 | mozilla::baseprofiler::BaseProfilerProcessId::FromNumber(123); | |||
543 | ||||
544 | MOZ_RELEASE_ASSERT(do { static_assert( mozilla::detail::AssertionConditionType< decltype(!FiltersExcludePid(mozilla::Span<const char*>{ }, pid123))>::isValid, "invalid assertion condition"); if ( (__builtin_expect(!!(!(!!(!FiltersExcludePid(mozilla::Span< const char*>{}, pid123)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("!FiltersExcludePid(mozilla::Span<const char*>{}, pid123)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 545); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!FiltersExcludePid(mozilla::Span<const char*>{}, pid123)" ")"); do { *((volatile int*)__null) = 545; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
545 | !FiltersExcludePid(mozilla::Span<const char*>{}, pid123))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!FiltersExcludePid(mozilla::Span<const char*>{ }, pid123))>::isValid, "invalid assertion condition"); if ( (__builtin_expect(!!(!(!!(!FiltersExcludePid(mozilla::Span< const char*>{}, pid123)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("!FiltersExcludePid(mozilla::Span<const char*>{}, pid123)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 545); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!FiltersExcludePid(mozilla::Span<const char*>{}, pid123)" ")"); do { *((volatile int*)__null) = 545; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
546 | ||||
547 | { | |||
548 | const char* const filters[] = {"main"}; | |||
549 | MOZ_RELEASE_ASSERT(!FiltersExcludePid(filters, pid123))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!FiltersExcludePid(filters, pid123))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!FiltersExcludePid(filters, pid123 )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("!FiltersExcludePid(filters, pid123)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 549); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!FiltersExcludePid(filters, pid123)" ")"); do { *((volatile int*)__null) = 549; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
550 | } | |||
551 | ||||
552 | { | |||
553 | const char* const filters[] = {"main", "pid:123"}; | |||
554 | MOZ_RELEASE_ASSERT(!FiltersExcludePid(filters, pid123))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!FiltersExcludePid(filters, pid123))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!FiltersExcludePid(filters, pid123 )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("!FiltersExcludePid(filters, pid123)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 554); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!FiltersExcludePid(filters, pid123)" ")"); do { *((volatile int*)__null) = 554; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
555 | } | |||
556 | ||||
557 | { | |||
558 | const char* const filters[] = {"main", "pid:456"}; | |||
559 | MOZ_RELEASE_ASSERT(!FiltersExcludePid(filters, pid123))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!FiltersExcludePid(filters, pid123))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!FiltersExcludePid(filters, pid123 )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("!FiltersExcludePid(filters, pid123)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 559); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!FiltersExcludePid(filters, pid123)" ")"); do { *((volatile int*)__null) = 559; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
560 | } | |||
561 | ||||
562 | { | |||
563 | const char* const filters[] = {"pid:123"}; | |||
564 | MOZ_RELEASE_ASSERT(!FiltersExcludePid(filters, pid123))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!FiltersExcludePid(filters, pid123))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!FiltersExcludePid(filters, pid123 )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("!FiltersExcludePid(filters, pid123)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 564); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!FiltersExcludePid(filters, pid123)" ")"); do { *((volatile int*)__null) = 564; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
565 | } | |||
566 | ||||
567 | { | |||
568 | const char* const filters[] = {"pid:123", "pid:456"}; | |||
569 | MOZ_RELEASE_ASSERT(!FiltersExcludePid(filters, pid123))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!FiltersExcludePid(filters, pid123))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!FiltersExcludePid(filters, pid123 )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("!FiltersExcludePid(filters, pid123)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 569); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!FiltersExcludePid(filters, pid123)" ")"); do { *((volatile int*)__null) = 569; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
570 | } | |||
571 | ||||
572 | { | |||
573 | const char* const filters[] = {"pid:456", "pid:123"}; | |||
574 | MOZ_RELEASE_ASSERT(!FiltersExcludePid(filters, pid123))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!FiltersExcludePid(filters, pid123))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!FiltersExcludePid(filters, pid123 )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("!FiltersExcludePid(filters, pid123)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 574); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!FiltersExcludePid(filters, pid123)" ")"); do { *((volatile int*)__null) = 574; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
575 | } | |||
576 | ||||
577 | { | |||
578 | const char* const filters[] = {"pid:456"}; | |||
579 | MOZ_RELEASE_ASSERT(FiltersExcludePid(filters, pid123))do { static_assert( mozilla::detail::AssertionConditionType< decltype(FiltersExcludePid(filters, pid123))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(FiltersExcludePid(filters, pid123 )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("FiltersExcludePid(filters, pid123)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 579); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "FiltersExcludePid(filters, pid123)" ")"); do { *((volatile int*)__null) = 579; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
580 | } | |||
581 | ||||
582 | { | |||
583 | const char* const filters[] = {"pid:456", "pid:789"}; | |||
584 | MOZ_RELEASE_ASSERT(FiltersExcludePid(filters, pid123))do { static_assert( mozilla::detail::AssertionConditionType< decltype(FiltersExcludePid(filters, pid123))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(FiltersExcludePid(filters, pid123 )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("FiltersExcludePid(filters, pid123)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 584); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "FiltersExcludePid(filters, pid123)" ")"); do { *((volatile int*)__null) = 584; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
585 | } | |||
586 | } | |||
587 | ||||
588 | printf("TestBaseAndProfilerDetail done\n"); | |||
589 | } | |||
590 | ||||
591 | void TestSharedMutex() { | |||
592 | printf("TestSharedMutex...\n"); | |||
593 | ||||
594 | mozilla::baseprofiler::detail::BaseProfilerSharedMutex sm; | |||
595 | ||||
596 | // First round of minimal tests in this thread. | |||
597 | ||||
598 | MOZ_RELEASE_ASSERT(!sm.IsLockedExclusiveOnCurrentThread())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!sm.IsLockedExclusiveOnCurrentThread())>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(!sm.IsLockedExclusiveOnCurrentThread()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!sm.IsLockedExclusiveOnCurrentThread()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 598); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!sm.IsLockedExclusiveOnCurrentThread()" ")"); do { *((volatile int*)__null) = 598; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
599 | ||||
600 | sm.LockExclusive(); | |||
601 | MOZ_RELEASE_ASSERT(sm.IsLockedExclusiveOnCurrentThread())do { static_assert( mozilla::detail::AssertionConditionType< decltype(sm.IsLockedExclusiveOnCurrentThread())>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(! !(sm.IsLockedExclusiveOnCurrentThread()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("sm.IsLockedExclusiveOnCurrentThread()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 601); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "sm.IsLockedExclusiveOnCurrentThread()" ")"); do { *((volatile int*)__null) = 601; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
602 | sm.UnlockExclusive(); | |||
603 | MOZ_RELEASE_ASSERT(!sm.IsLockedExclusiveOnCurrentThread())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!sm.IsLockedExclusiveOnCurrentThread())>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(!sm.IsLockedExclusiveOnCurrentThread()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!sm.IsLockedExclusiveOnCurrentThread()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 603); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!sm.IsLockedExclusiveOnCurrentThread()" ")"); do { *((volatile int*)__null) = 603; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
604 | ||||
605 | sm.LockShared(); | |||
606 | MOZ_RELEASE_ASSERT(!sm.IsLockedExclusiveOnCurrentThread())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!sm.IsLockedExclusiveOnCurrentThread())>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(!sm.IsLockedExclusiveOnCurrentThread()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!sm.IsLockedExclusiveOnCurrentThread()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 606); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!sm.IsLockedExclusiveOnCurrentThread()" ")"); do { *((volatile int*)__null) = 606; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
607 | sm.UnlockShared(); | |||
608 | MOZ_RELEASE_ASSERT(!sm.IsLockedExclusiveOnCurrentThread())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!sm.IsLockedExclusiveOnCurrentThread())>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(!sm.IsLockedExclusiveOnCurrentThread()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!sm.IsLockedExclusiveOnCurrentThread()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 608); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!sm.IsLockedExclusiveOnCurrentThread()" ")"); do { *((volatile int*)__null) = 608; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
609 | ||||
610 | { | |||
611 | mozilla::baseprofiler::detail::BaseProfilerAutoLockExclusive exclusiveLock{ | |||
612 | sm}; | |||
613 | MOZ_RELEASE_ASSERT(sm.IsLockedExclusiveOnCurrentThread())do { static_assert( mozilla::detail::AssertionConditionType< decltype(sm.IsLockedExclusiveOnCurrentThread())>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(! !(sm.IsLockedExclusiveOnCurrentThread()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("sm.IsLockedExclusiveOnCurrentThread()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 613); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "sm.IsLockedExclusiveOnCurrentThread()" ")"); do { *((volatile int*)__null) = 613; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
614 | } | |||
615 | MOZ_RELEASE_ASSERT(!sm.IsLockedExclusiveOnCurrentThread())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!sm.IsLockedExclusiveOnCurrentThread())>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(!sm.IsLockedExclusiveOnCurrentThread()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!sm.IsLockedExclusiveOnCurrentThread()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 615); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!sm.IsLockedExclusiveOnCurrentThread()" ")"); do { *((volatile int*)__null) = 615; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
616 | ||||
617 | { | |||
618 | mozilla::baseprofiler::detail::BaseProfilerAutoLockShared sharedLock{sm}; | |||
619 | MOZ_RELEASE_ASSERT(!sm.IsLockedExclusiveOnCurrentThread())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!sm.IsLockedExclusiveOnCurrentThread())>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(!sm.IsLockedExclusiveOnCurrentThread()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!sm.IsLockedExclusiveOnCurrentThread()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 619); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!sm.IsLockedExclusiveOnCurrentThread()" ")"); do { *((volatile int*)__null) = 619; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
620 | } | |||
621 | MOZ_RELEASE_ASSERT(!sm.IsLockedExclusiveOnCurrentThread())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!sm.IsLockedExclusiveOnCurrentThread())>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(!sm.IsLockedExclusiveOnCurrentThread()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!sm.IsLockedExclusiveOnCurrentThread()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 621); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!sm.IsLockedExclusiveOnCurrentThread()" ")"); do { *((volatile int*)__null) = 621; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
622 | ||||
623 | // The following will run actions between two threads, to verify that | |||
624 | // exclusive and shared locks work as expected. | |||
625 | ||||
626 | // These actions will happen from top to bottom. | |||
627 | // This will test all possible lock interactions. | |||
628 | enum NextAction { // State of the lock: | |||
629 | t1Starting, // (x=exclusive, s=shared, ?=blocked) | |||
630 | t2Starting, // t1 t2 | |||
631 | t1LockExclusive, // x | |||
632 | t2LockExclusiveAndBlock, // x x? - Can't have two exclusives. | |||
633 | t1UnlockExclusive, // x | |||
634 | t2UnblockedAfterT1Unlock, // x | |||
635 | t1LockSharedAndBlock, // s? x - Can't have shared during excl | |||
636 | t2UnlockExclusive, // s | |||
637 | t1UnblockedAfterT2Unlock, // s | |||
638 | t2LockShared, // s s - Can have multiple shared locks | |||
639 | t1UnlockShared, // s | |||
640 | t2StillLockedShared, // s | |||
641 | t1LockExclusiveAndBlock, // x? s - Can't have excl during shared | |||
642 | t2UnlockShared, // x | |||
643 | t1UnblockedAfterT2UnlockShared, // x | |||
644 | t2CheckAfterT1Lock, // x | |||
645 | t1LastUnlockExclusive, // (unlocked) | |||
646 | done | |||
647 | }; | |||
648 | ||||
649 | // Each thread will repeatedly read this `nextAction`, and run actions that | |||
650 | // target it... | |||
651 | std::atomic<NextAction> nextAction{static_cast<NextAction>(0)}; | |||
652 | // ... and advance to the next available action (which should usually be for | |||
653 | // the other thread). | |||
654 | auto AdvanceAction = [&nextAction]() { | |||
655 | MOZ_RELEASE_ASSERT(nextAction <= done)do { static_assert( mozilla::detail::AssertionConditionType< decltype(nextAction <= done)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(nextAction <= done))), 0) )) { do { } while (false); MOZ_ReportAssertionFailure("nextAction <= done" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 655); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "nextAction <= done" ")"); do { *((volatile int*)__null) = 655; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
656 | nextAction = static_cast<NextAction>(static_cast<int>(nextAction) + 1); | |||
657 | }; | |||
658 | ||||
659 | std::thread t1{[&]() { | |||
660 | for (;;) { | |||
661 | switch (nextAction) { | |||
662 | case t1Starting: | |||
663 | AdvanceAction(); | |||
664 | break; | |||
665 | case t1LockExclusive: | |||
666 | MOZ_RELEASE_ASSERT(!sm.IsLockedExclusiveOnCurrentThread())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!sm.IsLockedExclusiveOnCurrentThread())>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(!sm.IsLockedExclusiveOnCurrentThread()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!sm.IsLockedExclusiveOnCurrentThread()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 666); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!sm.IsLockedExclusiveOnCurrentThread()" ")"); do { *((volatile int*)__null) = 666; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
667 | sm.LockExclusive(); | |||
668 | MOZ_RELEASE_ASSERT(sm.IsLockedExclusiveOnCurrentThread())do { static_assert( mozilla::detail::AssertionConditionType< decltype(sm.IsLockedExclusiveOnCurrentThread())>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(! !(sm.IsLockedExclusiveOnCurrentThread()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("sm.IsLockedExclusiveOnCurrentThread()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 668); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "sm.IsLockedExclusiveOnCurrentThread()" ")"); do { *((volatile int*)__null) = 668; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
669 | AdvanceAction(); | |||
670 | break; | |||
671 | case t1UnlockExclusive: | |||
672 | MOZ_RELEASE_ASSERT(sm.IsLockedExclusiveOnCurrentThread())do { static_assert( mozilla::detail::AssertionConditionType< decltype(sm.IsLockedExclusiveOnCurrentThread())>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(! !(sm.IsLockedExclusiveOnCurrentThread()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("sm.IsLockedExclusiveOnCurrentThread()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 672); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "sm.IsLockedExclusiveOnCurrentThread()" ")"); do { *((volatile int*)__null) = 672; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
673 | // Advance first, before unlocking, so that t2 sees the new state. | |||
674 | AdvanceAction(); | |||
675 | sm.UnlockExclusive(); | |||
676 | MOZ_RELEASE_ASSERT(!sm.IsLockedExclusiveOnCurrentThread())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!sm.IsLockedExclusiveOnCurrentThread())>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(!sm.IsLockedExclusiveOnCurrentThread()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!sm.IsLockedExclusiveOnCurrentThread()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 676); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!sm.IsLockedExclusiveOnCurrentThread()" ")"); do { *((volatile int*)__null) = 676; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
677 | break; | |||
678 | case t1LockSharedAndBlock: | |||
679 | // Advance action before attempting to lock after t2's exclusive lock. | |||
680 | AdvanceAction(); | |||
681 | sm.LockShared(); | |||
682 | // We will only acquire the lock after t1 unlocks. | |||
683 | MOZ_RELEASE_ASSERT(nextAction == t1UnblockedAfterT2Unlock)do { static_assert( mozilla::detail::AssertionConditionType< decltype(nextAction == t1UnblockedAfterT2Unlock)>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(nextAction == t1UnblockedAfterT2Unlock))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("nextAction == t1UnblockedAfterT2Unlock" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 683); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "nextAction == t1UnblockedAfterT2Unlock" ")"); do { *((volatile int*)__null) = 683; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
684 | MOZ_RELEASE_ASSERT(!sm.IsLockedExclusiveOnCurrentThread())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!sm.IsLockedExclusiveOnCurrentThread())>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(!sm.IsLockedExclusiveOnCurrentThread()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!sm.IsLockedExclusiveOnCurrentThread()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 684); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!sm.IsLockedExclusiveOnCurrentThread()" ")"); do { *((volatile int*)__null) = 684; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
685 | AdvanceAction(); | |||
686 | break; | |||
687 | case t1UnlockShared: | |||
688 | MOZ_RELEASE_ASSERT(!sm.IsLockedExclusiveOnCurrentThread())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!sm.IsLockedExclusiveOnCurrentThread())>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(!sm.IsLockedExclusiveOnCurrentThread()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!sm.IsLockedExclusiveOnCurrentThread()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 688); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!sm.IsLockedExclusiveOnCurrentThread()" ")"); do { *((volatile int*)__null) = 688; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
689 | // Advance first, before unlocking, so that t2 sees the new state. | |||
690 | AdvanceAction(); | |||
691 | sm.UnlockShared(); | |||
692 | MOZ_RELEASE_ASSERT(!sm.IsLockedExclusiveOnCurrentThread())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!sm.IsLockedExclusiveOnCurrentThread())>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(!sm.IsLockedExclusiveOnCurrentThread()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!sm.IsLockedExclusiveOnCurrentThread()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 692); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!sm.IsLockedExclusiveOnCurrentThread()" ")"); do { *((volatile int*)__null) = 692; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
693 | break; | |||
694 | case t1LockExclusiveAndBlock: | |||
695 | MOZ_RELEASE_ASSERT(!sm.IsLockedExclusiveOnCurrentThread())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!sm.IsLockedExclusiveOnCurrentThread())>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(!sm.IsLockedExclusiveOnCurrentThread()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!sm.IsLockedExclusiveOnCurrentThread()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 695); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!sm.IsLockedExclusiveOnCurrentThread()" ")"); do { *((volatile int*)__null) = 695; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
696 | // Advance action before attempting to lock after t2's shared lock. | |||
697 | AdvanceAction(); | |||
698 | sm.LockExclusive(); | |||
699 | // We will only acquire the lock after t2 unlocks. | |||
700 | MOZ_RELEASE_ASSERT(nextAction == t1UnblockedAfterT2UnlockShared)do { static_assert( mozilla::detail::AssertionConditionType< decltype(nextAction == t1UnblockedAfterT2UnlockShared)>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(nextAction == t1UnblockedAfterT2UnlockShared))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("nextAction == t1UnblockedAfterT2UnlockShared" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 700); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "nextAction == t1UnblockedAfterT2UnlockShared" ")"); do { *((volatile int*)__null) = 700; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
701 | MOZ_RELEASE_ASSERT(sm.IsLockedExclusiveOnCurrentThread())do { static_assert( mozilla::detail::AssertionConditionType< decltype(sm.IsLockedExclusiveOnCurrentThread())>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(! !(sm.IsLockedExclusiveOnCurrentThread()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("sm.IsLockedExclusiveOnCurrentThread()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 701); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "sm.IsLockedExclusiveOnCurrentThread()" ")"); do { *((volatile int*)__null) = 701; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
702 | AdvanceAction(); | |||
703 | break; | |||
704 | case t1LastUnlockExclusive: | |||
705 | MOZ_RELEASE_ASSERT(sm.IsLockedExclusiveOnCurrentThread())do { static_assert( mozilla::detail::AssertionConditionType< decltype(sm.IsLockedExclusiveOnCurrentThread())>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(! !(sm.IsLockedExclusiveOnCurrentThread()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("sm.IsLockedExclusiveOnCurrentThread()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 705); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "sm.IsLockedExclusiveOnCurrentThread()" ")"); do { *((volatile int*)__null) = 705; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
706 | // Advance first, before unlocking, so that t2 sees the new state. | |||
707 | AdvanceAction(); | |||
708 | sm.UnlockExclusive(); | |||
709 | MOZ_RELEASE_ASSERT(!sm.IsLockedExclusiveOnCurrentThread())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!sm.IsLockedExclusiveOnCurrentThread())>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(!sm.IsLockedExclusiveOnCurrentThread()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!sm.IsLockedExclusiveOnCurrentThread()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 709); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!sm.IsLockedExclusiveOnCurrentThread()" ")"); do { *((volatile int*)__null) = 709; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
710 | break; | |||
711 | case done: | |||
712 | return; | |||
713 | default: | |||
714 | // Ignore other actions intended for t2. | |||
715 | break; | |||
716 | } | |||
717 | } | |||
718 | }}; | |||
719 | ||||
720 | std::thread t2{[&]() { | |||
721 | for (;;) { | |||
722 | switch (nextAction) { | |||
723 | case t2Starting: | |||
724 | AdvanceAction(); | |||
725 | break; | |||
726 | case t2LockExclusiveAndBlock: | |||
727 | MOZ_RELEASE_ASSERT(!sm.IsLockedExclusiveOnCurrentThread())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!sm.IsLockedExclusiveOnCurrentThread())>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(!sm.IsLockedExclusiveOnCurrentThread()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!sm.IsLockedExclusiveOnCurrentThread()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 727); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!sm.IsLockedExclusiveOnCurrentThread()" ")"); do { *((volatile int*)__null) = 727; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
728 | // Advance action before attempting to lock after t1's exclusive lock. | |||
729 | AdvanceAction(); | |||
730 | sm.LockExclusive(); | |||
731 | // We will only acquire the lock after t1 unlocks. | |||
732 | MOZ_RELEASE_ASSERT(nextAction == t2UnblockedAfterT1Unlock)do { static_assert( mozilla::detail::AssertionConditionType< decltype(nextAction == t2UnblockedAfterT1Unlock)>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(nextAction == t2UnblockedAfterT1Unlock))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("nextAction == t2UnblockedAfterT1Unlock" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 732); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "nextAction == t2UnblockedAfterT1Unlock" ")"); do { *((volatile int*)__null) = 732; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
733 | MOZ_RELEASE_ASSERT(sm.IsLockedExclusiveOnCurrentThread())do { static_assert( mozilla::detail::AssertionConditionType< decltype(sm.IsLockedExclusiveOnCurrentThread())>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(! !(sm.IsLockedExclusiveOnCurrentThread()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("sm.IsLockedExclusiveOnCurrentThread()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 733); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "sm.IsLockedExclusiveOnCurrentThread()" ")"); do { *((volatile int*)__null) = 733; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
734 | AdvanceAction(); | |||
735 | break; | |||
736 | case t2UnlockExclusive: | |||
737 | MOZ_RELEASE_ASSERT(sm.IsLockedExclusiveOnCurrentThread())do { static_assert( mozilla::detail::AssertionConditionType< decltype(sm.IsLockedExclusiveOnCurrentThread())>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(! !(sm.IsLockedExclusiveOnCurrentThread()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("sm.IsLockedExclusiveOnCurrentThread()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 737); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "sm.IsLockedExclusiveOnCurrentThread()" ")"); do { *((volatile int*)__null) = 737; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
738 | // Advance first, before unlocking, so that t1 sees the new state. | |||
739 | AdvanceAction(); | |||
740 | sm.UnlockExclusive(); | |||
741 | MOZ_RELEASE_ASSERT(!sm.IsLockedExclusiveOnCurrentThread())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!sm.IsLockedExclusiveOnCurrentThread())>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(!sm.IsLockedExclusiveOnCurrentThread()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!sm.IsLockedExclusiveOnCurrentThread()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 741); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!sm.IsLockedExclusiveOnCurrentThread()" ")"); do { *((volatile int*)__null) = 741; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
742 | break; | |||
743 | case t2LockShared: | |||
744 | sm.LockShared(); | |||
745 | MOZ_RELEASE_ASSERT(!sm.IsLockedExclusiveOnCurrentThread())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!sm.IsLockedExclusiveOnCurrentThread())>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(!sm.IsLockedExclusiveOnCurrentThread()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!sm.IsLockedExclusiveOnCurrentThread()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 745); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!sm.IsLockedExclusiveOnCurrentThread()" ")"); do { *((volatile int*)__null) = 745; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
746 | AdvanceAction(); | |||
747 | break; | |||
748 | case t2StillLockedShared: | |||
749 | AdvanceAction(); | |||
750 | break; | |||
751 | case t2UnlockShared: | |||
752 | MOZ_RELEASE_ASSERT(!sm.IsLockedExclusiveOnCurrentThread())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!sm.IsLockedExclusiveOnCurrentThread())>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(!sm.IsLockedExclusiveOnCurrentThread()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!sm.IsLockedExclusiveOnCurrentThread()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 752); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!sm.IsLockedExclusiveOnCurrentThread()" ")"); do { *((volatile int*)__null) = 752; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
753 | // Advance first, before unlocking, so that t1 sees the new state. | |||
754 | AdvanceAction(); | |||
755 | sm.UnlockShared(); | |||
756 | MOZ_RELEASE_ASSERT(!sm.IsLockedExclusiveOnCurrentThread())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!sm.IsLockedExclusiveOnCurrentThread())>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(!sm.IsLockedExclusiveOnCurrentThread()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!sm.IsLockedExclusiveOnCurrentThread()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 756); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!sm.IsLockedExclusiveOnCurrentThread()" ")"); do { *((volatile int*)__null) = 756; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
757 | break; | |||
758 | case t2CheckAfterT1Lock: | |||
759 | MOZ_RELEASE_ASSERT(!sm.IsLockedExclusiveOnCurrentThread())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!sm.IsLockedExclusiveOnCurrentThread())>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(!sm.IsLockedExclusiveOnCurrentThread()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!sm.IsLockedExclusiveOnCurrentThread()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 759); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!sm.IsLockedExclusiveOnCurrentThread()" ")"); do { *((volatile int*)__null) = 759; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
760 | AdvanceAction(); | |||
761 | break; | |||
762 | case done: | |||
763 | return; | |||
764 | default: | |||
765 | // Ignore other actions intended for t1. | |||
766 | break; | |||
767 | } | |||
768 | } | |||
769 | }}; | |||
770 | ||||
771 | t1.join(); | |||
772 | t2.join(); | |||
773 | ||||
774 | printf("TestSharedMutex done\n"); | |||
775 | } | |||
776 | ||||
777 | void TestProportionValue() { | |||
778 | printf("TestProportionValue...\n"); | |||
779 | ||||
780 | using mozilla::ProportionValue; | |||
781 | ||||
782 | #define STATIC_ASSERT_EQ(a, b) \ | |||
783 | static_assert((a) == (b)); \ | |||
784 | MOZ_RELEASE_ASSERT((a) == (b))do { static_assert( mozilla::detail::AssertionConditionType< decltype((a) == (b))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!((a) == (b)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("(a) == (b)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 784); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "(a) == (b)" ")"); do { *((volatile int*)__null) = 784; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
785 | ||||
786 | #define STATIC_ASSERT(e)STATIC_ASSERT_EQ(e, true) STATIC_ASSERT_EQ(e, true) | |||
787 | ||||
788 | // Conversion from&to double. | |||
789 | STATIC_ASSERT_EQ(ProportionValue().ToDouble(), 0.0); | |||
790 | STATIC_ASSERT_EQ(ProportionValue(0.0).ToDouble(), 0.0); | |||
791 | STATIC_ASSERT_EQ(ProportionValue(0.5).ToDouble(), 0.5); | |||
792 | STATIC_ASSERT_EQ(ProportionValue(1.0).ToDouble(), 1.0); | |||
793 | ||||
794 | // Clamping. | |||
795 | STATIC_ASSERT_EQ( | |||
796 | ProportionValue(std::numeric_limits<double>::min()).ToDouble(), 0.0); | |||
797 | STATIC_ASSERT_EQ( | |||
798 | ProportionValue(std::numeric_limits<long double>::min()).ToDouble(), 0.0); | |||
799 | STATIC_ASSERT_EQ(ProportionValue(-1.0).ToDouble(), 0.0); | |||
800 | STATIC_ASSERT_EQ(ProportionValue(-0.01).ToDouble(), 0.0); | |||
801 | STATIC_ASSERT_EQ(ProportionValue(-0.0).ToDouble(), 0.0); | |||
802 | STATIC_ASSERT_EQ(ProportionValue(1.01).ToDouble(), 1.0); | |||
803 | STATIC_ASSERT_EQ( | |||
804 | ProportionValue(std::numeric_limits<double>::max()).ToDouble(), 1.0); | |||
805 | ||||
806 | // User-defined literal. | |||
807 | { | |||
808 | using namespace mozilla::literals::ProportionValue_literals; | |||
809 | STATIC_ASSERT_EQ(0_pc, ProportionValue(0.0)); | |||
810 | STATIC_ASSERT_EQ(0._pc, ProportionValue(0.0)); | |||
811 | STATIC_ASSERT_EQ(50_pc, ProportionValue(0.5)); | |||
812 | STATIC_ASSERT_EQ(50._pc, ProportionValue(0.5)); | |||
813 | STATIC_ASSERT_EQ(100_pc, ProportionValue(1.0)); | |||
814 | STATIC_ASSERT_EQ(100._pc, ProportionValue(1.0)); | |||
815 | STATIC_ASSERT_EQ(101_pc, ProportionValue(1.0)); | |||
816 | STATIC_ASSERT_EQ(100.01_pc, ProportionValue(1.0)); | |||
817 | STATIC_ASSERT_EQ(1000_pc, ProportionValue(1.0)); | |||
818 | STATIC_ASSERT_EQ(1000._pc, ProportionValue(1.0)); | |||
819 | } | |||
820 | { | |||
821 | // ProportionValue_literals is an inline namespace of mozilla::literals, so | |||
822 | // it's optional. | |||
823 | using namespace mozilla::literals; | |||
824 | STATIC_ASSERT_EQ(0_pc, ProportionValue(0.0)); | |||
825 | STATIC_ASSERT_EQ(0._pc, ProportionValue(0.0)); | |||
826 | STATIC_ASSERT_EQ(50_pc, ProportionValue(0.5)); | |||
827 | STATIC_ASSERT_EQ(50._pc, ProportionValue(0.5)); | |||
828 | STATIC_ASSERT_EQ(100_pc, ProportionValue(1.0)); | |||
829 | STATIC_ASSERT_EQ(100._pc, ProportionValue(1.0)); | |||
830 | STATIC_ASSERT_EQ(101_pc, ProportionValue(1.0)); | |||
831 | STATIC_ASSERT_EQ(100.01_pc, ProportionValue(1.0)); | |||
832 | STATIC_ASSERT_EQ(1000_pc, ProportionValue(1.0)); | |||
833 | STATIC_ASSERT_EQ(1000._pc, ProportionValue(1.0)); | |||
834 | } | |||
835 | ||||
836 | // Invalid construction, conversion to double NaN. | |||
837 | MOZ_RELEASE_ASSERT(std::isnan(ProportionValue::MakeInvalid().ToDouble()))do { static_assert( mozilla::detail::AssertionConditionType< decltype(std::isnan(ProportionValue::MakeInvalid().ToDouble() ))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(std::isnan(ProportionValue::MakeInvalid().ToDouble() )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("std::isnan(ProportionValue::MakeInvalid().ToDouble())", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 837); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "std::isnan(ProportionValue::MakeInvalid().ToDouble())" ")"); do { *((volatile int*)__null) = 837; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
838 | ||||
839 | using namespace mozilla::literals::ProportionValue_literals; | |||
840 | ||||
841 | // Conversion to&from underlying integral number. | |||
842 | STATIC_ASSERT_EQ( | |||
843 | ProportionValue::FromUnderlyingType((0_pc).ToUnderlyingType()).ToDouble(), | |||
844 | 0.0); | |||
845 | STATIC_ASSERT_EQ( | |||
846 | ProportionValue::FromUnderlyingType((50_pc).ToUnderlyingType()) | |||
847 | .ToDouble(), | |||
848 | 0.5); | |||
849 | STATIC_ASSERT_EQ( | |||
850 | ProportionValue::FromUnderlyingType((100_pc).ToUnderlyingType()) | |||
851 | .ToDouble(), | |||
852 | 1.0); | |||
853 | STATIC_ASSERT(ProportionValue::FromUnderlyingType(STATIC_ASSERT_EQ(ProportionValue::FromUnderlyingType( ProportionValue ::MakeInvalid().ToUnderlyingType()) .IsInvalid(), true) | |||
854 | ProportionValue::MakeInvalid().ToUnderlyingType())STATIC_ASSERT_EQ(ProportionValue::FromUnderlyingType( ProportionValue ::MakeInvalid().ToUnderlyingType()) .IsInvalid(), true) | |||
855 | .IsInvalid())STATIC_ASSERT_EQ(ProportionValue::FromUnderlyingType( ProportionValue ::MakeInvalid().ToUnderlyingType()) .IsInvalid(), true); | |||
856 | ||||
857 | // IsExactlyZero. | |||
858 | STATIC_ASSERT(ProportionValue().IsExactlyZero())STATIC_ASSERT_EQ(ProportionValue().IsExactlyZero(), true); | |||
859 | STATIC_ASSERT((0_pc).IsExactlyZero())STATIC_ASSERT_EQ((0_pc).IsExactlyZero(), true); | |||
860 | STATIC_ASSERT(!(50_pc).IsExactlyZero())STATIC_ASSERT_EQ(!(50_pc).IsExactlyZero(), true); | |||
861 | STATIC_ASSERT(!(100_pc).IsExactlyZero())STATIC_ASSERT_EQ(!(100_pc).IsExactlyZero(), true); | |||
862 | STATIC_ASSERT(!ProportionValue::MakeInvalid().IsExactlyZero())STATIC_ASSERT_EQ(!ProportionValue::MakeInvalid().IsExactlyZero (), true); | |||
863 | ||||
864 | // IsExactlyOne. | |||
865 | STATIC_ASSERT(!ProportionValue().IsExactlyOne())STATIC_ASSERT_EQ(!ProportionValue().IsExactlyOne(), true); | |||
866 | STATIC_ASSERT(!(0_pc).IsExactlyOne())STATIC_ASSERT_EQ(!(0_pc).IsExactlyOne(), true); | |||
867 | STATIC_ASSERT(!(50_pc).IsExactlyOne())STATIC_ASSERT_EQ(!(50_pc).IsExactlyOne(), true); | |||
868 | STATIC_ASSERT((100_pc).IsExactlyOne())STATIC_ASSERT_EQ((100_pc).IsExactlyOne(), true); | |||
869 | STATIC_ASSERT(!ProportionValue::MakeInvalid().IsExactlyOne())STATIC_ASSERT_EQ(!ProportionValue::MakeInvalid().IsExactlyOne (), true); | |||
870 | ||||
871 | // IsValid. | |||
872 | STATIC_ASSERT(ProportionValue().IsValid())STATIC_ASSERT_EQ(ProportionValue().IsValid(), true); | |||
873 | STATIC_ASSERT((0_pc).IsValid())STATIC_ASSERT_EQ((0_pc).IsValid(), true); | |||
874 | STATIC_ASSERT((50_pc).IsValid())STATIC_ASSERT_EQ((50_pc).IsValid(), true); | |||
875 | STATIC_ASSERT((100_pc).IsValid())STATIC_ASSERT_EQ((100_pc).IsValid(), true); | |||
876 | STATIC_ASSERT(!ProportionValue::MakeInvalid().IsValid())STATIC_ASSERT_EQ(!ProportionValue::MakeInvalid().IsValid(), true ); | |||
877 | ||||
878 | // IsInvalid. | |||
879 | STATIC_ASSERT(!ProportionValue().IsInvalid())STATIC_ASSERT_EQ(!ProportionValue().IsInvalid(), true); | |||
880 | STATIC_ASSERT(!(0_pc).IsInvalid())STATIC_ASSERT_EQ(!(0_pc).IsInvalid(), true); | |||
881 | STATIC_ASSERT(!(50_pc).IsInvalid())STATIC_ASSERT_EQ(!(50_pc).IsInvalid(), true); | |||
882 | STATIC_ASSERT(!(100_pc).IsInvalid())STATIC_ASSERT_EQ(!(100_pc).IsInvalid(), true); | |||
883 | STATIC_ASSERT(ProportionValue::MakeInvalid().IsInvalid())STATIC_ASSERT_EQ(ProportionValue::MakeInvalid().IsInvalid(), true ); | |||
884 | ||||
885 | // Addition. | |||
886 | STATIC_ASSERT_EQ((0_pc + 0_pc).ToDouble(), 0.0); | |||
887 | STATIC_ASSERT_EQ((0_pc + 100_pc).ToDouble(), 1.0); | |||
888 | STATIC_ASSERT_EQ((100_pc + 0_pc).ToDouble(), 1.0); | |||
889 | STATIC_ASSERT_EQ((100_pc + 100_pc).ToDouble(), 1.0); | |||
890 | STATIC_ASSERT((ProportionValue::MakeInvalid() + 50_pc).IsInvalid())STATIC_ASSERT_EQ((ProportionValue::MakeInvalid() + 50_pc).IsInvalid (), true); | |||
891 | STATIC_ASSERT((50_pc + ProportionValue::MakeInvalid()).IsInvalid())STATIC_ASSERT_EQ((50_pc + ProportionValue::MakeInvalid()).IsInvalid (), true); | |||
892 | ||||
893 | // Subtraction. | |||
894 | STATIC_ASSERT_EQ((0_pc - 0_pc).ToDouble(), 0.0); | |||
895 | STATIC_ASSERT_EQ((0_pc - 100_pc).ToDouble(), 0.0); | |||
896 | STATIC_ASSERT_EQ((100_pc - 0_pc).ToDouble(), 1.0); | |||
897 | STATIC_ASSERT_EQ((100_pc - 100_pc).ToDouble(), 0.0); | |||
898 | STATIC_ASSERT((ProportionValue::MakeInvalid() - 50_pc).IsInvalid())STATIC_ASSERT_EQ((ProportionValue::MakeInvalid() - 50_pc).IsInvalid (), true); | |||
899 | STATIC_ASSERT((50_pc - ProportionValue::MakeInvalid()).IsInvalid())STATIC_ASSERT_EQ((50_pc - ProportionValue::MakeInvalid()).IsInvalid (), true); | |||
900 | ||||
901 | // Multiplication. | |||
902 | STATIC_ASSERT_EQ((0_pc * 0_pc).ToDouble(), 0.0); | |||
903 | STATIC_ASSERT_EQ((0_pc * 100_pc).ToDouble(), 0.0); | |||
904 | STATIC_ASSERT_EQ((50_pc * 50_pc).ToDouble(), 0.25); | |||
905 | STATIC_ASSERT_EQ((50_pc * 100_pc).ToDouble(), 0.5); | |||
906 | STATIC_ASSERT_EQ((100_pc * 50_pc).ToDouble(), 0.5); | |||
907 | STATIC_ASSERT_EQ((100_pc * 0_pc).ToDouble(), 0.0); | |||
908 | STATIC_ASSERT_EQ((100_pc * 100_pc).ToDouble(), 1.0); | |||
909 | STATIC_ASSERT((ProportionValue::MakeInvalid() * 50_pc).IsInvalid())STATIC_ASSERT_EQ((ProportionValue::MakeInvalid() * 50_pc).IsInvalid (), true); | |||
910 | STATIC_ASSERT((50_pc * ProportionValue::MakeInvalid()).IsInvalid())STATIC_ASSERT_EQ((50_pc * ProportionValue::MakeInvalid()).IsInvalid (), true); | |||
911 | ||||
912 | // Division by a positive integer value. | |||
913 | STATIC_ASSERT_EQ((100_pc / 1u).ToDouble(), 1.0); | |||
914 | STATIC_ASSERT_EQ((100_pc / 2u).ToDouble(), 0.5); | |||
915 | STATIC_ASSERT_EQ( | |||
916 | (ProportionValue::FromUnderlyingType(6u) / 2u).ToUnderlyingType(), 3u); | |||
917 | STATIC_ASSERT_EQ( | |||
918 | (ProportionValue::FromUnderlyingType(5u) / 2u).ToUnderlyingType(), 2u); | |||
919 | STATIC_ASSERT_EQ( | |||
920 | (ProportionValue::FromUnderlyingType(1u) / 2u).ToUnderlyingType(), 0u); | |||
921 | STATIC_ASSERT_EQ( | |||
922 | (ProportionValue::FromUnderlyingType(0u) / 2u).ToUnderlyingType(), 0u); | |||
923 | STATIC_ASSERT((100_pc / 0u).IsInvalid())STATIC_ASSERT_EQ((100_pc / 0u).IsInvalid(), true); | |||
924 | STATIC_ASSERT((ProportionValue::MakeInvalid() / 2u).IsInvalid())STATIC_ASSERT_EQ((ProportionValue::MakeInvalid() / 2u).IsInvalid (), true); | |||
925 | ||||
926 | // Multiplication by a positive integer value. | |||
927 | STATIC_ASSERT_EQ((100_pc * 1u).ToDouble(), 1.0); | |||
928 | STATIC_ASSERT_EQ((50_pc * 1u).ToDouble(), 0.5); | |||
929 | STATIC_ASSERT_EQ((50_pc * 2u).ToDouble(), 1.0); | |||
930 | STATIC_ASSERT_EQ((50_pc * 3u).ToDouble(), 1.0); // Clamped. | |||
931 | STATIC_ASSERT_EQ( | |||
932 | (ProportionValue::FromUnderlyingType(1u) * 2u).ToUnderlyingType(), 2u); | |||
933 | STATIC_ASSERT((ProportionValue::MakeInvalid() * 2u).IsInvalid())STATIC_ASSERT_EQ((ProportionValue::MakeInvalid() * 2u).IsInvalid (), true); | |||
934 | ||||
935 | // Verifying PV - u < (PV / u) * u <= PV, with n=3, PV between 6 and 9 : | |||
936 | STATIC_ASSERT_EQ( | |||
937 | (ProportionValue::FromUnderlyingType(6u) / 3u).ToUnderlyingType(), 2u); | |||
938 | STATIC_ASSERT_EQ( | |||
939 | (ProportionValue::FromUnderlyingType(7u) / 3u).ToUnderlyingType(), 2u); | |||
940 | STATIC_ASSERT_EQ( | |||
941 | (ProportionValue::FromUnderlyingType(8u) / 3u).ToUnderlyingType(), 2u); | |||
942 | STATIC_ASSERT_EQ( | |||
943 | (ProportionValue::FromUnderlyingType(9u) / 3u).ToUnderlyingType(), 3u); | |||
944 | ||||
945 | // Direct comparisons. | |||
946 | STATIC_ASSERT_EQ(0_pc, 0_pc); | |||
947 | STATIC_ASSERT(0_pc == 0_pc)STATIC_ASSERT_EQ(0_pc == 0_pc, true); | |||
948 | STATIC_ASSERT(!(0_pc == 100_pc))STATIC_ASSERT_EQ(!(0_pc == 100_pc), true); | |||
949 | STATIC_ASSERT(0_pc != 100_pc)STATIC_ASSERT_EQ(0_pc != 100_pc, true); | |||
950 | STATIC_ASSERT(!(0_pc != 0_pc))STATIC_ASSERT_EQ(!(0_pc != 0_pc), true); | |||
951 | STATIC_ASSERT(0_pc < 100_pc)STATIC_ASSERT_EQ(0_pc < 100_pc, true); | |||
952 | STATIC_ASSERT(!(0_pc < 0_pc))STATIC_ASSERT_EQ(!(0_pc < 0_pc), true); | |||
953 | STATIC_ASSERT(0_pc <= 0_pc)STATIC_ASSERT_EQ(0_pc <= 0_pc, true); | |||
954 | STATIC_ASSERT(0_pc <= 100_pc)STATIC_ASSERT_EQ(0_pc <= 100_pc, true); | |||
955 | STATIC_ASSERT(!(100_pc <= 0_pc))STATIC_ASSERT_EQ(!(100_pc <= 0_pc), true); | |||
956 | STATIC_ASSERT(100_pc > 0_pc)STATIC_ASSERT_EQ(100_pc > 0_pc, true); | |||
957 | STATIC_ASSERT(!(100_pc > 100_pc))STATIC_ASSERT_EQ(!(100_pc > 100_pc), true); | |||
958 | STATIC_ASSERT(100_pc >= 0_pc)STATIC_ASSERT_EQ(100_pc >= 0_pc, true); | |||
959 | STATIC_ASSERT(100_pc >= 100_pc)STATIC_ASSERT_EQ(100_pc >= 100_pc, true); | |||
960 | STATIC_ASSERT(!(0_pc >= 100_pc))STATIC_ASSERT_EQ(!(0_pc >= 100_pc), true); | |||
961 | // 0.5 is binary-friendly, so we can double it and compare it exactly. | |||
962 | STATIC_ASSERT_EQ(50_pc + 50_pc, 100_pc); | |||
963 | ||||
964 | #undef STATIC_ASSERT_EQ | |||
965 | ||||
966 | printf("TestProportionValue done\n"); | |||
967 | } | |||
968 | ||||
969 | template <typename Arg0, typename... Args> | |||
970 | bool AreAllEqual(Arg0&& aArg0, Args&&... aArgs) { | |||
971 | return ((aArg0 == aArgs) && ...); | |||
972 | } | |||
973 | ||||
974 | void TestProgressLogger() { | |||
975 | printf("TestProgressLogger...\n"); | |||
976 | ||||
977 | using mozilla::ProgressLogger; | |||
978 | using mozilla::ProportionValue; | |||
979 | using namespace mozilla::literals::ProportionValue_literals; | |||
980 | ||||
981 | auto progressRefPtr = mozilla::MakeRefPtr<ProgressLogger::SharedProgress>(); | |||
982 | MOZ_RELEASE_ASSERT(progressRefPtr)do { static_assert( mozilla::detail::AssertionConditionType< decltype(progressRefPtr)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(progressRefPtr))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("progressRefPtr" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 982); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "progressRefPtr" ")"); do { *((volatile int*)__null) = 982; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
983 | MOZ_RELEASE_ASSERT(progressRefPtr->Progress().IsExactlyZero())do { static_assert( mozilla::detail::AssertionConditionType< decltype(progressRefPtr->Progress().IsExactlyZero())>:: isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(progressRefPtr->Progress().IsExactlyZero()))), 0) )) { do { } while (false); MOZ_ReportAssertionFailure("progressRefPtr->Progress().IsExactlyZero()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 983); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "progressRefPtr->Progress().IsExactlyZero()" ")"); do { *((volatile int*)__null) = 983; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
984 | ||||
985 | { | |||
986 | ProgressLogger pl(progressRefPtr, "Started", "All done"); | |||
987 | MOZ_RELEASE_ASSERT(progressRefPtr->Progress().IsExactlyZero())do { static_assert( mozilla::detail::AssertionConditionType< decltype(progressRefPtr->Progress().IsExactlyZero())>:: isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(progressRefPtr->Progress().IsExactlyZero()))), 0) )) { do { } while (false); MOZ_ReportAssertionFailure("progressRefPtr->Progress().IsExactlyZero()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 987); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "progressRefPtr->Progress().IsExactlyZero()" ")"); do { *((volatile int*)__null) = 987; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
988 | MOZ_RELEASE_ASSERT(pl.GetGlobalProgress().IsExactlyZero())do { static_assert( mozilla::detail::AssertionConditionType< decltype(pl.GetGlobalProgress().IsExactlyZero())>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(pl.GetGlobalProgress().IsExactlyZero()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("pl.GetGlobalProgress().IsExactlyZero()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 988); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "pl.GetGlobalProgress().IsExactlyZero()" ")"); do { *((volatile int*)__null) = 988; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
989 | MOZ_RELEASE_ASSERT(AreAllEqual(progressRefPtr->LastLocation(),do { static_assert( mozilla::detail::AssertionConditionType< decltype(AreAllEqual(progressRefPtr->LastLocation(), pl.GetLastGlobalLocation (), "Started"))>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(!!(AreAllEqual(progressRefPtr-> LastLocation(), pl.GetLastGlobalLocation(), "Started")))), 0) )) { do { } while (false); MOZ_ReportAssertionFailure("AreAllEqual(progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), \"Started\")" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 990); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual(progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), \"Started\")" ")"); do { *((volatile int*)__null) = 990; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
990 | pl.GetLastGlobalLocation(), "Started"))do { static_assert( mozilla::detail::AssertionConditionType< decltype(AreAllEqual(progressRefPtr->LastLocation(), pl.GetLastGlobalLocation (), "Started"))>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(!!(AreAllEqual(progressRefPtr-> LastLocation(), pl.GetLastGlobalLocation(), "Started")))), 0) )) { do { } while (false); MOZ_ReportAssertionFailure("AreAllEqual(progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), \"Started\")" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 990); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual(progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), \"Started\")" ")"); do { *((volatile int*)__null) = 990; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
991 | ||||
992 | // At this top level, the scale is 1:1. | |||
993 | pl.SetLocalProgress(10_pc, "Top 10%"); | |||
994 | MOZ_RELEASE_ASSERT(do { static_assert( mozilla::detail::AssertionConditionType< decltype(AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress (), 10_pc))>::isValid, "invalid assertion condition"); if ( (__builtin_expect(!!(!(!!(AreAllEqual(progressRefPtr->Progress (), pl.GetGlobalProgress(), 10_pc)))), 0))) { do { } while (false ); MOZ_ReportAssertionFailure("AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress(), 10_pc)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 995); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress(), 10_pc)" ")"); do { *((volatile int*)__null) = 995; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
995 | AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress(), 10_pc))do { static_assert( mozilla::detail::AssertionConditionType< decltype(AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress (), 10_pc))>::isValid, "invalid assertion condition"); if ( (__builtin_expect(!!(!(!!(AreAllEqual(progressRefPtr->Progress (), pl.GetGlobalProgress(), 10_pc)))), 0))) { do { } while (false ); MOZ_ReportAssertionFailure("AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress(), 10_pc)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 995); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress(), 10_pc)" ")"); do { *((volatile int*)__null) = 995; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
996 | MOZ_RELEASE_ASSERT(AreAllEqual(progressRefPtr->LastLocation(),do { static_assert( mozilla::detail::AssertionConditionType< decltype(AreAllEqual(progressRefPtr->LastLocation(), pl.GetLastGlobalLocation (), "Top 10%"))>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(!!(AreAllEqual(progressRefPtr-> LastLocation(), pl.GetLastGlobalLocation(), "Top 10%")))), 0) )) { do { } while (false); MOZ_ReportAssertionFailure("AreAllEqual(progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), \"Top 10%\")" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 997); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual(progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), \"Top 10%\")" ")"); do { *((volatile int*)__null) = 997; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
997 | pl.GetLastGlobalLocation(), "Top 10%"))do { static_assert( mozilla::detail::AssertionConditionType< decltype(AreAllEqual(progressRefPtr->LastLocation(), pl.GetLastGlobalLocation (), "Top 10%"))>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(!!(AreAllEqual(progressRefPtr-> LastLocation(), pl.GetLastGlobalLocation(), "Top 10%")))), 0) )) { do { } while (false); MOZ_ReportAssertionFailure("AreAllEqual(progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), \"Top 10%\")" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 997); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual(progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), \"Top 10%\")" ")"); do { *((volatile int*)__null) = 997; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
998 | ||||
999 | pl.SetLocalProgress(0_pc, "Restarted"); | |||
1000 | MOZ_RELEASE_ASSERT(do { static_assert( mozilla::detail::AssertionConditionType< decltype(AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress (), 0_pc))>::isValid, "invalid assertion condition"); if ( (__builtin_expect(!!(!(!!(AreAllEqual(progressRefPtr->Progress (), pl.GetGlobalProgress(), 0_pc)))), 0))) { do { } while (false ); MOZ_ReportAssertionFailure("AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress(), 0_pc)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1001); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress(), 0_pc)" ")"); do { *((volatile int*)__null) = 1001; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
1001 | AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress(), 0_pc))do { static_assert( mozilla::detail::AssertionConditionType< decltype(AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress (), 0_pc))>::isValid, "invalid assertion condition"); if ( (__builtin_expect(!!(!(!!(AreAllEqual(progressRefPtr->Progress (), pl.GetGlobalProgress(), 0_pc)))), 0))) { do { } while (false ); MOZ_ReportAssertionFailure("AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress(), 0_pc)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1001); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress(), 0_pc)" ")"); do { *((volatile int*)__null) = 1001; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1002 | MOZ_RELEASE_ASSERT(AreAllEqual(progressRefPtr->LastLocation(),do { static_assert( mozilla::detail::AssertionConditionType< decltype(AreAllEqual(progressRefPtr->LastLocation(), pl.GetLastGlobalLocation (), "Restarted"))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(AreAllEqual(progressRefPtr-> LastLocation(), pl.GetLastGlobalLocation(), "Restarted")))), 0 ))) { do { } while (false); MOZ_ReportAssertionFailure("AreAllEqual(progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), \"Restarted\")" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1003); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual(progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), \"Restarted\")" ")"); do { *((volatile int*)__null) = 1003; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
1003 | pl.GetLastGlobalLocation(), "Restarted"))do { static_assert( mozilla::detail::AssertionConditionType< decltype(AreAllEqual(progressRefPtr->LastLocation(), pl.GetLastGlobalLocation (), "Restarted"))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(AreAllEqual(progressRefPtr-> LastLocation(), pl.GetLastGlobalLocation(), "Restarted")))), 0 ))) { do { } while (false); MOZ_ReportAssertionFailure("AreAllEqual(progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), \"Restarted\")" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1003); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual(progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), \"Restarted\")" ")"); do { *((volatile int*)__null) = 1003; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1004 | ||||
1005 | { | |||
1006 | // Create a sub-logger for the whole global range. Notice that this is | |||
1007 | // moving the current progress back to 0. | |||
1008 | ProgressLogger plSub1 = | |||
1009 | pl.CreateSubLoggerFromTo(0_pc, "Sub1 started", 100_pc, "Sub1 ended"); | |||
1010 | MOZ_RELEASE_ASSERT(progressRefPtr->Progress().IsExactlyZero())do { static_assert( mozilla::detail::AssertionConditionType< decltype(progressRefPtr->Progress().IsExactlyZero())>:: isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(progressRefPtr->Progress().IsExactlyZero()))), 0) )) { do { } while (false); MOZ_ReportAssertionFailure("progressRefPtr->Progress().IsExactlyZero()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1010); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "progressRefPtr->Progress().IsExactlyZero()" ")"); do { *((volatile int*)__null) = 1010; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1011 | MOZ_RELEASE_ASSERT(pl.GetGlobalProgress().IsExactlyZero())do { static_assert( mozilla::detail::AssertionConditionType< decltype(pl.GetGlobalProgress().IsExactlyZero())>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(pl.GetGlobalProgress().IsExactlyZero()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("pl.GetGlobalProgress().IsExactlyZero()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1011); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "pl.GetGlobalProgress().IsExactlyZero()" ")"); do { *((volatile int*)__null) = 1011; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1012 | MOZ_RELEASE_ASSERT(plSub1.GetGlobalProgress().IsExactlyZero())do { static_assert( mozilla::detail::AssertionConditionType< decltype(plSub1.GetGlobalProgress().IsExactlyZero())>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(plSub1.GetGlobalProgress().IsExactlyZero()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("plSub1.GetGlobalProgress().IsExactlyZero()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1012); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "plSub1.GetGlobalProgress().IsExactlyZero()" ")"); do { *((volatile int*)__null) = 1012; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1013 | MOZ_RELEASE_ASSERT(AreAllEqual(do { static_assert( mozilla::detail::AssertionConditionType< decltype(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation (), plSub1.GetLastGlobalLocation(), "Sub1 started"))>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation (), plSub1.GetLastGlobalLocation(), "Sub1 started")))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), \"Sub1 started\")" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1015); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), \"Sub1 started\")" ")"); do { *((volatile int*)__null) = 1015; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
1014 | progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(),do { static_assert( mozilla::detail::AssertionConditionType< decltype(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation (), plSub1.GetLastGlobalLocation(), "Sub1 started"))>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation (), plSub1.GetLastGlobalLocation(), "Sub1 started")))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), \"Sub1 started\")" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1015); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), \"Sub1 started\")" ")"); do { *((volatile int*)__null) = 1015; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
1015 | plSub1.GetLastGlobalLocation(), "Sub1 started"))do { static_assert( mozilla::detail::AssertionConditionType< decltype(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation (), plSub1.GetLastGlobalLocation(), "Sub1 started"))>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation (), plSub1.GetLastGlobalLocation(), "Sub1 started")))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), \"Sub1 started\")" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1015); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), \"Sub1 started\")" ")"); do { *((volatile int*)__null) = 1015; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1016 | ||||
1017 | // At this level, the scale is still 1:1. | |||
1018 | plSub1.SetLocalProgress(10_pc, "Sub1 10%"); | |||
1019 | MOZ_RELEASE_ASSERT(AreAllEqual(progressRefPtr->Progress(),do { static_assert( mozilla::detail::AssertionConditionType< decltype(AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress (), plSub1.GetGlobalProgress(), 10_pc))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(AreAllEqual(progressRefPtr-> Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress( ), 10_pc)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(), 10_pc)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1021); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(), 10_pc)" ")"); do { *((volatile int*)__null) = 1021; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
1020 | pl.GetGlobalProgress(),do { static_assert( mozilla::detail::AssertionConditionType< decltype(AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress (), plSub1.GetGlobalProgress(), 10_pc))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(AreAllEqual(progressRefPtr-> Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress( ), 10_pc)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(), 10_pc)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1021); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(), 10_pc)" ")"); do { *((volatile int*)__null) = 1021; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
1021 | plSub1.GetGlobalProgress(), 10_pc))do { static_assert( mozilla::detail::AssertionConditionType< decltype(AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress (), plSub1.GetGlobalProgress(), 10_pc))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(AreAllEqual(progressRefPtr-> Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress( ), 10_pc)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(), 10_pc)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1021); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(), 10_pc)" ")"); do { *((volatile int*)__null) = 1021; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1022 | MOZ_RELEASE_ASSERT(AreAllEqual(do { static_assert( mozilla::detail::AssertionConditionType< decltype(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation (), plSub1.GetLastGlobalLocation(), "Sub1 10%"))>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation (), plSub1.GetLastGlobalLocation(), "Sub1 10%")))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), \"Sub1 10%\")" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1024); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), \"Sub1 10%\")" ")"); do { *((volatile int*)__null) = 1024; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
1023 | progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(),do { static_assert( mozilla::detail::AssertionConditionType< decltype(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation (), plSub1.GetLastGlobalLocation(), "Sub1 10%"))>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation (), plSub1.GetLastGlobalLocation(), "Sub1 10%")))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), \"Sub1 10%\")" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1024); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), \"Sub1 10%\")" ")"); do { *((volatile int*)__null) = 1024; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
1024 | plSub1.GetLastGlobalLocation(), "Sub1 10%"))do { static_assert( mozilla::detail::AssertionConditionType< decltype(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation (), plSub1.GetLastGlobalLocation(), "Sub1 10%"))>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation (), plSub1.GetLastGlobalLocation(), "Sub1 10%")))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), \"Sub1 10%\")" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1024); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), \"Sub1 10%\")" ")"); do { *((volatile int*)__null) = 1024; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1025 | ||||
1026 | { | |||
1027 | // Create a sub-logger half the global range. | |||
1028 | // 0 0.25 0.375 0.5 0.625 0.75 1 | |||
1029 | // |---------------|-------|-------|-------|-------|---------------| | |||
1030 | // plSub2: 0 0.25 0.5 0.75 1 | |||
1031 | ProgressLogger plSub2 = plSub1.CreateSubLoggerFromTo( | |||
1032 | 25_pc, "Sub2 started", 75_pc, "Sub2 ended"); | |||
1033 | MOZ_RELEASE_ASSERT(AreAllEqual(do { static_assert( mozilla::detail::AssertionConditionType< decltype(AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress (), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), 25_pc ))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress (), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), 25_pc )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), 25_pc)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1035); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), 25_pc)" ")"); do { *((volatile int*)__null) = 1035; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
1034 | progressRefPtr->Progress(), pl.GetGlobalProgress(),do { static_assert( mozilla::detail::AssertionConditionType< decltype(AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress (), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), 25_pc ))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress (), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), 25_pc )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), 25_pc)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1035); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), 25_pc)" ")"); do { *((volatile int*)__null) = 1035; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
1035 | plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), 25_pc))do { static_assert( mozilla::detail::AssertionConditionType< decltype(AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress (), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), 25_pc ))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress (), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), 25_pc )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), 25_pc)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1035); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), 25_pc)" ")"); do { *((volatile int*)__null) = 1035; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1036 | MOZ_RELEASE_ASSERT(AreAllEqual(do { static_assert( mozilla::detail::AssertionConditionType< decltype(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation (), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation (), "Sub2 started"))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(AreAllEqual( progressRefPtr-> LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation (), plSub2.GetLastGlobalLocation(), "Sub2 started")))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation(), \"Sub2 started\")" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1039); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation(), \"Sub2 started\")" ")"); do { *((volatile int*)__null) = 1039; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
1037 | progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(),do { static_assert( mozilla::detail::AssertionConditionType< decltype(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation (), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation (), "Sub2 started"))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(AreAllEqual( progressRefPtr-> LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation (), plSub2.GetLastGlobalLocation(), "Sub2 started")))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation(), \"Sub2 started\")" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1039); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation(), \"Sub2 started\")" ")"); do { *((volatile int*)__null) = 1039; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
1038 | plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation(),do { static_assert( mozilla::detail::AssertionConditionType< decltype(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation (), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation (), "Sub2 started"))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(AreAllEqual( progressRefPtr-> LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation (), plSub2.GetLastGlobalLocation(), "Sub2 started")))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation(), \"Sub2 started\")" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1039); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation(), \"Sub2 started\")" ")"); do { *((volatile int*)__null) = 1039; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
1039 | "Sub2 started"))do { static_assert( mozilla::detail::AssertionConditionType< decltype(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation (), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation (), "Sub2 started"))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(AreAllEqual( progressRefPtr-> LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation (), plSub2.GetLastGlobalLocation(), "Sub2 started")))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation(), \"Sub2 started\")" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1039); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation(), \"Sub2 started\")" ")"); do { *((volatile int*)__null) = 1039; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1040 | ||||
1041 | plSub2.SetLocalProgress(25_pc, "Sub2 25%"); | |||
1042 | MOZ_RELEASE_ASSERT(AreAllEqual(do { static_assert( mozilla::detail::AssertionConditionType< decltype(AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress (), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), 37.5_pc ))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress (), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), 37.5_pc )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), 37.5_pc)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1044); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), 37.5_pc)" ")"); do { *((volatile int*)__null) = 1044; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
1043 | progressRefPtr->Progress(), pl.GetGlobalProgress(),do { static_assert( mozilla::detail::AssertionConditionType< decltype(AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress (), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), 37.5_pc ))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress (), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), 37.5_pc )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), 37.5_pc)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1044); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), 37.5_pc)" ")"); do { *((volatile int*)__null) = 1044; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
1044 | plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), 37.5_pc))do { static_assert( mozilla::detail::AssertionConditionType< decltype(AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress (), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), 37.5_pc ))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress (), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), 37.5_pc )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), 37.5_pc)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1044); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), 37.5_pc)" ")"); do { *((volatile int*)__null) = 1044; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1045 | MOZ_RELEASE_ASSERT(AreAllEqual(do { static_assert( mozilla::detail::AssertionConditionType< decltype(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation (), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation (), "Sub2 25%"))>::isValid, "invalid assertion condition") ; if ((__builtin_expect(!!(!(!!(AreAllEqual( progressRefPtr-> LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation (), plSub2.GetLastGlobalLocation(), "Sub2 25%")))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation(), \"Sub2 25%\")" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1048); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation(), \"Sub2 25%\")" ")"); do { *((volatile int*)__null) = 1048; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
1046 | progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(),do { static_assert( mozilla::detail::AssertionConditionType< decltype(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation (), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation (), "Sub2 25%"))>::isValid, "invalid assertion condition") ; if ((__builtin_expect(!!(!(!!(AreAllEqual( progressRefPtr-> LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation (), plSub2.GetLastGlobalLocation(), "Sub2 25%")))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation(), \"Sub2 25%\")" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1048); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation(), \"Sub2 25%\")" ")"); do { *((volatile int*)__null) = 1048; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
1047 | plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation(),do { static_assert( mozilla::detail::AssertionConditionType< decltype(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation (), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation (), "Sub2 25%"))>::isValid, "invalid assertion condition") ; if ((__builtin_expect(!!(!(!!(AreAllEqual( progressRefPtr-> LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation (), plSub2.GetLastGlobalLocation(), "Sub2 25%")))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation(), \"Sub2 25%\")" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1048); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation(), \"Sub2 25%\")" ")"); do { *((volatile int*)__null) = 1048; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
1048 | "Sub2 25%"))do { static_assert( mozilla::detail::AssertionConditionType< decltype(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation (), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation (), "Sub2 25%"))>::isValid, "invalid assertion condition") ; if ((__builtin_expect(!!(!(!!(AreAllEqual( progressRefPtr-> LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation (), plSub2.GetLastGlobalLocation(), "Sub2 25%")))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation(), \"Sub2 25%\")" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1048); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation(), \"Sub2 25%\")" ")"); do { *((volatile int*)__null) = 1048; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1049 | ||||
1050 | plSub2.SetLocalProgress(50_pc, "Sub2 50%"); | |||
1051 | MOZ_RELEASE_ASSERT(AreAllEqual(do { static_assert( mozilla::detail::AssertionConditionType< decltype(AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress (), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), 50_pc ))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress (), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), 50_pc )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), 50_pc)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1053); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), 50_pc)" ")"); do { *((volatile int*)__null) = 1053; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
1052 | progressRefPtr->Progress(), pl.GetGlobalProgress(),do { static_assert( mozilla::detail::AssertionConditionType< decltype(AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress (), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), 50_pc ))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress (), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), 50_pc )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), 50_pc)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1053); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), 50_pc)" ")"); do { *((volatile int*)__null) = 1053; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
1053 | plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), 50_pc))do { static_assert( mozilla::detail::AssertionConditionType< decltype(AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress (), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), 50_pc ))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress (), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), 50_pc )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), 50_pc)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1053); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), 50_pc)" ")"); do { *((volatile int*)__null) = 1053; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1054 | MOZ_RELEASE_ASSERT(AreAllEqual(do { static_assert( mozilla::detail::AssertionConditionType< decltype(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation (), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation (), "Sub2 50%"))>::isValid, "invalid assertion condition") ; if ((__builtin_expect(!!(!(!!(AreAllEqual( progressRefPtr-> LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation (), plSub2.GetLastGlobalLocation(), "Sub2 50%")))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation(), \"Sub2 50%\")" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1057); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation(), \"Sub2 50%\")" ")"); do { *((volatile int*)__null) = 1057; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
1055 | progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(),do { static_assert( mozilla::detail::AssertionConditionType< decltype(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation (), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation (), "Sub2 50%"))>::isValid, "invalid assertion condition") ; if ((__builtin_expect(!!(!(!!(AreAllEqual( progressRefPtr-> LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation (), plSub2.GetLastGlobalLocation(), "Sub2 50%")))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation(), \"Sub2 50%\")" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1057); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation(), \"Sub2 50%\")" ")"); do { *((volatile int*)__null) = 1057; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
1056 | plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation(),do { static_assert( mozilla::detail::AssertionConditionType< decltype(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation (), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation (), "Sub2 50%"))>::isValid, "invalid assertion condition") ; if ((__builtin_expect(!!(!(!!(AreAllEqual( progressRefPtr-> LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation (), plSub2.GetLastGlobalLocation(), "Sub2 50%")))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation(), \"Sub2 50%\")" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1057); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation(), \"Sub2 50%\")" ")"); do { *((volatile int*)__null) = 1057; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
1057 | "Sub2 50%"))do { static_assert( mozilla::detail::AssertionConditionType< decltype(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation (), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation (), "Sub2 50%"))>::isValid, "invalid assertion condition") ; if ((__builtin_expect(!!(!(!!(AreAllEqual( progressRefPtr-> LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation (), plSub2.GetLastGlobalLocation(), "Sub2 50%")))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation(), \"Sub2 50%\")" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1057); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation(), \"Sub2 50%\")" ")"); do { *((volatile int*)__null) = 1057; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1058 | ||||
1059 | { | |||
1060 | // Create a sub-logger half the parent range. | |||
1061 | // 0 0.25 0.375 0.5 0.625 0.75 1 | |||
1062 | // |---------------|-------|-------|-------|-------|---------------| | |||
1063 | // plSub2: 0 0.25 0.5 0.75 1 | |||
1064 | // plSub3: 0 0.5 1 | |||
1065 | ProgressLogger plSub3 = plSub2.CreateSubLoggerTo( | |||
1066 | "Sub3 started", 100_pc, ProgressLogger::NO_LOCATION_UPDATE); | |||
1067 | MOZ_RELEASE_ASSERT(AreAllEqual(do { static_assert( mozilla::detail::AssertionConditionType< decltype(AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress (), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), plSub3 .GetGlobalProgress(), 50_pc))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(AreAllEqual( progressRefPtr-> Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress( ), plSub2.GetGlobalProgress(), plSub3.GetGlobalProgress(), 50_pc )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), plSub3.GetGlobalProgress(), 50_pc)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1070); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), plSub3.GetGlobalProgress(), 50_pc)" ")"); do { *((volatile int*)__null) = 1070; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
1068 | progressRefPtr->Progress(), pl.GetGlobalProgress(),do { static_assert( mozilla::detail::AssertionConditionType< decltype(AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress (), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), plSub3 .GetGlobalProgress(), 50_pc))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(AreAllEqual( progressRefPtr-> Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress( ), plSub2.GetGlobalProgress(), plSub3.GetGlobalProgress(), 50_pc )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), plSub3.GetGlobalProgress(), 50_pc)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1070); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), plSub3.GetGlobalProgress(), 50_pc)" ")"); do { *((volatile int*)__null) = 1070; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
1069 | plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(),do { static_assert( mozilla::detail::AssertionConditionType< decltype(AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress (), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), plSub3 .GetGlobalProgress(), 50_pc))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(AreAllEqual( progressRefPtr-> Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress( ), plSub2.GetGlobalProgress(), plSub3.GetGlobalProgress(), 50_pc )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), plSub3.GetGlobalProgress(), 50_pc)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1070); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), plSub3.GetGlobalProgress(), 50_pc)" ")"); do { *((volatile int*)__null) = 1070; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
1070 | plSub3.GetGlobalProgress(), 50_pc))do { static_assert( mozilla::detail::AssertionConditionType< decltype(AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress (), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), plSub3 .GetGlobalProgress(), 50_pc))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(AreAllEqual( progressRefPtr-> Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress( ), plSub2.GetGlobalProgress(), plSub3.GetGlobalProgress(), 50_pc )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), plSub3.GetGlobalProgress(), 50_pc)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1070); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), plSub3.GetGlobalProgress(), 50_pc)" ")"); do { *((volatile int*)__null) = 1070; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1071 | MOZ_RELEASE_ASSERT(AreAllEqual(do { static_assert( mozilla::detail::AssertionConditionType< decltype(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation (), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation (), plSub3.GetLastGlobalLocation(), "Sub3 started"))>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation (), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation (), plSub3.GetLastGlobalLocation(), "Sub3 started")))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation(), plSub3.GetLastGlobalLocation(), \"Sub3 started\")" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1074); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation(), plSub3.GetLastGlobalLocation(), \"Sub3 started\")" ")"); do { *((volatile int*)__null) = 1074; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
1072 | progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(),do { static_assert( mozilla::detail::AssertionConditionType< decltype(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation (), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation (), plSub3.GetLastGlobalLocation(), "Sub3 started"))>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation (), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation (), plSub3.GetLastGlobalLocation(), "Sub3 started")))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation(), plSub3.GetLastGlobalLocation(), \"Sub3 started\")" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1074); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation(), plSub3.GetLastGlobalLocation(), \"Sub3 started\")" ")"); do { *((volatile int*)__null) = 1074; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
1073 | plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation(),do { static_assert( mozilla::detail::AssertionConditionType< decltype(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation (), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation (), plSub3.GetLastGlobalLocation(), "Sub3 started"))>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation (), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation (), plSub3.GetLastGlobalLocation(), "Sub3 started")))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation(), plSub3.GetLastGlobalLocation(), \"Sub3 started\")" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1074); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation(), plSub3.GetLastGlobalLocation(), \"Sub3 started\")" ")"); do { *((volatile int*)__null) = 1074; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
1074 | plSub3.GetLastGlobalLocation(), "Sub3 started"))do { static_assert( mozilla::detail::AssertionConditionType< decltype(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation (), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation (), plSub3.GetLastGlobalLocation(), "Sub3 started"))>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation (), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation (), plSub3.GetLastGlobalLocation(), "Sub3 started")))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation(), plSub3.GetLastGlobalLocation(), \"Sub3 started\")" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1074); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation(), plSub3.GetLastGlobalLocation(), \"Sub3 started\")" ")"); do { *((volatile int*)__null) = 1074; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1075 | ||||
1076 | plSub3.SetLocalProgress(50_pc, "Sub3 50%"); | |||
1077 | MOZ_RELEASE_ASSERT(AreAllEqual(do { static_assert( mozilla::detail::AssertionConditionType< decltype(AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress (), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), plSub3 .GetGlobalProgress(), 62.5_pc))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(AreAllEqual( progressRefPtr-> Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress( ), plSub2.GetGlobalProgress(), plSub3.GetGlobalProgress(), 62.5_pc )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), plSub3.GetGlobalProgress(), 62.5_pc)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1080); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), plSub3.GetGlobalProgress(), 62.5_pc)" ")"); do { *((volatile int*)__null) = 1080; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
1078 | progressRefPtr->Progress(), pl.GetGlobalProgress(),do { static_assert( mozilla::detail::AssertionConditionType< decltype(AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress (), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), plSub3 .GetGlobalProgress(), 62.5_pc))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(AreAllEqual( progressRefPtr-> Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress( ), plSub2.GetGlobalProgress(), plSub3.GetGlobalProgress(), 62.5_pc )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), plSub3.GetGlobalProgress(), 62.5_pc)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1080); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), plSub3.GetGlobalProgress(), 62.5_pc)" ")"); do { *((volatile int*)__null) = 1080; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
1079 | plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(),do { static_assert( mozilla::detail::AssertionConditionType< decltype(AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress (), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), plSub3 .GetGlobalProgress(), 62.5_pc))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(AreAllEqual( progressRefPtr-> Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress( ), plSub2.GetGlobalProgress(), plSub3.GetGlobalProgress(), 62.5_pc )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), plSub3.GetGlobalProgress(), 62.5_pc)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1080); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), plSub3.GetGlobalProgress(), 62.5_pc)" ")"); do { *((volatile int*)__null) = 1080; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
1080 | plSub3.GetGlobalProgress(), 62.5_pc))do { static_assert( mozilla::detail::AssertionConditionType< decltype(AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress (), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), plSub3 .GetGlobalProgress(), 62.5_pc))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(AreAllEqual( progressRefPtr-> Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress( ), plSub2.GetGlobalProgress(), plSub3.GetGlobalProgress(), 62.5_pc )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), plSub3.GetGlobalProgress(), 62.5_pc)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1080); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), plSub3.GetGlobalProgress(), 62.5_pc)" ")"); do { *((volatile int*)__null) = 1080; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1081 | MOZ_RELEASE_ASSERT(AreAllEqual(do { static_assert( mozilla::detail::AssertionConditionType< decltype(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation (), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation (), plSub3.GetLastGlobalLocation(), "Sub3 50%"))>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation (), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation (), plSub3.GetLastGlobalLocation(), "Sub3 50%")))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation(), plSub3.GetLastGlobalLocation(), \"Sub3 50%\")" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1084); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation(), plSub3.GetLastGlobalLocation(), \"Sub3 50%\")" ")"); do { *((volatile int*)__null) = 1084; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
1082 | progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(),do { static_assert( mozilla::detail::AssertionConditionType< decltype(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation (), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation (), plSub3.GetLastGlobalLocation(), "Sub3 50%"))>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation (), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation (), plSub3.GetLastGlobalLocation(), "Sub3 50%")))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation(), plSub3.GetLastGlobalLocation(), \"Sub3 50%\")" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1084); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation(), plSub3.GetLastGlobalLocation(), \"Sub3 50%\")" ")"); do { *((volatile int*)__null) = 1084; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
1083 | plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation(),do { static_assert( mozilla::detail::AssertionConditionType< decltype(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation (), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation (), plSub3.GetLastGlobalLocation(), "Sub3 50%"))>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation (), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation (), plSub3.GetLastGlobalLocation(), "Sub3 50%")))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation(), plSub3.GetLastGlobalLocation(), \"Sub3 50%\")" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1084); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation(), plSub3.GetLastGlobalLocation(), \"Sub3 50%\")" ")"); do { *((volatile int*)__null) = 1084; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
1084 | plSub3.GetLastGlobalLocation(), "Sub3 50%"))do { static_assert( mozilla::detail::AssertionConditionType< decltype(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation (), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation (), plSub3.GetLastGlobalLocation(), "Sub3 50%"))>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation (), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation (), plSub3.GetLastGlobalLocation(), "Sub3 50%")))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation(), plSub3.GetLastGlobalLocation(), \"Sub3 50%\")" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1084); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation(), plSub3.GetLastGlobalLocation(), \"Sub3 50%\")" ")"); do { *((volatile int*)__null) = 1084; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1085 | } // End of plSub3 | |||
1086 | ||||
1087 | // When plSub3 ends, progress moves to its 100%, which is also plSub2's | |||
1088 | // 100%, which is plSub1's and the global progress of 75% | |||
1089 | MOZ_RELEASE_ASSERT(AreAllEqual(do { static_assert( mozilla::detail::AssertionConditionType< decltype(AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress (), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), 75_pc ))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress (), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), 75_pc )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), 75_pc)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1091); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), 75_pc)" ")"); do { *((volatile int*)__null) = 1091; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
1090 | progressRefPtr->Progress(), pl.GetGlobalProgress(),do { static_assert( mozilla::detail::AssertionConditionType< decltype(AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress (), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), 75_pc ))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress (), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), 75_pc )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), 75_pc)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1091); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), 75_pc)" ")"); do { *((volatile int*)__null) = 1091; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
1091 | plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), 75_pc))do { static_assert( mozilla::detail::AssertionConditionType< decltype(AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress (), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), 75_pc ))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress (), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), 75_pc )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), 75_pc)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1091); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(), plSub2.GetGlobalProgress(), 75_pc)" ")"); do { *((volatile int*)__null) = 1091; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1092 | // But location is still at the last explicit update. | |||
1093 | MOZ_RELEASE_ASSERT(AreAllEqual(do { static_assert( mozilla::detail::AssertionConditionType< decltype(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation (), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation (), "Sub3 50%"))>::isValid, "invalid assertion condition") ; if ((__builtin_expect(!!(!(!!(AreAllEqual( progressRefPtr-> LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation (), plSub2.GetLastGlobalLocation(), "Sub3 50%")))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation(), \"Sub3 50%\")" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1096); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation(), \"Sub3 50%\")" ")"); do { *((volatile int*)__null) = 1096; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
1094 | progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(),do { static_assert( mozilla::detail::AssertionConditionType< decltype(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation (), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation (), "Sub3 50%"))>::isValid, "invalid assertion condition") ; if ((__builtin_expect(!!(!(!!(AreAllEqual( progressRefPtr-> LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation (), plSub2.GetLastGlobalLocation(), "Sub3 50%")))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation(), \"Sub3 50%\")" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1096); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation(), \"Sub3 50%\")" ")"); do { *((volatile int*)__null) = 1096; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
1095 | plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation(),do { static_assert( mozilla::detail::AssertionConditionType< decltype(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation (), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation (), "Sub3 50%"))>::isValid, "invalid assertion condition") ; if ((__builtin_expect(!!(!(!!(AreAllEqual( progressRefPtr-> LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation (), plSub2.GetLastGlobalLocation(), "Sub3 50%")))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation(), \"Sub3 50%\")" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1096); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation(), \"Sub3 50%\")" ")"); do { *((volatile int*)__null) = 1096; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
1096 | "Sub3 50%"))do { static_assert( mozilla::detail::AssertionConditionType< decltype(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation (), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation (), "Sub3 50%"))>::isValid, "invalid assertion condition") ; if ((__builtin_expect(!!(!(!!(AreAllEqual( progressRefPtr-> LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation (), plSub2.GetLastGlobalLocation(), "Sub3 50%")))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation(), \"Sub3 50%\")" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1096); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), plSub2.GetLastGlobalLocation(), \"Sub3 50%\")" ")"); do { *((volatile int*)__null) = 1096; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1097 | } // End of plSub2 | |||
1098 | ||||
1099 | MOZ_RELEASE_ASSERT(AreAllEqual(progressRefPtr->Progress(),do { static_assert( mozilla::detail::AssertionConditionType< decltype(AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress (), plSub1.GetGlobalProgress(), 75_pc))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(AreAllEqual(progressRefPtr-> Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress( ), 75_pc)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(), 75_pc)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1101); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(), 75_pc)" ")"); do { *((volatile int*)__null) = 1101; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
1100 | pl.GetGlobalProgress(),do { static_assert( mozilla::detail::AssertionConditionType< decltype(AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress (), plSub1.GetGlobalProgress(), 75_pc))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(AreAllEqual(progressRefPtr-> Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress( ), 75_pc)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(), 75_pc)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1101); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(), 75_pc)" ")"); do { *((volatile int*)__null) = 1101; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
1101 | plSub1.GetGlobalProgress(), 75_pc))do { static_assert( mozilla::detail::AssertionConditionType< decltype(AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress (), plSub1.GetGlobalProgress(), 75_pc))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(AreAllEqual(progressRefPtr-> Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress( ), 75_pc)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(), 75_pc)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1101); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress(), plSub1.GetGlobalProgress(), 75_pc)" ")"); do { *((volatile int*)__null) = 1101; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1102 | MOZ_RELEASE_ASSERT(AreAllEqual(do { static_assert( mozilla::detail::AssertionConditionType< decltype(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation (), plSub1.GetLastGlobalLocation(), "Sub2 ended"))>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation (), plSub1.GetLastGlobalLocation(), "Sub2 ended")))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), \"Sub2 ended\")" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1104); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), \"Sub2 ended\")" ")"); do { *((volatile int*)__null) = 1104; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
1103 | progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(),do { static_assert( mozilla::detail::AssertionConditionType< decltype(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation (), plSub1.GetLastGlobalLocation(), "Sub2 ended"))>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation (), plSub1.GetLastGlobalLocation(), "Sub2 ended")))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), \"Sub2 ended\")" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1104); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), \"Sub2 ended\")" ")"); do { *((volatile int*)__null) = 1104; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
1104 | plSub1.GetLastGlobalLocation(), "Sub2 ended"))do { static_assert( mozilla::detail::AssertionConditionType< decltype(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation (), plSub1.GetLastGlobalLocation(), "Sub2 ended"))>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation (), plSub1.GetLastGlobalLocation(), "Sub2 ended")))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), \"Sub2 ended\")" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1104); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), plSub1.GetLastGlobalLocation(), \"Sub2 ended\")" ")"); do { *((volatile int*)__null) = 1104; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1105 | } // End of plSub1 | |||
1106 | ||||
1107 | MOZ_RELEASE_ASSERT(progressRefPtr->Progress().IsExactlyOne())do { static_assert( mozilla::detail::AssertionConditionType< decltype(progressRefPtr->Progress().IsExactlyOne())>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(progressRefPtr->Progress().IsExactlyOne()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("progressRefPtr->Progress().IsExactlyOne()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1107); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "progressRefPtr->Progress().IsExactlyOne()" ")"); do { *((volatile int*)__null) = 1107; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1108 | MOZ_RELEASE_ASSERT(pl.GetGlobalProgress().IsExactlyOne())do { static_assert( mozilla::detail::AssertionConditionType< decltype(pl.GetGlobalProgress().IsExactlyOne())>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(! !(pl.GetGlobalProgress().IsExactlyOne()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("pl.GetGlobalProgress().IsExactlyOne()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1108); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "pl.GetGlobalProgress().IsExactlyOne()" ")"); do { *((volatile int*)__null) = 1108; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1109 | MOZ_RELEASE_ASSERT(AreAllEqual(progressRefPtr->LastLocation(),do { static_assert( mozilla::detail::AssertionConditionType< decltype(AreAllEqual(progressRefPtr->LastLocation(), pl.GetLastGlobalLocation (), "Sub1 ended"))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(AreAllEqual(progressRefPtr-> LastLocation(), pl.GetLastGlobalLocation(), "Sub1 ended")))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("AreAllEqual(progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), \"Sub1 ended\")" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1110); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual(progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), \"Sub1 ended\")" ")"); do { *((volatile int*)__null) = 1110; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
1110 | pl.GetLastGlobalLocation(), "Sub1 ended"))do { static_assert( mozilla::detail::AssertionConditionType< decltype(AreAllEqual(progressRefPtr->LastLocation(), pl.GetLastGlobalLocation (), "Sub1 ended"))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(AreAllEqual(progressRefPtr-> LastLocation(), pl.GetLastGlobalLocation(), "Sub1 ended")))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("AreAllEqual(progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), \"Sub1 ended\")" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1110); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual(progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), \"Sub1 ended\")" ")"); do { *((volatile int*)__null) = 1110; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1111 | ||||
1112 | const auto loopStart = 75_pc; | |||
1113 | const auto loopEnd = 87.5_pc; | |||
1114 | const uint32_t loopCount = 8; | |||
1115 | uint32_t expectedIndex = 0u; | |||
1116 | auto expectedIterationStart = loopStart; | |||
1117 | const auto iterationIncrement = (loopEnd - loopStart) / loopCount; | |||
1118 | for (auto&& [index, loopPL] : pl.CreateLoopSubLoggersFromTo( | |||
1119 | loopStart, loopEnd, loopCount, "looping...")) { | |||
1120 | MOZ_RELEASE_ASSERT(index == expectedIndex)do { static_assert( mozilla::detail::AssertionConditionType< decltype(index == expectedIndex)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(index == expectedIndex))), 0 ))) { do { } while (false); MOZ_ReportAssertionFailure("index == expectedIndex" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1120); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "index == expectedIndex" ")"); do { *((volatile int*)__null) = 1120; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1121 | ++expectedIndex; | |||
1122 | MOZ_RELEASE_ASSERT(do { static_assert( mozilla::detail::AssertionConditionType< decltype(AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress (), loopPL.GetGlobalProgress(), expectedIterationStart))>:: isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress (), loopPL.GetGlobalProgress(), expectedIterationStart)))), 0 ))) { do { } while (false); MOZ_ReportAssertionFailure("AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress(), loopPL.GetGlobalProgress(), expectedIterationStart)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1124); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress(), loopPL.GetGlobalProgress(), expectedIterationStart)" ")"); do { *((volatile int*)__null) = 1124; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
1123 | AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress(),do { static_assert( mozilla::detail::AssertionConditionType< decltype(AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress (), loopPL.GetGlobalProgress(), expectedIterationStart))>:: isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress (), loopPL.GetGlobalProgress(), expectedIterationStart)))), 0 ))) { do { } while (false); MOZ_ReportAssertionFailure("AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress(), loopPL.GetGlobalProgress(), expectedIterationStart)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1124); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress(), loopPL.GetGlobalProgress(), expectedIterationStart)" ")"); do { *((volatile int*)__null) = 1124; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
1124 | loopPL.GetGlobalProgress(), expectedIterationStart))do { static_assert( mozilla::detail::AssertionConditionType< decltype(AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress (), loopPL.GetGlobalProgress(), expectedIterationStart))>:: isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress (), loopPL.GetGlobalProgress(), expectedIterationStart)))), 0 ))) { do { } while (false); MOZ_ReportAssertionFailure("AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress(), loopPL.GetGlobalProgress(), expectedIterationStart)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1124); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress(), loopPL.GetGlobalProgress(), expectedIterationStart)" ")"); do { *((volatile int*)__null) = 1124; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1125 | MOZ_RELEASE_ASSERT(AreAllEqual(do { static_assert( mozilla::detail::AssertionConditionType< decltype(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation (), loopPL.GetLastGlobalLocation(), "looping..."))>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation (), loopPL.GetLastGlobalLocation(), "looping...")))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), loopPL.GetLastGlobalLocation(), \"looping...\")" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1127); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), loopPL.GetLastGlobalLocation(), \"looping...\")" ")"); do { *((volatile int*)__null) = 1127; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
1126 | progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(),do { static_assert( mozilla::detail::AssertionConditionType< decltype(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation (), loopPL.GetLastGlobalLocation(), "looping..."))>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation (), loopPL.GetLastGlobalLocation(), "looping...")))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), loopPL.GetLastGlobalLocation(), \"looping...\")" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1127); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), loopPL.GetLastGlobalLocation(), \"looping...\")" ")"); do { *((volatile int*)__null) = 1127; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
1127 | loopPL.GetLastGlobalLocation(), "looping..."))do { static_assert( mozilla::detail::AssertionConditionType< decltype(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation (), loopPL.GetLastGlobalLocation(), "looping..."))>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation (), loopPL.GetLastGlobalLocation(), "looping...")))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), loopPL.GetLastGlobalLocation(), \"looping...\")" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1127); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual( progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), loopPL.GetLastGlobalLocation(), \"looping...\")" ")"); do { *((volatile int*)__null) = 1127; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1128 | ||||
1129 | loopPL.SetLocalProgress(50_pc, "half"); | |||
1130 | MOZ_RELEASE_ASSERT(loopPL.GetGlobalProgress() ==do { static_assert( mozilla::detail::AssertionConditionType< decltype(loopPL.GetGlobalProgress() == expectedIterationStart + iterationIncrement / 2u)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(loopPL.GetGlobalProgress() == expectedIterationStart + iterationIncrement / 2u))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("loopPL.GetGlobalProgress() == expectedIterationStart + iterationIncrement / 2u" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1131); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "loopPL.GetGlobalProgress() == expectedIterationStart + iterationIncrement / 2u" ")"); do { *((volatile int*)__null) = 1131; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
1131 | expectedIterationStart + iterationIncrement / 2u)do { static_assert( mozilla::detail::AssertionConditionType< decltype(loopPL.GetGlobalProgress() == expectedIterationStart + iterationIncrement / 2u)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(loopPL.GetGlobalProgress() == expectedIterationStart + iterationIncrement / 2u))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("loopPL.GetGlobalProgress() == expectedIterationStart + iterationIncrement / 2u" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1131); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "loopPL.GetGlobalProgress() == expectedIterationStart + iterationIncrement / 2u" ")"); do { *((volatile int*)__null) = 1131; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1132 | MOZ_RELEASE_ASSERT(do { static_assert( mozilla::detail::AssertionConditionType< decltype(AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress (), loopPL.GetGlobalProgress(), expectedIterationStart + iterationIncrement / 2u))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress (), loopPL.GetGlobalProgress(), expectedIterationStart + iterationIncrement / 2u)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress(), loopPL.GetGlobalProgress(), expectedIterationStart + iterationIncrement / 2u)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1135); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress(), loopPL.GetGlobalProgress(), expectedIterationStart + iterationIncrement / 2u)" ")"); do { *((volatile int*)__null) = 1135; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
1133 | AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress(),do { static_assert( mozilla::detail::AssertionConditionType< decltype(AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress (), loopPL.GetGlobalProgress(), expectedIterationStart + iterationIncrement / 2u))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress (), loopPL.GetGlobalProgress(), expectedIterationStart + iterationIncrement / 2u)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress(), loopPL.GetGlobalProgress(), expectedIterationStart + iterationIncrement / 2u)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1135); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress(), loopPL.GetGlobalProgress(), expectedIterationStart + iterationIncrement / 2u)" ")"); do { *((volatile int*)__null) = 1135; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
1134 | loopPL.GetGlobalProgress(),do { static_assert( mozilla::detail::AssertionConditionType< decltype(AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress (), loopPL.GetGlobalProgress(), expectedIterationStart + iterationIncrement / 2u))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress (), loopPL.GetGlobalProgress(), expectedIterationStart + iterationIncrement / 2u)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress(), loopPL.GetGlobalProgress(), expectedIterationStart + iterationIncrement / 2u)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1135); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress(), loopPL.GetGlobalProgress(), expectedIterationStart + iterationIncrement / 2u)" ")"); do { *((volatile int*)__null) = 1135; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
1135 | expectedIterationStart + iterationIncrement / 2u))do { static_assert( mozilla::detail::AssertionConditionType< decltype(AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress (), loopPL.GetGlobalProgress(), expectedIterationStart + iterationIncrement / 2u))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress (), loopPL.GetGlobalProgress(), expectedIterationStart + iterationIncrement / 2u)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress(), loopPL.GetGlobalProgress(), expectedIterationStart + iterationIncrement / 2u)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1135); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress(), loopPL.GetGlobalProgress(), expectedIterationStart + iterationIncrement / 2u)" ")"); do { *((volatile int*)__null) = 1135; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1136 | MOZ_RELEASE_ASSERT(AreAllEqual(progressRefPtr->LastLocation(),do { static_assert( mozilla::detail::AssertionConditionType< decltype(AreAllEqual(progressRefPtr->LastLocation(), pl.GetLastGlobalLocation (), loopPL.GetLastGlobalLocation(), "half"))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(AreAllEqual(progressRefPtr-> LastLocation(), pl.GetLastGlobalLocation(), loopPL.GetLastGlobalLocation (), "half")))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("AreAllEqual(progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), loopPL.GetLastGlobalLocation(), \"half\")" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1138); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual(progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), loopPL.GetLastGlobalLocation(), \"half\")" ")"); do { *((volatile int*)__null) = 1138; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
1137 | pl.GetLastGlobalLocation(),do { static_assert( mozilla::detail::AssertionConditionType< decltype(AreAllEqual(progressRefPtr->LastLocation(), pl.GetLastGlobalLocation (), loopPL.GetLastGlobalLocation(), "half"))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(AreAllEqual(progressRefPtr-> LastLocation(), pl.GetLastGlobalLocation(), loopPL.GetLastGlobalLocation (), "half")))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("AreAllEqual(progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), loopPL.GetLastGlobalLocation(), \"half\")" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1138); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual(progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), loopPL.GetLastGlobalLocation(), \"half\")" ")"); do { *((volatile int*)__null) = 1138; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
1138 | loopPL.GetLastGlobalLocation(), "half"))do { static_assert( mozilla::detail::AssertionConditionType< decltype(AreAllEqual(progressRefPtr->LastLocation(), pl.GetLastGlobalLocation (), loopPL.GetLastGlobalLocation(), "half"))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(AreAllEqual(progressRefPtr-> LastLocation(), pl.GetLastGlobalLocation(), loopPL.GetLastGlobalLocation (), "half")))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("AreAllEqual(progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), loopPL.GetLastGlobalLocation(), \"half\")" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1138); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual(progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), loopPL.GetLastGlobalLocation(), \"half\")" ")"); do { *((volatile int*)__null) = 1138; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1139 | ||||
1140 | expectedIterationStart = expectedIterationStart + iterationIncrement; | |||
1141 | } | |||
1142 | MOZ_RELEASE_ASSERT(AreAllEqual(progressRefPtr->Progress(),do { static_assert( mozilla::detail::AssertionConditionType< decltype(AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress (), expectedIterationStart))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(AreAllEqual(progressRefPtr-> Progress(), pl.GetGlobalProgress(), expectedIterationStart))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress(), expectedIterationStart)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1144); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress(), expectedIterationStart)" ")"); do { *((volatile int*)__null) = 1144; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
1143 | pl.GetGlobalProgress(),do { static_assert( mozilla::detail::AssertionConditionType< decltype(AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress (), expectedIterationStart))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(AreAllEqual(progressRefPtr-> Progress(), pl.GetGlobalProgress(), expectedIterationStart))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress(), expectedIterationStart)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1144); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress(), expectedIterationStart)" ")"); do { *((volatile int*)__null) = 1144; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
1144 | expectedIterationStart))do { static_assert( mozilla::detail::AssertionConditionType< decltype(AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress (), expectedIterationStart))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(AreAllEqual(progressRefPtr-> Progress(), pl.GetGlobalProgress(), expectedIterationStart))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress(), expectedIterationStart)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1144); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual(progressRefPtr->Progress(), pl.GetGlobalProgress(), expectedIterationStart)" ")"); do { *((volatile int*)__null) = 1144; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1145 | MOZ_RELEASE_ASSERT(AreAllEqual(progressRefPtr->LastLocation(),do { static_assert( mozilla::detail::AssertionConditionType< decltype(AreAllEqual(progressRefPtr->LastLocation(), pl.GetLastGlobalLocation (), "looping..."))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(AreAllEqual(progressRefPtr-> LastLocation(), pl.GetLastGlobalLocation(), "looping...")))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("AreAllEqual(progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), \"looping...\")" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1146); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual(progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), \"looping...\")" ")"); do { *((volatile int*)__null) = 1146; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
1146 | pl.GetLastGlobalLocation(), "looping..."))do { static_assert( mozilla::detail::AssertionConditionType< decltype(AreAllEqual(progressRefPtr->LastLocation(), pl.GetLastGlobalLocation (), "looping..."))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(AreAllEqual(progressRefPtr-> LastLocation(), pl.GetLastGlobalLocation(), "looping...")))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("AreAllEqual(progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), \"looping...\")" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1146); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual(progressRefPtr->LastLocation(), pl.GetLastGlobalLocation(), \"looping...\")" ")"); do { *((volatile int*)__null) = 1146; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1147 | } // End of pl | |||
1148 | MOZ_RELEASE_ASSERT(progressRefPtr->Progress().IsExactlyOne())do { static_assert( mozilla::detail::AssertionConditionType< decltype(progressRefPtr->Progress().IsExactlyOne())>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(progressRefPtr->Progress().IsExactlyOne()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("progressRefPtr->Progress().IsExactlyOne()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1148); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "progressRefPtr->Progress().IsExactlyOne()" ")"); do { *((volatile int*)__null) = 1148; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1149 | MOZ_RELEASE_ASSERT(AreAllEqual(progressRefPtr->LastLocation(), "All done"))do { static_assert( mozilla::detail::AssertionConditionType< decltype(AreAllEqual(progressRefPtr->LastLocation(), "All done" ))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(AreAllEqual(progressRefPtr->LastLocation(), "All done" )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("AreAllEqual(progressRefPtr->LastLocation(), \"All done\")" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1149); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "AreAllEqual(progressRefPtr->LastLocation(), \"All done\")" ")"); do { *((volatile int*)__null) = 1149; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1150 | ||||
1151 | printf("TestProgressLogger done\n"); | |||
1152 | } | |||
1153 | ||||
1154 | #ifdef MOZ_GECKO_PROFILER1 | |||
1155 | ||||
1156 | MOZ_MAYBE_UNUSED__attribute__((__unused__)) static void SleepMilli(unsigned aMilliseconds) { | |||
1157 | # if defined(_MSC_VER) || defined(__MINGW32__) | |||
1158 | Sleep(aMilliseconds); | |||
1159 | # else | |||
1160 | struct timespec ts = {/* .tv_sec */ static_cast<time_t>(aMilliseconds / 1000), | |||
1161 | /* ts.tv_nsec */ long(aMilliseconds % 1000) * 1000000}; | |||
1162 | struct timespec tr = {0, 0}; | |||
1163 | while (nanosleep(&ts, &tr)) { | |||
1164 | if (errno(*__errno_location ()) == EINTR4) { | |||
1165 | ts = tr; | |||
1166 | } else { | |||
1167 | printf("nanosleep() -> %s\n", strerror(errno(*__errno_location ()))); | |||
1168 | exit(1); | |||
1169 | } | |||
1170 | } | |||
1171 | # endif | |||
1172 | } | |||
1173 | ||||
1174 | MOZ_MAYBE_UNUSED__attribute__((__unused__)) static void WaitUntilTimeStampChanges( | |||
1175 | const mozilla::TimeStamp& aTimeStampToCompare = mozilla::TimeStamp::Now()) { | |||
1176 | while (aTimeStampToCompare == mozilla::TimeStamp::Now()) { | |||
1177 | SleepMilli(1); | |||
1178 | } | |||
1179 | } | |||
1180 | ||||
1181 | using namespace mozilla; | |||
1182 | ||||
1183 | void TestPowerOfTwoMask() { | |||
1184 | printf("TestPowerOfTwoMask...\n"); | |||
1185 | ||||
1186 | static_assert(MakePowerOfTwoMask<uint32_t, 0>().MaskValue() == 0); | |||
1187 | constexpr PowerOfTwoMask<uint32_t> c0 = MakePowerOfTwoMask<uint32_t, 0>(); | |||
1188 | MOZ_RELEASE_ASSERT(c0.MaskValue() == 0)do { static_assert( mozilla::detail::AssertionConditionType< decltype(c0.MaskValue() == 0)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(c0.MaskValue() == 0))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("c0.MaskValue() == 0" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1188); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "c0.MaskValue() == 0" ")"); do { *((volatile int*)__null) = 1188; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1189 | ||||
1190 | static_assert(MakePowerOfTwoMask<uint32_t, 0xFFu>().MaskValue() == 0xFFu); | |||
1191 | constexpr PowerOfTwoMask<uint32_t> cFF = | |||
1192 | MakePowerOfTwoMask<uint32_t, 0xFFu>(); | |||
1193 | MOZ_RELEASE_ASSERT(cFF.MaskValue() == 0xFFu)do { static_assert( mozilla::detail::AssertionConditionType< decltype(cFF.MaskValue() == 0xFFu)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(cFF.MaskValue() == 0xFFu))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("cFF.MaskValue() == 0xFFu" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1193); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "cFF.MaskValue() == 0xFFu" ")"); do { *((volatile int*)__null) = 1193; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1194 | ||||
1195 | static_assert(MakePowerOfTwoMask<uint32_t, 0xFFFFFFFFu>().MaskValue() == | |||
1196 | 0xFFFFFFFFu); | |||
1197 | constexpr PowerOfTwoMask<uint32_t> cFFFFFFFF = | |||
1198 | MakePowerOfTwoMask<uint32_t, 0xFFFFFFFFu>(); | |||
1199 | MOZ_RELEASE_ASSERT(cFFFFFFFF.MaskValue() == 0xFFFFFFFFu)do { static_assert( mozilla::detail::AssertionConditionType< decltype(cFFFFFFFF.MaskValue() == 0xFFFFFFFFu)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(cFFFFFFFF.MaskValue() == 0xFFFFFFFFu ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "cFFFFFFFF.MaskValue() == 0xFFFFFFFFu", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1199); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "cFFFFFFFF.MaskValue() == 0xFFFFFFFFu" ")"); do { *((volatile int*)__null) = 1199; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1200 | ||||
1201 | struct TestDataU32 { | |||
1202 | uint32_t mInput; | |||
1203 | uint32_t mMask; | |||
1204 | }; | |||
1205 | // clang-format off | |||
1206 | TestDataU32 tests[] = { | |||
1207 | { 0, 0 }, | |||
1208 | { 1, 1 }, | |||
1209 | { 2, 3 }, | |||
1210 | { 3, 3 }, | |||
1211 | { 4, 7 }, | |||
1212 | { 5, 7 }, | |||
1213 | { (1u << 31) - 1, (1u << 31) - 1 }, | |||
1214 | { (1u << 31), uint32_t(-1) }, | |||
1215 | { (1u << 31) + 1, uint32_t(-1) }, | |||
1216 | { uint32_t(-1), uint32_t(-1) } | |||
1217 | }; | |||
1218 | // clang-format on | |||
1219 | for (const TestDataU32& test : tests) { | |||
1220 | PowerOfTwoMask<uint32_t> p2m(test.mInput); | |||
1221 | MOZ_RELEASE_ASSERT(p2m.MaskValue() == test.mMask)do { static_assert( mozilla::detail::AssertionConditionType< decltype(p2m.MaskValue() == test.mMask)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(p2m.MaskValue() == test.mMask ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "p2m.MaskValue() == test.mMask", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1221); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "p2m.MaskValue() == test.mMask" ")"); do { *((volatile int*)__null) = 1221; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1222 | for (const TestDataU32& inner : tests) { | |||
1223 | if (p2m.MaskValue() != uint32_t(-1)) { | |||
1224 | MOZ_RELEASE_ASSERT((inner.mInput % p2m) ==do { static_assert( mozilla::detail::AssertionConditionType< decltype((inner.mInput % p2m) == (inner.mInput % (p2m.MaskValue () + 1)))>::isValid, "invalid assertion condition"); if (( __builtin_expect(!!(!(!!((inner.mInput % p2m) == (inner.mInput % (p2m.MaskValue() + 1))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("(inner.mInput % p2m) == (inner.mInput % (p2m.MaskValue() + 1))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1225); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "(inner.mInput % p2m) == (inner.mInput % (p2m.MaskValue() + 1))" ")"); do { *((volatile int*)__null) = 1225; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
1225 | (inner.mInput % (p2m.MaskValue() + 1)))do { static_assert( mozilla::detail::AssertionConditionType< decltype((inner.mInput % p2m) == (inner.mInput % (p2m.MaskValue () + 1)))>::isValid, "invalid assertion condition"); if (( __builtin_expect(!!(!(!!((inner.mInput % p2m) == (inner.mInput % (p2m.MaskValue() + 1))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("(inner.mInput % p2m) == (inner.mInput % (p2m.MaskValue() + 1))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1225); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "(inner.mInput % p2m) == (inner.mInput % (p2m.MaskValue() + 1))" ")"); do { *((volatile int*)__null) = 1225; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1226 | } | |||
1227 | MOZ_RELEASE_ASSERT((inner.mInput & p2m) == (inner.mInput % p2m))do { static_assert( mozilla::detail::AssertionConditionType< decltype((inner.mInput & p2m) == (inner.mInput % p2m))> ::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!((inner.mInput & p2m) == (inner.mInput % p2m)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("(inner.mInput & p2m) == (inner.mInput % p2m)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1227); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "(inner.mInput & p2m) == (inner.mInput % p2m)" ")"); do { *((volatile int*)__null) = 1227; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1228 | MOZ_RELEASE_ASSERT((p2m & inner.mInput) == (inner.mInput & p2m))do { static_assert( mozilla::detail::AssertionConditionType< decltype((p2m & inner.mInput) == (inner.mInput & p2m) )>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!((p2m & inner.mInput) == (inner.mInput & p2m) ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "(p2m & inner.mInput) == (inner.mInput & p2m)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1228); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "(p2m & inner.mInput) == (inner.mInput & p2m)" ")"); do { *((volatile int*)__null) = 1228; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1229 | } | |||
1230 | } | |||
1231 | ||||
1232 | printf("TestPowerOfTwoMask done\n"); | |||
1233 | } | |||
1234 | ||||
1235 | void TestPowerOfTwo() { | |||
1236 | printf("TestPowerOfTwo...\n"); | |||
1237 | ||||
1238 | static_assert(MakePowerOfTwo<uint32_t, 1>().Value() == 1); | |||
1239 | constexpr PowerOfTwo<uint32_t> c1 = MakePowerOfTwo<uint32_t, 1>(); | |||
1240 | MOZ_RELEASE_ASSERT(c1.Value() == 1)do { static_assert( mozilla::detail::AssertionConditionType< decltype(c1.Value() == 1)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(c1.Value() == 1))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("c1.Value() == 1" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1240); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "c1.Value() == 1" ")"); do { *((volatile int*)__null) = 1240; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1241 | static_assert(MakePowerOfTwo<uint32_t, 1>().Mask().MaskValue() == 0); | |||
1242 | ||||
1243 | static_assert(MakePowerOfTwo<uint32_t, 128>().Value() == 128); | |||
1244 | constexpr PowerOfTwo<uint32_t> c128 = MakePowerOfTwo<uint32_t, 128>(); | |||
1245 | MOZ_RELEASE_ASSERT(c128.Value() == 128)do { static_assert( mozilla::detail::AssertionConditionType< decltype(c128.Value() == 128)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(c128.Value() == 128))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("c128.Value() == 128" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1245); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "c128.Value() == 128" ")"); do { *((volatile int*)__null) = 1245; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1246 | static_assert(MakePowerOfTwo<uint32_t, 128>().Mask().MaskValue() == 127); | |||
1247 | ||||
1248 | static_assert(MakePowerOfTwo<uint32_t, 0x80000000u>().Value() == 0x80000000u); | |||
1249 | constexpr PowerOfTwo<uint32_t> cMax = MakePowerOfTwo<uint32_t, 0x80000000u>(); | |||
1250 | MOZ_RELEASE_ASSERT(cMax.Value() == 0x80000000u)do { static_assert( mozilla::detail::AssertionConditionType< decltype(cMax.Value() == 0x80000000u)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(cMax.Value() == 0x80000000u) )), 0))) { do { } while (false); MOZ_ReportAssertionFailure("cMax.Value() == 0x80000000u" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1250); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "cMax.Value() == 0x80000000u" ")"); do { *((volatile int*)__null) = 1250; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1251 | static_assert(MakePowerOfTwo<uint32_t, 0x80000000u>().Mask().MaskValue() == | |||
1252 | 0x7FFFFFFFu); | |||
1253 | ||||
1254 | struct TestDataU32 { | |||
1255 | uint32_t mInput; | |||
1256 | uint32_t mValue; | |||
1257 | uint32_t mMask; | |||
1258 | }; | |||
1259 | // clang-format off | |||
1260 | TestDataU32 tests[] = { | |||
1261 | { 0, 1, 0 }, | |||
1262 | { 1, 1, 0 }, | |||
1263 | { 2, 2, 1 }, | |||
1264 | { 3, 4, 3 }, | |||
1265 | { 4, 4, 3 }, | |||
1266 | { 5, 8, 7 }, | |||
1267 | { (1u << 31) - 1, (1u << 31), (1u << 31) - 1 }, | |||
1268 | { (1u << 31), (1u << 31), (1u << 31) - 1 }, | |||
1269 | { (1u << 31) + 1, (1u << 31), (1u << 31) - 1 }, | |||
1270 | { uint32_t(-1), (1u << 31), (1u << 31) - 1 } | |||
1271 | }; | |||
1272 | // clang-format on | |||
1273 | for (const TestDataU32& test : tests) { | |||
1274 | PowerOfTwo<uint32_t> p2(test.mInput); | |||
1275 | MOZ_RELEASE_ASSERT(p2.Value() == test.mValue)do { static_assert( mozilla::detail::AssertionConditionType< decltype(p2.Value() == test.mValue)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(p2.Value() == test.mValue))) , 0))) { do { } while (false); MOZ_ReportAssertionFailure("p2.Value() == test.mValue" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1275); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "p2.Value() == test.mValue" ")"); do { *((volatile int*)__null) = 1275; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1276 | MOZ_RELEASE_ASSERT(p2.MaskValue() == test.mMask)do { static_assert( mozilla::detail::AssertionConditionType< decltype(p2.MaskValue() == test.mMask)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(p2.MaskValue() == test.mMask ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "p2.MaskValue() == test.mMask", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1276); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "p2.MaskValue() == test.mMask" ")"); do { *((volatile int*)__null) = 1276; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1277 | PowerOfTwoMask<uint32_t> p2m = p2.Mask(); | |||
1278 | MOZ_RELEASE_ASSERT(p2m.MaskValue() == test.mMask)do { static_assert( mozilla::detail::AssertionConditionType< decltype(p2m.MaskValue() == test.mMask)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(p2m.MaskValue() == test.mMask ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "p2m.MaskValue() == test.mMask", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1278); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "p2m.MaskValue() == test.mMask" ")"); do { *((volatile int*)__null) = 1278; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1279 | for (const TestDataU32& inner : tests) { | |||
1280 | MOZ_RELEASE_ASSERT((inner.mInput % p2) == (inner.mInput % p2.Value()))do { static_assert( mozilla::detail::AssertionConditionType< decltype((inner.mInput % p2) == (inner.mInput % p2.Value()))> ::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!((inner.mInput % p2) == (inner.mInput % p2.Value()))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("(inner.mInput % p2) == (inner.mInput % p2.Value())" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1280); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "(inner.mInput % p2) == (inner.mInput % p2.Value())" ")"); do { *((volatile int*)__null) = 1280; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1281 | } | |||
1282 | } | |||
1283 | ||||
1284 | printf("TestPowerOfTwo done\n"); | |||
1285 | } | |||
1286 | ||||
1287 | void TestLEB128() { | |||
1288 | printf("TestLEB128...\n"); | |||
1289 | ||||
1290 | MOZ_RELEASE_ASSERT(ULEB128MaxSize<uint8_t>() == 2)do { static_assert( mozilla::detail::AssertionConditionType< decltype(ULEB128MaxSize<uint8_t>() == 2)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(ULEB128MaxSize<uint8_t> () == 2))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("ULEB128MaxSize<uint8_t>() == 2", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1290); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "ULEB128MaxSize<uint8_t>() == 2" ")"); do { *((volatile int*)__null) = 1290; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1291 | MOZ_RELEASE_ASSERT(ULEB128MaxSize<uint16_t>() == 3)do { static_assert( mozilla::detail::AssertionConditionType< decltype(ULEB128MaxSize<uint16_t>() == 3)>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(! !(ULEB128MaxSize<uint16_t>() == 3))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("ULEB128MaxSize<uint16_t>() == 3" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1291); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "ULEB128MaxSize<uint16_t>() == 3" ")"); do { *((volatile int*)__null) = 1291; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1292 | MOZ_RELEASE_ASSERT(ULEB128MaxSize<uint32_t>() == 5)do { static_assert( mozilla::detail::AssertionConditionType< decltype(ULEB128MaxSize<uint32_t>() == 5)>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(! !(ULEB128MaxSize<uint32_t>() == 5))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("ULEB128MaxSize<uint32_t>() == 5" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1292); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "ULEB128MaxSize<uint32_t>() == 5" ")"); do { *((volatile int*)__null) = 1292; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1293 | MOZ_RELEASE_ASSERT(ULEB128MaxSize<uint64_t>() == 10)do { static_assert( mozilla::detail::AssertionConditionType< decltype(ULEB128MaxSize<uint64_t>() == 10)>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(ULEB128MaxSize<uint64_t>() == 10))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("ULEB128MaxSize<uint64_t>() == 10" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1293); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "ULEB128MaxSize<uint64_t>() == 10" ")"); do { *((volatile int*)__null) = 1293; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1294 | ||||
1295 | struct TestDataU64 { | |||
1296 | uint64_t mValue; | |||
1297 | unsigned mSize; | |||
1298 | const char* mBytes; | |||
1299 | }; | |||
1300 | // clang-format off | |||
1301 | TestDataU64 tests[] = { | |||
1302 | // Small numbers should keep their normal byte representation. | |||
1303 | { 0u, 1, "\0" }, | |||
1304 | { 1u, 1, "\x01" }, | |||
1305 | ||||
1306 | // 0111 1111 (127, or 0x7F) is the highest number that fits into a single | |||
1307 | // LEB128 byte. It gets encoded as 0111 1111, note the most significant bit | |||
1308 | // is off. | |||
1309 | { 0x7Fu, 1, "\x7F" }, | |||
1310 | ||||
1311 | // Next number: 128, or 0x80. | |||
1312 | // Original data representation: 1000 0000 | |||
1313 | // Broken up into groups of 7: 1 0000000 | |||
1314 | // Padded with 0 (msB) or 1 (lsB): 00000001 10000000 | |||
1315 | // Byte representation: 0x01 0x80 | |||
1316 | // Little endian order: -> 0x80 0x01 | |||
1317 | { 0x80u, 2, "\x80\x01" }, | |||
1318 | ||||
1319 | // Next: 129, or 0x81 (showing that we don't lose low bits.) | |||
1320 | // Original data representation: 1000 0001 | |||
1321 | // Broken up into groups of 7: 1 0000001 | |||
1322 | // Padded with 0 (msB) or 1 (lsB): 00000001 10000001 | |||
1323 | // Byte representation: 0x01 0x81 | |||
1324 | // Little endian order: -> 0x81 0x01 | |||
1325 | { 0x81u, 2, "\x81\x01" }, | |||
1326 | ||||
1327 | // Highest 8-bit number: 255, or 0xFF. | |||
1328 | // Original data representation: 1111 1111 | |||
1329 | // Broken up into groups of 7: 1 1111111 | |||
1330 | // Padded with 0 (msB) or 1 (lsB): 00000001 11111111 | |||
1331 | // Byte representation: 0x01 0xFF | |||
1332 | // Little endian order: -> 0xFF 0x01 | |||
1333 | { 0xFFu, 2, "\xFF\x01" }, | |||
1334 | ||||
1335 | // Next: 256, or 0x100. | |||
1336 | // Original data representation: 1 0000 0000 | |||
1337 | // Broken up into groups of 7: 10 0000000 | |||
1338 | // Padded with 0 (msB) or 1 (lsB): 00000010 10000000 | |||
1339 | // Byte representation: 0x10 0x80 | |||
1340 | // Little endian order: -> 0x80 0x02 | |||
1341 | { 0x100u, 2, "\x80\x02" }, | |||
1342 | ||||
1343 | // Highest 32-bit number: 0xFFFFFFFF (8 bytes, all bits set). | |||
1344 | // Original: 1111 1111 1111 1111 1111 1111 1111 1111 | |||
1345 | // Groups: 1111 1111111 1111111 1111111 1111111 | |||
1346 | // Padded: 00001111 11111111 11111111 11111111 11111111 | |||
1347 | // Bytes: 0x0F 0xFF 0xFF 0xFF 0xFF | |||
1348 | // Little Endian: -> 0xFF 0xFF 0xFF 0xFF 0x0F | |||
1349 | { 0xFFFFFFFFu, 5, "\xFF\xFF\xFF\xFF\x0F" }, | |||
1350 | ||||
1351 | // Highest 64-bit number: 0xFFFFFFFFFFFFFFFF (16 bytes, all bits set). | |||
1352 | // 64 bits, that's 9 groups of 7 bits, plus 1 (most significant) bit. | |||
1353 | { 0xFFFFFFFFFFFFFFFFu, 10, "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x01" } | |||
1354 | }; | |||
1355 | // clang-format on | |||
1356 | ||||
1357 | for (const TestDataU64& test : tests) { | |||
1358 | MOZ_RELEASE_ASSERT(ULEB128Size(test.mValue) == test.mSize)do { static_assert( mozilla::detail::AssertionConditionType< decltype(ULEB128Size(test.mValue) == test.mSize)>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(ULEB128Size(test.mValue) == test.mSize))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("ULEB128Size(test.mValue) == test.mSize" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1358); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "ULEB128Size(test.mValue) == test.mSize" ")"); do { *((volatile int*)__null) = 1358; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1359 | // Prepare a buffer that can accomodate the largest-possible LEB128. | |||
1360 | uint8_t buffer[ULEB128MaxSize<uint64_t>()]; | |||
1361 | // Use a pointer into the buffer as iterator. | |||
1362 | uint8_t* p = buffer; | |||
1363 | // And write the LEB128. | |||
1364 | WriteULEB128(test.mValue, p); | |||
1365 | // Pointer (iterator) should have advanced just past the expected LEB128 | |||
1366 | // size. | |||
1367 | MOZ_RELEASE_ASSERT(p == buffer + test.mSize)do { static_assert( mozilla::detail::AssertionConditionType< decltype(p == buffer + test.mSize)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(p == buffer + test.mSize))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("p == buffer + test.mSize" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1367); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "p == buffer + test.mSize" ")"); do { *((volatile int*)__null) = 1367; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1368 | // Check expected bytes. | |||
1369 | for (unsigned i = 0; i < test.mSize; ++i) { | |||
1370 | MOZ_RELEASE_ASSERT(buffer[i] == uint8_t(test.mBytes[i]))do { static_assert( mozilla::detail::AssertionConditionType< decltype(buffer[i] == uint8_t(test.mBytes[i]))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(buffer[i] == uint8_t(test.mBytes [i])))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("buffer[i] == uint8_t(test.mBytes[i])", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1370); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "buffer[i] == uint8_t(test.mBytes[i])" ")"); do { *((volatile int*)__null) = 1370; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1371 | } | |||
1372 | ||||
1373 | // Move pointer (iterator) back to start of buffer. | |||
1374 | p = buffer; | |||
1375 | // And read the LEB128 we wrote above. | |||
1376 | uint64_t read = ReadULEB128<uint64_t>(p); | |||
1377 | // Pointer (iterator) should have also advanced just past the expected | |||
1378 | // LEB128 size. | |||
1379 | MOZ_RELEASE_ASSERT(p == buffer + test.mSize)do { static_assert( mozilla::detail::AssertionConditionType< decltype(p == buffer + test.mSize)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(p == buffer + test.mSize))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("p == buffer + test.mSize" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1379); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "p == buffer + test.mSize" ")"); do { *((volatile int*)__null) = 1379; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1380 | // And check the read value. | |||
1381 | MOZ_RELEASE_ASSERT(read == test.mValue)do { static_assert( mozilla::detail::AssertionConditionType< decltype(read == test.mValue)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(read == test.mValue))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("read == test.mValue" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1381); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "read == test.mValue" ")"); do { *((volatile int*)__null) = 1381; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1382 | ||||
1383 | // Testing ULEB128 reader. | |||
1384 | ULEB128Reader<uint64_t> reader; | |||
1385 | MOZ_RELEASE_ASSERT(!reader.IsComplete())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!reader.IsComplete())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!reader.IsComplete()))), 0)) ) { do { } while (false); MOZ_ReportAssertionFailure("!reader.IsComplete()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1385); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!reader.IsComplete()" ")"); do { *((volatile int*)__null) = 1385; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1386 | // Move pointer back to start of buffer. | |||
1387 | p = buffer; | |||
1388 | for (;;) { | |||
1389 | // Read a byte and feed it to the reader. | |||
1390 | if (reader.FeedByteIsComplete(*p++)) { | |||
1391 | break; | |||
1392 | } | |||
1393 | // Not complete yet, we shouldn't have reached the end pointer. | |||
1394 | MOZ_RELEASE_ASSERT(!reader.IsComplete())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!reader.IsComplete())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!reader.IsComplete()))), 0)) ) { do { } while (false); MOZ_ReportAssertionFailure("!reader.IsComplete()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1394); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!reader.IsComplete()" ")"); do { *((volatile int*)__null) = 1394; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1395 | MOZ_RELEASE_ASSERT(p < buffer + test.mSize)do { static_assert( mozilla::detail::AssertionConditionType< decltype(p < buffer + test.mSize)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(p < buffer + test.mSize)) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("p < buffer + test.mSize" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1395); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "p < buffer + test.mSize" ")"); do { *((volatile int*)__null) = 1395; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1396 | } | |||
1397 | MOZ_RELEASE_ASSERT(reader.IsComplete())do { static_assert( mozilla::detail::AssertionConditionType< decltype(reader.IsComplete())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(reader.IsComplete()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("reader.IsComplete()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1397); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "reader.IsComplete()" ")"); do { *((volatile int*)__null) = 1397; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1398 | // Pointer should have advanced just past the expected LEB128 size. | |||
1399 | MOZ_RELEASE_ASSERT(p == buffer + test.mSize)do { static_assert( mozilla::detail::AssertionConditionType< decltype(p == buffer + test.mSize)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(p == buffer + test.mSize))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("p == buffer + test.mSize" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1399); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "p == buffer + test.mSize" ")"); do { *((volatile int*)__null) = 1399; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1400 | // And check the read value. | |||
1401 | MOZ_RELEASE_ASSERT(reader.Value() == test.mValue)do { static_assert( mozilla::detail::AssertionConditionType< decltype(reader.Value() == test.mValue)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(reader.Value() == test.mValue ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "reader.Value() == test.mValue", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1401); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "reader.Value() == test.mValue" ")"); do { *((volatile int*)__null) = 1401; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1402 | ||||
1403 | // And again after a Reset. | |||
1404 | reader.Reset(); | |||
1405 | MOZ_RELEASE_ASSERT(!reader.IsComplete())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!reader.IsComplete())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!reader.IsComplete()))), 0)) ) { do { } while (false); MOZ_ReportAssertionFailure("!reader.IsComplete()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1405); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!reader.IsComplete()" ")"); do { *((volatile int*)__null) = 1405; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1406 | p = buffer; | |||
1407 | for (;;) { | |||
1408 | if (reader.FeedByteIsComplete(*p++)) { | |||
1409 | break; | |||
1410 | } | |||
1411 | MOZ_RELEASE_ASSERT(!reader.IsComplete())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!reader.IsComplete())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!reader.IsComplete()))), 0)) ) { do { } while (false); MOZ_ReportAssertionFailure("!reader.IsComplete()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1411); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!reader.IsComplete()" ")"); do { *((volatile int*)__null) = 1411; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1412 | MOZ_RELEASE_ASSERT(p < buffer + test.mSize)do { static_assert( mozilla::detail::AssertionConditionType< decltype(p < buffer + test.mSize)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(p < buffer + test.mSize)) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("p < buffer + test.mSize" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1412); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "p < buffer + test.mSize" ")"); do { *((volatile int*)__null) = 1412; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1413 | } | |||
1414 | MOZ_RELEASE_ASSERT(reader.IsComplete())do { static_assert( mozilla::detail::AssertionConditionType< decltype(reader.IsComplete())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(reader.IsComplete()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("reader.IsComplete()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1414); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "reader.IsComplete()" ")"); do { *((volatile int*)__null) = 1414; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1415 | MOZ_RELEASE_ASSERT(p == buffer + test.mSize)do { static_assert( mozilla::detail::AssertionConditionType< decltype(p == buffer + test.mSize)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(p == buffer + test.mSize))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("p == buffer + test.mSize" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1415); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "p == buffer + test.mSize" ")"); do { *((volatile int*)__null) = 1415; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1416 | MOZ_RELEASE_ASSERT(reader.Value() == test.mValue)do { static_assert( mozilla::detail::AssertionConditionType< decltype(reader.Value() == test.mValue)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(reader.Value() == test.mValue ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "reader.Value() == test.mValue", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1416); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "reader.Value() == test.mValue" ")"); do { *((volatile int*)__null) = 1416; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1417 | } | |||
1418 | ||||
1419 | printf("TestLEB128 done\n"); | |||
1420 | } | |||
1421 | ||||
1422 | struct StringWriteFunc final : public JSONWriteFunc { | |||
1423 | std::string mString; | |||
1424 | ||||
1425 | void Write(const mozilla::Span<const char>& aStr) final { | |||
1426 | mString.append(aStr.data(), aStr.size()); | |||
1427 | } | |||
1428 | }; | |||
1429 | ||||
1430 | void CheckJSON(mozilla::baseprofiler::SpliceableJSONWriter& aWriter, | |||
1431 | const char* aExpected, int aLine) { | |||
1432 | const std::string& actual = | |||
1433 | static_cast<StringWriteFunc&>(aWriter.WriteFunc()).mString; | |||
1434 | if (strcmp(aExpected, actual.c_str()) != 0) { | |||
1435 | fprintf(stderrstderr, | |||
1436 | "---- EXPECTED ---- (line %d)\n<<<%s>>>\n" | |||
1437 | "---- ACTUAL ----\n<<<%s>>>\n", | |||
1438 | aLine, aExpected, actual.c_str()); | |||
1439 | MOZ_RELEASE_ASSERT(false, "expected and actual output don't match")do { static_assert( mozilla::detail::AssertionConditionType< decltype(false)>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(!!(false))), 0))) { do { } while ( false); MOZ_ReportAssertionFailure("false" " (" "expected and actual output don't match" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1439); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "false" ") (" "expected and actual output don't match" ")"); do { *( (volatile int*)__null) = 1439; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
1440 | } | |||
1441 | } | |||
1442 | ||||
1443 | void TestJSONTimeOutput() { | |||
1444 | printf("TestJSONTimeOutput...\n"); | |||
1445 | ||||
1446 | # define TEST(in, out) \ | |||
1447 | do { \ | |||
1448 | mozilla::baseprofiler::SpliceableJSONWriter writer( \ | |||
1449 | mozilla::MakeUnique<StringWriteFunc>(), \ | |||
1450 | FailureLatchInfallibleSource::Singleton()); \ | |||
1451 | writer.Start(); \ | |||
1452 | writer.TimeDoubleMsProperty("time_ms", (in)); \ | |||
1453 | writer.End(); \ | |||
1454 | CheckJSON(writer, "{\"time_ms\":" out "}", __LINE__1454); \ | |||
1455 | } while (false); | |||
1456 | ||||
1457 | TEST(0, "0"); | |||
1458 | ||||
1459 | TEST(0.000'000'1, "0"); | |||
1460 | TEST(0.000'000'4, "0"); | |||
1461 | TEST(0.000'000'499, "0"); | |||
1462 | TEST(0.000'000'5, "0.000001"); | |||
1463 | TEST(0.000'001, "0.000001"); | |||
1464 | TEST(0.000'01, "0.00001"); | |||
1465 | TEST(0.000'1, "0.0001"); | |||
1466 | TEST(0.001, "0.001"); | |||
1467 | TEST(0.01, "0.01"); | |||
1468 | TEST(0.1, "0.1"); | |||
1469 | TEST(1, "1"); | |||
1470 | TEST(2, "2"); | |||
1471 | TEST(10, "10"); | |||
1472 | TEST(100, "100"); | |||
1473 | TEST(1'000, "1000"); | |||
1474 | TEST(10'000, "10000"); | |||
1475 | TEST(100'000, "100000"); | |||
1476 | TEST(1'000'000, "1000000"); | |||
1477 | // 2^53-2 ns in ms. 2^53-1 is the highest integer value representable in | |||
1478 | // double, -1 again because we're adding 0.5 before truncating. | |||
1479 | // That's 104 days, after which the nanosecond precision would decrease. | |||
1480 | TEST(9'007'199'254.740'990, "9007199254.74099"); | |||
1481 | ||||
1482 | TEST(-0.000'000'1, "0"); | |||
1483 | TEST(-0.000'000'4, "0"); | |||
1484 | TEST(-0.000'000'499, "0"); | |||
1485 | TEST(-0.000'000'5, "-0.000001"); | |||
1486 | TEST(-0.000'001, "-0.000001"); | |||
1487 | TEST(-0.000'01, "-0.00001"); | |||
1488 | TEST(-0.000'1, "-0.0001"); | |||
1489 | TEST(-0.001, "-0.001"); | |||
1490 | TEST(-0.01, "-0.01"); | |||
1491 | TEST(-0.1, "-0.1"); | |||
1492 | TEST(-1, "-1"); | |||
1493 | TEST(-2, "-2"); | |||
1494 | TEST(-10, "-10"); | |||
1495 | TEST(-100, "-100"); | |||
1496 | TEST(-1'000, "-1000"); | |||
1497 | TEST(-10'000, "-10000"); | |||
1498 | TEST(-100'000, "-100000"); | |||
1499 | TEST(-1'000'000, "-1000000"); | |||
1500 | TEST(-9'007'199'254.740'990, "-9007199254.74099"); | |||
1501 | ||||
1502 | # undef TEST | |||
1503 | ||||
1504 | printf("TestJSONTimeOutput done\n"); | |||
1505 | } | |||
1506 | ||||
1507 | template <uint8_t byte, uint8_t... tail> | |||
1508 | constexpr bool TestConstexprULEB128Reader(ULEB128Reader<uint64_t>& aReader) { | |||
1509 | if (aReader.IsComplete()) { | |||
1510 | return false; | |||
1511 | } | |||
1512 | const bool isComplete = aReader.FeedByteIsComplete(byte); | |||
1513 | if (aReader.IsComplete() != isComplete) { | |||
1514 | return false; | |||
1515 | } | |||
1516 | if constexpr (sizeof...(tail) == 0) { | |||
1517 | return isComplete; | |||
1518 | } else { | |||
1519 | if (isComplete) { | |||
1520 | return false; | |||
1521 | } | |||
1522 | return TestConstexprULEB128Reader<tail...>(aReader); | |||
1523 | } | |||
1524 | } | |||
1525 | ||||
1526 | template <uint64_t expected, uint8_t... bytes> | |||
1527 | constexpr bool TestConstexprULEB128Reader() { | |||
1528 | ULEB128Reader<uint64_t> reader; | |||
1529 | if (!TestConstexprULEB128Reader<bytes...>(reader)) { | |||
1530 | return false; | |||
1531 | } | |||
1532 | if (!reader.IsComplete()) { | |||
1533 | return false; | |||
1534 | } | |||
1535 | if (reader.Value() != expected) { | |||
1536 | return false; | |||
1537 | } | |||
1538 | ||||
1539 | reader.Reset(); | |||
1540 | if (!TestConstexprULEB128Reader<bytes...>(reader)) { | |||
1541 | return false; | |||
1542 | } | |||
1543 | if (!reader.IsComplete()) { | |||
1544 | return false; | |||
1545 | } | |||
1546 | if (reader.Value() != expected) { | |||
1547 | return false; | |||
1548 | } | |||
1549 | ||||
1550 | return true; | |||
1551 | } | |||
1552 | ||||
1553 | static_assert(TestConstexprULEB128Reader<0x0u, 0x0u>()); | |||
1554 | static_assert(!TestConstexprULEB128Reader<0x0u, 0x0u, 0x0u>()); | |||
1555 | static_assert(TestConstexprULEB128Reader<0x1u, 0x1u>()); | |||
1556 | static_assert(TestConstexprULEB128Reader<0x7Fu, 0x7Fu>()); | |||
1557 | static_assert(TestConstexprULEB128Reader<0x80u, 0x80u, 0x01u>()); | |||
1558 | static_assert(!TestConstexprULEB128Reader<0x80u, 0x80u>()); | |||
1559 | static_assert(!TestConstexprULEB128Reader<0x80u, 0x01u>()); | |||
1560 | static_assert(TestConstexprULEB128Reader<0x81u, 0x81u, 0x01u>()); | |||
1561 | static_assert(TestConstexprULEB128Reader<0xFFu, 0xFFu, 0x01u>()); | |||
1562 | static_assert(TestConstexprULEB128Reader<0x100u, 0x80u, 0x02u>()); | |||
1563 | static_assert(TestConstexprULEB128Reader<0xFFFFFFFFu, 0xFFu, 0xFFu, 0xFFu, | |||
1564 | 0xFFu, 0x0Fu>()); | |||
1565 | static_assert( | |||
1566 | !TestConstexprULEB128Reader<0xFFFFFFFFu, 0xFFu, 0xFFu, 0xFFu, 0xFFu>()); | |||
1567 | static_assert(!TestConstexprULEB128Reader<0xFFFFFFFFu, 0xFFu, 0xFFu, 0xFFu, | |||
1568 | 0xFFu, 0xFFu, 0x0Fu>()); | |||
1569 | static_assert( | |||
1570 | TestConstexprULEB128Reader<0xFFFFFFFFFFFFFFFFu, 0xFFu, 0xFFu, 0xFFu, 0xFFu, | |||
1571 | 0xFFu, 0xFFu, 0xFFu, 0xFFu, 0xFFu, 0x01u>()); | |||
1572 | static_assert( | |||
1573 | !TestConstexprULEB128Reader<0xFFFFFFFFFFFFFFFFu, 0xFFu, 0xFFu, 0xFFu, 0xFFu, | |||
1574 | 0xFFu, 0xFFu, 0xFFu, 0xFFu, 0xFFu>()); | |||
1575 | ||||
1576 | static void TestChunk() { | |||
1577 | printf("TestChunk...\n"); | |||
1578 | ||||
1579 | static_assert(!std::is_default_constructible_v<ProfileBufferChunk>, | |||
1580 | "ProfileBufferChunk should not be default-constructible"); | |||
1581 | static_assert( | |||
1582 | !std::is_constructible_v<ProfileBufferChunk, ProfileBufferChunk::Length>, | |||
1583 | "ProfileBufferChunk should not be constructible from Length"); | |||
1584 | ||||
1585 | static_assert( | |||
1586 | sizeof(ProfileBufferChunk::Header) == | |||
1587 | sizeof(ProfileBufferChunk::Header::mOffsetFirstBlock) + | |||
1588 | sizeof(ProfileBufferChunk::Header::mOffsetPastLastBlock) + | |||
1589 | sizeof(ProfileBufferChunk::Header::mStartTimeStamp) + | |||
1590 | sizeof(ProfileBufferChunk::Header::mDoneTimeStamp) + | |||
1591 | sizeof(ProfileBufferChunk::Header::mBufferBytes) + | |||
1592 | sizeof(ProfileBufferChunk::Header::mBlockCount) + | |||
1593 | sizeof(ProfileBufferChunk::Header::mRangeStart) + | |||
1594 | sizeof(ProfileBufferChunk::Header::mProcessId) + | |||
1595 | sizeof(ProfileBufferChunk::Header::mPADDING), | |||
1596 | "ProfileBufferChunk::Header may have unwanted padding, please review"); | |||
1597 | // Note: The above static_assert is an attempt at keeping | |||
1598 | // ProfileBufferChunk::Header tightly packed, but some changes could make this | |||
1599 | // impossible to achieve (most probably due to alignment) -- Just do your | |||
1600 | // best! | |||
1601 | ||||
1602 | constexpr ProfileBufferChunk::Length TestLen = 1000; | |||
1603 | ||||
1604 | // Basic allocations of different sizes. | |||
1605 | for (ProfileBufferChunk::Length len = 0; len <= TestLen; ++len) { | |||
1606 | auto chunk = ProfileBufferChunk::Create(len); | |||
1607 | static_assert( | |||
1608 | std::is_same_v<decltype(chunk), UniquePtr<ProfileBufferChunk>>, | |||
1609 | "ProfileBufferChunk::Create() should return a " | |||
1610 | "UniquePtr<ProfileBufferChunk>"); | |||
1611 | MOZ_RELEASE_ASSERT(!!chunk, "OOM!?")do { static_assert( mozilla::detail::AssertionConditionType< decltype(!!chunk)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!!chunk))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!!chunk" " (" "OOM!?" ")" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1611); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!!chunk" ") (" "OOM!?" ")"); do { *((volatile int*)__null) = 1611; __attribute__ ((nomerge)) ::abort(); } while (false); } } while (false); | |||
1612 | MOZ_RELEASE_ASSERT(chunk->BufferBytes() >= len)do { static_assert( mozilla::detail::AssertionConditionType< decltype(chunk->BufferBytes() >= len)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(chunk->BufferBytes() >= len))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("chunk->BufferBytes() >= len", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1612); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunk->BufferBytes() >= len" ")"); do { *((volatile int*)__null) = 1612; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1613 | MOZ_RELEASE_ASSERT(chunk->ChunkBytes() >=do { static_assert( mozilla::detail::AssertionConditionType< decltype(chunk->ChunkBytes() >= len + ProfileBufferChunk ::SizeofChunkMetadata())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(chunk->ChunkBytes() >= len + ProfileBufferChunk::SizeofChunkMetadata()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("chunk->ChunkBytes() >= len + ProfileBufferChunk::SizeofChunkMetadata()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1614); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunk->ChunkBytes() >= len + ProfileBufferChunk::SizeofChunkMetadata()" ")"); do { *((volatile int*)__null) = 1614; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
1614 | len + ProfileBufferChunk::SizeofChunkMetadata())do { static_assert( mozilla::detail::AssertionConditionType< decltype(chunk->ChunkBytes() >= len + ProfileBufferChunk ::SizeofChunkMetadata())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(chunk->ChunkBytes() >= len + ProfileBufferChunk::SizeofChunkMetadata()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("chunk->ChunkBytes() >= len + ProfileBufferChunk::SizeofChunkMetadata()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1614); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunk->ChunkBytes() >= len + ProfileBufferChunk::SizeofChunkMetadata()" ")"); do { *((volatile int*)__null) = 1614; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1615 | MOZ_RELEASE_ASSERT(chunk->RemainingBytes() == chunk->BufferBytes())do { static_assert( mozilla::detail::AssertionConditionType< decltype(chunk->RemainingBytes() == chunk->BufferBytes( ))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(chunk->RemainingBytes() == chunk->BufferBytes( )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("chunk->RemainingBytes() == chunk->BufferBytes()", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1615); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunk->RemainingBytes() == chunk->BufferBytes()" ")"); do { *((volatile int*)__null) = 1615; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1616 | MOZ_RELEASE_ASSERT(chunk->OffsetFirstBlock() == 0)do { static_assert( mozilla::detail::AssertionConditionType< decltype(chunk->OffsetFirstBlock() == 0)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(chunk->OffsetFirstBlock() == 0))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("chunk->OffsetFirstBlock() == 0", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1616); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunk->OffsetFirstBlock() == 0" ")"); do { *((volatile int*)__null) = 1616; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1617 | MOZ_RELEASE_ASSERT(chunk->OffsetPastLastBlock() == 0)do { static_assert( mozilla::detail::AssertionConditionType< decltype(chunk->OffsetPastLastBlock() == 0)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(chunk->OffsetPastLastBlock () == 0))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("chunk->OffsetPastLastBlock() == 0", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1617); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunk->OffsetPastLastBlock() == 0" ")"); do { *((volatile int*)__null) = 1617; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1618 | MOZ_RELEASE_ASSERT(chunk->BlockCount() == 0)do { static_assert( mozilla::detail::AssertionConditionType< decltype(chunk->BlockCount() == 0)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(chunk->BlockCount() == 0) )), 0))) { do { } while (false); MOZ_ReportAssertionFailure("chunk->BlockCount() == 0" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1618); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunk->BlockCount() == 0" ")"); do { *((volatile int*)__null) = 1618; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1619 | MOZ_RELEASE_ASSERT(chunk->ProcessId() == 0)do { static_assert( mozilla::detail::AssertionConditionType< decltype(chunk->ProcessId() == 0)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(chunk->ProcessId() == 0)) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("chunk->ProcessId() == 0" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1619); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunk->ProcessId() == 0" ")"); do { *((volatile int*)__null) = 1619; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1620 | MOZ_RELEASE_ASSERT(chunk->RangeStart() == 0)do { static_assert( mozilla::detail::AssertionConditionType< decltype(chunk->RangeStart() == 0)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(chunk->RangeStart() == 0) )), 0))) { do { } while (false); MOZ_ReportAssertionFailure("chunk->RangeStart() == 0" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1620); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunk->RangeStart() == 0" ")"); do { *((volatile int*)__null) = 1620; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1621 | MOZ_RELEASE_ASSERT(chunk->BufferSpan().LengthBytes() ==do { static_assert( mozilla::detail::AssertionConditionType< decltype(chunk->BufferSpan().LengthBytes() == chunk->BufferBytes ())>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(chunk->BufferSpan().LengthBytes() == chunk->BufferBytes ()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("chunk->BufferSpan().LengthBytes() == chunk->BufferBytes()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1622); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunk->BufferSpan().LengthBytes() == chunk->BufferBytes()" ")"); do { *((volatile int*)__null) = 1622; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
1622 | chunk->BufferBytes())do { static_assert( mozilla::detail::AssertionConditionType< decltype(chunk->BufferSpan().LengthBytes() == chunk->BufferBytes ())>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(chunk->BufferSpan().LengthBytes() == chunk->BufferBytes ()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("chunk->BufferSpan().LengthBytes() == chunk->BufferBytes()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1622); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunk->BufferSpan().LengthBytes() == chunk->BufferBytes()" ")"); do { *((volatile int*)__null) = 1622; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1623 | MOZ_RELEASE_ASSERT(!chunk->GetNext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!chunk->GetNext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!chunk->GetNext()))), 0)) ) { do { } while (false); MOZ_ReportAssertionFailure("!chunk->GetNext()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1623); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!chunk->GetNext()" ")"); do { *((volatile int*)__null) = 1623; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1624 | MOZ_RELEASE_ASSERT(!chunk->ReleaseNext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!chunk->ReleaseNext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!chunk->ReleaseNext()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!chunk->ReleaseNext()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1624); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!chunk->ReleaseNext()" ")"); do { *((volatile int*)__null) = 1624; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1625 | MOZ_RELEASE_ASSERT(chunk->Last() == chunk.get())do { static_assert( mozilla::detail::AssertionConditionType< decltype(chunk->Last() == chunk.get())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(chunk->Last() == chunk.get ()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("chunk->Last() == chunk.get()", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1625); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunk->Last() == chunk.get()" ")"); do { *((volatile int*)__null) = 1625; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1626 | } | |||
1627 | ||||
1628 | // Allocate the main test Chunk. | |||
1629 | auto chunkA = ProfileBufferChunk::Create(TestLen); | |||
1630 | MOZ_RELEASE_ASSERT(!!chunkA, "OOM!?")do { static_assert( mozilla::detail::AssertionConditionType< decltype(!!chunkA)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!!chunkA))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!!chunkA" " (" "OOM!?" ")" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1630); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!!chunkA" ") (" "OOM!?" ")"); do { *((volatile int*)__null) = 1630; __attribute__ ((nomerge)) ::abort(); } while (false); } } while (false); | |||
1631 | MOZ_RELEASE_ASSERT(chunkA->BufferBytes() >= TestLen)do { static_assert( mozilla::detail::AssertionConditionType< decltype(chunkA->BufferBytes() >= TestLen)>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(chunkA->BufferBytes() >= TestLen))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("chunkA->BufferBytes() >= TestLen" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1631); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunkA->BufferBytes() >= TestLen" ")"); do { *((volatile int*)__null) = 1631; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1632 | MOZ_RELEASE_ASSERT(chunkA->ChunkBytes() >=do { static_assert( mozilla::detail::AssertionConditionType< decltype(chunkA->ChunkBytes() >= TestLen + ProfileBufferChunk ::SizeofChunkMetadata())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(chunkA->ChunkBytes() >= TestLen + ProfileBufferChunk::SizeofChunkMetadata()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("chunkA->ChunkBytes() >= TestLen + ProfileBufferChunk::SizeofChunkMetadata()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1633); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunkA->ChunkBytes() >= TestLen + ProfileBufferChunk::SizeofChunkMetadata()" ")"); do { *((volatile int*)__null) = 1633; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
1633 | TestLen + ProfileBufferChunk::SizeofChunkMetadata())do { static_assert( mozilla::detail::AssertionConditionType< decltype(chunkA->ChunkBytes() >= TestLen + ProfileBufferChunk ::SizeofChunkMetadata())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(chunkA->ChunkBytes() >= TestLen + ProfileBufferChunk::SizeofChunkMetadata()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("chunkA->ChunkBytes() >= TestLen + ProfileBufferChunk::SizeofChunkMetadata()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1633); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunkA->ChunkBytes() >= TestLen + ProfileBufferChunk::SizeofChunkMetadata()" ")"); do { *((volatile int*)__null) = 1633; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1634 | MOZ_RELEASE_ASSERT(!chunkA->GetNext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!chunkA->GetNext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!chunkA->GetNext()))), 0) )) { do { } while (false); MOZ_ReportAssertionFailure("!chunkA->GetNext()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1634); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!chunkA->GetNext()" ")"); do { *((volatile int*)__null) = 1634; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1635 | MOZ_RELEASE_ASSERT(!chunkA->ReleaseNext())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!chunkA->ReleaseNext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!chunkA->ReleaseNext()))) , 0))) { do { } while (false); MOZ_ReportAssertionFailure("!chunkA->ReleaseNext()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1635); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!chunkA->ReleaseNext()" ")"); do { *((volatile int*)__null) = 1635; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1636 | ||||
1637 | constexpr ProfileBufferIndex chunkARangeStart = 12345; | |||
1638 | chunkA->SetRangeStart(chunkARangeStart); | |||
1639 | MOZ_RELEASE_ASSERT(chunkA->RangeStart() == chunkARangeStart)do { static_assert( mozilla::detail::AssertionConditionType< decltype(chunkA->RangeStart() == chunkARangeStart)>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(chunkA->RangeStart() == chunkARangeStart))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("chunkA->RangeStart() == chunkARangeStart" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1639); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunkA->RangeStart() == chunkARangeStart" ")"); do { *((volatile int*)__null) = 1639; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1640 | ||||
1641 | // Get a read-only span over its buffer. | |||
1642 | auto bufferA = chunkA->BufferSpan(); | |||
1643 | static_assert( | |||
1644 | std::is_same_v<decltype(bufferA), Span<const ProfileBufferChunk::Byte>>, | |||
1645 | "BufferSpan() should return a Span<const Byte>"); | |||
1646 | MOZ_RELEASE_ASSERT(bufferA.LengthBytes() == chunkA->BufferBytes())do { static_assert( mozilla::detail::AssertionConditionType< decltype(bufferA.LengthBytes() == chunkA->BufferBytes())> ::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(bufferA.LengthBytes() == chunkA->BufferBytes()))) , 0))) { do { } while (false); MOZ_ReportAssertionFailure("bufferA.LengthBytes() == chunkA->BufferBytes()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1646); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "bufferA.LengthBytes() == chunkA->BufferBytes()" ")"); do { *((volatile int*)__null) = 1646; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1647 | ||||
1648 | // Add the initial tail block. | |||
1649 | constexpr ProfileBufferChunk::Length initTailLen = 10; | |||
1650 | auto initTail = chunkA->ReserveInitialBlockAsTail(initTailLen); | |||
1651 | static_assert( | |||
1652 | std::is_same_v<decltype(initTail), Span<ProfileBufferChunk::Byte>>, | |||
1653 | "ReserveInitialBlockAsTail() should return a Span<Byte>"); | |||
1654 | MOZ_RELEASE_ASSERT(initTail.LengthBytes() == initTailLen)do { static_assert( mozilla::detail::AssertionConditionType< decltype(initTail.LengthBytes() == initTailLen)>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(! !(initTail.LengthBytes() == initTailLen))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("initTail.LengthBytes() == initTailLen" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1654); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "initTail.LengthBytes() == initTailLen" ")"); do { *((volatile int*)__null) = 1654; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1655 | MOZ_RELEASE_ASSERT(initTail.Elements() == bufferA.Elements())do { static_assert( mozilla::detail::AssertionConditionType< decltype(initTail.Elements() == bufferA.Elements())>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(initTail.Elements() == bufferA.Elements()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("initTail.Elements() == bufferA.Elements()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1655); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "initTail.Elements() == bufferA.Elements()" ")"); do { *((volatile int*)__null) = 1655; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1656 | MOZ_RELEASE_ASSERT(chunkA->OffsetFirstBlock() == initTailLen)do { static_assert( mozilla::detail::AssertionConditionType< decltype(chunkA->OffsetFirstBlock() == initTailLen)>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(chunkA->OffsetFirstBlock() == initTailLen))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("chunkA->OffsetFirstBlock() == initTailLen" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1656); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunkA->OffsetFirstBlock() == initTailLen" ")"); do { *((volatile int*)__null) = 1656; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1657 | MOZ_RELEASE_ASSERT(chunkA->OffsetPastLastBlock() == initTailLen)do { static_assert( mozilla::detail::AssertionConditionType< decltype(chunkA->OffsetPastLastBlock() == initTailLen)> ::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(chunkA->OffsetPastLastBlock() == initTailLen))), 0 ))) { do { } while (false); MOZ_ReportAssertionFailure("chunkA->OffsetPastLastBlock() == initTailLen" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1657); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunkA->OffsetPastLastBlock() == initTailLen" ")"); do { *((volatile int*)__null) = 1657; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1658 | ||||
1659 | // Add the first complete block. | |||
1660 | constexpr ProfileBufferChunk::Length block1Len = 20; | |||
1661 | auto block1 = chunkA->ReserveBlock(block1Len); | |||
1662 | static_assert( | |||
1663 | std::is_same_v<decltype(block1), ProfileBufferChunk::ReserveReturn>, | |||
1664 | "ReserveBlock() should return a ReserveReturn"); | |||
1665 | MOZ_RELEASE_ASSERT(block1.mBlockRangeIndex.ConvertToProfileBufferIndex() ==do { static_assert( mozilla::detail::AssertionConditionType< decltype(block1.mBlockRangeIndex.ConvertToProfileBufferIndex( ) == chunkARangeStart + initTailLen)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(block1.mBlockRangeIndex.ConvertToProfileBufferIndex () == chunkARangeStart + initTailLen))), 0))) { do { } while ( false); MOZ_ReportAssertionFailure("block1.mBlockRangeIndex.ConvertToProfileBufferIndex() == chunkARangeStart + initTailLen" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1666); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "block1.mBlockRangeIndex.ConvertToProfileBufferIndex() == chunkARangeStart + initTailLen" ")"); do { *((volatile int*)__null) = 1666; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
1666 | chunkARangeStart + initTailLen)do { static_assert( mozilla::detail::AssertionConditionType< decltype(block1.mBlockRangeIndex.ConvertToProfileBufferIndex( ) == chunkARangeStart + initTailLen)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(block1.mBlockRangeIndex.ConvertToProfileBufferIndex () == chunkARangeStart + initTailLen))), 0))) { do { } while ( false); MOZ_ReportAssertionFailure("block1.mBlockRangeIndex.ConvertToProfileBufferIndex() == chunkARangeStart + initTailLen" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1666); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "block1.mBlockRangeIndex.ConvertToProfileBufferIndex() == chunkARangeStart + initTailLen" ")"); do { *((volatile int*)__null) = 1666; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1667 | MOZ_RELEASE_ASSERT(block1.mSpan.LengthBytes() == block1Len)do { static_assert( mozilla::detail::AssertionConditionType< decltype(block1.mSpan.LengthBytes() == block1Len)>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(block1.mSpan.LengthBytes() == block1Len))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("block1.mSpan.LengthBytes() == block1Len" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1667); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "block1.mSpan.LengthBytes() == block1Len" ")"); do { *((volatile int*)__null) = 1667; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1668 | MOZ_RELEASE_ASSERT(block1.mSpan.Elements() ==do { static_assert( mozilla::detail::AssertionConditionType< decltype(block1.mSpan.Elements() == bufferA.Elements() + initTailLen )>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(block1.mSpan.Elements() == bufferA.Elements() + initTailLen ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "block1.mSpan.Elements() == bufferA.Elements() + initTailLen" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1669); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "block1.mSpan.Elements() == bufferA.Elements() + initTailLen" ")"); do { *((volatile int*)__null) = 1669; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
1669 | bufferA.Elements() + initTailLen)do { static_assert( mozilla::detail::AssertionConditionType< decltype(block1.mSpan.Elements() == bufferA.Elements() + initTailLen )>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(block1.mSpan.Elements() == bufferA.Elements() + initTailLen ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "block1.mSpan.Elements() == bufferA.Elements() + initTailLen" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1669); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "block1.mSpan.Elements() == bufferA.Elements() + initTailLen" ")"); do { *((volatile int*)__null) = 1669; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1670 | MOZ_RELEASE_ASSERT(chunkA->OffsetFirstBlock() == initTailLen)do { static_assert( mozilla::detail::AssertionConditionType< decltype(chunkA->OffsetFirstBlock() == initTailLen)>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(chunkA->OffsetFirstBlock() == initTailLen))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("chunkA->OffsetFirstBlock() == initTailLen" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1670); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunkA->OffsetFirstBlock() == initTailLen" ")"); do { *((volatile int*)__null) = 1670; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1671 | MOZ_RELEASE_ASSERT(chunkA->OffsetPastLastBlock() == initTailLen + block1Len)do { static_assert( mozilla::detail::AssertionConditionType< decltype(chunkA->OffsetPastLastBlock() == initTailLen + block1Len )>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(chunkA->OffsetPastLastBlock() == initTailLen + block1Len ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "chunkA->OffsetPastLastBlock() == initTailLen + block1Len" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1671); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunkA->OffsetPastLastBlock() == initTailLen + block1Len" ")"); do { *((volatile int*)__null) = 1671; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1672 | MOZ_RELEASE_ASSERT(chunkA->RemainingBytes() != 0)do { static_assert( mozilla::detail::AssertionConditionType< decltype(chunkA->RemainingBytes() != 0)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(chunkA->RemainingBytes() != 0))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("chunkA->RemainingBytes() != 0", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1672); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunkA->RemainingBytes() != 0" ")"); do { *((volatile int*)__null) = 1672; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1673 | ||||
1674 | // Add another block to over-fill the ProfileBufferChunk. | |||
1675 | const ProfileBufferChunk::Length remaining = | |||
1676 | chunkA->BufferBytes() - (initTailLen + block1Len); | |||
1677 | constexpr ProfileBufferChunk::Length overfill = 30; | |||
1678 | const ProfileBufferChunk::Length block2Len = remaining + overfill; | |||
1679 | ProfileBufferChunk::ReserveReturn block2 = chunkA->ReserveBlock(block2Len); | |||
1680 | MOZ_RELEASE_ASSERT(block2.mBlockRangeIndex.ConvertToProfileBufferIndex() ==do { static_assert( mozilla::detail::AssertionConditionType< decltype(block2.mBlockRangeIndex.ConvertToProfileBufferIndex( ) == chunkARangeStart + initTailLen + block1Len)>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(block2.mBlockRangeIndex.ConvertToProfileBufferIndex() == chunkARangeStart + initTailLen + block1Len))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("block2.mBlockRangeIndex.ConvertToProfileBufferIndex() == chunkARangeStart + initTailLen + block1Len" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1681); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "block2.mBlockRangeIndex.ConvertToProfileBufferIndex() == chunkARangeStart + initTailLen + block1Len" ")"); do { *((volatile int*)__null) = 1681; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
1681 | chunkARangeStart + initTailLen + block1Len)do { static_assert( mozilla::detail::AssertionConditionType< decltype(block2.mBlockRangeIndex.ConvertToProfileBufferIndex( ) == chunkARangeStart + initTailLen + block1Len)>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(block2.mBlockRangeIndex.ConvertToProfileBufferIndex() == chunkARangeStart + initTailLen + block1Len))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("block2.mBlockRangeIndex.ConvertToProfileBufferIndex() == chunkARangeStart + initTailLen + block1Len" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1681); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "block2.mBlockRangeIndex.ConvertToProfileBufferIndex() == chunkARangeStart + initTailLen + block1Len" ")"); do { *((volatile int*)__null) = 1681; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1682 | MOZ_RELEASE_ASSERT(block2.mSpan.LengthBytes() == remaining)do { static_assert( mozilla::detail::AssertionConditionType< decltype(block2.mSpan.LengthBytes() == remaining)>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(block2.mSpan.LengthBytes() == remaining))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("block2.mSpan.LengthBytes() == remaining" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1682); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "block2.mSpan.LengthBytes() == remaining" ")"); do { *((volatile int*)__null) = 1682; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1683 | MOZ_RELEASE_ASSERT(block2.mSpan.Elements() ==do { static_assert( mozilla::detail::AssertionConditionType< decltype(block2.mSpan.Elements() == bufferA.Elements() + initTailLen + block1Len)>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(!!(block2.mSpan.Elements() == bufferA .Elements() + initTailLen + block1Len))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("block2.mSpan.Elements() == bufferA.Elements() + initTailLen + block1Len" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1684); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "block2.mSpan.Elements() == bufferA.Elements() + initTailLen + block1Len" ")"); do { *((volatile int*)__null) = 1684; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
1684 | bufferA.Elements() + initTailLen + block1Len)do { static_assert( mozilla::detail::AssertionConditionType< decltype(block2.mSpan.Elements() == bufferA.Elements() + initTailLen + block1Len)>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(!!(block2.mSpan.Elements() == bufferA .Elements() + initTailLen + block1Len))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("block2.mSpan.Elements() == bufferA.Elements() + initTailLen + block1Len" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1684); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "block2.mSpan.Elements() == bufferA.Elements() + initTailLen + block1Len" ")"); do { *((volatile int*)__null) = 1684; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1685 | MOZ_RELEASE_ASSERT(chunkA->OffsetFirstBlock() == initTailLen)do { static_assert( mozilla::detail::AssertionConditionType< decltype(chunkA->OffsetFirstBlock() == initTailLen)>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(chunkA->OffsetFirstBlock() == initTailLen))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("chunkA->OffsetFirstBlock() == initTailLen" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1685); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunkA->OffsetFirstBlock() == initTailLen" ")"); do { *((volatile int*)__null) = 1685; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1686 | MOZ_RELEASE_ASSERT(chunkA->OffsetPastLastBlock() == chunkA->BufferBytes())do { static_assert( mozilla::detail::AssertionConditionType< decltype(chunkA->OffsetPastLastBlock() == chunkA->BufferBytes ())>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(chunkA->OffsetPastLastBlock() == chunkA->BufferBytes ()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("chunkA->OffsetPastLastBlock() == chunkA->BufferBytes()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1686); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunkA->OffsetPastLastBlock() == chunkA->BufferBytes()" ")"); do { *((volatile int*)__null) = 1686; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1687 | MOZ_RELEASE_ASSERT(chunkA->RemainingBytes() == 0)do { static_assert( mozilla::detail::AssertionConditionType< decltype(chunkA->RemainingBytes() == 0)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(chunkA->RemainingBytes() == 0))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("chunkA->RemainingBytes() == 0", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1687); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunkA->RemainingBytes() == 0" ")"); do { *((volatile int*)__null) = 1687; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1688 | ||||
1689 | // Block must be marked "done" before it can be recycled. | |||
1690 | chunkA->MarkDone(); | |||
1691 | ||||
1692 | // It must be marked "recycled" before data can be added to it again. | |||
1693 | chunkA->MarkRecycled(); | |||
1694 | ||||
1695 | // Add an empty initial tail block. | |||
1696 | Span<ProfileBufferChunk::Byte> initTail2 = | |||
1697 | chunkA->ReserveInitialBlockAsTail(0); | |||
1698 | MOZ_RELEASE_ASSERT(initTail2.LengthBytes() == 0)do { static_assert( mozilla::detail::AssertionConditionType< decltype(initTail2.LengthBytes() == 0)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(initTail2.LengthBytes() == 0 ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "initTail2.LengthBytes() == 0", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1698); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "initTail2.LengthBytes() == 0" ")"); do { *((volatile int*)__null) = 1698; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1699 | MOZ_RELEASE_ASSERT(initTail2.Elements() == bufferA.Elements())do { static_assert( mozilla::detail::AssertionConditionType< decltype(initTail2.Elements() == bufferA.Elements())>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(initTail2.Elements() == bufferA.Elements()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("initTail2.Elements() == bufferA.Elements()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1699); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "initTail2.Elements() == bufferA.Elements()" ")"); do { *((volatile int*)__null) = 1699; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1700 | MOZ_RELEASE_ASSERT(chunkA->OffsetFirstBlock() == 0)do { static_assert( mozilla::detail::AssertionConditionType< decltype(chunkA->OffsetFirstBlock() == 0)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(chunkA->OffsetFirstBlock( ) == 0))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("chunkA->OffsetFirstBlock() == 0", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1700); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunkA->OffsetFirstBlock() == 0" ")"); do { *((volatile int*)__null) = 1700; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1701 | MOZ_RELEASE_ASSERT(chunkA->OffsetPastLastBlock() == 0)do { static_assert( mozilla::detail::AssertionConditionType< decltype(chunkA->OffsetPastLastBlock() == 0)>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(! !(chunkA->OffsetPastLastBlock() == 0))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("chunkA->OffsetPastLastBlock() == 0" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1701); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunkA->OffsetPastLastBlock() == 0" ")"); do { *((volatile int*)__null) = 1701; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1702 | ||||
1703 | // Block must be marked "done" before it can be destroyed. | |||
1704 | chunkA->MarkDone(); | |||
1705 | ||||
1706 | chunkA->SetProcessId(123); | |||
1707 | MOZ_RELEASE_ASSERT(chunkA->ProcessId() == 123)do { static_assert( mozilla::detail::AssertionConditionType< decltype(chunkA->ProcessId() == 123)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(chunkA->ProcessId() == 123 ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "chunkA->ProcessId() == 123", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1707); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunkA->ProcessId() == 123" ")"); do { *((volatile int*)__null) = 1707; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1708 | ||||
1709 | printf("TestChunk done\n"); | |||
1710 | } | |||
1711 | ||||
1712 | static void TestChunkManagerSingle() { | |||
1713 | printf("TestChunkManagerSingle...\n"); | |||
1714 | ||||
1715 | // Construct a ProfileBufferChunkManagerSingle for one chunk of size >=1000. | |||
1716 | constexpr ProfileBufferChunk::Length ChunkMinBufferBytes = 1000; | |||
1717 | ProfileBufferChunkManagerSingle cms{ChunkMinBufferBytes}; | |||
1718 | ||||
1719 | // Reference to base class, to exercize virtual methods. | |||
1720 | ProfileBufferChunkManager& cm = cms; | |||
1721 | ||||
1722 | # ifdef DEBUG1 | |||
1723 | const char* chunkManagerRegisterer = "TestChunkManagerSingle"; | |||
1724 | cm.RegisteredWith(chunkManagerRegisterer); | |||
1725 | # endif // DEBUG | |||
1726 | ||||
1727 | const auto maxTotalSize = cm.MaxTotalSize(); | |||
1728 | MOZ_RELEASE_ASSERT(maxTotalSize >= ChunkMinBufferBytes)do { static_assert( mozilla::detail::AssertionConditionType< decltype(maxTotalSize >= ChunkMinBufferBytes)>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(maxTotalSize >= ChunkMinBufferBytes))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("maxTotalSize >= ChunkMinBufferBytes" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1728); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "maxTotalSize >= ChunkMinBufferBytes" ")"); do { *((volatile int*)__null) = 1728; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1729 | ||||
1730 | cm.SetChunkDestroyedCallback([](const ProfileBufferChunk&) { | |||
1731 | MOZ_RELEASE_ASSERT(do { static_assert( mozilla::detail::AssertionConditionType< decltype(false)>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(!!(false))), 0))) { do { } while ( false); MOZ_ReportAssertionFailure("false" " (" "ProfileBufferChunkManagerSingle should never destroy its one chunk" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1733); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "false" ") (" "ProfileBufferChunkManagerSingle should never destroy its one chunk" ")"); do { *((volatile int*)__null) = 1733; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
1732 | false,do { static_assert( mozilla::detail::AssertionConditionType< decltype(false)>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(!!(false))), 0))) { do { } while ( false); MOZ_ReportAssertionFailure("false" " (" "ProfileBufferChunkManagerSingle should never destroy its one chunk" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1733); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "false" ") (" "ProfileBufferChunkManagerSingle should never destroy its one chunk" ")"); do { *((volatile int*)__null) = 1733; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
1733 | "ProfileBufferChunkManagerSingle should never destroy its one chunk")do { static_assert( mozilla::detail::AssertionConditionType< decltype(false)>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(!!(false))), 0))) { do { } while ( false); MOZ_ReportAssertionFailure("false" " (" "ProfileBufferChunkManagerSingle should never destroy its one chunk" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1733); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "false" ") (" "ProfileBufferChunkManagerSingle should never destroy its one chunk" ")"); do { *((volatile int*)__null) = 1733; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1734 | }); | |||
1735 | ||||
1736 | UniquePtr<ProfileBufferChunk> extantReleasedChunks = | |||
1737 | cm.GetExtantReleasedChunks(); | |||
1738 | MOZ_RELEASE_ASSERT(!extantReleasedChunks, "Unexpected released chunk(s)")do { static_assert( mozilla::detail::AssertionConditionType< decltype(!extantReleasedChunks)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!extantReleasedChunks))), 0) )) { do { } while (false); MOZ_ReportAssertionFailure("!extantReleasedChunks" " (" "Unexpected released chunk(s)" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1738); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!extantReleasedChunks" ") (" "Unexpected released chunk(s)" ")"); do { *((volatile int *)__null) = 1738; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | |||
1739 | ||||
1740 | // First request. | |||
1741 | UniquePtr<ProfileBufferChunk> chunk = cm.GetChunk(); | |||
1742 | MOZ_RELEASE_ASSERT(!!chunk, "First chunk request should always work")do { static_assert( mozilla::detail::AssertionConditionType< decltype(!!chunk)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!!chunk))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!!chunk" " (" "First chunk request should always work" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1742); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!!chunk" ") (" "First chunk request should always work" ")"); do { *( (volatile int*)__null) = 1742; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
1743 | MOZ_RELEASE_ASSERT(chunk->BufferBytes() >= ChunkMinBufferBytes,do { static_assert( mozilla::detail::AssertionConditionType< decltype(chunk->BufferBytes() >= ChunkMinBufferBytes)> ::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(chunk->BufferBytes() >= ChunkMinBufferBytes))) , 0))) { do { } while (false); MOZ_ReportAssertionFailure("chunk->BufferBytes() >= ChunkMinBufferBytes" " (" "Unexpected chunk size" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1744); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunk->BufferBytes() >= ChunkMinBufferBytes" ") (" "Unexpected chunk size" ")"); do { *((volatile int*)__null ) = 1744; __attribute__((nomerge)) ::abort(); } while (false) ; } } while (false) | |||
1744 | "Unexpected chunk size")do { static_assert( mozilla::detail::AssertionConditionType< decltype(chunk->BufferBytes() >= ChunkMinBufferBytes)> ::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(chunk->BufferBytes() >= ChunkMinBufferBytes))) , 0))) { do { } while (false); MOZ_ReportAssertionFailure("chunk->BufferBytes() >= ChunkMinBufferBytes" " (" "Unexpected chunk size" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1744); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunk->BufferBytes() >= ChunkMinBufferBytes" ") (" "Unexpected chunk size" ")"); do { *((volatile int*)__null ) = 1744; __attribute__((nomerge)) ::abort(); } while (false) ; } } while (false); | |||
1745 | MOZ_RELEASE_ASSERT(!chunk->GetNext(), "There should only be one chunk")do { static_assert( mozilla::detail::AssertionConditionType< decltype(!chunk->GetNext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!chunk->GetNext()))), 0)) ) { do { } while (false); MOZ_ReportAssertionFailure("!chunk->GetNext()" " (" "There should only be one chunk" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1745); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!chunk->GetNext()" ") (" "There should only be one chunk" ")"); do { *((volatile int*)__null) = 1745; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | |||
1746 | ||||
1747 | // Keep address, for later checks. | |||
1748 | const uintptr_t chunkAddress = reinterpret_cast<uintptr_t>(chunk.get()); | |||
1749 | ||||
1750 | extantReleasedChunks = cm.GetExtantReleasedChunks(); | |||
1751 | MOZ_RELEASE_ASSERT(!extantReleasedChunks, "Unexpected released chunk(s)")do { static_assert( mozilla::detail::AssertionConditionType< decltype(!extantReleasedChunks)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!extantReleasedChunks))), 0) )) { do { } while (false); MOZ_ReportAssertionFailure("!extantReleasedChunks" " (" "Unexpected released chunk(s)" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1751); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!extantReleasedChunks" ") (" "Unexpected released chunk(s)" ")"); do { *((volatile int *)__null) = 1751; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | |||
1752 | ||||
1753 | // Second request. | |||
1754 | MOZ_RELEASE_ASSERT(!cm.GetChunk(), "Second chunk request should always fail")do { static_assert( mozilla::detail::AssertionConditionType< decltype(!cm.GetChunk())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!cm.GetChunk()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!cm.GetChunk()" " (" "Second chunk request should always fail" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1754); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!cm.GetChunk()" ") (" "Second chunk request should always fail" ")"); do { * ((volatile int*)__null) = 1754; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
1755 | ||||
1756 | extantReleasedChunks = cm.GetExtantReleasedChunks(); | |||
1757 | MOZ_RELEASE_ASSERT(!extantReleasedChunks, "Unexpected released chunk(s)")do { static_assert( mozilla::detail::AssertionConditionType< decltype(!extantReleasedChunks)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!extantReleasedChunks))), 0) )) { do { } while (false); MOZ_ReportAssertionFailure("!extantReleasedChunks" " (" "Unexpected released chunk(s)" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1757); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!extantReleasedChunks" ") (" "Unexpected released chunk(s)" ")"); do { *((volatile int *)__null) = 1757; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | |||
1758 | ||||
1759 | // Add some data to the chunk (to verify recycling later on). | |||
1760 | MOZ_RELEASE_ASSERT(chunk->ChunkHeader().mOffsetFirstBlock == 0)do { static_assert( mozilla::detail::AssertionConditionType< decltype(chunk->ChunkHeader().mOffsetFirstBlock == 0)>:: isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(chunk->ChunkHeader().mOffsetFirstBlock == 0))), 0 ))) { do { } while (false); MOZ_ReportAssertionFailure("chunk->ChunkHeader().mOffsetFirstBlock == 0" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1760); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunk->ChunkHeader().mOffsetFirstBlock == 0" ")"); do { *((volatile int*)__null) = 1760; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1761 | MOZ_RELEASE_ASSERT(chunk->ChunkHeader().mOffsetPastLastBlock == 0)do { static_assert( mozilla::detail::AssertionConditionType< decltype(chunk->ChunkHeader().mOffsetPastLastBlock == 0)> ::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(chunk->ChunkHeader().mOffsetPastLastBlock == 0))) , 0))) { do { } while (false); MOZ_ReportAssertionFailure("chunk->ChunkHeader().mOffsetPastLastBlock == 0" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1761); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunk->ChunkHeader().mOffsetPastLastBlock == 0" ")"); do { *((volatile int*)__null) = 1761; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1762 | MOZ_RELEASE_ASSERT(chunk->RangeStart() == 0)do { static_assert( mozilla::detail::AssertionConditionType< decltype(chunk->RangeStart() == 0)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(chunk->RangeStart() == 0) )), 0))) { do { } while (false); MOZ_ReportAssertionFailure("chunk->RangeStart() == 0" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1762); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunk->RangeStart() == 0" ")"); do { *((volatile int*)__null) = 1762; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1763 | chunk->SetRangeStart(100); | |||
1764 | MOZ_RELEASE_ASSERT(chunk->RangeStart() == 100)do { static_assert( mozilla::detail::AssertionConditionType< decltype(chunk->RangeStart() == 100)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(chunk->RangeStart() == 100 ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "chunk->RangeStart() == 100", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1764); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunk->RangeStart() == 100" ")"); do { *((volatile int*)__null) = 1764; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1765 | Unused << chunk->ReserveInitialBlockAsTail(1); | |||
1766 | Unused << chunk->ReserveBlock(2); | |||
1767 | MOZ_RELEASE_ASSERT(chunk->ChunkHeader().mOffsetFirstBlock == 1)do { static_assert( mozilla::detail::AssertionConditionType< decltype(chunk->ChunkHeader().mOffsetFirstBlock == 1)>:: isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(chunk->ChunkHeader().mOffsetFirstBlock == 1))), 0 ))) { do { } while (false); MOZ_ReportAssertionFailure("chunk->ChunkHeader().mOffsetFirstBlock == 1" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1767); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunk->ChunkHeader().mOffsetFirstBlock == 1" ")"); do { *((volatile int*)__null) = 1767; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1768 | MOZ_RELEASE_ASSERT(chunk->ChunkHeader().mOffsetPastLastBlock == 1 + 2)do { static_assert( mozilla::detail::AssertionConditionType< decltype(chunk->ChunkHeader().mOffsetPastLastBlock == 1 + 2 )>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(chunk->ChunkHeader().mOffsetPastLastBlock == 1 + 2 ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "chunk->ChunkHeader().mOffsetPastLastBlock == 1 + 2", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1768); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunk->ChunkHeader().mOffsetPastLastBlock == 1 + 2" ")"); do { *((volatile int*)__null) = 1768; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1769 | ||||
1770 | // Release the first chunk. | |||
1771 | chunk->MarkDone(); | |||
1772 | cm.ReleaseChunk(std::move(chunk)); | |||
1773 | MOZ_RELEASE_ASSERT(!chunk, "chunk UniquePtr should have been moved-from")do { static_assert( mozilla::detail::AssertionConditionType< decltype(!chunk)>::isValid, "invalid assertion condition") ; if ((__builtin_expect(!!(!(!!(!chunk))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!chunk" " (" "chunk UniquePtr should have been moved-from" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1773); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!chunk" ") (" "chunk UniquePtr should have been moved-from" ")"); do { *((volatile int*)__null) = 1773; __attribute__((nomerge)) :: abort(); } while (false); } } while (false); | |||
1774 | ||||
1775 | // Request after release. | |||
1776 | MOZ_RELEASE_ASSERT(!cm.GetChunk(),do { static_assert( mozilla::detail::AssertionConditionType< decltype(!cm.GetChunk())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!cm.GetChunk()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!cm.GetChunk()" " (" "Chunk request after release should also fail" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1777); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!cm.GetChunk()" ") (" "Chunk request after release should also fail" ")"); do { *((volatile int*)__null) = 1777; __attribute__((nomerge)) :: abort(); } while (false); } } while (false) | |||
1777 | "Chunk request after release should also fail")do { static_assert( mozilla::detail::AssertionConditionType< decltype(!cm.GetChunk())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!cm.GetChunk()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!cm.GetChunk()" " (" "Chunk request after release should also fail" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1777); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!cm.GetChunk()" ") (" "Chunk request after release should also fail" ")"); do { *((volatile int*)__null) = 1777; __attribute__((nomerge)) :: abort(); } while (false); } } while (false); | |||
1778 | ||||
1779 | // Check released chunk. | |||
1780 | extantReleasedChunks = cm.GetExtantReleasedChunks(); | |||
1781 | MOZ_RELEASE_ASSERT(!!extantReleasedChunks,do { static_assert( mozilla::detail::AssertionConditionType< decltype(!!extantReleasedChunks)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!!extantReleasedChunks))), 0 ))) { do { } while (false); MOZ_ReportAssertionFailure("!!extantReleasedChunks" " (" "Could not retrieve released chunk" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1782); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!!extantReleasedChunks" ") (" "Could not retrieve released chunk" ")"); do { *((volatile int*)__null) = 1782; __attribute__((nomerge)) ::abort(); } while (false); } } while (false) | |||
1782 | "Could not retrieve released chunk")do { static_assert( mozilla::detail::AssertionConditionType< decltype(!!extantReleasedChunks)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!!extantReleasedChunks))), 0 ))) { do { } while (false); MOZ_ReportAssertionFailure("!!extantReleasedChunks" " (" "Could not retrieve released chunk" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1782); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!!extantReleasedChunks" ") (" "Could not retrieve released chunk" ")"); do { *((volatile int*)__null) = 1782; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | |||
1783 | MOZ_RELEASE_ASSERT(!extantReleasedChunks->GetNext(),do { static_assert( mozilla::detail::AssertionConditionType< decltype(!extantReleasedChunks->GetNext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!extantReleasedChunks->GetNext ()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("!extantReleasedChunks->GetNext()" " (" "There should only be one released chunk" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1784); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!extantReleasedChunks->GetNext()" ") (" "There should only be one released chunk" ")"); do { * ((volatile int*)__null) = 1784; __attribute__((nomerge)) ::abort (); } while (false); } } while (false) | |||
1784 | "There should only be one released chunk")do { static_assert( mozilla::detail::AssertionConditionType< decltype(!extantReleasedChunks->GetNext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!extantReleasedChunks->GetNext ()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("!extantReleasedChunks->GetNext()" " (" "There should only be one released chunk" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1784); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!extantReleasedChunks->GetNext()" ") (" "There should only be one released chunk" ")"); do { * ((volatile int*)__null) = 1784; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
1785 | MOZ_RELEASE_ASSERT(do { static_assert( mozilla::detail::AssertionConditionType< decltype(reinterpret_cast<uintptr_t>(extantReleasedChunks .get()) == chunkAddress)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(reinterpret_cast<uintptr_t >(extantReleasedChunks.get()) == chunkAddress))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("reinterpret_cast<uintptr_t>(extantReleasedChunks.get()) == chunkAddress" " (" "Released chunk should be first requested one" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1787); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "reinterpret_cast<uintptr_t>(extantReleasedChunks.get()) == chunkAddress" ") (" "Released chunk should be first requested one" ")"); do { *((volatile int*)__null) = 1787; __attribute__((nomerge)) :: abort(); } while (false); } } while (false) | |||
1786 | reinterpret_cast<uintptr_t>(extantReleasedChunks.get()) == chunkAddress,do { static_assert( mozilla::detail::AssertionConditionType< decltype(reinterpret_cast<uintptr_t>(extantReleasedChunks .get()) == chunkAddress)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(reinterpret_cast<uintptr_t >(extantReleasedChunks.get()) == chunkAddress))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("reinterpret_cast<uintptr_t>(extantReleasedChunks.get()) == chunkAddress" " (" "Released chunk should be first requested one" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1787); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "reinterpret_cast<uintptr_t>(extantReleasedChunks.get()) == chunkAddress" ") (" "Released chunk should be first requested one" ")"); do { *((volatile int*)__null) = 1787; __attribute__((nomerge)) :: abort(); } while (false); } } while (false) | |||
1787 | "Released chunk should be first requested one")do { static_assert( mozilla::detail::AssertionConditionType< decltype(reinterpret_cast<uintptr_t>(extantReleasedChunks .get()) == chunkAddress)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(reinterpret_cast<uintptr_t >(extantReleasedChunks.get()) == chunkAddress))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("reinterpret_cast<uintptr_t>(extantReleasedChunks.get()) == chunkAddress" " (" "Released chunk should be first requested one" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1787); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "reinterpret_cast<uintptr_t>(extantReleasedChunks.get()) == chunkAddress" ") (" "Released chunk should be first requested one" ")"); do { *((volatile int*)__null) = 1787; __attribute__((nomerge)) :: abort(); } while (false); } } while (false); | |||
1788 | ||||
1789 | MOZ_RELEASE_ASSERT(!cm.GetExtantReleasedChunks(),do { static_assert( mozilla::detail::AssertionConditionType< decltype(!cm.GetExtantReleasedChunks())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!cm.GetExtantReleasedChunks( )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("!cm.GetExtantReleasedChunks()" " (" "Unexpected extra released chunk(s)" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1790); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!cm.GetExtantReleasedChunks()" ") (" "Unexpected extra released chunk(s)" ")"); do { *((volatile int*)__null) = 1790; __attribute__((nomerge)) ::abort(); } while (false); } } while (false) | |||
1790 | "Unexpected extra released chunk(s)")do { static_assert( mozilla::detail::AssertionConditionType< decltype(!cm.GetExtantReleasedChunks())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!cm.GetExtantReleasedChunks( )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("!cm.GetExtantReleasedChunks()" " (" "Unexpected extra released chunk(s)" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1790); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!cm.GetExtantReleasedChunks()" ") (" "Unexpected extra released chunk(s)" ")"); do { *((volatile int*)__null) = 1790; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | |||
1791 | ||||
1792 | // Another request after release. | |||
1793 | MOZ_RELEASE_ASSERT(!cm.GetChunk(),do { static_assert( mozilla::detail::AssertionConditionType< decltype(!cm.GetChunk())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!cm.GetChunk()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!cm.GetChunk()" " (" "Chunk request after release should also fail" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1794); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!cm.GetChunk()" ") (" "Chunk request after release should also fail" ")"); do { *((volatile int*)__null) = 1794; __attribute__((nomerge)) :: abort(); } while (false); } } while (false) | |||
1794 | "Chunk request after release should also fail")do { static_assert( mozilla::detail::AssertionConditionType< decltype(!cm.GetChunk())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!cm.GetChunk()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!cm.GetChunk()" " (" "Chunk request after release should also fail" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1794); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!cm.GetChunk()" ") (" "Chunk request after release should also fail" ")"); do { *((volatile int*)__null) = 1794; __attribute__((nomerge)) :: abort(); } while (false); } } while (false); | |||
1795 | ||||
1796 | MOZ_RELEASE_ASSERT(do { static_assert( mozilla::detail::AssertionConditionType< decltype(cm.MaxTotalSize() == maxTotalSize)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(cm.MaxTotalSize() == maxTotalSize ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "cm.MaxTotalSize() == maxTotalSize" " (" "MaxTotalSize() should not change after requests&releases" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1798); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "cm.MaxTotalSize() == maxTotalSize" ") (" "MaxTotalSize() should not change after requests&releases" ")"); do { *((volatile int*)__null) = 1798; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
1797 | cm.MaxTotalSize() == maxTotalSize,do { static_assert( mozilla::detail::AssertionConditionType< decltype(cm.MaxTotalSize() == maxTotalSize)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(cm.MaxTotalSize() == maxTotalSize ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "cm.MaxTotalSize() == maxTotalSize" " (" "MaxTotalSize() should not change after requests&releases" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1798); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "cm.MaxTotalSize() == maxTotalSize" ") (" "MaxTotalSize() should not change after requests&releases" ")"); do { *((volatile int*)__null) = 1798; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
1798 | "MaxTotalSize() should not change after requests&releases")do { static_assert( mozilla::detail::AssertionConditionType< decltype(cm.MaxTotalSize() == maxTotalSize)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(cm.MaxTotalSize() == maxTotalSize ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "cm.MaxTotalSize() == maxTotalSize" " (" "MaxTotalSize() should not change after requests&releases" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1798); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "cm.MaxTotalSize() == maxTotalSize" ") (" "MaxTotalSize() should not change after requests&releases" ")"); do { *((volatile int*)__null) = 1798; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1799 | ||||
1800 | // Reset the chunk manager. (Single-only non-virtual function.) | |||
1801 | cms.Reset(std::move(extantReleasedChunks)); | |||
1802 | MOZ_RELEASE_ASSERT(!extantReleasedChunks,do { static_assert( mozilla::detail::AssertionConditionType< decltype(!extantReleasedChunks)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!extantReleasedChunks))), 0) )) { do { } while (false); MOZ_ReportAssertionFailure("!extantReleasedChunks" " (" "Released chunk UniquePtr should have been moved-from" ")" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1803); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!extantReleasedChunks" ") (" "Released chunk UniquePtr should have been moved-from" ")"); do { *((volatile int*)__null) = 1803; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
1803 | "Released chunk UniquePtr should have been moved-from")do { static_assert( mozilla::detail::AssertionConditionType< decltype(!extantReleasedChunks)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!extantReleasedChunks))), 0) )) { do { } while (false); MOZ_ReportAssertionFailure("!extantReleasedChunks" " (" "Released chunk UniquePtr should have been moved-from" ")" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1803); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!extantReleasedChunks" ") (" "Released chunk UniquePtr should have been moved-from" ")"); do { *((volatile int*)__null) = 1803; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1804 | ||||
1805 | MOZ_RELEASE_ASSERT(do { static_assert( mozilla::detail::AssertionConditionType< decltype(cm.MaxTotalSize() == maxTotalSize)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(cm.MaxTotalSize() == maxTotalSize ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "cm.MaxTotalSize() == maxTotalSize" " (" "MaxTotalSize() should not change when resetting with the same chunk" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1807); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "cm.MaxTotalSize() == maxTotalSize" ") (" "MaxTotalSize() should not change when resetting with the same chunk" ")"); do { *((volatile int*)__null) = 1807; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
1806 | cm.MaxTotalSize() == maxTotalSize,do { static_assert( mozilla::detail::AssertionConditionType< decltype(cm.MaxTotalSize() == maxTotalSize)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(cm.MaxTotalSize() == maxTotalSize ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "cm.MaxTotalSize() == maxTotalSize" " (" "MaxTotalSize() should not change when resetting with the same chunk" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1807); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "cm.MaxTotalSize() == maxTotalSize" ") (" "MaxTotalSize() should not change when resetting with the same chunk" ")"); do { *((volatile int*)__null) = 1807; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
1807 | "MaxTotalSize() should not change when resetting with the same chunk")do { static_assert( mozilla::detail::AssertionConditionType< decltype(cm.MaxTotalSize() == maxTotalSize)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(cm.MaxTotalSize() == maxTotalSize ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "cm.MaxTotalSize() == maxTotalSize" " (" "MaxTotalSize() should not change when resetting with the same chunk" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1807); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "cm.MaxTotalSize() == maxTotalSize" ") (" "MaxTotalSize() should not change when resetting with the same chunk" ")"); do { *((volatile int*)__null) = 1807; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1808 | ||||
1809 | // 2nd round, first request. Theoretically async, but this implementation just | |||
1810 | // immediately runs the callback. | |||
1811 | bool ran = false; | |||
1812 | cm.RequestChunk([&](UniquePtr<ProfileBufferChunk> aChunk) { | |||
1813 | ran = true; | |||
1814 | MOZ_RELEASE_ASSERT(!!aChunk)do { static_assert( mozilla::detail::AssertionConditionType< decltype(!!aChunk)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!!aChunk))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!!aChunk", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1814); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!!aChunk" ")"); do { *((volatile int*)__null) = 1814; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1815 | chunk = std::move(aChunk); | |||
1816 | }); | |||
1817 | MOZ_RELEASE_ASSERT(ran, "RequestChunk callback not called immediately")do { static_assert( mozilla::detail::AssertionConditionType< decltype(ran)>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(!!(ran))), 0))) { do { } while (false ); MOZ_ReportAssertionFailure("ran" " (" "RequestChunk callback not called immediately" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1817); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "ran" ") (" "RequestChunk callback not called immediately" ")"); do { *((volatile int*)__null) = 1817; __attribute__((nomerge)) :: abort(); } while (false); } } while (false); | |||
1818 | ran = false; | |||
1819 | cm.FulfillChunkRequests(); | |||
1820 | MOZ_RELEASE_ASSERT(!ran, "FulfillChunkRequests should not have any effects")do { static_assert( mozilla::detail::AssertionConditionType< decltype(!ran)>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(!!(!ran))), 0))) { do { } while (false ); MOZ_ReportAssertionFailure("!ran" " (" "FulfillChunkRequests should not have any effects" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1820); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!ran" ") (" "FulfillChunkRequests should not have any effects" ")" ); do { *((volatile int*)__null) = 1820; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1821 | MOZ_RELEASE_ASSERT(!!chunk, "First chunk request should always work")do { static_assert( mozilla::detail::AssertionConditionType< decltype(!!chunk)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!!chunk))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!!chunk" " (" "First chunk request should always work" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1821); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!!chunk" ") (" "First chunk request should always work" ")"); do { *( (volatile int*)__null) = 1821; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
1822 | MOZ_RELEASE_ASSERT(chunk->BufferBytes() >= ChunkMinBufferBytes,do { static_assert( mozilla::detail::AssertionConditionType< decltype(chunk->BufferBytes() >= ChunkMinBufferBytes)> ::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(chunk->BufferBytes() >= ChunkMinBufferBytes))) , 0))) { do { } while (false); MOZ_ReportAssertionFailure("chunk->BufferBytes() >= ChunkMinBufferBytes" " (" "Unexpected chunk size" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1823); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunk->BufferBytes() >= ChunkMinBufferBytes" ") (" "Unexpected chunk size" ")"); do { *((volatile int*)__null ) = 1823; __attribute__((nomerge)) ::abort(); } while (false) ; } } while (false) | |||
1823 | "Unexpected chunk size")do { static_assert( mozilla::detail::AssertionConditionType< decltype(chunk->BufferBytes() >= ChunkMinBufferBytes)> ::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(chunk->BufferBytes() >= ChunkMinBufferBytes))) , 0))) { do { } while (false); MOZ_ReportAssertionFailure("chunk->BufferBytes() >= ChunkMinBufferBytes" " (" "Unexpected chunk size" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1823); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunk->BufferBytes() >= ChunkMinBufferBytes" ") (" "Unexpected chunk size" ")"); do { *((volatile int*)__null ) = 1823; __attribute__((nomerge)) ::abort(); } while (false) ; } } while (false); | |||
1824 | MOZ_RELEASE_ASSERT(!chunk->GetNext(), "There should only be one chunk")do { static_assert( mozilla::detail::AssertionConditionType< decltype(!chunk->GetNext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!chunk->GetNext()))), 0)) ) { do { } while (false); MOZ_ReportAssertionFailure("!chunk->GetNext()" " (" "There should only be one chunk" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1824); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!chunk->GetNext()" ") (" "There should only be one chunk" ")"); do { *((volatile int*)__null) = 1824; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | |||
1825 | MOZ_RELEASE_ASSERT(reinterpret_cast<uintptr_t>(chunk.get()) == chunkAddress,do { static_assert( mozilla::detail::AssertionConditionType< decltype(reinterpret_cast<uintptr_t>(chunk.get()) == chunkAddress )>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(reinterpret_cast<uintptr_t>(chunk.get()) == chunkAddress ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "reinterpret_cast<uintptr_t>(chunk.get()) == chunkAddress" " (" "Requested chunk should be first requested one" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1826); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "reinterpret_cast<uintptr_t>(chunk.get()) == chunkAddress" ") (" "Requested chunk should be first requested one" ")"); do { *((volatile int*)__null) = 1826; __attribute__((nomerge)) :: abort(); } while (false); } } while (false) | |||
1826 | "Requested chunk should be first requested one")do { static_assert( mozilla::detail::AssertionConditionType< decltype(reinterpret_cast<uintptr_t>(chunk.get()) == chunkAddress )>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(reinterpret_cast<uintptr_t>(chunk.get()) == chunkAddress ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "reinterpret_cast<uintptr_t>(chunk.get()) == chunkAddress" " (" "Requested chunk should be first requested one" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1826); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "reinterpret_cast<uintptr_t>(chunk.get()) == chunkAddress" ") (" "Requested chunk should be first requested one" ")"); do { *((volatile int*)__null) = 1826; __attribute__((nomerge)) :: abort(); } while (false); } } while (false); | |||
1827 | // Verify that chunk is empty and usable. | |||
1828 | MOZ_RELEASE_ASSERT(chunk->ChunkHeader().mOffsetFirstBlock == 0)do { static_assert( mozilla::detail::AssertionConditionType< decltype(chunk->ChunkHeader().mOffsetFirstBlock == 0)>:: isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(chunk->ChunkHeader().mOffsetFirstBlock == 0))), 0 ))) { do { } while (false); MOZ_ReportAssertionFailure("chunk->ChunkHeader().mOffsetFirstBlock == 0" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1828); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunk->ChunkHeader().mOffsetFirstBlock == 0" ")"); do { *((volatile int*)__null) = 1828; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1829 | MOZ_RELEASE_ASSERT(chunk->ChunkHeader().mOffsetPastLastBlock == 0)do { static_assert( mozilla::detail::AssertionConditionType< decltype(chunk->ChunkHeader().mOffsetPastLastBlock == 0)> ::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(chunk->ChunkHeader().mOffsetPastLastBlock == 0))) , 0))) { do { } while (false); MOZ_ReportAssertionFailure("chunk->ChunkHeader().mOffsetPastLastBlock == 0" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1829); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunk->ChunkHeader().mOffsetPastLastBlock == 0" ")"); do { *((volatile int*)__null) = 1829; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1830 | MOZ_RELEASE_ASSERT(chunk->RangeStart() == 0)do { static_assert( mozilla::detail::AssertionConditionType< decltype(chunk->RangeStart() == 0)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(chunk->RangeStart() == 0) )), 0))) { do { } while (false); MOZ_ReportAssertionFailure("chunk->RangeStart() == 0" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1830); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunk->RangeStart() == 0" ")"); do { *((volatile int*)__null) = 1830; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1831 | chunk->SetRangeStart(200); | |||
1832 | MOZ_RELEASE_ASSERT(chunk->RangeStart() == 200)do { static_assert( mozilla::detail::AssertionConditionType< decltype(chunk->RangeStart() == 200)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(chunk->RangeStart() == 200 ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "chunk->RangeStart() == 200", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1832); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunk->RangeStart() == 200" ")"); do { *((volatile int*)__null) = 1832; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1833 | Unused << chunk->ReserveInitialBlockAsTail(3); | |||
1834 | Unused << chunk->ReserveBlock(4); | |||
1835 | MOZ_RELEASE_ASSERT(chunk->ChunkHeader().mOffsetFirstBlock == 3)do { static_assert( mozilla::detail::AssertionConditionType< decltype(chunk->ChunkHeader().mOffsetFirstBlock == 3)>:: isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(chunk->ChunkHeader().mOffsetFirstBlock == 3))), 0 ))) { do { } while (false); MOZ_ReportAssertionFailure("chunk->ChunkHeader().mOffsetFirstBlock == 3" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1835); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunk->ChunkHeader().mOffsetFirstBlock == 3" ")"); do { *((volatile int*)__null) = 1835; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1836 | MOZ_RELEASE_ASSERT(chunk->ChunkHeader().mOffsetPastLastBlock == 3 + 4)do { static_assert( mozilla::detail::AssertionConditionType< decltype(chunk->ChunkHeader().mOffsetPastLastBlock == 3 + 4 )>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(chunk->ChunkHeader().mOffsetPastLastBlock == 3 + 4 ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "chunk->ChunkHeader().mOffsetPastLastBlock == 3 + 4", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1836); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunk->ChunkHeader().mOffsetPastLastBlock == 3 + 4" ")"); do { *((volatile int*)__null) = 1836; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1837 | ||||
1838 | // Second request. | |||
1839 | ran = false; | |||
1840 | cm.RequestChunk([&](UniquePtr<ProfileBufferChunk> aChunk) { | |||
1841 | ran = true; | |||
1842 | MOZ_RELEASE_ASSERT(!aChunk, "Second chunk request should always fail")do { static_assert( mozilla::detail::AssertionConditionType< decltype(!aChunk)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!aChunk))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!aChunk" " (" "Second chunk request should always fail" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1842); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!aChunk" ") (" "Second chunk request should always fail" ")"); do { * ((volatile int*)__null) = 1842; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
1843 | }); | |||
1844 | MOZ_RELEASE_ASSERT(ran, "RequestChunk callback not called")do { static_assert( mozilla::detail::AssertionConditionType< decltype(ran)>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(!!(ran))), 0))) { do { } while (false ); MOZ_ReportAssertionFailure("ran" " (" "RequestChunk callback not called" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1844); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "ran" ") (" "RequestChunk callback not called" ")"); do { *((volatile int*)__null) = 1844; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | |||
1845 | ||||
1846 | // This one does nothing. | |||
1847 | cm.ForgetUnreleasedChunks(); | |||
1848 | ||||
1849 | // Don't forget to mark chunk "Done" before letting it die. | |||
1850 | chunk->MarkDone(); | |||
1851 | chunk = nullptr; | |||
1852 | ||||
1853 | // Create a tiny chunk and reset the chunk manager with it. | |||
1854 | chunk = ProfileBufferChunk::Create(1); | |||
1855 | MOZ_RELEASE_ASSERT(!!chunk)do { static_assert( mozilla::detail::AssertionConditionType< decltype(!!chunk)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!!chunk))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!!chunk", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1855); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!!chunk" ")"); do { *((volatile int*)__null) = 1855; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1856 | auto tinyChunkSize = chunk->BufferBytes(); | |||
1857 | MOZ_RELEASE_ASSERT(tinyChunkSize >= 1)do { static_assert( mozilla::detail::AssertionConditionType< decltype(tinyChunkSize >= 1)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(tinyChunkSize >= 1))), 0) )) { do { } while (false); MOZ_ReportAssertionFailure("tinyChunkSize >= 1" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1857); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "tinyChunkSize >= 1" ")"); do { *((volatile int*)__null) = 1857; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1858 | MOZ_RELEASE_ASSERT(tinyChunkSize < ChunkMinBufferBytes)do { static_assert( mozilla::detail::AssertionConditionType< decltype(tinyChunkSize < ChunkMinBufferBytes)>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(tinyChunkSize < ChunkMinBufferBytes))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("tinyChunkSize < ChunkMinBufferBytes" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1858); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "tinyChunkSize < ChunkMinBufferBytes" ")"); do { *((volatile int*)__null) = 1858; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1859 | MOZ_RELEASE_ASSERT(chunk->RangeStart() == 0)do { static_assert( mozilla::detail::AssertionConditionType< decltype(chunk->RangeStart() == 0)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(chunk->RangeStart() == 0) )), 0))) { do { } while (false); MOZ_ReportAssertionFailure("chunk->RangeStart() == 0" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1859); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunk->RangeStart() == 0" ")"); do { *((volatile int*)__null) = 1859; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1860 | chunk->SetRangeStart(300); | |||
1861 | MOZ_RELEASE_ASSERT(chunk->RangeStart() == 300)do { static_assert( mozilla::detail::AssertionConditionType< decltype(chunk->RangeStart() == 300)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(chunk->RangeStart() == 300 ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "chunk->RangeStart() == 300", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1861); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunk->RangeStart() == 300" ")"); do { *((volatile int*)__null) = 1861; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1862 | cms.Reset(std::move(chunk)); | |||
1863 | MOZ_RELEASE_ASSERT(!chunk, "chunk UniquePtr should have been moved-from")do { static_assert( mozilla::detail::AssertionConditionType< decltype(!chunk)>::isValid, "invalid assertion condition") ; if ((__builtin_expect(!!(!(!!(!chunk))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!chunk" " (" "chunk UniquePtr should have been moved-from" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1863); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!chunk" ") (" "chunk UniquePtr should have been moved-from" ")"); do { *((volatile int*)__null) = 1863; __attribute__((nomerge)) :: abort(); } while (false); } } while (false); | |||
1864 | MOZ_RELEASE_ASSERT(cm.MaxTotalSize() == tinyChunkSize,do { static_assert( mozilla::detail::AssertionConditionType< decltype(cm.MaxTotalSize() == tinyChunkSize)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(cm.MaxTotalSize() == tinyChunkSize ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "cm.MaxTotalSize() == tinyChunkSize" " (" "MaxTotalSize() should match the new chunk size" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1865); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "cm.MaxTotalSize() == tinyChunkSize" ") (" "MaxTotalSize() should match the new chunk size" ")"); do { *((volatile int*)__null) = 1865; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
1865 | "MaxTotalSize() should match the new chunk size")do { static_assert( mozilla::detail::AssertionConditionType< decltype(cm.MaxTotalSize() == tinyChunkSize)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(cm.MaxTotalSize() == tinyChunkSize ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "cm.MaxTotalSize() == tinyChunkSize" " (" "MaxTotalSize() should match the new chunk size" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1865); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "cm.MaxTotalSize() == tinyChunkSize" ") (" "MaxTotalSize() should match the new chunk size" ")"); do { *((volatile int*)__null) = 1865; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1866 | chunk = cm.GetChunk(); | |||
1867 | MOZ_RELEASE_ASSERT(chunk->RangeStart() == 0, "Got non-recycled chunk")do { static_assert( mozilla::detail::AssertionConditionType< decltype(chunk->RangeStart() == 0)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(chunk->RangeStart() == 0) )), 0))) { do { } while (false); MOZ_ReportAssertionFailure("chunk->RangeStart() == 0" " (" "Got non-recycled chunk" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1867); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunk->RangeStart() == 0" ") (" "Got non-recycled chunk" ")"); do { *((volatile int*)__null ) = 1867; __attribute__((nomerge)) ::abort(); } while (false) ; } } while (false); | |||
1868 | ||||
1869 | // Enough testing! Clean-up. | |||
1870 | Unused << chunk->ReserveInitialBlockAsTail(0); | |||
1871 | chunk->MarkDone(); | |||
1872 | cm.ForgetUnreleasedChunks(); | |||
1873 | ||||
1874 | # ifdef DEBUG1 | |||
1875 | cm.DeregisteredFrom(chunkManagerRegisterer); | |||
1876 | # endif // DEBUG | |||
1877 | ||||
1878 | printf("TestChunkManagerSingle done\n"); | |||
1879 | } | |||
1880 | ||||
1881 | static void TestChunkManagerWithLocalLimit() { | |||
1882 | printf("TestChunkManagerWithLocalLimit...\n"); | |||
1883 | ||||
1884 | // Construct a ProfileBufferChunkManagerWithLocalLimit with chunk of minimum | |||
1885 | // size >=100, up to 1000 bytes. | |||
1886 | constexpr ProfileBufferChunk::Length MaxTotalBytes = 1000; | |||
1887 | constexpr ProfileBufferChunk::Length ChunkMinBufferBytes = 100; | |||
1888 | ProfileBufferChunkManagerWithLocalLimit cmll{MaxTotalBytes, | |||
1889 | ChunkMinBufferBytes}; | |||
1890 | ||||
1891 | // Reference to base class, to exercize virtual methods. | |||
1892 | ProfileBufferChunkManager& cm = cmll; | |||
1893 | ||||
1894 | # ifdef DEBUG1 | |||
1895 | const char* chunkManagerRegisterer = "TestChunkManagerWithLocalLimit"; | |||
1896 | cm.RegisteredWith(chunkManagerRegisterer); | |||
1897 | # endif // DEBUG | |||
1898 | ||||
1899 | MOZ_RELEASE_ASSERT(cm.MaxTotalSize() == MaxTotalBytes,do { static_assert( mozilla::detail::AssertionConditionType< decltype(cm.MaxTotalSize() == MaxTotalBytes)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(cm.MaxTotalSize() == MaxTotalBytes ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "cm.MaxTotalSize() == MaxTotalBytes" " (" "Max total size should be exactly as given" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1900); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "cm.MaxTotalSize() == MaxTotalBytes" ") (" "Max total size should be exactly as given" ")"); do { *((volatile int*)__null) = 1900; __attribute__((nomerge)) :: abort(); } while (false); } } while (false) | |||
1900 | "Max total size should be exactly as given")do { static_assert( mozilla::detail::AssertionConditionType< decltype(cm.MaxTotalSize() == MaxTotalBytes)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(cm.MaxTotalSize() == MaxTotalBytes ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "cm.MaxTotalSize() == MaxTotalBytes" " (" "Max total size should be exactly as given" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1900); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "cm.MaxTotalSize() == MaxTotalBytes" ") (" "Max total size should be exactly as given" ")"); do { *((volatile int*)__null) = 1900; __attribute__((nomerge)) :: abort(); } while (false); } } while (false); | |||
1901 | ||||
1902 | unsigned destroyedChunks = 0; | |||
1903 | unsigned destroyedBytes = 0; | |||
1904 | cm.SetChunkDestroyedCallback([&](const ProfileBufferChunk& aChunks) { | |||
1905 | for (const ProfileBufferChunk* chunk = &aChunks; chunk; | |||
1906 | chunk = chunk->GetNext()) { | |||
1907 | destroyedChunks += 1; | |||
1908 | destroyedBytes += chunk->BufferBytes(); | |||
1909 | } | |||
1910 | }); | |||
1911 | ||||
1912 | UniquePtr<ProfileBufferChunk> extantReleasedChunks = | |||
1913 | cm.GetExtantReleasedChunks(); | |||
1914 | MOZ_RELEASE_ASSERT(!extantReleasedChunks, "Unexpected released chunk(s)")do { static_assert( mozilla::detail::AssertionConditionType< decltype(!extantReleasedChunks)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!extantReleasedChunks))), 0) )) { do { } while (false); MOZ_ReportAssertionFailure("!extantReleasedChunks" " (" "Unexpected released chunk(s)" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1914); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!extantReleasedChunks" ") (" "Unexpected released chunk(s)" ")"); do { *((volatile int *)__null) = 1914; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | |||
1915 | ||||
1916 | // First request. | |||
1917 | UniquePtr<ProfileBufferChunk> chunk = cm.GetChunk(); | |||
1918 | MOZ_RELEASE_ASSERT(!!chunk,do { static_assert( mozilla::detail::AssertionConditionType< decltype(!!chunk)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!!chunk))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!!chunk" " (" "First chunk immediate request should always work" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1919); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!!chunk" ") (" "First chunk immediate request should always work" ")" ); do { *((volatile int*)__null) = 1919; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
1919 | "First chunk immediate request should always work")do { static_assert( mozilla::detail::AssertionConditionType< decltype(!!chunk)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!!chunk))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!!chunk" " (" "First chunk immediate request should always work" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1919); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!!chunk" ") (" "First chunk immediate request should always work" ")" ); do { *((volatile int*)__null) = 1919; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1920 | const auto chunkActualBufferBytes = chunk->BufferBytes(); | |||
1921 | MOZ_RELEASE_ASSERT(chunkActualBufferBytes >= ChunkMinBufferBytes,do { static_assert( mozilla::detail::AssertionConditionType< decltype(chunkActualBufferBytes >= ChunkMinBufferBytes)> ::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(chunkActualBufferBytes >= ChunkMinBufferBytes))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("chunkActualBufferBytes >= ChunkMinBufferBytes" " (" "Unexpected chunk size" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1922); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunkActualBufferBytes >= ChunkMinBufferBytes" ") (" "Unexpected chunk size" ")"); do { *((volatile int*)__null ) = 1922; __attribute__((nomerge)) ::abort(); } while (false) ; } } while (false) | |||
1922 | "Unexpected chunk size")do { static_assert( mozilla::detail::AssertionConditionType< decltype(chunkActualBufferBytes >= ChunkMinBufferBytes)> ::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(chunkActualBufferBytes >= ChunkMinBufferBytes))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("chunkActualBufferBytes >= ChunkMinBufferBytes" " (" "Unexpected chunk size" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1922); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunkActualBufferBytes >= ChunkMinBufferBytes" ") (" "Unexpected chunk size" ")"); do { *((volatile int*)__null ) = 1922; __attribute__((nomerge)) ::abort(); } while (false) ; } } while (false); | |||
1923 | MOZ_RELEASE_ASSERT(!chunk->GetNext(), "There should only be one chunk")do { static_assert( mozilla::detail::AssertionConditionType< decltype(!chunk->GetNext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!chunk->GetNext()))), 0)) ) { do { } while (false); MOZ_ReportAssertionFailure("!chunk->GetNext()" " (" "There should only be one chunk" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1923); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!chunk->GetNext()" ") (" "There should only be one chunk" ")"); do { *((volatile int*)__null) = 1923; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | |||
1924 | ||||
1925 | // Keep address, for later checks. | |||
1926 | const uintptr_t chunk1Address = reinterpret_cast<uintptr_t>(chunk.get()); | |||
1927 | ||||
1928 | extantReleasedChunks = cm.GetExtantReleasedChunks(); | |||
1929 | MOZ_RELEASE_ASSERT(!extantReleasedChunks, "Unexpected released chunk(s)")do { static_assert( mozilla::detail::AssertionConditionType< decltype(!extantReleasedChunks)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!extantReleasedChunks))), 0) )) { do { } while (false); MOZ_ReportAssertionFailure("!extantReleasedChunks" " (" "Unexpected released chunk(s)" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1929); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!extantReleasedChunks" ") (" "Unexpected released chunk(s)" ")"); do { *((volatile int *)__null) = 1929; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | |||
1930 | ||||
1931 | // Verify that ReleaseChunk accepts zero chunks. | |||
1932 | cm.ReleaseChunk(nullptr); | |||
1933 | MOZ_RELEASE_ASSERT(!extantReleasedChunks, "Unexpected released chunk(s)")do { static_assert( mozilla::detail::AssertionConditionType< decltype(!extantReleasedChunks)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!extantReleasedChunks))), 0) )) { do { } while (false); MOZ_ReportAssertionFailure("!extantReleasedChunks" " (" "Unexpected released chunk(s)" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1933); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!extantReleasedChunks" ") (" "Unexpected released chunk(s)" ")"); do { *((volatile int *)__null) = 1933; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | |||
1934 | ||||
1935 | // For this test, we need to be able to get at least 2 chunks without hitting | |||
1936 | // the limit. (If this failed, it wouldn't necessary be a problem with | |||
1937 | // ProfileBufferChunkManagerWithLocalLimit, fiddle with constants at the top | |||
1938 | // of this test.) | |||
1939 | MOZ_RELEASE_ASSERT(chunkActualBufferBytes < 2 * MaxTotalBytes)do { static_assert( mozilla::detail::AssertionConditionType< decltype(chunkActualBufferBytes < 2 * MaxTotalBytes)>:: isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(chunkActualBufferBytes < 2 * MaxTotalBytes))), 0) )) { do { } while (false); MOZ_ReportAssertionFailure("chunkActualBufferBytes < 2 * MaxTotalBytes" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1939); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunkActualBufferBytes < 2 * MaxTotalBytes" ")"); do { *((volatile int*)__null) = 1939; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1940 | ||||
1941 | unsigned chunk1ReuseCount = 0; | |||
1942 | ||||
1943 | // We will do enough loops to go through the maximum size a number of times. | |||
1944 | const unsigned Rollovers = 3; | |||
1945 | const unsigned Loops = Rollovers * MaxTotalBytes / chunkActualBufferBytes; | |||
1946 | for (unsigned i = 0; i < Loops; ++i) { | |||
1947 | // Add some data to the chunk. | |||
1948 | MOZ_RELEASE_ASSERT(chunk->ChunkHeader().mOffsetFirstBlock == 0)do { static_assert( mozilla::detail::AssertionConditionType< decltype(chunk->ChunkHeader().mOffsetFirstBlock == 0)>:: isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(chunk->ChunkHeader().mOffsetFirstBlock == 0))), 0 ))) { do { } while (false); MOZ_ReportAssertionFailure("chunk->ChunkHeader().mOffsetFirstBlock == 0" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1948); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunk->ChunkHeader().mOffsetFirstBlock == 0" ")"); do { *((volatile int*)__null) = 1948; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1949 | MOZ_RELEASE_ASSERT(chunk->ChunkHeader().mOffsetPastLastBlock == 0)do { static_assert( mozilla::detail::AssertionConditionType< decltype(chunk->ChunkHeader().mOffsetPastLastBlock == 0)> ::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(chunk->ChunkHeader().mOffsetPastLastBlock == 0))) , 0))) { do { } while (false); MOZ_ReportAssertionFailure("chunk->ChunkHeader().mOffsetPastLastBlock == 0" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1949); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunk->ChunkHeader().mOffsetPastLastBlock == 0" ")"); do { *((volatile int*)__null) = 1949; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1950 | MOZ_RELEASE_ASSERT(chunk->RangeStart() == 0)do { static_assert( mozilla::detail::AssertionConditionType< decltype(chunk->RangeStart() == 0)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(chunk->RangeStart() == 0) )), 0))) { do { } while (false); MOZ_ReportAssertionFailure("chunk->RangeStart() == 0" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1950); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunk->RangeStart() == 0" ")"); do { *((volatile int*)__null) = 1950; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1951 | const ProfileBufferIndex index = 1 + i * chunkActualBufferBytes; | |||
1952 | chunk->SetRangeStart(index); | |||
1953 | MOZ_RELEASE_ASSERT(chunk->RangeStart() == index)do { static_assert( mozilla::detail::AssertionConditionType< decltype(chunk->RangeStart() == index)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(chunk->RangeStart() == index ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "chunk->RangeStart() == index", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1953); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunk->RangeStart() == index" ")"); do { *((volatile int*)__null) = 1953; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1954 | Unused << chunk->ReserveInitialBlockAsTail(1); | |||
1955 | Unused << chunk->ReserveBlock(2); | |||
1956 | MOZ_RELEASE_ASSERT(chunk->ChunkHeader().mOffsetFirstBlock == 1)do { static_assert( mozilla::detail::AssertionConditionType< decltype(chunk->ChunkHeader().mOffsetFirstBlock == 1)>:: isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(chunk->ChunkHeader().mOffsetFirstBlock == 1))), 0 ))) { do { } while (false); MOZ_ReportAssertionFailure("chunk->ChunkHeader().mOffsetFirstBlock == 1" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1956); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunk->ChunkHeader().mOffsetFirstBlock == 1" ")"); do { *((volatile int*)__null) = 1956; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1957 | MOZ_RELEASE_ASSERT(chunk->ChunkHeader().mOffsetPastLastBlock == 1 + 2)do { static_assert( mozilla::detail::AssertionConditionType< decltype(chunk->ChunkHeader().mOffsetPastLastBlock == 1 + 2 )>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(chunk->ChunkHeader().mOffsetPastLastBlock == 1 + 2 ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "chunk->ChunkHeader().mOffsetPastLastBlock == 1 + 2", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1957); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunk->ChunkHeader().mOffsetPastLastBlock == 1 + 2" ")"); do { *((volatile int*)__null) = 1957; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1958 | ||||
1959 | // Request a new chunk. | |||
1960 | bool ran = false; | |||
1961 | UniquePtr<ProfileBufferChunk> newChunk; | |||
1962 | cm.RequestChunk([&](UniquePtr<ProfileBufferChunk> aChunk) { | |||
1963 | ran = true; | |||
1964 | newChunk = std::move(aChunk); | |||
1965 | }); | |||
1966 | MOZ_RELEASE_ASSERT(do { static_assert( mozilla::detail::AssertionConditionType< decltype(!ran)>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(!!(!ran))), 0))) { do { } while (false ); MOZ_ReportAssertionFailure("!ran" " (" "RequestChunk should not immediately fulfill the request" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1967); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!ran" ") (" "RequestChunk should not immediately fulfill the request" ")"); do { *((volatile int*)__null) = 1967; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
1967 | !ran, "RequestChunk should not immediately fulfill the request")do { static_assert( mozilla::detail::AssertionConditionType< decltype(!ran)>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(!!(!ran))), 0))) { do { } while (false ); MOZ_ReportAssertionFailure("!ran" " (" "RequestChunk should not immediately fulfill the request" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1967); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!ran" ") (" "RequestChunk should not immediately fulfill the request" ")"); do { *((volatile int*)__null) = 1967; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1968 | cm.FulfillChunkRequests(); | |||
1969 | MOZ_RELEASE_ASSERT(ran, "FulfillChunkRequests should invoke the callback")do { static_assert( mozilla::detail::AssertionConditionType< decltype(ran)>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(!!(ran))), 0))) { do { } while (false ); MOZ_ReportAssertionFailure("ran" " (" "FulfillChunkRequests should invoke the callback" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1969); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "ran" ") (" "FulfillChunkRequests should invoke the callback" ")") ; do { *((volatile int*)__null) = 1969; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
1970 | MOZ_RELEASE_ASSERT(!!newChunk, "Chunk request should always work")do { static_assert( mozilla::detail::AssertionConditionType< decltype(!!newChunk)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!!newChunk))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!!newChunk" " (" "Chunk request should always work" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1970); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!!newChunk" ") (" "Chunk request should always work" ")"); do { *((volatile int*)__null) = 1970; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | |||
1971 | MOZ_RELEASE_ASSERT(newChunk->BufferBytes() == chunkActualBufferBytes,do { static_assert( mozilla::detail::AssertionConditionType< decltype(newChunk->BufferBytes() == chunkActualBufferBytes )>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(newChunk->BufferBytes() == chunkActualBufferBytes ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "newChunk->BufferBytes() == chunkActualBufferBytes" " (" "Unexpected chunk size" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1972); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "newChunk->BufferBytes() == chunkActualBufferBytes" ") (" "Unexpected chunk size" ")"); do { *((volatile int*)__null ) = 1972; __attribute__((nomerge)) ::abort(); } while (false) ; } } while (false) | |||
1972 | "Unexpected chunk size")do { static_assert( mozilla::detail::AssertionConditionType< decltype(newChunk->BufferBytes() == chunkActualBufferBytes )>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(newChunk->BufferBytes() == chunkActualBufferBytes ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "newChunk->BufferBytes() == chunkActualBufferBytes" " (" "Unexpected chunk size" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1972); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "newChunk->BufferBytes() == chunkActualBufferBytes" ") (" "Unexpected chunk size" ")"); do { *((volatile int*)__null ) = 1972; __attribute__((nomerge)) ::abort(); } while (false) ; } } while (false); | |||
1973 | MOZ_RELEASE_ASSERT(!newChunk->GetNext(), "There should only be one chunk")do { static_assert( mozilla::detail::AssertionConditionType< decltype(!newChunk->GetNext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!newChunk->GetNext()))), 0 ))) { do { } while (false); MOZ_ReportAssertionFailure("!newChunk->GetNext()" " (" "There should only be one chunk" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1973); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!newChunk->GetNext()" ") (" "There should only be one chunk" ")"); do { *((volatile int*)__null) = 1973; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | |||
1974 | ||||
1975 | // Mark previous chunk done and release it. | |||
1976 | WaitUntilTimeStampChanges(); // Force "done" timestamp to change. | |||
1977 | chunk->MarkDone(); | |||
1978 | cm.ReleaseChunk(std::move(chunk)); | |||
1979 | ||||
1980 | // And cycle to the new chunk. | |||
1981 | chunk = std::move(newChunk); | |||
1982 | ||||
1983 | if (reinterpret_cast<uintptr_t>(chunk.get()) == chunk1Address) { | |||
1984 | ++chunk1ReuseCount; | |||
1985 | } | |||
1986 | } | |||
1987 | ||||
1988 | // Expect all rollovers except 1 to destroy chunks. | |||
1989 | MOZ_RELEASE_ASSERT(destroyedChunks >= (Rollovers - 1) * MaxTotalBytes /do { static_assert( mozilla::detail::AssertionConditionType< decltype(destroyedChunks >= (Rollovers - 1) * MaxTotalBytes / chunkActualBufferBytes)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(destroyedChunks >= (Rollovers - 1) * MaxTotalBytes / chunkActualBufferBytes))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("destroyedChunks >= (Rollovers - 1) * MaxTotalBytes / chunkActualBufferBytes" " (" "Not enough destroyed chunks" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1991); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "destroyedChunks >= (Rollovers - 1) * MaxTotalBytes / chunkActualBufferBytes" ") (" "Not enough destroyed chunks" ")"); do { *((volatile int *)__null) = 1991; __attribute__((nomerge)) ::abort(); } while (false); } } while (false) | |||
1990 | chunkActualBufferBytes,do { static_assert( mozilla::detail::AssertionConditionType< decltype(destroyedChunks >= (Rollovers - 1) * MaxTotalBytes / chunkActualBufferBytes)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(destroyedChunks >= (Rollovers - 1) * MaxTotalBytes / chunkActualBufferBytes))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("destroyedChunks >= (Rollovers - 1) * MaxTotalBytes / chunkActualBufferBytes" " (" "Not enough destroyed chunks" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1991); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "destroyedChunks >= (Rollovers - 1) * MaxTotalBytes / chunkActualBufferBytes" ") (" "Not enough destroyed chunks" ")"); do { *((volatile int *)__null) = 1991; __attribute__((nomerge)) ::abort(); } while (false); } } while (false) | |||
1991 | "Not enough destroyed chunks")do { static_assert( mozilla::detail::AssertionConditionType< decltype(destroyedChunks >= (Rollovers - 1) * MaxTotalBytes / chunkActualBufferBytes)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(destroyedChunks >= (Rollovers - 1) * MaxTotalBytes / chunkActualBufferBytes))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("destroyedChunks >= (Rollovers - 1) * MaxTotalBytes / chunkActualBufferBytes" " (" "Not enough destroyed chunks" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1991); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "destroyedChunks >= (Rollovers - 1) * MaxTotalBytes / chunkActualBufferBytes" ") (" "Not enough destroyed chunks" ")"); do { *((volatile int *)__null) = 1991; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | |||
1992 | MOZ_RELEASE_ASSERT(destroyedBytes == destroyedChunks * chunkActualBufferBytes,do { static_assert( mozilla::detail::AssertionConditionType< decltype(destroyedBytes == destroyedChunks * chunkActualBufferBytes )>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(destroyedBytes == destroyedChunks * chunkActualBufferBytes ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "destroyedBytes == destroyedChunks * chunkActualBufferBytes" " (" "Mismatched destroyed chunks and bytes" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1993); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "destroyedBytes == destroyedChunks * chunkActualBufferBytes" ") (" "Mismatched destroyed chunks and bytes" ")"); do { *(( volatile int*)__null) = 1993; __attribute__((nomerge)) ::abort (); } while (false); } } while (false) | |||
1993 | "Mismatched destroyed chunks and bytes")do { static_assert( mozilla::detail::AssertionConditionType< decltype(destroyedBytes == destroyedChunks * chunkActualBufferBytes )>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(destroyedBytes == destroyedChunks * chunkActualBufferBytes ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "destroyedBytes == destroyedChunks * chunkActualBufferBytes" " (" "Mismatched destroyed chunks and bytes" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1993); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "destroyedBytes == destroyedChunks * chunkActualBufferBytes" ") (" "Mismatched destroyed chunks and bytes" ")"); do { *(( volatile int*)__null) = 1993; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
1994 | MOZ_RELEASE_ASSERT(chunk1ReuseCount >= (Rollovers - 1),do { static_assert( mozilla::detail::AssertionConditionType< decltype(chunk1ReuseCount >= (Rollovers - 1))>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(chunk1ReuseCount >= (Rollovers - 1)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("chunk1ReuseCount >= (Rollovers - 1)" " (" "Not enough reuse of the first chunks" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1995); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunk1ReuseCount >= (Rollovers - 1)" ") (" "Not enough reuse of the first chunks" ")"); do { *((volatile int*)__null) = 1995; __attribute__((nomerge)) ::abort(); } while (false); } } while (false) | |||
1995 | "Not enough reuse of the first chunks")do { static_assert( mozilla::detail::AssertionConditionType< decltype(chunk1ReuseCount >= (Rollovers - 1))>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(chunk1ReuseCount >= (Rollovers - 1)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("chunk1ReuseCount >= (Rollovers - 1)" " (" "Not enough reuse of the first chunks" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 1995); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunk1ReuseCount >= (Rollovers - 1)" ") (" "Not enough reuse of the first chunks" ")"); do { *((volatile int*)__null) = 1995; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | |||
1996 | ||||
1997 | // Check that chunk manager is reentrant from request callback. | |||
1998 | bool ran = false; | |||
1999 | bool ranInner = false; | |||
2000 | UniquePtr<ProfileBufferChunk> newChunk; | |||
2001 | cm.RequestChunk([&](UniquePtr<ProfileBufferChunk> aChunk) { | |||
2002 | ran = true; | |||
2003 | MOZ_RELEASE_ASSERT(!!aChunk, "Chunk request should always work")do { static_assert( mozilla::detail::AssertionConditionType< decltype(!!aChunk)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!!aChunk))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!!aChunk" " (" "Chunk request should always work" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2003); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!!aChunk" ") (" "Chunk request should always work" ")"); do { *((volatile int*)__null) = 2003; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | |||
2004 | Unused << aChunk->ReserveInitialBlockAsTail(0); | |||
2005 | WaitUntilTimeStampChanges(); // Force "done" timestamp to change. | |||
2006 | aChunk->MarkDone(); | |||
2007 | UniquePtr<ProfileBufferChunk> anotherChunk = cm.GetChunk(); | |||
2008 | MOZ_RELEASE_ASSERT(!!anotherChunk)do { static_assert( mozilla::detail::AssertionConditionType< decltype(!!anotherChunk)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!!anotherChunk))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!!anotherChunk" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2008); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!!anotherChunk" ")"); do { *((volatile int*)__null) = 2008; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2009 | Unused << anotherChunk->ReserveInitialBlockAsTail(0); | |||
2010 | WaitUntilTimeStampChanges(); // Force "done" timestamp to change. | |||
2011 | anotherChunk->MarkDone(); | |||
2012 | cm.RequestChunk([&](UniquePtr<ProfileBufferChunk> aChunk) { | |||
2013 | ranInner = true; | |||
2014 | MOZ_RELEASE_ASSERT(!!aChunk, "Chunk request should always work")do { static_assert( mozilla::detail::AssertionConditionType< decltype(!!aChunk)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!!aChunk))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!!aChunk" " (" "Chunk request should always work" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2014); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!!aChunk" ") (" "Chunk request should always work" ")"); do { *((volatile int*)__null) = 2014; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | |||
2015 | Unused << aChunk->ReserveInitialBlockAsTail(0); | |||
2016 | WaitUntilTimeStampChanges(); // Force "done" timestamp to change. | |||
2017 | aChunk->MarkDone(); | |||
2018 | }); | |||
2019 | MOZ_RELEASE_ASSERT(do { static_assert( mozilla::detail::AssertionConditionType< decltype(!ranInner)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!ranInner))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!ranInner" " (" "RequestChunk should not immediately fulfill the request" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2020); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!ranInner" ") (" "RequestChunk should not immediately fulfill the request" ")"); do { *((volatile int*)__null) = 2020; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
2020 | !ranInner, "RequestChunk should not immediately fulfill the request")do { static_assert( mozilla::detail::AssertionConditionType< decltype(!ranInner)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!ranInner))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!ranInner" " (" "RequestChunk should not immediately fulfill the request" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2020); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!ranInner" ") (" "RequestChunk should not immediately fulfill the request" ")"); do { *((volatile int*)__null) = 2020; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2021 | }); | |||
2022 | MOZ_RELEASE_ASSERT(!ran,do { static_assert( mozilla::detail::AssertionConditionType< decltype(!ran)>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(!!(!ran))), 0))) { do { } while (false ); MOZ_ReportAssertionFailure("!ran" " (" "RequestChunk should not immediately fulfill the request" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2023); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!ran" ") (" "RequestChunk should not immediately fulfill the request" ")"); do { *((volatile int*)__null) = 2023; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
2023 | "RequestChunk should not immediately fulfill the request")do { static_assert( mozilla::detail::AssertionConditionType< decltype(!ran)>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(!!(!ran))), 0))) { do { } while (false ); MOZ_ReportAssertionFailure("!ran" " (" "RequestChunk should not immediately fulfill the request" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2023); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!ran" ") (" "RequestChunk should not immediately fulfill the request" ")"); do { *((volatile int*)__null) = 2023; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2024 | MOZ_RELEASE_ASSERT(do { static_assert( mozilla::detail::AssertionConditionType< decltype(!ranInner)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!ranInner))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!ranInner" " (" "RequestChunk should not immediately fulfill the inner request" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2026); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!ranInner" ") (" "RequestChunk should not immediately fulfill the inner request" ")"); do { *((volatile int*)__null) = 2026; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
2025 | !ranInner,do { static_assert( mozilla::detail::AssertionConditionType< decltype(!ranInner)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!ranInner))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!ranInner" " (" "RequestChunk should not immediately fulfill the inner request" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2026); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!ranInner" ") (" "RequestChunk should not immediately fulfill the inner request" ")"); do { *((volatile int*)__null) = 2026; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
2026 | "RequestChunk should not immediately fulfill the inner request")do { static_assert( mozilla::detail::AssertionConditionType< decltype(!ranInner)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!ranInner))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!ranInner" " (" "RequestChunk should not immediately fulfill the inner request" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2026); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!ranInner" ") (" "RequestChunk should not immediately fulfill the inner request" ")"); do { *((volatile int*)__null) = 2026; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2027 | cm.FulfillChunkRequests(); | |||
2028 | MOZ_RELEASE_ASSERT(ran, "FulfillChunkRequests should invoke the callback")do { static_assert( mozilla::detail::AssertionConditionType< decltype(ran)>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(!!(ran))), 0))) { do { } while (false ); MOZ_ReportAssertionFailure("ran" " (" "FulfillChunkRequests should invoke the callback" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2028); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "ran" ") (" "FulfillChunkRequests should invoke the callback" ")") ; do { *((volatile int*)__null) = 2028; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2029 | MOZ_RELEASE_ASSERT(!ranInner,do { static_assert( mozilla::detail::AssertionConditionType< decltype(!ranInner)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!ranInner))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!ranInner" " (" "FulfillChunkRequests should not immediately fulfill " "the inner request" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2031); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!ranInner" ") (" "FulfillChunkRequests should not immediately fulfill " "the inner request" ")"); do { *((volatile int*)__null) = 2031 ; __attribute__((nomerge)) ::abort(); } while (false); } } while (false) | |||
2030 | "FulfillChunkRequests should not immediately fulfill "do { static_assert( mozilla::detail::AssertionConditionType< decltype(!ranInner)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!ranInner))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!ranInner" " (" "FulfillChunkRequests should not immediately fulfill " "the inner request" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2031); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!ranInner" ") (" "FulfillChunkRequests should not immediately fulfill " "the inner request" ")"); do { *((volatile int*)__null) = 2031 ; __attribute__((nomerge)) ::abort(); } while (false); } } while (false) | |||
2031 | "the inner request")do { static_assert( mozilla::detail::AssertionConditionType< decltype(!ranInner)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!ranInner))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!ranInner" " (" "FulfillChunkRequests should not immediately fulfill " "the inner request" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2031); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!ranInner" ") (" "FulfillChunkRequests should not immediately fulfill " "the inner request" ")"); do { *((volatile int*)__null) = 2031 ; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | |||
2032 | cm.FulfillChunkRequests(); | |||
2033 | MOZ_RELEASE_ASSERT(do { static_assert( mozilla::detail::AssertionConditionType< decltype(ran)>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(!!(ran))), 0))) { do { } while (false ); MOZ_ReportAssertionFailure("ran" " (" "2nd FulfillChunkRequests should invoke the inner request callback" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2034); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "ran" ") (" "2nd FulfillChunkRequests should invoke the inner request callback" ")"); do { *((volatile int*)__null) = 2034; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
2034 | ran, "2nd FulfillChunkRequests should invoke the inner request callback")do { static_assert( mozilla::detail::AssertionConditionType< decltype(ran)>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(!!(ran))), 0))) { do { } while (false ); MOZ_ReportAssertionFailure("ran" " (" "2nd FulfillChunkRequests should invoke the inner request callback" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2034); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "ran" ") (" "2nd FulfillChunkRequests should invoke the inner request callback" ")"); do { *((volatile int*)__null) = 2034; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2035 | ||||
2036 | // Enough testing! Clean-up. | |||
2037 | Unused << chunk->ReserveInitialBlockAsTail(0); | |||
2038 | WaitUntilTimeStampChanges(); // Force "done" timestamp to change. | |||
2039 | chunk->MarkDone(); | |||
2040 | cm.ForgetUnreleasedChunks(); | |||
2041 | ||||
2042 | // Special testing of the release algorithm, to make sure released chunks get | |||
2043 | // sorted. | |||
2044 | constexpr unsigned RandomReleaseChunkLoop = 100; | |||
2045 | // Build a vector of chunks, and mark them "done", ready to be released. | |||
2046 | Vector<UniquePtr<ProfileBufferChunk>> chunksToRelease; | |||
2047 | MOZ_RELEASE_ASSERT(chunksToRelease.reserve(RandomReleaseChunkLoop))do { static_assert( mozilla::detail::AssertionConditionType< decltype(chunksToRelease.reserve(RandomReleaseChunkLoop))> ::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(chunksToRelease.reserve(RandomReleaseChunkLoop)))), 0 ))) { do { } while (false); MOZ_ReportAssertionFailure("chunksToRelease.reserve(RandomReleaseChunkLoop)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2047); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunksToRelease.reserve(RandomReleaseChunkLoop)" ")"); do { *((volatile int*)__null) = 2047; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2048 | Vector<TimeStamp> chunksTimeStamps; | |||
2049 | MOZ_RELEASE_ASSERT(chunksTimeStamps.reserve(RandomReleaseChunkLoop))do { static_assert( mozilla::detail::AssertionConditionType< decltype(chunksTimeStamps.reserve(RandomReleaseChunkLoop))> ::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(chunksTimeStamps.reserve(RandomReleaseChunkLoop)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("chunksTimeStamps.reserve(RandomReleaseChunkLoop)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2049); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunksTimeStamps.reserve(RandomReleaseChunkLoop)" ")"); do { *((volatile int*)__null) = 2049; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2050 | for (unsigned i = 0; i < RandomReleaseChunkLoop; ++i) { | |||
2051 | UniquePtr<ProfileBufferChunk> chunk = cm.GetChunk(); | |||
2052 | MOZ_RELEASE_ASSERT(chunk)do { static_assert( mozilla::detail::AssertionConditionType< decltype(chunk)>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(!!(chunk))), 0))) { do { } while ( false); MOZ_ReportAssertionFailure("chunk", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2052); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunk" ")"); do { *((volatile int*)__null) = 2052; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2053 | Unused << chunk->ReserveInitialBlockAsTail(0); | |||
2054 | chunk->MarkDone(); | |||
2055 | MOZ_RELEASE_ASSERT(!chunk->ChunkHeader().mDoneTimeStamp.IsNull())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!chunk->ChunkHeader().mDoneTimeStamp.IsNull())> ::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(!chunk->ChunkHeader().mDoneTimeStamp.IsNull()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!chunk->ChunkHeader().mDoneTimeStamp.IsNull()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2055); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!chunk->ChunkHeader().mDoneTimeStamp.IsNull()" ")"); do { *((volatile int*)__null) = 2055; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2056 | chunksTimeStamps.infallibleEmplaceBack(chunk->ChunkHeader().mDoneTimeStamp); | |||
2057 | chunksToRelease.infallibleEmplaceBack(std::move(chunk)); | |||
2058 | if (i % 10 == 0) { | |||
2059 | // "Done" timestamps should *usually* increase, let's make extra sure some | |||
2060 | // timestamps are actually different. | |||
2061 | WaitUntilTimeStampChanges(); | |||
2062 | } | |||
2063 | } | |||
2064 | // Shuffle the list. | |||
2065 | std::random_device randomDevice; | |||
2066 | std::mt19937 generator(randomDevice()); | |||
2067 | std::shuffle(chunksToRelease.begin(), chunksToRelease.end(), generator); | |||
2068 | // And release chunks one by one, checking that the list of released chunks | |||
2069 | // is always sorted. | |||
2070 | printf("TestChunkManagerWithLocalLimit - Shuffle test timestamps:"); | |||
2071 | for (unsigned i = 0; i < RandomReleaseChunkLoop; ++i) { | |||
2072 | printf(" %f", (chunksToRelease[i]->ChunkHeader().mDoneTimeStamp - | |||
2073 | TimeStamp::ProcessCreation()) | |||
2074 | .ToMicroseconds()); | |||
2075 | cm.ReleaseChunk(std::move(chunksToRelease[i])); | |||
2076 | cm.PeekExtantReleasedChunks([i](const ProfileBufferChunk* releasedChunks) { | |||
2077 | MOZ_RELEASE_ASSERT(releasedChunks)do { static_assert( mozilla::detail::AssertionConditionType< decltype(releasedChunks)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(releasedChunks))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("releasedChunks" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2077); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "releasedChunks" ")"); do { *((volatile int*)__null) = 2077; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2078 | unsigned releasedChunkCount = 1; | |||
2079 | for (;;) { | |||
2080 | const ProfileBufferChunk* nextChunk = releasedChunks->GetNext(); | |||
2081 | if (!nextChunk) { | |||
2082 | break; | |||
2083 | } | |||
2084 | ++releasedChunkCount; | |||
2085 | MOZ_RELEASE_ASSERT(releasedChunks->ChunkHeader().mDoneTimeStamp <=do { static_assert( mozilla::detail::AssertionConditionType< decltype(releasedChunks->ChunkHeader().mDoneTimeStamp <= nextChunk->ChunkHeader().mDoneTimeStamp)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(releasedChunks->ChunkHeader ().mDoneTimeStamp <= nextChunk->ChunkHeader().mDoneTimeStamp ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "releasedChunks->ChunkHeader().mDoneTimeStamp <= nextChunk->ChunkHeader().mDoneTimeStamp" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2086); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "releasedChunks->ChunkHeader().mDoneTimeStamp <= nextChunk->ChunkHeader().mDoneTimeStamp" ")"); do { *((volatile int*)__null) = 2086; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
2086 | nextChunk->ChunkHeader().mDoneTimeStamp)do { static_assert( mozilla::detail::AssertionConditionType< decltype(releasedChunks->ChunkHeader().mDoneTimeStamp <= nextChunk->ChunkHeader().mDoneTimeStamp)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(releasedChunks->ChunkHeader ().mDoneTimeStamp <= nextChunk->ChunkHeader().mDoneTimeStamp ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "releasedChunks->ChunkHeader().mDoneTimeStamp <= nextChunk->ChunkHeader().mDoneTimeStamp" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2086); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "releasedChunks->ChunkHeader().mDoneTimeStamp <= nextChunk->ChunkHeader().mDoneTimeStamp" ")"); do { *((volatile int*)__null) = 2086; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2087 | releasedChunks = nextChunk; | |||
2088 | } | |||
2089 | MOZ_RELEASE_ASSERT(releasedChunkCount == i + 1)do { static_assert( mozilla::detail::AssertionConditionType< decltype(releasedChunkCount == i + 1)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(releasedChunkCount == i + 1) )), 0))) { do { } while (false); MOZ_ReportAssertionFailure("releasedChunkCount == i + 1" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2089); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "releasedChunkCount == i + 1" ")"); do { *((volatile int*)__null) = 2089; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2090 | }); | |||
2091 | } | |||
2092 | printf("\n"); | |||
2093 | // Finally, the whole list of released chunks should have the exact same | |||
2094 | // timestamps as the initial list of "done" chunks. | |||
2095 | extantReleasedChunks = cm.GetExtantReleasedChunks(); | |||
2096 | for (unsigned i = 0; i < RandomReleaseChunkLoop; ++i) { | |||
2097 | MOZ_RELEASE_ASSERT(extantReleasedChunks, "Not enough released chunks")do { static_assert( mozilla::detail::AssertionConditionType< decltype(extantReleasedChunks)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(extantReleasedChunks))), 0)) ) { do { } while (false); MOZ_ReportAssertionFailure("extantReleasedChunks" " (" "Not enough released chunks" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2097); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "extantReleasedChunks" ") (" "Not enough released chunks" ")"); do { *((volatile int *)__null) = 2097; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | |||
2098 | MOZ_RELEASE_ASSERT(extantReleasedChunks->ChunkHeader().mDoneTimeStamp ==do { static_assert( mozilla::detail::AssertionConditionType< decltype(extantReleasedChunks->ChunkHeader().mDoneTimeStamp == chunksTimeStamps[i])>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(extantReleasedChunks->ChunkHeader ().mDoneTimeStamp == chunksTimeStamps[i]))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("extantReleasedChunks->ChunkHeader().mDoneTimeStamp == chunksTimeStamps[i]" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2099); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "extantReleasedChunks->ChunkHeader().mDoneTimeStamp == chunksTimeStamps[i]" ")"); do { *((volatile int*)__null) = 2099; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
2099 | chunksTimeStamps[i])do { static_assert( mozilla::detail::AssertionConditionType< decltype(extantReleasedChunks->ChunkHeader().mDoneTimeStamp == chunksTimeStamps[i])>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(extantReleasedChunks->ChunkHeader ().mDoneTimeStamp == chunksTimeStamps[i]))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("extantReleasedChunks->ChunkHeader().mDoneTimeStamp == chunksTimeStamps[i]" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2099); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "extantReleasedChunks->ChunkHeader().mDoneTimeStamp == chunksTimeStamps[i]" ")"); do { *((volatile int*)__null) = 2099; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2100 | Unused << std::exchange(extantReleasedChunks, | |||
2101 | extantReleasedChunks->ReleaseNext()); | |||
2102 | } | |||
2103 | MOZ_RELEASE_ASSERT(!extantReleasedChunks, "Too many released chunks")do { static_assert( mozilla::detail::AssertionConditionType< decltype(!extantReleasedChunks)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!extantReleasedChunks))), 0) )) { do { } while (false); MOZ_ReportAssertionFailure("!extantReleasedChunks" " (" "Too many released chunks" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2103); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!extantReleasedChunks" ") (" "Too many released chunks" ")"); do { *((volatile int* )__null) = 2103; __attribute__((nomerge)) ::abort(); } while ( false); } } while (false); | |||
2104 | ||||
2105 | # ifdef DEBUG1 | |||
2106 | cm.DeregisteredFrom(chunkManagerRegisterer); | |||
2107 | # endif // DEBUG | |||
2108 | ||||
2109 | printf("TestChunkManagerWithLocalLimit done\n"); | |||
2110 | } | |||
2111 | ||||
2112 | static bool IsSameMetadata( | |||
2113 | const ProfileBufferControlledChunkManager::ChunkMetadata& a1, | |||
2114 | const ProfileBufferControlledChunkManager::ChunkMetadata& a2) { | |||
2115 | return a1.mDoneTimeStamp == a2.mDoneTimeStamp && | |||
2116 | a1.mBufferBytes == a2.mBufferBytes; | |||
2117 | }; | |||
2118 | ||||
2119 | static bool IsSameUpdate( | |||
2120 | const ProfileBufferControlledChunkManager::Update& a1, | |||
2121 | const ProfileBufferControlledChunkManager::Update& a2) { | |||
2122 | // Final and not-an-update don't carry other data, so we can test these two | |||
2123 | // states first. | |||
2124 | if (a1.IsFinal() || a2.IsFinal()) { | |||
2125 | return a1.IsFinal() && a2.IsFinal(); | |||
2126 | } | |||
2127 | if (a1.IsNotUpdate() || a2.IsNotUpdate()) { | |||
2128 | return a1.IsNotUpdate() && a2.IsNotUpdate(); | |||
2129 | } | |||
2130 | ||||
2131 | // Here, both are "normal" udpates, check member variables: | |||
2132 | ||||
2133 | if (a1.UnreleasedBytes() != a2.UnreleasedBytes()) { | |||
2134 | return false; | |||
2135 | } | |||
2136 | if (a1.ReleasedBytes() != a2.ReleasedBytes()) { | |||
2137 | return false; | |||
2138 | } | |||
2139 | if (a1.OldestDoneTimeStamp() != a2.OldestDoneTimeStamp()) { | |||
2140 | return false; | |||
2141 | } | |||
2142 | if (a1.NewlyReleasedChunksRef().size() != | |||
2143 | a2.NewlyReleasedChunksRef().size()) { | |||
2144 | return false; | |||
2145 | } | |||
2146 | for (unsigned i = 0; i < a1.NewlyReleasedChunksRef().size(); ++i) { | |||
2147 | if (!IsSameMetadata(a1.NewlyReleasedChunksRef()[i], | |||
2148 | a2.NewlyReleasedChunksRef()[i])) { | |||
2149 | return false; | |||
2150 | } | |||
2151 | } | |||
2152 | return true; | |||
2153 | } | |||
2154 | ||||
2155 | static void TestControlledChunkManagerUpdate() { | |||
2156 | printf("TestControlledChunkManagerUpdate...\n"); | |||
2157 | ||||
2158 | using Update = ProfileBufferControlledChunkManager::Update; | |||
2159 | ||||
2160 | // Default construction. | |||
2161 | Update update1; | |||
2162 | MOZ_RELEASE_ASSERT(update1.IsNotUpdate())do { static_assert( mozilla::detail::AssertionConditionType< decltype(update1.IsNotUpdate())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(update1.IsNotUpdate()))), 0) )) { do { } while (false); MOZ_ReportAssertionFailure("update1.IsNotUpdate()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2162); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "update1.IsNotUpdate()" ")"); do { *((volatile int*)__null) = 2162; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2163 | MOZ_RELEASE_ASSERT(!update1.IsFinal())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!update1.IsFinal())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!update1.IsFinal()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!update1.IsFinal()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2163); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!update1.IsFinal()" ")"); do { *((volatile int*)__null) = 2163; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2164 | ||||
2165 | // Clear an already-cleared update. | |||
2166 | update1.Clear(); | |||
2167 | MOZ_RELEASE_ASSERT(update1.IsNotUpdate())do { static_assert( mozilla::detail::AssertionConditionType< decltype(update1.IsNotUpdate())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(update1.IsNotUpdate()))), 0) )) { do { } while (false); MOZ_ReportAssertionFailure("update1.IsNotUpdate()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2167); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "update1.IsNotUpdate()" ")"); do { *((volatile int*)__null) = 2167; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2168 | MOZ_RELEASE_ASSERT(!update1.IsFinal())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!update1.IsFinal())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!update1.IsFinal()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!update1.IsFinal()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2168); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!update1.IsFinal()" ")"); do { *((volatile int*)__null) = 2168; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2169 | ||||
2170 | // Final construction with nullptr. | |||
2171 | const Update final(nullptr); | |||
2172 | MOZ_RELEASE_ASSERT(final.IsFinal())do { static_assert( mozilla::detail::AssertionConditionType< decltype(final.IsFinal())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(final.IsFinal()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("final.IsFinal()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2172); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "final.IsFinal()" ")"); do { *((volatile int*)__null) = 2172; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2173 | MOZ_RELEASE_ASSERT(!final.IsNotUpdate())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!final.IsNotUpdate())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!final.IsNotUpdate()))), 0)) ) { do { } while (false); MOZ_ReportAssertionFailure("!final.IsNotUpdate()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2173); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!final.IsNotUpdate()" ")"); do { *((volatile int*)__null) = 2173; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2174 | ||||
2175 | // Copy final to cleared. | |||
2176 | update1 = final; | |||
2177 | MOZ_RELEASE_ASSERT(update1.IsFinal())do { static_assert( mozilla::detail::AssertionConditionType< decltype(update1.IsFinal())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(update1.IsFinal()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("update1.IsFinal()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2177); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "update1.IsFinal()" ")"); do { *((volatile int*)__null) = 2177; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2178 | MOZ_RELEASE_ASSERT(!update1.IsNotUpdate())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!update1.IsNotUpdate())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!update1.IsNotUpdate()))), 0 ))) { do { } while (false); MOZ_ReportAssertionFailure("!update1.IsNotUpdate()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2178); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!update1.IsNotUpdate()" ")"); do { *((volatile int*)__null) = 2178; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2179 | ||||
2180 | // Copy final to final. | |||
2181 | update1 = final; | |||
2182 | MOZ_RELEASE_ASSERT(update1.IsFinal())do { static_assert( mozilla::detail::AssertionConditionType< decltype(update1.IsFinal())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(update1.IsFinal()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("update1.IsFinal()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2182); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "update1.IsFinal()" ")"); do { *((volatile int*)__null) = 2182; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2183 | MOZ_RELEASE_ASSERT(!update1.IsNotUpdate())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!update1.IsNotUpdate())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!update1.IsNotUpdate()))), 0 ))) { do { } while (false); MOZ_ReportAssertionFailure("!update1.IsNotUpdate()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2183); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!update1.IsNotUpdate()" ")"); do { *((volatile int*)__null) = 2183; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2184 | ||||
2185 | // Clear a final update. | |||
2186 | update1.Clear(); | |||
2187 | MOZ_RELEASE_ASSERT(update1.IsNotUpdate())do { static_assert( mozilla::detail::AssertionConditionType< decltype(update1.IsNotUpdate())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(update1.IsNotUpdate()))), 0) )) { do { } while (false); MOZ_ReportAssertionFailure("update1.IsNotUpdate()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2187); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "update1.IsNotUpdate()" ")"); do { *((volatile int*)__null) = 2187; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2188 | MOZ_RELEASE_ASSERT(!update1.IsFinal())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!update1.IsFinal())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!update1.IsFinal()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!update1.IsFinal()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2188); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!update1.IsFinal()" ")"); do { *((volatile int*)__null) = 2188; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2189 | ||||
2190 | // Move final to cleared. | |||
2191 | update1 = Update(nullptr); | |||
2192 | MOZ_RELEASE_ASSERT(update1.IsFinal())do { static_assert( mozilla::detail::AssertionConditionType< decltype(update1.IsFinal())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(update1.IsFinal()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("update1.IsFinal()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2192); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "update1.IsFinal()" ")"); do { *((volatile int*)__null) = 2192; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2193 | MOZ_RELEASE_ASSERT(!update1.IsNotUpdate())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!update1.IsNotUpdate())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!update1.IsNotUpdate()))), 0 ))) { do { } while (false); MOZ_ReportAssertionFailure("!update1.IsNotUpdate()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2193); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!update1.IsNotUpdate()" ")"); do { *((volatile int*)__null) = 2193; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2194 | ||||
2195 | // Move final to final. | |||
2196 | update1 = Update(nullptr); | |||
2197 | MOZ_RELEASE_ASSERT(update1.IsFinal())do { static_assert( mozilla::detail::AssertionConditionType< decltype(update1.IsFinal())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(update1.IsFinal()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("update1.IsFinal()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2197); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "update1.IsFinal()" ")"); do { *((volatile int*)__null) = 2197; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2198 | MOZ_RELEASE_ASSERT(!update1.IsNotUpdate())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!update1.IsNotUpdate())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!update1.IsNotUpdate()))), 0 ))) { do { } while (false); MOZ_ReportAssertionFailure("!update1.IsNotUpdate()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2198); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!update1.IsNotUpdate()" ")"); do { *((volatile int*)__null) = 2198; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2199 | ||||
2200 | // Move from not-an-update (effectively same as Clear). | |||
2201 | update1 = Update(); | |||
2202 | MOZ_RELEASE_ASSERT(update1.IsNotUpdate())do { static_assert( mozilla::detail::AssertionConditionType< decltype(update1.IsNotUpdate())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(update1.IsNotUpdate()))), 0) )) { do { } while (false); MOZ_ReportAssertionFailure("update1.IsNotUpdate()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2202); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "update1.IsNotUpdate()" ")"); do { *((volatile int*)__null) = 2202; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2203 | MOZ_RELEASE_ASSERT(!update1.IsFinal())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!update1.IsFinal())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!update1.IsFinal()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!update1.IsFinal()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2203); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!update1.IsFinal()" ")"); do { *((volatile int*)__null) = 2203; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2204 | ||||
2205 | auto CreateBiggerChunkAfter = [](const ProfileBufferChunk& aChunkToBeat) { | |||
2206 | while (TimeStamp::Now() <= aChunkToBeat.ChunkHeader().mDoneTimeStamp) { | |||
2207 | ::SleepMilli(1); | |||
2208 | } | |||
2209 | auto chunk = ProfileBufferChunk::Create(aChunkToBeat.BufferBytes() * 2); | |||
2210 | MOZ_RELEASE_ASSERT(!!chunk)do { static_assert( mozilla::detail::AssertionConditionType< decltype(!!chunk)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!!chunk))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!!chunk", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2210); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!!chunk" ")"); do { *((volatile int*)__null) = 2210; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2211 | MOZ_RELEASE_ASSERT(chunk->BufferBytes() >= aChunkToBeat.BufferBytes() * 2)do { static_assert( mozilla::detail::AssertionConditionType< decltype(chunk->BufferBytes() >= aChunkToBeat.BufferBytes () * 2)>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(chunk->BufferBytes() >= aChunkToBeat.BufferBytes () * 2))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("chunk->BufferBytes() >= aChunkToBeat.BufferBytes() * 2" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2211); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunk->BufferBytes() >= aChunkToBeat.BufferBytes() * 2" ")"); do { *((volatile int*)__null) = 2211; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2212 | Unused << chunk->ReserveInitialBlockAsTail(0); | |||
2213 | chunk->MarkDone(); | |||
2214 | MOZ_RELEASE_ASSERT(chunk->ChunkHeader().mDoneTimeStamp >do { static_assert( mozilla::detail::AssertionConditionType< decltype(chunk->ChunkHeader().mDoneTimeStamp > aChunkToBeat .ChunkHeader().mDoneTimeStamp)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(chunk->ChunkHeader().mDoneTimeStamp > aChunkToBeat.ChunkHeader().mDoneTimeStamp))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("chunk->ChunkHeader().mDoneTimeStamp > aChunkToBeat.ChunkHeader().mDoneTimeStamp" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2215); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunk->ChunkHeader().mDoneTimeStamp > aChunkToBeat.ChunkHeader().mDoneTimeStamp" ")"); do { *((volatile int*)__null) = 2215; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
2215 | aChunkToBeat.ChunkHeader().mDoneTimeStamp)do { static_assert( mozilla::detail::AssertionConditionType< decltype(chunk->ChunkHeader().mDoneTimeStamp > aChunkToBeat .ChunkHeader().mDoneTimeStamp)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(chunk->ChunkHeader().mDoneTimeStamp > aChunkToBeat.ChunkHeader().mDoneTimeStamp))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("chunk->ChunkHeader().mDoneTimeStamp > aChunkToBeat.ChunkHeader().mDoneTimeStamp" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2215); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunk->ChunkHeader().mDoneTimeStamp > aChunkToBeat.ChunkHeader().mDoneTimeStamp" ")"); do { *((volatile int*)__null) = 2215; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2216 | return chunk; | |||
2217 | }; | |||
2218 | ||||
2219 | update1 = Update(1, 2, nullptr, nullptr); | |||
2220 | ||||
2221 | // Create initial update with 2 released chunks and 1 unreleased chunk. | |||
2222 | auto released = ProfileBufferChunk::Create(10); | |||
2223 | ProfileBufferChunk* c1 = released.get(); | |||
2224 | Unused << c1->ReserveInitialBlockAsTail(0); | |||
2225 | c1->MarkDone(); | |||
2226 | ||||
2227 | released->SetLast(CreateBiggerChunkAfter(*c1)); | |||
2228 | ProfileBufferChunk* c2 = c1->GetNext(); | |||
2229 | ||||
2230 | auto unreleased = CreateBiggerChunkAfter(*c2); | |||
2231 | ProfileBufferChunk* c3 = unreleased.get(); | |||
2232 | ||||
2233 | Update update2(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1, | |||
2234 | c1); | |||
2235 | MOZ_RELEASE_ASSERT(IsSameUpdate(do { static_assert( mozilla::detail::AssertionConditionType< decltype(IsSameUpdate( update2, Update(c3->BufferBytes(), c1 ->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader ().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1-> BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2-> BufferBytes()}})))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update2, Update (c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes (), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader ().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader ().mDoneTimeStamp, c2->BufferBytes()}}))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("IsSameUpdate( update2, Update(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}}))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2240); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update2, Update(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}}))" ")"); do { *((volatile int*)__null) = 2240; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
2236 | update2,do { static_assert( mozilla::detail::AssertionConditionType< decltype(IsSameUpdate( update2, Update(c3->BufferBytes(), c1 ->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader ().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1-> BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2-> BufferBytes()}})))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update2, Update (c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes (), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader ().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader ().mDoneTimeStamp, c2->BufferBytes()}}))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("IsSameUpdate( update2, Update(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}}))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2240); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update2, Update(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}}))" ")"); do { *((volatile int*)__null) = 2240; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
2237 | Update(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(),do { static_assert( mozilla::detail::AssertionConditionType< decltype(IsSameUpdate( update2, Update(c3->BufferBytes(), c1 ->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader ().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1-> BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2-> BufferBytes()}})))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update2, Update (c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes (), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader ().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader ().mDoneTimeStamp, c2->BufferBytes()}}))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("IsSameUpdate( update2, Update(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}}))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2240); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update2, Update(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}}))" ")"); do { *((volatile int*)__null) = 2240; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
2238 | c1->ChunkHeader().mDoneTimeStamp,do { static_assert( mozilla::detail::AssertionConditionType< decltype(IsSameUpdate( update2, Update(c3->BufferBytes(), c1 ->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader ().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1-> BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2-> BufferBytes()}})))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update2, Update (c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes (), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader ().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader ().mDoneTimeStamp, c2->BufferBytes()}}))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("IsSameUpdate( update2, Update(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}}))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2240); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update2, Update(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}}))" ")"); do { *((volatile int*)__null) = 2240; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
2239 | {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()},do { static_assert( mozilla::detail::AssertionConditionType< decltype(IsSameUpdate( update2, Update(c3->BufferBytes(), c1 ->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader ().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1-> BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2-> BufferBytes()}})))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update2, Update (c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes (), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader ().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader ().mDoneTimeStamp, c2->BufferBytes()}}))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("IsSameUpdate( update2, Update(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}}))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2240); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update2, Update(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}}))" ")"); do { *((volatile int*)__null) = 2240; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
2240 | {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}})))do { static_assert( mozilla::detail::AssertionConditionType< decltype(IsSameUpdate( update2, Update(c3->BufferBytes(), c1 ->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader ().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1-> BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2-> BufferBytes()}})))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update2, Update (c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes (), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader ().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader ().mDoneTimeStamp, c2->BufferBytes()}}))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("IsSameUpdate( update2, Update(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}}))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2240); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update2, Update(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}}))" ")"); do { *((volatile int*)__null) = 2240; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2241 | // Check every field, this time only, after that we'll trust that the | |||
2242 | // `SameUpdate` test will be enough. | |||
2243 | MOZ_RELEASE_ASSERT(!update2.IsNotUpdate())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!update2.IsNotUpdate())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!update2.IsNotUpdate()))), 0 ))) { do { } while (false); MOZ_ReportAssertionFailure("!update2.IsNotUpdate()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2243); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!update2.IsNotUpdate()" ")"); do { *((volatile int*)__null) = 2243; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2244 | MOZ_RELEASE_ASSERT(!update2.IsFinal())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!update2.IsFinal())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!update2.IsFinal()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!update2.IsFinal()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2244); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!update2.IsFinal()" ")"); do { *((volatile int*)__null) = 2244; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2245 | MOZ_RELEASE_ASSERT(update2.UnreleasedBytes() == c3->BufferBytes())do { static_assert( mozilla::detail::AssertionConditionType< decltype(update2.UnreleasedBytes() == c3->BufferBytes())> ::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(update2.UnreleasedBytes() == c3->BufferBytes()))) , 0))) { do { } while (false); MOZ_ReportAssertionFailure("update2.UnreleasedBytes() == c3->BufferBytes()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2245); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "update2.UnreleasedBytes() == c3->BufferBytes()" ")"); do { *((volatile int*)__null) = 2245; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2246 | MOZ_RELEASE_ASSERT(update2.ReleasedBytes() ==do { static_assert( mozilla::detail::AssertionConditionType< decltype(update2.ReleasedBytes() == c1->BufferBytes() + c2 ->BufferBytes())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(update2.ReleasedBytes() == c1 ->BufferBytes() + c2->BufferBytes()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("update2.ReleasedBytes() == c1->BufferBytes() + c2->BufferBytes()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2247); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "update2.ReleasedBytes() == c1->BufferBytes() + c2->BufferBytes()" ")"); do { *((volatile int*)__null) = 2247; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
2247 | c1->BufferBytes() + c2->BufferBytes())do { static_assert( mozilla::detail::AssertionConditionType< decltype(update2.ReleasedBytes() == c1->BufferBytes() + c2 ->BufferBytes())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(update2.ReleasedBytes() == c1 ->BufferBytes() + c2->BufferBytes()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("update2.ReleasedBytes() == c1->BufferBytes() + c2->BufferBytes()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2247); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "update2.ReleasedBytes() == c1->BufferBytes() + c2->BufferBytes()" ")"); do { *((volatile int*)__null) = 2247; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2248 | MOZ_RELEASE_ASSERT(update2.OldestDoneTimeStamp() ==do { static_assert( mozilla::detail::AssertionConditionType< decltype(update2.OldestDoneTimeStamp() == c1->ChunkHeader( ).mDoneTimeStamp)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(update2.OldestDoneTimeStamp( ) == c1->ChunkHeader().mDoneTimeStamp))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("update2.OldestDoneTimeStamp() == c1->ChunkHeader().mDoneTimeStamp" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2249); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "update2.OldestDoneTimeStamp() == c1->ChunkHeader().mDoneTimeStamp" ")"); do { *((volatile int*)__null) = 2249; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
2249 | c1->ChunkHeader().mDoneTimeStamp)do { static_assert( mozilla::detail::AssertionConditionType< decltype(update2.OldestDoneTimeStamp() == c1->ChunkHeader( ).mDoneTimeStamp)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(update2.OldestDoneTimeStamp( ) == c1->ChunkHeader().mDoneTimeStamp))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("update2.OldestDoneTimeStamp() == c1->ChunkHeader().mDoneTimeStamp" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2249); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "update2.OldestDoneTimeStamp() == c1->ChunkHeader().mDoneTimeStamp" ")"); do { *((volatile int*)__null) = 2249; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2250 | MOZ_RELEASE_ASSERT(update2.NewlyReleasedChunksRef().size() == 2)do { static_assert( mozilla::detail::AssertionConditionType< decltype(update2.NewlyReleasedChunksRef().size() == 2)>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(update2.NewlyReleasedChunksRef().size() == 2))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("update2.NewlyReleasedChunksRef().size() == 2" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2250); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "update2.NewlyReleasedChunksRef().size() == 2" ")"); do { *((volatile int*)__null) = 2250; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2251 | MOZ_RELEASE_ASSERT(do { static_assert( mozilla::detail::AssertionConditionType< decltype(IsSameMetadata(update2.NewlyReleasedChunksRef()[0], { c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}))> ::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(IsSameMetadata(update2.NewlyReleasedChunksRef()[0], { c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("IsSameMetadata(update2.NewlyReleasedChunksRef()[0], {c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()})" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2253); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameMetadata(update2.NewlyReleasedChunksRef()[0], {c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()})" ")"); do { *((volatile int*)__null) = 2253; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
2252 | IsSameMetadata(update2.NewlyReleasedChunksRef()[0],do { static_assert( mozilla::detail::AssertionConditionType< decltype(IsSameMetadata(update2.NewlyReleasedChunksRef()[0], { c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}))> ::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(IsSameMetadata(update2.NewlyReleasedChunksRef()[0], { c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("IsSameMetadata(update2.NewlyReleasedChunksRef()[0], {c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()})" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2253); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameMetadata(update2.NewlyReleasedChunksRef()[0], {c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()})" ")"); do { *((volatile int*)__null) = 2253; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
2253 | {c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}))do { static_assert( mozilla::detail::AssertionConditionType< decltype(IsSameMetadata(update2.NewlyReleasedChunksRef()[0], { c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}))> ::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(IsSameMetadata(update2.NewlyReleasedChunksRef()[0], { c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("IsSameMetadata(update2.NewlyReleasedChunksRef()[0], {c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()})" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2253); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameMetadata(update2.NewlyReleasedChunksRef()[0], {c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()})" ")"); do { *((volatile int*)__null) = 2253; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2254 | MOZ_RELEASE_ASSERT(do { static_assert( mozilla::detail::AssertionConditionType< decltype(IsSameMetadata(update2.NewlyReleasedChunksRef()[1], { c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}))> ::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(IsSameMetadata(update2.NewlyReleasedChunksRef()[1], { c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("IsSameMetadata(update2.NewlyReleasedChunksRef()[1], {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()})" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2256); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameMetadata(update2.NewlyReleasedChunksRef()[1], {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()})" ")"); do { *((volatile int*)__null) = 2256; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
2255 | IsSameMetadata(update2.NewlyReleasedChunksRef()[1],do { static_assert( mozilla::detail::AssertionConditionType< decltype(IsSameMetadata(update2.NewlyReleasedChunksRef()[1], { c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}))> ::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(IsSameMetadata(update2.NewlyReleasedChunksRef()[1], { c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("IsSameMetadata(update2.NewlyReleasedChunksRef()[1], {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()})" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2256); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameMetadata(update2.NewlyReleasedChunksRef()[1], {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()})" ")"); do { *((volatile int*)__null) = 2256; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
2256 | {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}))do { static_assert( mozilla::detail::AssertionConditionType< decltype(IsSameMetadata(update2.NewlyReleasedChunksRef()[1], { c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}))> ::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(IsSameMetadata(update2.NewlyReleasedChunksRef()[1], { c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("IsSameMetadata(update2.NewlyReleasedChunksRef()[1], {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()})" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2256); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameMetadata(update2.NewlyReleasedChunksRef()[1], {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()})" ")"); do { *((volatile int*)__null) = 2256; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2257 | ||||
2258 | // Fold into not-an-update. | |||
2259 | update1.Fold(std::move(update2)); | |||
2260 | MOZ_RELEASE_ASSERT(IsSameUpdate(do { static_assert( mozilla::detail::AssertionConditionType< decltype(IsSameUpdate( update1, Update(c3->BufferBytes(), c1 ->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader ().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1-> BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2-> BufferBytes()}})))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update1, Update (c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes (), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader ().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader ().mDoneTimeStamp, c2->BufferBytes()}}))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("IsSameUpdate( update1, Update(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}}))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2265); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update1, Update(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}}))" ")"); do { *((volatile int*)__null) = 2265; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
2261 | update1,do { static_assert( mozilla::detail::AssertionConditionType< decltype(IsSameUpdate( update1, Update(c3->BufferBytes(), c1 ->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader ().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1-> BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2-> BufferBytes()}})))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update1, Update (c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes (), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader ().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader ().mDoneTimeStamp, c2->BufferBytes()}}))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("IsSameUpdate( update1, Update(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}}))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2265); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update1, Update(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}}))" ")"); do { *((volatile int*)__null) = 2265; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
2262 | Update(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(),do { static_assert( mozilla::detail::AssertionConditionType< decltype(IsSameUpdate( update1, Update(c3->BufferBytes(), c1 ->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader ().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1-> BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2-> BufferBytes()}})))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update1, Update (c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes (), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader ().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader ().mDoneTimeStamp, c2->BufferBytes()}}))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("IsSameUpdate( update1, Update(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}}))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2265); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update1, Update(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}}))" ")"); do { *((volatile int*)__null) = 2265; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
2263 | c1->ChunkHeader().mDoneTimeStamp,do { static_assert( mozilla::detail::AssertionConditionType< decltype(IsSameUpdate( update1, Update(c3->BufferBytes(), c1 ->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader ().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1-> BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2-> BufferBytes()}})))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update1, Update (c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes (), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader ().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader ().mDoneTimeStamp, c2->BufferBytes()}}))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("IsSameUpdate( update1, Update(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}}))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2265); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update1, Update(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}}))" ")"); do { *((volatile int*)__null) = 2265; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
2264 | {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()},do { static_assert( mozilla::detail::AssertionConditionType< decltype(IsSameUpdate( update1, Update(c3->BufferBytes(), c1 ->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader ().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1-> BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2-> BufferBytes()}})))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update1, Update (c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes (), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader ().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader ().mDoneTimeStamp, c2->BufferBytes()}}))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("IsSameUpdate( update1, Update(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}}))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2265); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update1, Update(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}}))" ")"); do { *((volatile int*)__null) = 2265; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
2265 | {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}})))do { static_assert( mozilla::detail::AssertionConditionType< decltype(IsSameUpdate( update1, Update(c3->BufferBytes(), c1 ->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader ().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1-> BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2-> BufferBytes()}})))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update1, Update (c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes (), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader ().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader ().mDoneTimeStamp, c2->BufferBytes()}}))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("IsSameUpdate( update1, Update(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}}))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2265); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update1, Update(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}}))" ")"); do { *((volatile int*)__null) = 2265; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2266 | ||||
2267 | // Pretend nothing happened. | |||
2268 | update2 = Update(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1, | |||
2269 | nullptr); | |||
2270 | MOZ_RELEASE_ASSERT(IsSameUpdate(do { static_assert( mozilla::detail::AssertionConditionType< decltype(IsSameUpdate( update2, Update(c3->BufferBytes(), c1 ->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader ().mDoneTimeStamp, {})))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update2, Update (c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes (), c1->ChunkHeader().mDoneTimeStamp, {}))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("IsSameUpdate( update2, Update(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {}))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2272); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update2, Update(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {}))" ")"); do { *((volatile int*)__null) = 2272; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
2271 | update2, Update(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(),do { static_assert( mozilla::detail::AssertionConditionType< decltype(IsSameUpdate( update2, Update(c3->BufferBytes(), c1 ->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader ().mDoneTimeStamp, {})))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update2, Update (c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes (), c1->ChunkHeader().mDoneTimeStamp, {}))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("IsSameUpdate( update2, Update(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {}))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2272); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update2, Update(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {}))" ")"); do { *((volatile int*)__null) = 2272; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
2272 | c1->ChunkHeader().mDoneTimeStamp, {})))do { static_assert( mozilla::detail::AssertionConditionType< decltype(IsSameUpdate( update2, Update(c3->BufferBytes(), c1 ->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader ().mDoneTimeStamp, {})))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update2, Update (c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes (), c1->ChunkHeader().mDoneTimeStamp, {}))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("IsSameUpdate( update2, Update(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {}))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2272); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update2, Update(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {}))" ")"); do { *((volatile int*)__null) = 2272; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2273 | update1.Fold(std::move(update2)); | |||
2274 | MOZ_RELEASE_ASSERT(IsSameUpdate(do { static_assert( mozilla::detail::AssertionConditionType< decltype(IsSameUpdate( update1, Update(c3->BufferBytes(), c1 ->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader ().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1-> BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2-> BufferBytes()}})))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update1, Update (c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes (), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader ().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader ().mDoneTimeStamp, c2->BufferBytes()}}))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("IsSameUpdate( update1, Update(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}}))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2279); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update1, Update(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}}))" ")"); do { *((volatile int*)__null) = 2279; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
2275 | update1,do { static_assert( mozilla::detail::AssertionConditionType< decltype(IsSameUpdate( update1, Update(c3->BufferBytes(), c1 ->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader ().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1-> BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2-> BufferBytes()}})))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update1, Update (c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes (), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader ().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader ().mDoneTimeStamp, c2->BufferBytes()}}))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("IsSameUpdate( update1, Update(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}}))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2279); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update1, Update(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}}))" ")"); do { *((volatile int*)__null) = 2279; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
2276 | Update(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(),do { static_assert( mozilla::detail::AssertionConditionType< decltype(IsSameUpdate( update1, Update(c3->BufferBytes(), c1 ->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader ().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1-> BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2-> BufferBytes()}})))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update1, Update (c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes (), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader ().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader ().mDoneTimeStamp, c2->BufferBytes()}}))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("IsSameUpdate( update1, Update(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}}))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2279); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update1, Update(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}}))" ")"); do { *((volatile int*)__null) = 2279; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
2277 | c1->ChunkHeader().mDoneTimeStamp,do { static_assert( mozilla::detail::AssertionConditionType< decltype(IsSameUpdate( update1, Update(c3->BufferBytes(), c1 ->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader ().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1-> BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2-> BufferBytes()}})))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update1, Update (c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes (), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader ().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader ().mDoneTimeStamp, c2->BufferBytes()}}))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("IsSameUpdate( update1, Update(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}}))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2279); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update1, Update(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}}))" ")"); do { *((volatile int*)__null) = 2279; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
2278 | {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()},do { static_assert( mozilla::detail::AssertionConditionType< decltype(IsSameUpdate( update1, Update(c3->BufferBytes(), c1 ->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader ().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1-> BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2-> BufferBytes()}})))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update1, Update (c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes (), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader ().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader ().mDoneTimeStamp, c2->BufferBytes()}}))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("IsSameUpdate( update1, Update(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}}))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2279); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update1, Update(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}}))" ")"); do { *((volatile int*)__null) = 2279; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
2279 | {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}})))do { static_assert( mozilla::detail::AssertionConditionType< decltype(IsSameUpdate( update1, Update(c3->BufferBytes(), c1 ->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader ().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1-> BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2-> BufferBytes()}})))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update1, Update (c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes (), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader ().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader ().mDoneTimeStamp, c2->BufferBytes()}}))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("IsSameUpdate( update1, Update(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}}))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2279); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update1, Update(c3->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}}))" ")"); do { *((volatile int*)__null) = 2279; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2280 | ||||
2281 | // Pretend there's a new unreleased chunk. | |||
2282 | c3->SetLast(CreateBiggerChunkAfter(*c3)); | |||
2283 | ProfileBufferChunk* c4 = c3->GetNext(); | |||
2284 | update2 = Update(c3->BufferBytes() + c4->BufferBytes(), | |||
2285 | c1->BufferBytes() + c2->BufferBytes(), c1, nullptr); | |||
2286 | MOZ_RELEASE_ASSERT(do { static_assert( mozilla::detail::AssertionConditionType< decltype(IsSameUpdate(update2, Update(c3->BufferBytes() + c4 ->BufferBytes(), c1->BufferBytes() + c2->BufferBytes (), c1->ChunkHeader().mDoneTimeStamp, {})))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(IsSameUpdate(update2, Update (c3->BufferBytes() + c4->BufferBytes(), c1->BufferBytes () + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp , {}))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("IsSameUpdate(update2, Update(c3->BufferBytes() + c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {}))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2289); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate(update2, Update(c3->BufferBytes() + c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {}))" ")"); do { *((volatile int*)__null) = 2289; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
2287 | IsSameUpdate(update2, Update(c3->BufferBytes() + c4->BufferBytes(),do { static_assert( mozilla::detail::AssertionConditionType< decltype(IsSameUpdate(update2, Update(c3->BufferBytes() + c4 ->BufferBytes(), c1->BufferBytes() + c2->BufferBytes (), c1->ChunkHeader().mDoneTimeStamp, {})))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(IsSameUpdate(update2, Update (c3->BufferBytes() + c4->BufferBytes(), c1->BufferBytes () + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp , {}))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("IsSameUpdate(update2, Update(c3->BufferBytes() + c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {}))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2289); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate(update2, Update(c3->BufferBytes() + c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {}))" ")"); do { *((volatile int*)__null) = 2289; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
2288 | c1->BufferBytes() + c2->BufferBytes(),do { static_assert( mozilla::detail::AssertionConditionType< decltype(IsSameUpdate(update2, Update(c3->BufferBytes() + c4 ->BufferBytes(), c1->BufferBytes() + c2->BufferBytes (), c1->ChunkHeader().mDoneTimeStamp, {})))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(IsSameUpdate(update2, Update (c3->BufferBytes() + c4->BufferBytes(), c1->BufferBytes () + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp , {}))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("IsSameUpdate(update2, Update(c3->BufferBytes() + c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {}))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2289); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate(update2, Update(c3->BufferBytes() + c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {}))" ")"); do { *((volatile int*)__null) = 2289; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
2289 | c1->ChunkHeader().mDoneTimeStamp, {})))do { static_assert( mozilla::detail::AssertionConditionType< decltype(IsSameUpdate(update2, Update(c3->BufferBytes() + c4 ->BufferBytes(), c1->BufferBytes() + c2->BufferBytes (), c1->ChunkHeader().mDoneTimeStamp, {})))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(IsSameUpdate(update2, Update (c3->BufferBytes() + c4->BufferBytes(), c1->BufferBytes () + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp , {}))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("IsSameUpdate(update2, Update(c3->BufferBytes() + c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {}))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2289); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate(update2, Update(c3->BufferBytes() + c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {}))" ")"); do { *((volatile int*)__null) = 2289; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2290 | update1.Fold(std::move(update2)); | |||
2291 | MOZ_RELEASE_ASSERT(IsSameUpdate(do { static_assert( mozilla::detail::AssertionConditionType< decltype(IsSameUpdate( update1, Update(c3->BufferBytes() + c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes (), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader ().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader ().mDoneTimeStamp, c2->BufferBytes()}})))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update1, Update (c3->BufferBytes() + c4->BufferBytes(), c1->BufferBytes () + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp , {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes() }, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes() }}))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("IsSameUpdate( update1, Update(c3->BufferBytes() + c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}}))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2297); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update1, Update(c3->BufferBytes() + c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}}))" ")"); do { *((volatile int*)__null) = 2297; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
2292 | update1,do { static_assert( mozilla::detail::AssertionConditionType< decltype(IsSameUpdate( update1, Update(c3->BufferBytes() + c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes (), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader ().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader ().mDoneTimeStamp, c2->BufferBytes()}})))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update1, Update (c3->BufferBytes() + c4->BufferBytes(), c1->BufferBytes () + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp , {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes() }, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes() }}))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("IsSameUpdate( update1, Update(c3->BufferBytes() + c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}}))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2297); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update1, Update(c3->BufferBytes() + c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}}))" ")"); do { *((volatile int*)__null) = 2297; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
2293 | Update(c3->BufferBytes() + c4->BufferBytes(),do { static_assert( mozilla::detail::AssertionConditionType< decltype(IsSameUpdate( update1, Update(c3->BufferBytes() + c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes (), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader ().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader ().mDoneTimeStamp, c2->BufferBytes()}})))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update1, Update (c3->BufferBytes() + c4->BufferBytes(), c1->BufferBytes () + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp , {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes() }, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes() }}))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("IsSameUpdate( update1, Update(c3->BufferBytes() + c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}}))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2297); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update1, Update(c3->BufferBytes() + c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}}))" ")"); do { *((volatile int*)__null) = 2297; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
2294 | c1->BufferBytes() + c2->BufferBytes(),do { static_assert( mozilla::detail::AssertionConditionType< decltype(IsSameUpdate( update1, Update(c3->BufferBytes() + c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes (), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader ().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader ().mDoneTimeStamp, c2->BufferBytes()}})))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update1, Update (c3->BufferBytes() + c4->BufferBytes(), c1->BufferBytes () + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp , {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes() }, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes() }}))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("IsSameUpdate( update1, Update(c3->BufferBytes() + c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}}))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2297); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update1, Update(c3->BufferBytes() + c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}}))" ")"); do { *((volatile int*)__null) = 2297; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
2295 | c1->ChunkHeader().mDoneTimeStamp,do { static_assert( mozilla::detail::AssertionConditionType< decltype(IsSameUpdate( update1, Update(c3->BufferBytes() + c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes (), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader ().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader ().mDoneTimeStamp, c2->BufferBytes()}})))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update1, Update (c3->BufferBytes() + c4->BufferBytes(), c1->BufferBytes () + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp , {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes() }, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes() }}))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("IsSameUpdate( update1, Update(c3->BufferBytes() + c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}}))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2297); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update1, Update(c3->BufferBytes() + c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}}))" ")"); do { *((volatile int*)__null) = 2297; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
2296 | {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()},do { static_assert( mozilla::detail::AssertionConditionType< decltype(IsSameUpdate( update1, Update(c3->BufferBytes() + c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes (), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader ().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader ().mDoneTimeStamp, c2->BufferBytes()}})))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update1, Update (c3->BufferBytes() + c4->BufferBytes(), c1->BufferBytes () + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp , {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes() }, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes() }}))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("IsSameUpdate( update1, Update(c3->BufferBytes() + c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}}))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2297); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update1, Update(c3->BufferBytes() + c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}}))" ")"); do { *((volatile int*)__null) = 2297; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
2297 | {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}})))do { static_assert( mozilla::detail::AssertionConditionType< decltype(IsSameUpdate( update1, Update(c3->BufferBytes() + c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes (), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader ().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader ().mDoneTimeStamp, c2->BufferBytes()}})))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update1, Update (c3->BufferBytes() + c4->BufferBytes(), c1->BufferBytes () + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp , {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes() }, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes() }}))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("IsSameUpdate( update1, Update(c3->BufferBytes() + c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}}))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2297); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update1, Update(c3->BufferBytes() + c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}}))" ")"); do { *((volatile int*)__null) = 2297; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2298 | ||||
2299 | // Pretend the first unreleased chunk c3 has been released. | |||
2300 | released->SetLast(std::exchange(unreleased, unreleased->ReleaseNext())); | |||
2301 | update2 = | |||
2302 | Update(c4->BufferBytes(), | |||
2303 | c1->BufferBytes() + c2->BufferBytes() + c3->BufferBytes(), c1, c3); | |||
2304 | MOZ_RELEASE_ASSERT(IsSameUpdate(do { static_assert( mozilla::detail::AssertionConditionType< decltype(IsSameUpdate( update2, Update(c4->BufferBytes(), c1 ->BufferBytes() + c2->BufferBytes() + c3->BufferBytes (), c1->ChunkHeader().mDoneTimeStamp, {{c3->ChunkHeader ().mDoneTimeStamp, c3->BufferBytes()}})))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update2, Update (c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes () + c3->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp , {{c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes() }}))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("IsSameUpdate( update2, Update(c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes() + c3->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}}))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2309); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update2, Update(c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes() + c3->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}}))" ")"); do { *((volatile int*)__null) = 2309; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
2305 | update2,do { static_assert( mozilla::detail::AssertionConditionType< decltype(IsSameUpdate( update2, Update(c4->BufferBytes(), c1 ->BufferBytes() + c2->BufferBytes() + c3->BufferBytes (), c1->ChunkHeader().mDoneTimeStamp, {{c3->ChunkHeader ().mDoneTimeStamp, c3->BufferBytes()}})))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update2, Update (c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes () + c3->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp , {{c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes() }}))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("IsSameUpdate( update2, Update(c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes() + c3->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}}))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2309); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update2, Update(c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes() + c3->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}}))" ")"); do { *((volatile int*)__null) = 2309; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
2306 | Update(c4->BufferBytes(),do { static_assert( mozilla::detail::AssertionConditionType< decltype(IsSameUpdate( update2, Update(c4->BufferBytes(), c1 ->BufferBytes() + c2->BufferBytes() + c3->BufferBytes (), c1->ChunkHeader().mDoneTimeStamp, {{c3->ChunkHeader ().mDoneTimeStamp, c3->BufferBytes()}})))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update2, Update (c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes () + c3->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp , {{c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes() }}))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("IsSameUpdate( update2, Update(c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes() + c3->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}}))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2309); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update2, Update(c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes() + c3->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}}))" ")"); do { *((volatile int*)__null) = 2309; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
2307 | c1->BufferBytes() + c2->BufferBytes() + c3->BufferBytes(),do { static_assert( mozilla::detail::AssertionConditionType< decltype(IsSameUpdate( update2, Update(c4->BufferBytes(), c1 ->BufferBytes() + c2->BufferBytes() + c3->BufferBytes (), c1->ChunkHeader().mDoneTimeStamp, {{c3->ChunkHeader ().mDoneTimeStamp, c3->BufferBytes()}})))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update2, Update (c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes () + c3->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp , {{c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes() }}))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("IsSameUpdate( update2, Update(c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes() + c3->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}}))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2309); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update2, Update(c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes() + c3->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}}))" ")"); do { *((volatile int*)__null) = 2309; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
2308 | c1->ChunkHeader().mDoneTimeStamp,do { static_assert( mozilla::detail::AssertionConditionType< decltype(IsSameUpdate( update2, Update(c4->BufferBytes(), c1 ->BufferBytes() + c2->BufferBytes() + c3->BufferBytes (), c1->ChunkHeader().mDoneTimeStamp, {{c3->ChunkHeader ().mDoneTimeStamp, c3->BufferBytes()}})))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update2, Update (c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes () + c3->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp , {{c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes() }}))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("IsSameUpdate( update2, Update(c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes() + c3->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}}))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2309); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update2, Update(c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes() + c3->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}}))" ")"); do { *((volatile int*)__null) = 2309; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
2309 | {{c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}})))do { static_assert( mozilla::detail::AssertionConditionType< decltype(IsSameUpdate( update2, Update(c4->BufferBytes(), c1 ->BufferBytes() + c2->BufferBytes() + c3->BufferBytes (), c1->ChunkHeader().mDoneTimeStamp, {{c3->ChunkHeader ().mDoneTimeStamp, c3->BufferBytes()}})))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update2, Update (c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes () + c3->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp , {{c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes() }}))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("IsSameUpdate( update2, Update(c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes() + c3->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}}))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2309); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update2, Update(c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes() + c3->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}}))" ")"); do { *((volatile int*)__null) = 2309; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2310 | update1.Fold(std::move(update2)); | |||
2311 | MOZ_RELEASE_ASSERT(IsSameUpdate(do { static_assert( mozilla::detail::AssertionConditionType< decltype(IsSameUpdate( update1, Update(c4->BufferBytes(), c1 ->BufferBytes() + c2->BufferBytes() + c3->BufferBytes (), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader ().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader ().mDoneTimeStamp, c2->BufferBytes()}, {c3->ChunkHeader ().mDoneTimeStamp, c3->BufferBytes()}})))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update1, Update (c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes () + c3->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp , {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes() }, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes() }, {c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes() }}))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("IsSameUpdate( update1, Update(c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes() + c3->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}, {c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}}))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2318); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update1, Update(c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes() + c3->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}, {c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}}))" ")"); do { *((volatile int*)__null) = 2318; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
2312 | update1,do { static_assert( mozilla::detail::AssertionConditionType< decltype(IsSameUpdate( update1, Update(c4->BufferBytes(), c1 ->BufferBytes() + c2->BufferBytes() + c3->BufferBytes (), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader ().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader ().mDoneTimeStamp, c2->BufferBytes()}, {c3->ChunkHeader ().mDoneTimeStamp, c3->BufferBytes()}})))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update1, Update (c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes () + c3->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp , {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes() }, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes() }, {c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes() }}))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("IsSameUpdate( update1, Update(c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes() + c3->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}, {c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}}))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2318); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update1, Update(c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes() + c3->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}, {c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}}))" ")"); do { *((volatile int*)__null) = 2318; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
2313 | Update(c4->BufferBytes(),do { static_assert( mozilla::detail::AssertionConditionType< decltype(IsSameUpdate( update1, Update(c4->BufferBytes(), c1 ->BufferBytes() + c2->BufferBytes() + c3->BufferBytes (), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader ().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader ().mDoneTimeStamp, c2->BufferBytes()}, {c3->ChunkHeader ().mDoneTimeStamp, c3->BufferBytes()}})))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update1, Update (c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes () + c3->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp , {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes() }, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes() }, {c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes() }}))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("IsSameUpdate( update1, Update(c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes() + c3->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}, {c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}}))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2318); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update1, Update(c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes() + c3->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}, {c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}}))" ")"); do { *((volatile int*)__null) = 2318; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
2314 | c1->BufferBytes() + c2->BufferBytes() + c3->BufferBytes(),do { static_assert( mozilla::detail::AssertionConditionType< decltype(IsSameUpdate( update1, Update(c4->BufferBytes(), c1 ->BufferBytes() + c2->BufferBytes() + c3->BufferBytes (), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader ().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader ().mDoneTimeStamp, c2->BufferBytes()}, {c3->ChunkHeader ().mDoneTimeStamp, c3->BufferBytes()}})))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update1, Update (c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes () + c3->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp , {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes() }, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes() }, {c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes() }}))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("IsSameUpdate( update1, Update(c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes() + c3->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}, {c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}}))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2318); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update1, Update(c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes() + c3->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}, {c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}}))" ")"); do { *((volatile int*)__null) = 2318; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
2315 | c1->ChunkHeader().mDoneTimeStamp,do { static_assert( mozilla::detail::AssertionConditionType< decltype(IsSameUpdate( update1, Update(c4->BufferBytes(), c1 ->BufferBytes() + c2->BufferBytes() + c3->BufferBytes (), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader ().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader ().mDoneTimeStamp, c2->BufferBytes()}, {c3->ChunkHeader ().mDoneTimeStamp, c3->BufferBytes()}})))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update1, Update (c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes () + c3->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp , {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes() }, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes() }, {c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes() }}))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("IsSameUpdate( update1, Update(c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes() + c3->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}, {c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}}))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2318); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update1, Update(c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes() + c3->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}, {c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}}))" ")"); do { *((volatile int*)__null) = 2318; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
2316 | {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()},do { static_assert( mozilla::detail::AssertionConditionType< decltype(IsSameUpdate( update1, Update(c4->BufferBytes(), c1 ->BufferBytes() + c2->BufferBytes() + c3->BufferBytes (), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader ().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader ().mDoneTimeStamp, c2->BufferBytes()}, {c3->ChunkHeader ().mDoneTimeStamp, c3->BufferBytes()}})))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update1, Update (c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes () + c3->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp , {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes() }, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes() }, {c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes() }}))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("IsSameUpdate( update1, Update(c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes() + c3->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}, {c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}}))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2318); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update1, Update(c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes() + c3->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}, {c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}}))" ")"); do { *((volatile int*)__null) = 2318; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
2317 | {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()},do { static_assert( mozilla::detail::AssertionConditionType< decltype(IsSameUpdate( update1, Update(c4->BufferBytes(), c1 ->BufferBytes() + c2->BufferBytes() + c3->BufferBytes (), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader ().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader ().mDoneTimeStamp, c2->BufferBytes()}, {c3->ChunkHeader ().mDoneTimeStamp, c3->BufferBytes()}})))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update1, Update (c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes () + c3->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp , {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes() }, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes() }, {c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes() }}))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("IsSameUpdate( update1, Update(c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes() + c3->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}, {c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}}))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2318); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update1, Update(c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes() + c3->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}, {c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}}))" ")"); do { *((volatile int*)__null) = 2318; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
2318 | {c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}})))do { static_assert( mozilla::detail::AssertionConditionType< decltype(IsSameUpdate( update1, Update(c4->BufferBytes(), c1 ->BufferBytes() + c2->BufferBytes() + c3->BufferBytes (), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader ().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader ().mDoneTimeStamp, c2->BufferBytes()}, {c3->ChunkHeader ().mDoneTimeStamp, c3->BufferBytes()}})))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update1, Update (c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes () + c3->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp , {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes() }, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes() }, {c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes() }}))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("IsSameUpdate( update1, Update(c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes() + c3->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}, {c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}}))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2318); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update1, Update(c4->BufferBytes(), c1->BufferBytes() + c2->BufferBytes() + c3->BufferBytes(), c1->ChunkHeader().mDoneTimeStamp, {{c1->ChunkHeader().mDoneTimeStamp, c1->BufferBytes()}, {c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}, {c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}}))" ")"); do { *((volatile int*)__null) = 2318; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2319 | ||||
2320 | // Pretend c1 has been destroyed, so the oldest timestamp is now at c2. | |||
2321 | released = released->ReleaseNext(); | |||
2322 | c1 = nullptr; | |||
2323 | update2 = Update(c4->BufferBytes(), c2->BufferBytes() + c3->BufferBytes(), c2, | |||
2324 | nullptr); | |||
2325 | MOZ_RELEASE_ASSERT(IsSameUpdate(do { static_assert( mozilla::detail::AssertionConditionType< decltype(IsSameUpdate( update2, Update(c4->BufferBytes(), c2 ->BufferBytes() + c3->BufferBytes(), c2->ChunkHeader ().mDoneTimeStamp, {})))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update2, Update (c4->BufferBytes(), c2->BufferBytes() + c3->BufferBytes (), c2->ChunkHeader().mDoneTimeStamp, {}))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("IsSameUpdate( update2, Update(c4->BufferBytes(), c2->BufferBytes() + c3->BufferBytes(), c2->ChunkHeader().mDoneTimeStamp, {}))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2327); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update2, Update(c4->BufferBytes(), c2->BufferBytes() + c3->BufferBytes(), c2->ChunkHeader().mDoneTimeStamp, {}))" ")"); do { *((volatile int*)__null) = 2327; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
2326 | update2, Update(c4->BufferBytes(), c2->BufferBytes() + c3->BufferBytes(),do { static_assert( mozilla::detail::AssertionConditionType< decltype(IsSameUpdate( update2, Update(c4->BufferBytes(), c2 ->BufferBytes() + c3->BufferBytes(), c2->ChunkHeader ().mDoneTimeStamp, {})))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update2, Update (c4->BufferBytes(), c2->BufferBytes() + c3->BufferBytes (), c2->ChunkHeader().mDoneTimeStamp, {}))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("IsSameUpdate( update2, Update(c4->BufferBytes(), c2->BufferBytes() + c3->BufferBytes(), c2->ChunkHeader().mDoneTimeStamp, {}))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2327); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update2, Update(c4->BufferBytes(), c2->BufferBytes() + c3->BufferBytes(), c2->ChunkHeader().mDoneTimeStamp, {}))" ")"); do { *((volatile int*)__null) = 2327; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
2327 | c2->ChunkHeader().mDoneTimeStamp, {})))do { static_assert( mozilla::detail::AssertionConditionType< decltype(IsSameUpdate( update2, Update(c4->BufferBytes(), c2 ->BufferBytes() + c3->BufferBytes(), c2->ChunkHeader ().mDoneTimeStamp, {})))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update2, Update (c4->BufferBytes(), c2->BufferBytes() + c3->BufferBytes (), c2->ChunkHeader().mDoneTimeStamp, {}))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("IsSameUpdate( update2, Update(c4->BufferBytes(), c2->BufferBytes() + c3->BufferBytes(), c2->ChunkHeader().mDoneTimeStamp, {}))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2327); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update2, Update(c4->BufferBytes(), c2->BufferBytes() + c3->BufferBytes(), c2->ChunkHeader().mDoneTimeStamp, {}))" ")"); do { *((volatile int*)__null) = 2327; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2328 | update1.Fold(std::move(update2)); | |||
2329 | MOZ_RELEASE_ASSERT(IsSameUpdate(do { static_assert( mozilla::detail::AssertionConditionType< decltype(IsSameUpdate( update1, Update(c4->BufferBytes(), c2 ->BufferBytes() + c3->BufferBytes(), c2->ChunkHeader ().mDoneTimeStamp, {{c2->ChunkHeader().mDoneTimeStamp, c2-> BufferBytes()}, {c3->ChunkHeader().mDoneTimeStamp, c3-> BufferBytes()}})))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update1, Update (c4->BufferBytes(), c2->BufferBytes() + c3->BufferBytes (), c2->ChunkHeader().mDoneTimeStamp, {{c2->ChunkHeader ().mDoneTimeStamp, c2->BufferBytes()}, {c3->ChunkHeader ().mDoneTimeStamp, c3->BufferBytes()}}))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("IsSameUpdate( update1, Update(c4->BufferBytes(), c2->BufferBytes() + c3->BufferBytes(), c2->ChunkHeader().mDoneTimeStamp, {{c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}, {c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}}))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2334); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update1, Update(c4->BufferBytes(), c2->BufferBytes() + c3->BufferBytes(), c2->ChunkHeader().mDoneTimeStamp, {{c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}, {c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}}))" ")"); do { *((volatile int*)__null) = 2334; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
2330 | update1,do { static_assert( mozilla::detail::AssertionConditionType< decltype(IsSameUpdate( update1, Update(c4->BufferBytes(), c2 ->BufferBytes() + c3->BufferBytes(), c2->ChunkHeader ().mDoneTimeStamp, {{c2->ChunkHeader().mDoneTimeStamp, c2-> BufferBytes()}, {c3->ChunkHeader().mDoneTimeStamp, c3-> BufferBytes()}})))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update1, Update (c4->BufferBytes(), c2->BufferBytes() + c3->BufferBytes (), c2->ChunkHeader().mDoneTimeStamp, {{c2->ChunkHeader ().mDoneTimeStamp, c2->BufferBytes()}, {c3->ChunkHeader ().mDoneTimeStamp, c3->BufferBytes()}}))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("IsSameUpdate( update1, Update(c4->BufferBytes(), c2->BufferBytes() + c3->BufferBytes(), c2->ChunkHeader().mDoneTimeStamp, {{c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}, {c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}}))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2334); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update1, Update(c4->BufferBytes(), c2->BufferBytes() + c3->BufferBytes(), c2->ChunkHeader().mDoneTimeStamp, {{c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}, {c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}}))" ")"); do { *((volatile int*)__null) = 2334; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
2331 | Update(c4->BufferBytes(), c2->BufferBytes() + c3->BufferBytes(),do { static_assert( mozilla::detail::AssertionConditionType< decltype(IsSameUpdate( update1, Update(c4->BufferBytes(), c2 ->BufferBytes() + c3->BufferBytes(), c2->ChunkHeader ().mDoneTimeStamp, {{c2->ChunkHeader().mDoneTimeStamp, c2-> BufferBytes()}, {c3->ChunkHeader().mDoneTimeStamp, c3-> BufferBytes()}})))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update1, Update (c4->BufferBytes(), c2->BufferBytes() + c3->BufferBytes (), c2->ChunkHeader().mDoneTimeStamp, {{c2->ChunkHeader ().mDoneTimeStamp, c2->BufferBytes()}, {c3->ChunkHeader ().mDoneTimeStamp, c3->BufferBytes()}}))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("IsSameUpdate( update1, Update(c4->BufferBytes(), c2->BufferBytes() + c3->BufferBytes(), c2->ChunkHeader().mDoneTimeStamp, {{c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}, {c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}}))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2334); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update1, Update(c4->BufferBytes(), c2->BufferBytes() + c3->BufferBytes(), c2->ChunkHeader().mDoneTimeStamp, {{c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}, {c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}}))" ")"); do { *((volatile int*)__null) = 2334; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
2332 | c2->ChunkHeader().mDoneTimeStamp,do { static_assert( mozilla::detail::AssertionConditionType< decltype(IsSameUpdate( update1, Update(c4->BufferBytes(), c2 ->BufferBytes() + c3->BufferBytes(), c2->ChunkHeader ().mDoneTimeStamp, {{c2->ChunkHeader().mDoneTimeStamp, c2-> BufferBytes()}, {c3->ChunkHeader().mDoneTimeStamp, c3-> BufferBytes()}})))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update1, Update (c4->BufferBytes(), c2->BufferBytes() + c3->BufferBytes (), c2->ChunkHeader().mDoneTimeStamp, {{c2->ChunkHeader ().mDoneTimeStamp, c2->BufferBytes()}, {c3->ChunkHeader ().mDoneTimeStamp, c3->BufferBytes()}}))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("IsSameUpdate( update1, Update(c4->BufferBytes(), c2->BufferBytes() + c3->BufferBytes(), c2->ChunkHeader().mDoneTimeStamp, {{c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}, {c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}}))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2334); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update1, Update(c4->BufferBytes(), c2->BufferBytes() + c3->BufferBytes(), c2->ChunkHeader().mDoneTimeStamp, {{c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}, {c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}}))" ")"); do { *((volatile int*)__null) = 2334; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
2333 | {{c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()},do { static_assert( mozilla::detail::AssertionConditionType< decltype(IsSameUpdate( update1, Update(c4->BufferBytes(), c2 ->BufferBytes() + c3->BufferBytes(), c2->ChunkHeader ().mDoneTimeStamp, {{c2->ChunkHeader().mDoneTimeStamp, c2-> BufferBytes()}, {c3->ChunkHeader().mDoneTimeStamp, c3-> BufferBytes()}})))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update1, Update (c4->BufferBytes(), c2->BufferBytes() + c3->BufferBytes (), c2->ChunkHeader().mDoneTimeStamp, {{c2->ChunkHeader ().mDoneTimeStamp, c2->BufferBytes()}, {c3->ChunkHeader ().mDoneTimeStamp, c3->BufferBytes()}}))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("IsSameUpdate( update1, Update(c4->BufferBytes(), c2->BufferBytes() + c3->BufferBytes(), c2->ChunkHeader().mDoneTimeStamp, {{c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}, {c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}}))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2334); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update1, Update(c4->BufferBytes(), c2->BufferBytes() + c3->BufferBytes(), c2->ChunkHeader().mDoneTimeStamp, {{c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}, {c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}}))" ")"); do { *((volatile int*)__null) = 2334; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
2334 | {c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}})))do { static_assert( mozilla::detail::AssertionConditionType< decltype(IsSameUpdate( update1, Update(c4->BufferBytes(), c2 ->BufferBytes() + c3->BufferBytes(), c2->ChunkHeader ().mDoneTimeStamp, {{c2->ChunkHeader().mDoneTimeStamp, c2-> BufferBytes()}, {c3->ChunkHeader().mDoneTimeStamp, c3-> BufferBytes()}})))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update1, Update (c4->BufferBytes(), c2->BufferBytes() + c3->BufferBytes (), c2->ChunkHeader().mDoneTimeStamp, {{c2->ChunkHeader ().mDoneTimeStamp, c2->BufferBytes()}, {c3->ChunkHeader ().mDoneTimeStamp, c3->BufferBytes()}}))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("IsSameUpdate( update1, Update(c4->BufferBytes(), c2->BufferBytes() + c3->BufferBytes(), c2->ChunkHeader().mDoneTimeStamp, {{c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}, {c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}}))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2334); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update1, Update(c4->BufferBytes(), c2->BufferBytes() + c3->BufferBytes(), c2->ChunkHeader().mDoneTimeStamp, {{c2->ChunkHeader().mDoneTimeStamp, c2->BufferBytes()}, {c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}}))" ")"); do { *((volatile int*)__null) = 2334; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2335 | ||||
2336 | // Pretend c2 has been recycled to make unreleased c5, and c4 has been | |||
2337 | // released. | |||
2338 | auto recycled = std::exchange(released, released->ReleaseNext()); | |||
2339 | recycled->MarkRecycled(); | |||
2340 | Unused << recycled->ReserveInitialBlockAsTail(0); | |||
2341 | recycled->MarkDone(); | |||
2342 | released->SetLast(std::move(unreleased)); | |||
2343 | unreleased = std::move(recycled); | |||
2344 | ProfileBufferChunk* c5 = c2; | |||
2345 | c2 = nullptr; | |||
2346 | update2 = | |||
2347 | Update(c5->BufferBytes(), c3->BufferBytes() + c4->BufferBytes(), c3, c4); | |||
2348 | MOZ_RELEASE_ASSERT(IsSameUpdate(do { static_assert( mozilla::detail::AssertionConditionType< decltype(IsSameUpdate( update2, Update(c5->BufferBytes(), c3 ->BufferBytes() + c4->BufferBytes(), c3->ChunkHeader ().mDoneTimeStamp, {{c4->ChunkHeader().mDoneTimeStamp, c4-> BufferBytes()}})))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update2, Update (c5->BufferBytes(), c3->BufferBytes() + c4->BufferBytes (), c3->ChunkHeader().mDoneTimeStamp, {{c4->ChunkHeader ().mDoneTimeStamp, c4->BufferBytes()}}))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("IsSameUpdate( update2, Update(c5->BufferBytes(), c3->BufferBytes() + c4->BufferBytes(), c3->ChunkHeader().mDoneTimeStamp, {{c4->ChunkHeader().mDoneTimeStamp, c4->BufferBytes()}}))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2352); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update2, Update(c5->BufferBytes(), c3->BufferBytes() + c4->BufferBytes(), c3->ChunkHeader().mDoneTimeStamp, {{c4->ChunkHeader().mDoneTimeStamp, c4->BufferBytes()}}))" ")"); do { *((volatile int*)__null) = 2352; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
2349 | update2,do { static_assert( mozilla::detail::AssertionConditionType< decltype(IsSameUpdate( update2, Update(c5->BufferBytes(), c3 ->BufferBytes() + c4->BufferBytes(), c3->ChunkHeader ().mDoneTimeStamp, {{c4->ChunkHeader().mDoneTimeStamp, c4-> BufferBytes()}})))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update2, Update (c5->BufferBytes(), c3->BufferBytes() + c4->BufferBytes (), c3->ChunkHeader().mDoneTimeStamp, {{c4->ChunkHeader ().mDoneTimeStamp, c4->BufferBytes()}}))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("IsSameUpdate( update2, Update(c5->BufferBytes(), c3->BufferBytes() + c4->BufferBytes(), c3->ChunkHeader().mDoneTimeStamp, {{c4->ChunkHeader().mDoneTimeStamp, c4->BufferBytes()}}))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2352); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update2, Update(c5->BufferBytes(), c3->BufferBytes() + c4->BufferBytes(), c3->ChunkHeader().mDoneTimeStamp, {{c4->ChunkHeader().mDoneTimeStamp, c4->BufferBytes()}}))" ")"); do { *((volatile int*)__null) = 2352; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
2350 | Update(c5->BufferBytes(), c3->BufferBytes() + c4->BufferBytes(),do { static_assert( mozilla::detail::AssertionConditionType< decltype(IsSameUpdate( update2, Update(c5->BufferBytes(), c3 ->BufferBytes() + c4->BufferBytes(), c3->ChunkHeader ().mDoneTimeStamp, {{c4->ChunkHeader().mDoneTimeStamp, c4-> BufferBytes()}})))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update2, Update (c5->BufferBytes(), c3->BufferBytes() + c4->BufferBytes (), c3->ChunkHeader().mDoneTimeStamp, {{c4->ChunkHeader ().mDoneTimeStamp, c4->BufferBytes()}}))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("IsSameUpdate( update2, Update(c5->BufferBytes(), c3->BufferBytes() + c4->BufferBytes(), c3->ChunkHeader().mDoneTimeStamp, {{c4->ChunkHeader().mDoneTimeStamp, c4->BufferBytes()}}))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2352); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update2, Update(c5->BufferBytes(), c3->BufferBytes() + c4->BufferBytes(), c3->ChunkHeader().mDoneTimeStamp, {{c4->ChunkHeader().mDoneTimeStamp, c4->BufferBytes()}}))" ")"); do { *((volatile int*)__null) = 2352; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
2351 | c3->ChunkHeader().mDoneTimeStamp,do { static_assert( mozilla::detail::AssertionConditionType< decltype(IsSameUpdate( update2, Update(c5->BufferBytes(), c3 ->BufferBytes() + c4->BufferBytes(), c3->ChunkHeader ().mDoneTimeStamp, {{c4->ChunkHeader().mDoneTimeStamp, c4-> BufferBytes()}})))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update2, Update (c5->BufferBytes(), c3->BufferBytes() + c4->BufferBytes (), c3->ChunkHeader().mDoneTimeStamp, {{c4->ChunkHeader ().mDoneTimeStamp, c4->BufferBytes()}}))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("IsSameUpdate( update2, Update(c5->BufferBytes(), c3->BufferBytes() + c4->BufferBytes(), c3->ChunkHeader().mDoneTimeStamp, {{c4->ChunkHeader().mDoneTimeStamp, c4->BufferBytes()}}))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2352); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update2, Update(c5->BufferBytes(), c3->BufferBytes() + c4->BufferBytes(), c3->ChunkHeader().mDoneTimeStamp, {{c4->ChunkHeader().mDoneTimeStamp, c4->BufferBytes()}}))" ")"); do { *((volatile int*)__null) = 2352; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
2352 | {{c4->ChunkHeader().mDoneTimeStamp, c4->BufferBytes()}})))do { static_assert( mozilla::detail::AssertionConditionType< decltype(IsSameUpdate( update2, Update(c5->BufferBytes(), c3 ->BufferBytes() + c4->BufferBytes(), c3->ChunkHeader ().mDoneTimeStamp, {{c4->ChunkHeader().mDoneTimeStamp, c4-> BufferBytes()}})))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update2, Update (c5->BufferBytes(), c3->BufferBytes() + c4->BufferBytes (), c3->ChunkHeader().mDoneTimeStamp, {{c4->ChunkHeader ().mDoneTimeStamp, c4->BufferBytes()}}))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("IsSameUpdate( update2, Update(c5->BufferBytes(), c3->BufferBytes() + c4->BufferBytes(), c3->ChunkHeader().mDoneTimeStamp, {{c4->ChunkHeader().mDoneTimeStamp, c4->BufferBytes()}}))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2352); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update2, Update(c5->BufferBytes(), c3->BufferBytes() + c4->BufferBytes(), c3->ChunkHeader().mDoneTimeStamp, {{c4->ChunkHeader().mDoneTimeStamp, c4->BufferBytes()}}))" ")"); do { *((volatile int*)__null) = 2352; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2353 | update1.Fold(std::move(update2)); | |||
2354 | MOZ_RELEASE_ASSERT(IsSameUpdate(do { static_assert( mozilla::detail::AssertionConditionType< decltype(IsSameUpdate( update1, Update(c5->BufferBytes(), c3 ->BufferBytes() + c4->BufferBytes(), c3->ChunkHeader ().mDoneTimeStamp, {{c3->ChunkHeader().mDoneTimeStamp, c3-> BufferBytes()}, {c4->ChunkHeader().mDoneTimeStamp, c4-> BufferBytes()}})))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update1, Update (c5->BufferBytes(), c3->BufferBytes() + c4->BufferBytes (), c3->ChunkHeader().mDoneTimeStamp, {{c3->ChunkHeader ().mDoneTimeStamp, c3->BufferBytes()}, {c4->ChunkHeader ().mDoneTimeStamp, c4->BufferBytes()}}))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("IsSameUpdate( update1, Update(c5->BufferBytes(), c3->BufferBytes() + c4->BufferBytes(), c3->ChunkHeader().mDoneTimeStamp, {{c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}, {c4->ChunkHeader().mDoneTimeStamp, c4->BufferBytes()}}))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2359); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update1, Update(c5->BufferBytes(), c3->BufferBytes() + c4->BufferBytes(), c3->ChunkHeader().mDoneTimeStamp, {{c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}, {c4->ChunkHeader().mDoneTimeStamp, c4->BufferBytes()}}))" ")"); do { *((volatile int*)__null) = 2359; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
2355 | update1,do { static_assert( mozilla::detail::AssertionConditionType< decltype(IsSameUpdate( update1, Update(c5->BufferBytes(), c3 ->BufferBytes() + c4->BufferBytes(), c3->ChunkHeader ().mDoneTimeStamp, {{c3->ChunkHeader().mDoneTimeStamp, c3-> BufferBytes()}, {c4->ChunkHeader().mDoneTimeStamp, c4-> BufferBytes()}})))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update1, Update (c5->BufferBytes(), c3->BufferBytes() + c4->BufferBytes (), c3->ChunkHeader().mDoneTimeStamp, {{c3->ChunkHeader ().mDoneTimeStamp, c3->BufferBytes()}, {c4->ChunkHeader ().mDoneTimeStamp, c4->BufferBytes()}}))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("IsSameUpdate( update1, Update(c5->BufferBytes(), c3->BufferBytes() + c4->BufferBytes(), c3->ChunkHeader().mDoneTimeStamp, {{c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}, {c4->ChunkHeader().mDoneTimeStamp, c4->BufferBytes()}}))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2359); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update1, Update(c5->BufferBytes(), c3->BufferBytes() + c4->BufferBytes(), c3->ChunkHeader().mDoneTimeStamp, {{c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}, {c4->ChunkHeader().mDoneTimeStamp, c4->BufferBytes()}}))" ")"); do { *((volatile int*)__null) = 2359; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
2356 | Update(c5->BufferBytes(), c3->BufferBytes() + c4->BufferBytes(),do { static_assert( mozilla::detail::AssertionConditionType< decltype(IsSameUpdate( update1, Update(c5->BufferBytes(), c3 ->BufferBytes() + c4->BufferBytes(), c3->ChunkHeader ().mDoneTimeStamp, {{c3->ChunkHeader().mDoneTimeStamp, c3-> BufferBytes()}, {c4->ChunkHeader().mDoneTimeStamp, c4-> BufferBytes()}})))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update1, Update (c5->BufferBytes(), c3->BufferBytes() + c4->BufferBytes (), c3->ChunkHeader().mDoneTimeStamp, {{c3->ChunkHeader ().mDoneTimeStamp, c3->BufferBytes()}, {c4->ChunkHeader ().mDoneTimeStamp, c4->BufferBytes()}}))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("IsSameUpdate( update1, Update(c5->BufferBytes(), c3->BufferBytes() + c4->BufferBytes(), c3->ChunkHeader().mDoneTimeStamp, {{c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}, {c4->ChunkHeader().mDoneTimeStamp, c4->BufferBytes()}}))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2359); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update1, Update(c5->BufferBytes(), c3->BufferBytes() + c4->BufferBytes(), c3->ChunkHeader().mDoneTimeStamp, {{c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}, {c4->ChunkHeader().mDoneTimeStamp, c4->BufferBytes()}}))" ")"); do { *((volatile int*)__null) = 2359; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
2357 | c3->ChunkHeader().mDoneTimeStamp,do { static_assert( mozilla::detail::AssertionConditionType< decltype(IsSameUpdate( update1, Update(c5->BufferBytes(), c3 ->BufferBytes() + c4->BufferBytes(), c3->ChunkHeader ().mDoneTimeStamp, {{c3->ChunkHeader().mDoneTimeStamp, c3-> BufferBytes()}, {c4->ChunkHeader().mDoneTimeStamp, c4-> BufferBytes()}})))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update1, Update (c5->BufferBytes(), c3->BufferBytes() + c4->BufferBytes (), c3->ChunkHeader().mDoneTimeStamp, {{c3->ChunkHeader ().mDoneTimeStamp, c3->BufferBytes()}, {c4->ChunkHeader ().mDoneTimeStamp, c4->BufferBytes()}}))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("IsSameUpdate( update1, Update(c5->BufferBytes(), c3->BufferBytes() + c4->BufferBytes(), c3->ChunkHeader().mDoneTimeStamp, {{c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}, {c4->ChunkHeader().mDoneTimeStamp, c4->BufferBytes()}}))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2359); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update1, Update(c5->BufferBytes(), c3->BufferBytes() + c4->BufferBytes(), c3->ChunkHeader().mDoneTimeStamp, {{c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}, {c4->ChunkHeader().mDoneTimeStamp, c4->BufferBytes()}}))" ")"); do { *((volatile int*)__null) = 2359; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
2358 | {{c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()},do { static_assert( mozilla::detail::AssertionConditionType< decltype(IsSameUpdate( update1, Update(c5->BufferBytes(), c3 ->BufferBytes() + c4->BufferBytes(), c3->ChunkHeader ().mDoneTimeStamp, {{c3->ChunkHeader().mDoneTimeStamp, c3-> BufferBytes()}, {c4->ChunkHeader().mDoneTimeStamp, c4-> BufferBytes()}})))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update1, Update (c5->BufferBytes(), c3->BufferBytes() + c4->BufferBytes (), c3->ChunkHeader().mDoneTimeStamp, {{c3->ChunkHeader ().mDoneTimeStamp, c3->BufferBytes()}, {c4->ChunkHeader ().mDoneTimeStamp, c4->BufferBytes()}}))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("IsSameUpdate( update1, Update(c5->BufferBytes(), c3->BufferBytes() + c4->BufferBytes(), c3->ChunkHeader().mDoneTimeStamp, {{c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}, {c4->ChunkHeader().mDoneTimeStamp, c4->BufferBytes()}}))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2359); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update1, Update(c5->BufferBytes(), c3->BufferBytes() + c4->BufferBytes(), c3->ChunkHeader().mDoneTimeStamp, {{c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}, {c4->ChunkHeader().mDoneTimeStamp, c4->BufferBytes()}}))" ")"); do { *((volatile int*)__null) = 2359; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
2359 | {c4->ChunkHeader().mDoneTimeStamp, c4->BufferBytes()}})))do { static_assert( mozilla::detail::AssertionConditionType< decltype(IsSameUpdate( update1, Update(c5->BufferBytes(), c3 ->BufferBytes() + c4->BufferBytes(), c3->ChunkHeader ().mDoneTimeStamp, {{c3->ChunkHeader().mDoneTimeStamp, c3-> BufferBytes()}, {c4->ChunkHeader().mDoneTimeStamp, c4-> BufferBytes()}})))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(IsSameUpdate( update1, Update (c5->BufferBytes(), c3->BufferBytes() + c4->BufferBytes (), c3->ChunkHeader().mDoneTimeStamp, {{c3->ChunkHeader ().mDoneTimeStamp, c3->BufferBytes()}, {c4->ChunkHeader ().mDoneTimeStamp, c4->BufferBytes()}}))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("IsSameUpdate( update1, Update(c5->BufferBytes(), c3->BufferBytes() + c4->BufferBytes(), c3->ChunkHeader().mDoneTimeStamp, {{c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}, {c4->ChunkHeader().mDoneTimeStamp, c4->BufferBytes()}}))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2359); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate( update1, Update(c5->BufferBytes(), c3->BufferBytes() + c4->BufferBytes(), c3->ChunkHeader().mDoneTimeStamp, {{c3->ChunkHeader().mDoneTimeStamp, c3->BufferBytes()}, {c4->ChunkHeader().mDoneTimeStamp, c4->BufferBytes()}}))" ")"); do { *((volatile int*)__null) = 2359; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2360 | ||||
2361 | // And send a final update. | |||
2362 | update1.Fold(Update(nullptr)); | |||
2363 | MOZ_RELEASE_ASSERT(update1.IsFinal())do { static_assert( mozilla::detail::AssertionConditionType< decltype(update1.IsFinal())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(update1.IsFinal()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("update1.IsFinal()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2363); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "update1.IsFinal()" ")"); do { *((volatile int*)__null) = 2363; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2364 | MOZ_RELEASE_ASSERT(!update1.IsNotUpdate())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!update1.IsNotUpdate())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!update1.IsNotUpdate()))), 0 ))) { do { } while (false); MOZ_ReportAssertionFailure("!update1.IsNotUpdate()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2364); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!update1.IsNotUpdate()" ")"); do { *((volatile int*)__null) = 2364; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2365 | ||||
2366 | printf("TestControlledChunkManagerUpdate done\n"); | |||
2367 | } | |||
2368 | ||||
2369 | static void TestControlledChunkManagerWithLocalLimit() { | |||
2370 | printf("TestControlledChunkManagerWithLocalLimit...\n"); | |||
2371 | ||||
2372 | // Construct a ProfileBufferChunkManagerWithLocalLimit with chunk of minimum | |||
2373 | // size >=100, up to 1000 bytes. | |||
2374 | constexpr ProfileBufferChunk::Length MaxTotalBytes = 1000; | |||
2375 | constexpr ProfileBufferChunk::Length ChunkMinBufferBytes = 100; | |||
2376 | ProfileBufferChunkManagerWithLocalLimit cmll{MaxTotalBytes, | |||
2377 | ChunkMinBufferBytes}; | |||
2378 | ||||
2379 | // Reference to chunk manager base class. | |||
2380 | ProfileBufferChunkManager& cm = cmll; | |||
2381 | ||||
2382 | // Reference to controlled chunk manager base class. | |||
2383 | ProfileBufferControlledChunkManager& ccm = cmll; | |||
2384 | ||||
2385 | # ifdef DEBUG1 | |||
2386 | const char* chunkManagerRegisterer = | |||
2387 | "TestControlledChunkManagerWithLocalLimit"; | |||
2388 | cm.RegisteredWith(chunkManagerRegisterer); | |||
2389 | # endif // DEBUG | |||
2390 | ||||
2391 | MOZ_RELEASE_ASSERT(cm.MaxTotalSize() == MaxTotalBytes,do { static_assert( mozilla::detail::AssertionConditionType< decltype(cm.MaxTotalSize() == MaxTotalBytes)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(cm.MaxTotalSize() == MaxTotalBytes ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "cm.MaxTotalSize() == MaxTotalBytes" " (" "Max total size should be exactly as given" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2392); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "cm.MaxTotalSize() == MaxTotalBytes" ") (" "Max total size should be exactly as given" ")"); do { *((volatile int*)__null) = 2392; __attribute__((nomerge)) :: abort(); } while (false); } } while (false) | |||
2392 | "Max total size should be exactly as given")do { static_assert( mozilla::detail::AssertionConditionType< decltype(cm.MaxTotalSize() == MaxTotalBytes)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(cm.MaxTotalSize() == MaxTotalBytes ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "cm.MaxTotalSize() == MaxTotalBytes" " (" "Max total size should be exactly as given" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2392); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "cm.MaxTotalSize() == MaxTotalBytes" ") (" "Max total size should be exactly as given" ")"); do { *((volatile int*)__null) = 2392; __attribute__((nomerge)) :: abort(); } while (false); } } while (false); | |||
2393 | ||||
2394 | unsigned destroyedChunks = 0; | |||
2395 | unsigned destroyedBytes = 0; | |||
2396 | cm.SetChunkDestroyedCallback([&](const ProfileBufferChunk& aChunks) { | |||
2397 | for (const ProfileBufferChunk* chunk = &aChunks; chunk; | |||
2398 | chunk = chunk->GetNext()) { | |||
2399 | destroyedChunks += 1; | |||
2400 | destroyedBytes += chunk->BufferBytes(); | |||
2401 | } | |||
2402 | }); | |||
2403 | ||||
2404 | using Update = ProfileBufferControlledChunkManager::Update; | |||
2405 | unsigned updateCount = 0; | |||
2406 | ProfileBufferControlledChunkManager::Update update; | |||
2407 | MOZ_RELEASE_ASSERT(update.IsNotUpdate())do { static_assert( mozilla::detail::AssertionConditionType< decltype(update.IsNotUpdate())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(update.IsNotUpdate()))), 0)) ) { do { } while (false); MOZ_ReportAssertionFailure("update.IsNotUpdate()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2407); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "update.IsNotUpdate()" ")"); do { *((volatile int*)__null) = 2407; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2408 | auto updateCallback = [&](Update&& aUpdate) { | |||
2409 | ++updateCount; | |||
2410 | update.Fold(std::move(aUpdate)); | |||
2411 | }; | |||
2412 | ccm.SetUpdateCallback(updateCallback); | |||
2413 | MOZ_RELEASE_ASSERT(updateCount == 1,do { static_assert( mozilla::detail::AssertionConditionType< decltype(updateCount == 1)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(updateCount == 1))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("updateCount == 1" " (" "SetUpdateCallback should have triggered an update" ")" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2414); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "updateCount == 1" ") (" "SetUpdateCallback should have triggered an update" ")" ); do { *((volatile int*)__null) = 2414; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
2414 | "SetUpdateCallback should have triggered an update")do { static_assert( mozilla::detail::AssertionConditionType< decltype(updateCount == 1)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(updateCount == 1))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("updateCount == 1" " (" "SetUpdateCallback should have triggered an update" ")" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2414); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "updateCount == 1" ") (" "SetUpdateCallback should have triggered an update" ")" ); do { *((volatile int*)__null) = 2414; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2415 | MOZ_RELEASE_ASSERT(IsSameUpdate(update, Update(0, 0, TimeStamp{}, {})))do { static_assert( mozilla::detail::AssertionConditionType< decltype(IsSameUpdate(update, Update(0, 0, TimeStamp{}, {}))) >::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(IsSameUpdate(update, Update(0, 0, TimeStamp{}, {}))) )), 0))) { do { } while (false); MOZ_ReportAssertionFailure("IsSameUpdate(update, Update(0, 0, TimeStamp{}, {}))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2415); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate(update, Update(0, 0, TimeStamp{}, {}))" ")"); do { *((volatile int*)__null) = 2415; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2416 | updateCount = 0; | |||
2417 | update.Clear(); | |||
2418 | ||||
2419 | UniquePtr<ProfileBufferChunk> extantReleasedChunks = | |||
2420 | cm.GetExtantReleasedChunks(); | |||
2421 | MOZ_RELEASE_ASSERT(!extantReleasedChunks, "Unexpected released chunk(s)")do { static_assert( mozilla::detail::AssertionConditionType< decltype(!extantReleasedChunks)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!extantReleasedChunks))), 0) )) { do { } while (false); MOZ_ReportAssertionFailure("!extantReleasedChunks" " (" "Unexpected released chunk(s)" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2421); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!extantReleasedChunks" ") (" "Unexpected released chunk(s)" ")"); do { *((volatile int *)__null) = 2421; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | |||
2422 | MOZ_RELEASE_ASSERT(updateCount == 1,do { static_assert( mozilla::detail::AssertionConditionType< decltype(updateCount == 1)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(updateCount == 1))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("updateCount == 1" " (" "GetExtantReleasedChunks should have triggered an update" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2423); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "updateCount == 1" ") (" "GetExtantReleasedChunks should have triggered an update" ")"); do { *((volatile int*)__null) = 2423; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
2423 | "GetExtantReleasedChunks should have triggered an update")do { static_assert( mozilla::detail::AssertionConditionType< decltype(updateCount == 1)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(updateCount == 1))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("updateCount == 1" " (" "GetExtantReleasedChunks should have triggered an update" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2423); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "updateCount == 1" ") (" "GetExtantReleasedChunks should have triggered an update" ")"); do { *((volatile int*)__null) = 2423; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2424 | MOZ_RELEASE_ASSERT(IsSameUpdate(update, Update(0, 0, TimeStamp{}, {})))do { static_assert( mozilla::detail::AssertionConditionType< decltype(IsSameUpdate(update, Update(0, 0, TimeStamp{}, {}))) >::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(IsSameUpdate(update, Update(0, 0, TimeStamp{}, {}))) )), 0))) { do { } while (false); MOZ_ReportAssertionFailure("IsSameUpdate(update, Update(0, 0, TimeStamp{}, {}))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2424); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate(update, Update(0, 0, TimeStamp{}, {}))" ")"); do { *((volatile int*)__null) = 2424; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2425 | updateCount = 0; | |||
2426 | update.Clear(); | |||
2427 | ||||
2428 | // First request. | |||
2429 | UniquePtr<ProfileBufferChunk> chunk = cm.GetChunk(); | |||
2430 | MOZ_RELEASE_ASSERT(!!chunk,do { static_assert( mozilla::detail::AssertionConditionType< decltype(!!chunk)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!!chunk))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!!chunk" " (" "First chunk immediate request should always work" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2431); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!!chunk" ") (" "First chunk immediate request should always work" ")" ); do { *((volatile int*)__null) = 2431; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
2431 | "First chunk immediate request should always work")do { static_assert( mozilla::detail::AssertionConditionType< decltype(!!chunk)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!!chunk))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!!chunk" " (" "First chunk immediate request should always work" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2431); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!!chunk" ") (" "First chunk immediate request should always work" ")" ); do { *((volatile int*)__null) = 2431; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2432 | const auto chunkActualBufferBytes = chunk->BufferBytes(); | |||
2433 | MOZ_RELEASE_ASSERT(updateCount == 1,do { static_assert( mozilla::detail::AssertionConditionType< decltype(updateCount == 1)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(updateCount == 1))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("updateCount == 1" " (" "GetChunk should have triggered an update" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2434); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "updateCount == 1" ") (" "GetChunk should have triggered an update" ")"); do { * ((volatile int*)__null) = 2434; __attribute__((nomerge)) ::abort (); } while (false); } } while (false) | |||
2434 | "GetChunk should have triggered an update")do { static_assert( mozilla::detail::AssertionConditionType< decltype(updateCount == 1)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(updateCount == 1))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("updateCount == 1" " (" "GetChunk should have triggered an update" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2434); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "updateCount == 1" ") (" "GetChunk should have triggered an update" ")"); do { * ((volatile int*)__null) = 2434; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
2435 | MOZ_RELEASE_ASSERT(do { static_assert( mozilla::detail::AssertionConditionType< decltype(IsSameUpdate(update, Update(chunk->BufferBytes(), 0, TimeStamp{}, {})))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(IsSameUpdate(update, Update( chunk->BufferBytes(), 0, TimeStamp{}, {}))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("IsSameUpdate(update, Update(chunk->BufferBytes(), 0, TimeStamp{}, {}))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2436); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate(update, Update(chunk->BufferBytes(), 0, TimeStamp{}, {}))" ")"); do { *((volatile int*)__null) = 2436; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
2436 | IsSameUpdate(update, Update(chunk->BufferBytes(), 0, TimeStamp{}, {})))do { static_assert( mozilla::detail::AssertionConditionType< decltype(IsSameUpdate(update, Update(chunk->BufferBytes(), 0, TimeStamp{}, {})))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(IsSameUpdate(update, Update( chunk->BufferBytes(), 0, TimeStamp{}, {}))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("IsSameUpdate(update, Update(chunk->BufferBytes(), 0, TimeStamp{}, {}))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2436); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate(update, Update(chunk->BufferBytes(), 0, TimeStamp{}, {}))" ")"); do { *((volatile int*)__null) = 2436; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2437 | updateCount = 0; | |||
2438 | update.Clear(); | |||
2439 | ||||
2440 | extantReleasedChunks = cm.GetExtantReleasedChunks(); | |||
2441 | MOZ_RELEASE_ASSERT(!extantReleasedChunks, "Unexpected released chunk(s)")do { static_assert( mozilla::detail::AssertionConditionType< decltype(!extantReleasedChunks)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!extantReleasedChunks))), 0) )) { do { } while (false); MOZ_ReportAssertionFailure("!extantReleasedChunks" " (" "Unexpected released chunk(s)" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2441); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!extantReleasedChunks" ") (" "Unexpected released chunk(s)" ")"); do { *((volatile int *)__null) = 2441; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | |||
2442 | MOZ_RELEASE_ASSERT(updateCount == 1,do { static_assert( mozilla::detail::AssertionConditionType< decltype(updateCount == 1)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(updateCount == 1))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("updateCount == 1" " (" "GetExtantReleasedChunks should have triggered an update" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2443); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "updateCount == 1" ") (" "GetExtantReleasedChunks should have triggered an update" ")"); do { *((volatile int*)__null) = 2443; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
2443 | "GetExtantReleasedChunks should have triggered an update")do { static_assert( mozilla::detail::AssertionConditionType< decltype(updateCount == 1)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(updateCount == 1))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("updateCount == 1" " (" "GetExtantReleasedChunks should have triggered an update" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2443); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "updateCount == 1" ") (" "GetExtantReleasedChunks should have triggered an update" ")"); do { *((volatile int*)__null) = 2443; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2444 | MOZ_RELEASE_ASSERT(do { static_assert( mozilla::detail::AssertionConditionType< decltype(IsSameUpdate(update, Update(chunk->BufferBytes(), 0, TimeStamp{}, {})))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(IsSameUpdate(update, Update( chunk->BufferBytes(), 0, TimeStamp{}, {}))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("IsSameUpdate(update, Update(chunk->BufferBytes(), 0, TimeStamp{}, {}))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2445); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate(update, Update(chunk->BufferBytes(), 0, TimeStamp{}, {}))" ")"); do { *((volatile int*)__null) = 2445; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
2445 | IsSameUpdate(update, Update(chunk->BufferBytes(), 0, TimeStamp{}, {})))do { static_assert( mozilla::detail::AssertionConditionType< decltype(IsSameUpdate(update, Update(chunk->BufferBytes(), 0, TimeStamp{}, {})))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(IsSameUpdate(update, Update( chunk->BufferBytes(), 0, TimeStamp{}, {}))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("IsSameUpdate(update, Update(chunk->BufferBytes(), 0, TimeStamp{}, {}))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2445); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "IsSameUpdate(update, Update(chunk->BufferBytes(), 0, TimeStamp{}, {}))" ")"); do { *((volatile int*)__null) = 2445; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2446 | updateCount = 0; | |||
2447 | update.Clear(); | |||
2448 | ||||
2449 | // For this test, we need to be able to get at least 2 chunks without hitting | |||
2450 | // the limit. (If this failed, it wouldn't necessary be a problem with | |||
2451 | // ProfileBufferChunkManagerWithLocalLimit, fiddle with constants at the top | |||
2452 | // of this test.) | |||
2453 | MOZ_RELEASE_ASSERT(chunkActualBufferBytes < 2 * MaxTotalBytes)do { static_assert( mozilla::detail::AssertionConditionType< decltype(chunkActualBufferBytes < 2 * MaxTotalBytes)>:: isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(chunkActualBufferBytes < 2 * MaxTotalBytes))), 0) )) { do { } while (false); MOZ_ReportAssertionFailure("chunkActualBufferBytes < 2 * MaxTotalBytes" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2453); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunkActualBufferBytes < 2 * MaxTotalBytes" ")"); do { *((volatile int*)__null) = 2453; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2454 | ||||
2455 | ProfileBufferChunk::Length previousUnreleasedBytes = chunk->BufferBytes(); | |||
2456 | ProfileBufferChunk::Length previousReleasedBytes = 0; | |||
2457 | TimeStamp previousOldestDoneTimeStamp; | |||
2458 | ||||
2459 | // We will do enough loops to go through the maximum size a number of times. | |||
2460 | const unsigned Rollovers = 3; | |||
2461 | const unsigned Loops = Rollovers * MaxTotalBytes / chunkActualBufferBytes; | |||
2462 | for (unsigned i = 0; i < Loops; ++i) { | |||
2463 | // Add some data to the chunk. | |||
2464 | const ProfileBufferIndex index = | |||
2465 | ProfileBufferIndex(chunkActualBufferBytes) * i + 1; | |||
2466 | chunk->SetRangeStart(index); | |||
2467 | Unused << chunk->ReserveInitialBlockAsTail(1); | |||
2468 | Unused << chunk->ReserveBlock(2); | |||
2469 | ||||
2470 | // Request a new chunk. | |||
2471 | UniquePtr<ProfileBufferChunk> newChunk; | |||
2472 | cm.RequestChunk([&](UniquePtr<ProfileBufferChunk> aChunk) { | |||
2473 | newChunk = std::move(aChunk); | |||
2474 | }); | |||
2475 | MOZ_RELEASE_ASSERT(updateCount == 0,do { static_assert( mozilla::detail::AssertionConditionType< decltype(updateCount == 0)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(updateCount == 0))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("updateCount == 0" " (" "RequestChunk() shouldn't have triggered an update" ")" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2476); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "updateCount == 0" ") (" "RequestChunk() shouldn't have triggered an update" ")" ); do { *((volatile int*)__null) = 2476; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
2476 | "RequestChunk() shouldn't have triggered an update")do { static_assert( mozilla::detail::AssertionConditionType< decltype(updateCount == 0)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(updateCount == 0))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("updateCount == 0" " (" "RequestChunk() shouldn't have triggered an update" ")" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2476); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "updateCount == 0" ") (" "RequestChunk() shouldn't have triggered an update" ")" ); do { *((volatile int*)__null) = 2476; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2477 | cm.FulfillChunkRequests(); | |||
2478 | MOZ_RELEASE_ASSERT(!!newChunk, "Chunk request should always work")do { static_assert( mozilla::detail::AssertionConditionType< decltype(!!newChunk)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!!newChunk))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!!newChunk" " (" "Chunk request should always work" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2478); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!!newChunk" ") (" "Chunk request should always work" ")"); do { *((volatile int*)__null) = 2478; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | |||
2479 | MOZ_RELEASE_ASSERT(newChunk->BufferBytes() == chunkActualBufferBytes,do { static_assert( mozilla::detail::AssertionConditionType< decltype(newChunk->BufferBytes() == chunkActualBufferBytes )>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(newChunk->BufferBytes() == chunkActualBufferBytes ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "newChunk->BufferBytes() == chunkActualBufferBytes" " (" "Unexpected chunk size" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2480); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "newChunk->BufferBytes() == chunkActualBufferBytes" ") (" "Unexpected chunk size" ")"); do { *((volatile int*)__null ) = 2480; __attribute__((nomerge)) ::abort(); } while (false) ; } } while (false) | |||
2480 | "Unexpected chunk size")do { static_assert( mozilla::detail::AssertionConditionType< decltype(newChunk->BufferBytes() == chunkActualBufferBytes )>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(newChunk->BufferBytes() == chunkActualBufferBytes ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "newChunk->BufferBytes() == chunkActualBufferBytes" " (" "Unexpected chunk size" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2480); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "newChunk->BufferBytes() == chunkActualBufferBytes" ") (" "Unexpected chunk size" ")"); do { *((volatile int*)__null ) = 2480; __attribute__((nomerge)) ::abort(); } while (false) ; } } while (false); | |||
2481 | MOZ_RELEASE_ASSERT(!newChunk->GetNext(), "There should only be one chunk")do { static_assert( mozilla::detail::AssertionConditionType< decltype(!newChunk->GetNext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!newChunk->GetNext()))), 0 ))) { do { } while (false); MOZ_ReportAssertionFailure("!newChunk->GetNext()" " (" "There should only be one chunk" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2481); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!newChunk->GetNext()" ") (" "There should only be one chunk" ")"); do { *((volatile int*)__null) = 2481; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | |||
2482 | ||||
2483 | MOZ_RELEASE_ASSERT(updateCount == 1,do { static_assert( mozilla::detail::AssertionConditionType< decltype(updateCount == 1)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(updateCount == 1))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("updateCount == 1" " (" "FulfillChunkRequests() after a request should have " "triggered an update" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2485); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "updateCount == 1" ") (" "FulfillChunkRequests() after a request should have " "triggered an update" ")"); do { *((volatile int*)__null) = 2485; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
2484 | "FulfillChunkRequests() after a request should have "do { static_assert( mozilla::detail::AssertionConditionType< decltype(updateCount == 1)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(updateCount == 1))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("updateCount == 1" " (" "FulfillChunkRequests() after a request should have " "triggered an update" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2485); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "updateCount == 1" ") (" "FulfillChunkRequests() after a request should have " "triggered an update" ")"); do { *((volatile int*)__null) = 2485; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
2485 | "triggered an update")do { static_assert( mozilla::detail::AssertionConditionType< decltype(updateCount == 1)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(updateCount == 1))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("updateCount == 1" " (" "FulfillChunkRequests() after a request should have " "triggered an update" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2485); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "updateCount == 1" ") (" "FulfillChunkRequests() after a request should have " "triggered an update" ")"); do { *((volatile int*)__null) = 2485; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2486 | MOZ_RELEASE_ASSERT(!update.IsFinal())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!update.IsFinal())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!update.IsFinal()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!update.IsFinal()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2486); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!update.IsFinal()" ")"); do { *((volatile int*)__null) = 2486; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2487 | MOZ_RELEASE_ASSERT(!update.IsNotUpdate())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!update.IsNotUpdate())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!update.IsNotUpdate()))), 0) )) { do { } while (false); MOZ_ReportAssertionFailure("!update.IsNotUpdate()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2487); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!update.IsNotUpdate()" ")"); do { *((volatile int*)__null) = 2487; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2488 | MOZ_RELEASE_ASSERT(update.UnreleasedBytes() ==do { static_assert( mozilla::detail::AssertionConditionType< decltype(update.UnreleasedBytes() == previousUnreleasedBytes + newChunk->BufferBytes())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(update.UnreleasedBytes() == previousUnreleasedBytes + newChunk->BufferBytes()))), 0))) { do { } while (false) ; MOZ_ReportAssertionFailure("update.UnreleasedBytes() == previousUnreleasedBytes + newChunk->BufferBytes()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2489); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "update.UnreleasedBytes() == previousUnreleasedBytes + newChunk->BufferBytes()" ")"); do { *((volatile int*)__null) = 2489; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
2489 | previousUnreleasedBytes + newChunk->BufferBytes())do { static_assert( mozilla::detail::AssertionConditionType< decltype(update.UnreleasedBytes() == previousUnreleasedBytes + newChunk->BufferBytes())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(update.UnreleasedBytes() == previousUnreleasedBytes + newChunk->BufferBytes()))), 0))) { do { } while (false) ; MOZ_ReportAssertionFailure("update.UnreleasedBytes() == previousUnreleasedBytes + newChunk->BufferBytes()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2489); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "update.UnreleasedBytes() == previousUnreleasedBytes + newChunk->BufferBytes()" ")"); do { *((volatile int*)__null) = 2489; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2490 | previousUnreleasedBytes = update.UnreleasedBytes(); | |||
2491 | MOZ_RELEASE_ASSERT(update.ReleasedBytes() <= previousReleasedBytes)do { static_assert( mozilla::detail::AssertionConditionType< decltype(update.ReleasedBytes() <= previousReleasedBytes)> ::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(update.ReleasedBytes() <= previousReleasedBytes)) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("update.ReleasedBytes() <= previousReleasedBytes" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2491); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "update.ReleasedBytes() <= previousReleasedBytes" ")"); do { *((volatile int*)__null) = 2491; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2492 | previousReleasedBytes = update.ReleasedBytes(); | |||
2493 | MOZ_RELEASE_ASSERT(previousOldestDoneTimeStamp.IsNull() ||do { static_assert( mozilla::detail::AssertionConditionType< decltype(previousOldestDoneTimeStamp.IsNull() || update.OldestDoneTimeStamp () >= previousOldestDoneTimeStamp)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(previousOldestDoneTimeStamp. IsNull() || update.OldestDoneTimeStamp() >= previousOldestDoneTimeStamp ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "previousOldestDoneTimeStamp.IsNull() || update.OldestDoneTimeStamp() >= previousOldestDoneTimeStamp" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2495); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "previousOldestDoneTimeStamp.IsNull() || update.OldestDoneTimeStamp() >= previousOldestDoneTimeStamp" ")"); do { *((volatile int*)__null) = 2495; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
2494 | update.OldestDoneTimeStamp() >=do { static_assert( mozilla::detail::AssertionConditionType< decltype(previousOldestDoneTimeStamp.IsNull() || update.OldestDoneTimeStamp () >= previousOldestDoneTimeStamp)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(previousOldestDoneTimeStamp. IsNull() || update.OldestDoneTimeStamp() >= previousOldestDoneTimeStamp ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "previousOldestDoneTimeStamp.IsNull() || update.OldestDoneTimeStamp() >= previousOldestDoneTimeStamp" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2495); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "previousOldestDoneTimeStamp.IsNull() || update.OldestDoneTimeStamp() >= previousOldestDoneTimeStamp" ")"); do { *((volatile int*)__null) = 2495; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
2495 | previousOldestDoneTimeStamp)do { static_assert( mozilla::detail::AssertionConditionType< decltype(previousOldestDoneTimeStamp.IsNull() || update.OldestDoneTimeStamp () >= previousOldestDoneTimeStamp)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(previousOldestDoneTimeStamp. IsNull() || update.OldestDoneTimeStamp() >= previousOldestDoneTimeStamp ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "previousOldestDoneTimeStamp.IsNull() || update.OldestDoneTimeStamp() >= previousOldestDoneTimeStamp" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2495); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "previousOldestDoneTimeStamp.IsNull() || update.OldestDoneTimeStamp() >= previousOldestDoneTimeStamp" ")"); do { *((volatile int*)__null) = 2495; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2496 | previousOldestDoneTimeStamp = update.OldestDoneTimeStamp(); | |||
2497 | MOZ_RELEASE_ASSERT(update.NewlyReleasedChunksRef().empty())do { static_assert( mozilla::detail::AssertionConditionType< decltype(update.NewlyReleasedChunksRef().empty())>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(update.NewlyReleasedChunksRef().empty()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("update.NewlyReleasedChunksRef().empty()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2497); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "update.NewlyReleasedChunksRef().empty()" ")"); do { *((volatile int*)__null) = 2497; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2498 | updateCount = 0; | |||
2499 | update.Clear(); | |||
2500 | ||||
2501 | // Make sure the "Done" timestamp below cannot be the same as from the | |||
2502 | // previous loop. | |||
2503 | const TimeStamp now = TimeStamp::Now(); | |||
2504 | while (TimeStamp::Now() == now) { | |||
2505 | ::SleepMilli(1); | |||
2506 | } | |||
2507 | ||||
2508 | // Mark previous chunk done and release it. | |||
2509 | WaitUntilTimeStampChanges(); // Force "done" timestamp to change. | |||
2510 | chunk->MarkDone(); | |||
2511 | const auto doneTimeStamp = chunk->ChunkHeader().mDoneTimeStamp; | |||
2512 | const auto bufferBytes = chunk->BufferBytes(); | |||
2513 | cm.ReleaseChunk(std::move(chunk)); | |||
2514 | ||||
2515 | MOZ_RELEASE_ASSERT(updateCount == 1,do { static_assert( mozilla::detail::AssertionConditionType< decltype(updateCount == 1)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(updateCount == 1))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("updateCount == 1" " (" "ReleaseChunk() should have triggered an update" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2516); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "updateCount == 1" ") (" "ReleaseChunk() should have triggered an update" ")"); do { *((volatile int*)__null) = 2516; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
2516 | "ReleaseChunk() should have triggered an update")do { static_assert( mozilla::detail::AssertionConditionType< decltype(updateCount == 1)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(updateCount == 1))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("updateCount == 1" " (" "ReleaseChunk() should have triggered an update" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2516); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "updateCount == 1" ") (" "ReleaseChunk() should have triggered an update" ")"); do { *((volatile int*)__null) = 2516; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2517 | MOZ_RELEASE_ASSERT(!update.IsFinal())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!update.IsFinal())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!update.IsFinal()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!update.IsFinal()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2517); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!update.IsFinal()" ")"); do { *((volatile int*)__null) = 2517; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2518 | MOZ_RELEASE_ASSERT(!update.IsNotUpdate())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!update.IsNotUpdate())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!update.IsNotUpdate()))), 0) )) { do { } while (false); MOZ_ReportAssertionFailure("!update.IsNotUpdate()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2518); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!update.IsNotUpdate()" ")"); do { *((volatile int*)__null) = 2518; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2519 | MOZ_RELEASE_ASSERT(update.UnreleasedBytes() ==do { static_assert( mozilla::detail::AssertionConditionType< decltype(update.UnreleasedBytes() == previousUnreleasedBytes - bufferBytes)>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(!!(update.UnreleasedBytes() == previousUnreleasedBytes - bufferBytes))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("update.UnreleasedBytes() == previousUnreleasedBytes - bufferBytes" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2520); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "update.UnreleasedBytes() == previousUnreleasedBytes - bufferBytes" ")"); do { *((volatile int*)__null) = 2520; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
2520 | previousUnreleasedBytes - bufferBytes)do { static_assert( mozilla::detail::AssertionConditionType< decltype(update.UnreleasedBytes() == previousUnreleasedBytes - bufferBytes)>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(!!(update.UnreleasedBytes() == previousUnreleasedBytes - bufferBytes))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("update.UnreleasedBytes() == previousUnreleasedBytes - bufferBytes" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2520); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "update.UnreleasedBytes() == previousUnreleasedBytes - bufferBytes" ")"); do { *((volatile int*)__null) = 2520; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2521 | previousUnreleasedBytes = update.UnreleasedBytes(); | |||
2522 | MOZ_RELEASE_ASSERT(update.ReleasedBytes() ==do { static_assert( mozilla::detail::AssertionConditionType< decltype(update.ReleasedBytes() == previousReleasedBytes + bufferBytes )>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(update.ReleasedBytes() == previousReleasedBytes + bufferBytes ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "update.ReleasedBytes() == previousReleasedBytes + bufferBytes" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2523); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "update.ReleasedBytes() == previousReleasedBytes + bufferBytes" ")"); do { *((volatile int*)__null) = 2523; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
2523 | previousReleasedBytes + bufferBytes)do { static_assert( mozilla::detail::AssertionConditionType< decltype(update.ReleasedBytes() == previousReleasedBytes + bufferBytes )>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(update.ReleasedBytes() == previousReleasedBytes + bufferBytes ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "update.ReleasedBytes() == previousReleasedBytes + bufferBytes" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2523); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "update.ReleasedBytes() == previousReleasedBytes + bufferBytes" ")"); do { *((volatile int*)__null) = 2523; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2524 | previousReleasedBytes = update.ReleasedBytes(); | |||
2525 | MOZ_RELEASE_ASSERT(previousOldestDoneTimeStamp.IsNull() ||do { static_assert( mozilla::detail::AssertionConditionType< decltype(previousOldestDoneTimeStamp.IsNull() || update.OldestDoneTimeStamp () >= previousOldestDoneTimeStamp)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(previousOldestDoneTimeStamp. IsNull() || update.OldestDoneTimeStamp() >= previousOldestDoneTimeStamp ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "previousOldestDoneTimeStamp.IsNull() || update.OldestDoneTimeStamp() >= previousOldestDoneTimeStamp" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2527); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "previousOldestDoneTimeStamp.IsNull() || update.OldestDoneTimeStamp() >= previousOldestDoneTimeStamp" ")"); do { *((volatile int*)__null) = 2527; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
2526 | update.OldestDoneTimeStamp() >=do { static_assert( mozilla::detail::AssertionConditionType< decltype(previousOldestDoneTimeStamp.IsNull() || update.OldestDoneTimeStamp () >= previousOldestDoneTimeStamp)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(previousOldestDoneTimeStamp. IsNull() || update.OldestDoneTimeStamp() >= previousOldestDoneTimeStamp ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "previousOldestDoneTimeStamp.IsNull() || update.OldestDoneTimeStamp() >= previousOldestDoneTimeStamp" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2527); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "previousOldestDoneTimeStamp.IsNull() || update.OldestDoneTimeStamp() >= previousOldestDoneTimeStamp" ")"); do { *((volatile int*)__null) = 2527; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
2527 | previousOldestDoneTimeStamp)do { static_assert( mozilla::detail::AssertionConditionType< decltype(previousOldestDoneTimeStamp.IsNull() || update.OldestDoneTimeStamp () >= previousOldestDoneTimeStamp)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(previousOldestDoneTimeStamp. IsNull() || update.OldestDoneTimeStamp() >= previousOldestDoneTimeStamp ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "previousOldestDoneTimeStamp.IsNull() || update.OldestDoneTimeStamp() >= previousOldestDoneTimeStamp" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2527); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "previousOldestDoneTimeStamp.IsNull() || update.OldestDoneTimeStamp() >= previousOldestDoneTimeStamp" ")"); do { *((volatile int*)__null) = 2527; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2528 | previousOldestDoneTimeStamp = update.OldestDoneTimeStamp(); | |||
2529 | MOZ_RELEASE_ASSERT(update.OldestDoneTimeStamp() <= doneTimeStamp)do { static_assert( mozilla::detail::AssertionConditionType< decltype(update.OldestDoneTimeStamp() <= doneTimeStamp)> ::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(update.OldestDoneTimeStamp() <= doneTimeStamp))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("update.OldestDoneTimeStamp() <= doneTimeStamp" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2529); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "update.OldestDoneTimeStamp() <= doneTimeStamp" ")"); do { *((volatile int*)__null) = 2529; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2530 | MOZ_RELEASE_ASSERT(update.NewlyReleasedChunksRef().size() == 1)do { static_assert( mozilla::detail::AssertionConditionType< decltype(update.NewlyReleasedChunksRef().size() == 1)>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(update.NewlyReleasedChunksRef().size() == 1))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("update.NewlyReleasedChunksRef().size() == 1" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2530); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "update.NewlyReleasedChunksRef().size() == 1" ")"); do { *((volatile int*)__null) = 2530; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2531 | MOZ_RELEASE_ASSERT(update.NewlyReleasedChunksRef()[0].mDoneTimeStamp ==do { static_assert( mozilla::detail::AssertionConditionType< decltype(update.NewlyReleasedChunksRef()[0].mDoneTimeStamp == doneTimeStamp)>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(!!(update.NewlyReleasedChunksRef( )[0].mDoneTimeStamp == doneTimeStamp))), 0))) { do { } while ( false); MOZ_ReportAssertionFailure("update.NewlyReleasedChunksRef()[0].mDoneTimeStamp == doneTimeStamp" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2532); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "update.NewlyReleasedChunksRef()[0].mDoneTimeStamp == doneTimeStamp" ")"); do { *((volatile int*)__null) = 2532; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
2532 | doneTimeStamp)do { static_assert( mozilla::detail::AssertionConditionType< decltype(update.NewlyReleasedChunksRef()[0].mDoneTimeStamp == doneTimeStamp)>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(!!(update.NewlyReleasedChunksRef( )[0].mDoneTimeStamp == doneTimeStamp))), 0))) { do { } while ( false); MOZ_ReportAssertionFailure("update.NewlyReleasedChunksRef()[0].mDoneTimeStamp == doneTimeStamp" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2532); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "update.NewlyReleasedChunksRef()[0].mDoneTimeStamp == doneTimeStamp" ")"); do { *((volatile int*)__null) = 2532; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2533 | MOZ_RELEASE_ASSERT(update.NewlyReleasedChunksRef()[0].mBufferBytes ==do { static_assert( mozilla::detail::AssertionConditionType< decltype(update.NewlyReleasedChunksRef()[0].mBufferBytes == bufferBytes )>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(update.NewlyReleasedChunksRef()[0].mBufferBytes == bufferBytes ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "update.NewlyReleasedChunksRef()[0].mBufferBytes == bufferBytes" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2534); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "update.NewlyReleasedChunksRef()[0].mBufferBytes == bufferBytes" ")"); do { *((volatile int*)__null) = 2534; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
2534 | bufferBytes)do { static_assert( mozilla::detail::AssertionConditionType< decltype(update.NewlyReleasedChunksRef()[0].mBufferBytes == bufferBytes )>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(update.NewlyReleasedChunksRef()[0].mBufferBytes == bufferBytes ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "update.NewlyReleasedChunksRef()[0].mBufferBytes == bufferBytes" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2534); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "update.NewlyReleasedChunksRef()[0].mBufferBytes == bufferBytes" ")"); do { *((volatile int*)__null) = 2534; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2535 | updateCount = 0; | |||
2536 | update.Clear(); | |||
2537 | ||||
2538 | // And cycle to the new chunk. | |||
2539 | chunk = std::move(newChunk); | |||
2540 | } | |||
2541 | ||||
2542 | // Enough testing! Clean-up. | |||
2543 | Unused << chunk->ReserveInitialBlockAsTail(0); | |||
2544 | chunk->MarkDone(); | |||
2545 | cm.ForgetUnreleasedChunks(); | |||
2546 | MOZ_RELEASE_ASSERT(do { static_assert( mozilla::detail::AssertionConditionType< decltype(updateCount == 1)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(updateCount == 1))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("updateCount == 1" " (" "ForgetUnreleasedChunks() should have triggered an update" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2548); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "updateCount == 1" ") (" "ForgetUnreleasedChunks() should have triggered an update" ")"); do { *((volatile int*)__null) = 2548; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
2547 | updateCount == 1,do { static_assert( mozilla::detail::AssertionConditionType< decltype(updateCount == 1)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(updateCount == 1))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("updateCount == 1" " (" "ForgetUnreleasedChunks() should have triggered an update" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2548); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "updateCount == 1" ") (" "ForgetUnreleasedChunks() should have triggered an update" ")"); do { *((volatile int*)__null) = 2548; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
2548 | "ForgetUnreleasedChunks() should have triggered an update")do { static_assert( mozilla::detail::AssertionConditionType< decltype(updateCount == 1)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(updateCount == 1))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("updateCount == 1" " (" "ForgetUnreleasedChunks() should have triggered an update" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2548); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "updateCount == 1" ") (" "ForgetUnreleasedChunks() should have triggered an update" ")"); do { *((volatile int*)__null) = 2548; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2549 | MOZ_RELEASE_ASSERT(!update.IsFinal())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!update.IsFinal())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!update.IsFinal()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!update.IsFinal()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2549); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!update.IsFinal()" ")"); do { *((volatile int*)__null) = 2549; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2550 | MOZ_RELEASE_ASSERT(!update.IsNotUpdate())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!update.IsNotUpdate())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!update.IsNotUpdate()))), 0) )) { do { } while (false); MOZ_ReportAssertionFailure("!update.IsNotUpdate()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2550); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!update.IsNotUpdate()" ")"); do { *((volatile int*)__null) = 2550; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2551 | MOZ_RELEASE_ASSERT(update.UnreleasedBytes() == 0)do { static_assert( mozilla::detail::AssertionConditionType< decltype(update.UnreleasedBytes() == 0)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(update.UnreleasedBytes() == 0 ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "update.UnreleasedBytes() == 0", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2551); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "update.UnreleasedBytes() == 0" ")"); do { *((volatile int*)__null) = 2551; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2552 | MOZ_RELEASE_ASSERT(update.ReleasedBytes() == previousReleasedBytes)do { static_assert( mozilla::detail::AssertionConditionType< decltype(update.ReleasedBytes() == previousReleasedBytes)> ::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(update.ReleasedBytes() == previousReleasedBytes))), 0 ))) { do { } while (false); MOZ_ReportAssertionFailure("update.ReleasedBytes() == previousReleasedBytes" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2552); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "update.ReleasedBytes() == previousReleasedBytes" ")"); do { *((volatile int*)__null) = 2552; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2553 | MOZ_RELEASE_ASSERT(update.NewlyReleasedChunksRef().empty() == 1)do { static_assert( mozilla::detail::AssertionConditionType< decltype(update.NewlyReleasedChunksRef().empty() == 1)>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(update.NewlyReleasedChunksRef().empty() == 1))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("update.NewlyReleasedChunksRef().empty() == 1" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2553); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "update.NewlyReleasedChunksRef().empty() == 1" ")"); do { *((volatile int*)__null) = 2553; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2554 | updateCount = 0; | |||
2555 | update.Clear(); | |||
2556 | ||||
2557 | ccm.SetUpdateCallback({}); | |||
2558 | MOZ_RELEASE_ASSERT(updateCount == 1,do { static_assert( mozilla::detail::AssertionConditionType< decltype(updateCount == 1)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(updateCount == 1))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("updateCount == 1" " (" "SetUpdateCallback({}) should have triggered an update" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2559); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "updateCount == 1" ") (" "SetUpdateCallback({}) should have triggered an update" ")"); do { *((volatile int*)__null) = 2559; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
2559 | "SetUpdateCallback({}) should have triggered an update")do { static_assert( mozilla::detail::AssertionConditionType< decltype(updateCount == 1)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(updateCount == 1))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("updateCount == 1" " (" "SetUpdateCallback({}) should have triggered an update" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2559); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "updateCount == 1" ") (" "SetUpdateCallback({}) should have triggered an update" ")"); do { *((volatile int*)__null) = 2559; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2560 | MOZ_RELEASE_ASSERT(update.IsFinal())do { static_assert( mozilla::detail::AssertionConditionType< decltype(update.IsFinal())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(update.IsFinal()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("update.IsFinal()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2560); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "update.IsFinal()" ")"); do { *((volatile int*)__null) = 2560; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2561 | ||||
2562 | # ifdef DEBUG1 | |||
2563 | cm.DeregisteredFrom(chunkManagerRegisterer); | |||
2564 | # endif // DEBUG | |||
2565 | ||||
2566 | printf("TestControlledChunkManagerWithLocalLimit done\n"); | |||
2567 | } | |||
2568 | ||||
2569 | # define VERIFY_PCB_START_END_PUSHED_CLEARED_FAILED( \{ ProfileChunkedBuffer::State state = (aProfileChunkedBuffer) .GetState(); do { static_assert( mozilla::detail::AssertionConditionType <decltype(state.mRangeStart == (aStart))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(state.mRangeStart == (aStart )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mRangeStart == (aStart)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2570); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (aStart)" ")"); do { *((volatile int*)__null) = 2570; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd == (aEnd))>::isValid, "invalid assertion condition"); if ( (__builtin_expect(!!(!(!!(state.mRangeEnd == (aEnd)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mRangeEnd == (aEnd)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2570); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (aEnd)" ")"); do { *((volatile int*)__null) = 2570; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount == (aPushed))>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(!!(state.mPushedBlockCount == (aPushed )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mPushedBlockCount == (aPushed)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2570); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (aPushed)" ")"); do { *((volatile int*)__null) = 2570; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount == (aCleared))>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(!!(state.mClearedBlockCount == (aCleared )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mClearedBlockCount == (aCleared)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2570); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (aCleared)" ")"); do { *((volatile int*)__null) = 2570; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes == (aFailed))>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(!!(state.mFailedPutBytes == (aFailed )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mFailedPutBytes == (aFailed)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2570); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (aFailed)" ")"); do { *((volatile int*)__null) = 2570; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); } | |||
2570 | aProfileChunkedBuffer, aStart, aEnd, aPushed, aCleared, aFailed){ ProfileChunkedBuffer::State state = (aProfileChunkedBuffer) .GetState(); do { static_assert( mozilla::detail::AssertionConditionType <decltype(state.mRangeStart == (aStart))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(state.mRangeStart == (aStart )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mRangeStart == (aStart)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2570); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (aStart)" ")"); do { *((volatile int*)__null) = 2570; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd == (aEnd))>::isValid, "invalid assertion condition"); if ( (__builtin_expect(!!(!(!!(state.mRangeEnd == (aEnd)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mRangeEnd == (aEnd)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2570); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (aEnd)" ")"); do { *((volatile int*)__null) = 2570; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount == (aPushed))>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(!!(state.mPushedBlockCount == (aPushed )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mPushedBlockCount == (aPushed)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2570); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (aPushed)" ")"); do { *((volatile int*)__null) = 2570; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount == (aCleared))>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(!!(state.mClearedBlockCount == (aCleared )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mClearedBlockCount == (aCleared)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2570); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (aCleared)" ")"); do { *((volatile int*)__null) = 2570; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes == (aFailed))>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(!!(state.mFailedPutBytes == (aFailed )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mFailedPutBytes == (aFailed)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2570); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (aFailed)" ")"); do { *((volatile int*)__null) = 2570; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); } \ | |||
2571 | { \ | |||
2572 | ProfileChunkedBuffer::State state = (aProfileChunkedBuffer).GetState(); \ | |||
2573 | MOZ_RELEASE_ASSERT(state.mRangeStart == (aStart))do { static_assert( mozilla::detail::AssertionConditionType< decltype(state.mRangeStart == (aStart))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(state.mRangeStart == (aStart )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mRangeStart == (aStart)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2573); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (aStart)" ")"); do { *((volatile int*)__null) = 2573; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); \ | |||
2574 | MOZ_RELEASE_ASSERT(state.mRangeEnd == (aEnd))do { static_assert( mozilla::detail::AssertionConditionType< decltype(state.mRangeEnd == (aEnd))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(state.mRangeEnd == (aEnd)))) , 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mRangeEnd == (aEnd)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2574); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (aEnd)" ")"); do { *((volatile int*)__null) = 2574; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); \ | |||
2575 | MOZ_RELEASE_ASSERT(state.mPushedBlockCount == (aPushed))do { static_assert( mozilla::detail::AssertionConditionType< decltype(state.mPushedBlockCount == (aPushed))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(state.mPushedBlockCount == ( aPushed)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mPushedBlockCount == (aPushed)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2575); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (aPushed)" ")"); do { *((volatile int*)__null) = 2575; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); \ | |||
2576 | MOZ_RELEASE_ASSERT(state.mClearedBlockCount == (aCleared))do { static_assert( mozilla::detail::AssertionConditionType< decltype(state.mClearedBlockCount == (aCleared))>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(state.mClearedBlockCount == (aCleared)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (aCleared)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2576); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (aCleared)" ")"); do { *((volatile int*)__null) = 2576; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); \ | |||
2577 | MOZ_RELEASE_ASSERT(state.mFailedPutBytes == (aFailed))do { static_assert( mozilla::detail::AssertionConditionType< decltype(state.mFailedPutBytes == (aFailed))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(state.mFailedPutBytes == (aFailed )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mFailedPutBytes == (aFailed)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2577); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (aFailed)" ")"); do { *((volatile int*)__null) = 2577; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); \ | |||
2578 | } | |||
2579 | ||||
2580 | static void TestChunkedBuffer() { | |||
2581 | printf("TestChunkedBuffer...\n"); | |||
2582 | ||||
2583 | ProfileBufferBlockIndex blockIndex; | |||
2584 | MOZ_RELEASE_ASSERT(!blockIndex)do { static_assert( mozilla::detail::AssertionConditionType< decltype(!blockIndex)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!blockIndex))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!blockIndex", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2584); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!blockIndex" ")"); do { *((volatile int*)__null) = 2584; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2585 | MOZ_RELEASE_ASSERT(blockIndex == nullptr)do { static_assert( mozilla::detail::AssertionConditionType< decltype(blockIndex == nullptr)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(blockIndex == nullptr))), 0) )) { do { } while (false); MOZ_ReportAssertionFailure("blockIndex == nullptr" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2585); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "blockIndex == nullptr" ")"); do { *((volatile int*)__null) = 2585; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2586 | ||||
2587 | // Create an out-of-session ProfileChunkedBuffer. | |||
2588 | ProfileChunkedBuffer cb(ProfileChunkedBuffer::ThreadSafety::WithMutex); | |||
2589 | ||||
2590 | MOZ_RELEASE_ASSERT(cb.BufferLength().isNothing())do { static_assert( mozilla::detail::AssertionConditionType< decltype(cb.BufferLength().isNothing())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(cb.BufferLength().isNothing( )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("cb.BufferLength().isNothing()", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2590); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "cb.BufferLength().isNothing()" ")"); do { *((volatile int*)__null) = 2590; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2591 | ||||
2592 | VERIFY_PCB_START_END_PUSHED_CLEARED_FAILED(cb, 1, 1, 0, 0, 0){ ProfileChunkedBuffer::State state = (cb).GetState(); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mRangeStart == (1))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mRangeStart == (1)))), 0))) { do { } while (false ); MOZ_ReportAssertionFailure("state.mRangeStart == (1)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2592); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (1)" ")"); do { *((volatile int*)__null) = 2592; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd == (1))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mRangeEnd == (1)))), 0))) { do { } while (false ); MOZ_ReportAssertionFailure("state.mRangeEnd == (1)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2592); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (1)" ")"); do { *((volatile int*)__null) = 2592; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mPushedBlockCount == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mPushedBlockCount == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2592); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (0)" ")"); do { *((volatile int*)__null) = 2592; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2592); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)" ")"); do { *((volatile int*)__null) = 2592; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mFailedPutBytes == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mFailedPutBytes == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2592); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (0)" ")"); do { *((volatile int*)__null) = 2592; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); }; | |||
2593 | ||||
2594 | int result = 0; | |||
2595 | result = cb.ReserveAndPut( | |||
2596 | []() { | |||
2597 | MOZ_RELEASE_ASSERT(false)do { static_assert( mozilla::detail::AssertionConditionType< decltype(false)>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(!!(false))), 0))) { do { } while ( false); MOZ_ReportAssertionFailure("false", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2597); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "false" ")"); do { *((volatile int*)__null) = 2597; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2598 | return 1; | |||
2599 | }, | |||
2600 | [](Maybe<ProfileBufferEntryWriter>& aEW) { return aEW ? 2 : 3; }); | |||
2601 | MOZ_RELEASE_ASSERT(result == 3)do { static_assert( mozilla::detail::AssertionConditionType< decltype(result == 3)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(result == 3))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("result == 3", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2601); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "result == 3" ")"); do { *((volatile int*)__null) = 2601; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2602 | VERIFY_PCB_START_END_PUSHED_CLEARED_FAILED(cb, 1, 1, 0, 0, 0){ ProfileChunkedBuffer::State state = (cb).GetState(); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mRangeStart == (1))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mRangeStart == (1)))), 0))) { do { } while (false ); MOZ_ReportAssertionFailure("state.mRangeStart == (1)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2602); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (1)" ")"); do { *((volatile int*)__null) = 2602; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd == (1))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mRangeEnd == (1)))), 0))) { do { } while (false ); MOZ_ReportAssertionFailure("state.mRangeEnd == (1)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2602); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (1)" ")"); do { *((volatile int*)__null) = 2602; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mPushedBlockCount == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mPushedBlockCount == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2602); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (0)" ")"); do { *((volatile int*)__null) = 2602; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2602); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)" ")"); do { *((volatile int*)__null) = 2602; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mFailedPutBytes == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mFailedPutBytes == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2602); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (0)" ")"); do { *((volatile int*)__null) = 2602; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); }; | |||
2603 | ||||
2604 | result = 0; | |||
2605 | result = cb.Put( | |||
2606 | 1, [](Maybe<ProfileBufferEntryWriter>& aEW) { return aEW ? 1 : 2; }); | |||
2607 | MOZ_RELEASE_ASSERT(result == 2)do { static_assert( mozilla::detail::AssertionConditionType< decltype(result == 2)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(result == 2))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("result == 2", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2607); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "result == 2" ")"); do { *((volatile int*)__null) = 2607; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2608 | VERIFY_PCB_START_END_PUSHED_CLEARED_FAILED(cb, 1, 1, 0, 0, 0){ ProfileChunkedBuffer::State state = (cb).GetState(); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mRangeStart == (1))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mRangeStart == (1)))), 0))) { do { } while (false ); MOZ_ReportAssertionFailure("state.mRangeStart == (1)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2608); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (1)" ")"); do { *((volatile int*)__null) = 2608; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd == (1))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mRangeEnd == (1)))), 0))) { do { } while (false ); MOZ_ReportAssertionFailure("state.mRangeEnd == (1)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2608); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (1)" ")"); do { *((volatile int*)__null) = 2608; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mPushedBlockCount == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mPushedBlockCount == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2608); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (0)" ")"); do { *((volatile int*)__null) = 2608; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2608); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)" ")"); do { *((volatile int*)__null) = 2608; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mFailedPutBytes == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mFailedPutBytes == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2608); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (0)" ")"); do { *((volatile int*)__null) = 2608; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); }; | |||
2609 | ||||
2610 | blockIndex = cb.PutFrom(&result, 1); | |||
2611 | MOZ_RELEASE_ASSERT(!blockIndex)do { static_assert( mozilla::detail::AssertionConditionType< decltype(!blockIndex)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!blockIndex))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!blockIndex", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2611); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!blockIndex" ")"); do { *((volatile int*)__null) = 2611; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2612 | VERIFY_PCB_START_END_PUSHED_CLEARED_FAILED(cb, 1, 1, 0, 0, 0){ ProfileChunkedBuffer::State state = (cb).GetState(); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mRangeStart == (1))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mRangeStart == (1)))), 0))) { do { } while (false ); MOZ_ReportAssertionFailure("state.mRangeStart == (1)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2612); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (1)" ")"); do { *((volatile int*)__null) = 2612; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd == (1))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mRangeEnd == (1)))), 0))) { do { } while (false ); MOZ_ReportAssertionFailure("state.mRangeEnd == (1)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2612); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (1)" ")"); do { *((volatile int*)__null) = 2612; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mPushedBlockCount == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mPushedBlockCount == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2612); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (0)" ")"); do { *((volatile int*)__null) = 2612; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2612); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)" ")"); do { *((volatile int*)__null) = 2612; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mFailedPutBytes == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mFailedPutBytes == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2612); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (0)" ")"); do { *((volatile int*)__null) = 2612; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); }; | |||
2613 | ||||
2614 | blockIndex = cb.PutObjects(123, result, "hello"); | |||
2615 | MOZ_RELEASE_ASSERT(!blockIndex)do { static_assert( mozilla::detail::AssertionConditionType< decltype(!blockIndex)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!blockIndex))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!blockIndex", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2615); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!blockIndex" ")"); do { *((volatile int*)__null) = 2615; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2616 | VERIFY_PCB_START_END_PUSHED_CLEARED_FAILED(cb, 1, 1, 0, 0, 0){ ProfileChunkedBuffer::State state = (cb).GetState(); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mRangeStart == (1))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mRangeStart == (1)))), 0))) { do { } while (false ); MOZ_ReportAssertionFailure("state.mRangeStart == (1)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2616); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (1)" ")"); do { *((volatile int*)__null) = 2616; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd == (1))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mRangeEnd == (1)))), 0))) { do { } while (false ); MOZ_ReportAssertionFailure("state.mRangeEnd == (1)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2616); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (1)" ")"); do { *((volatile int*)__null) = 2616; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mPushedBlockCount == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mPushedBlockCount == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2616); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (0)" ")"); do { *((volatile int*)__null) = 2616; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2616); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)" ")"); do { *((volatile int*)__null) = 2616; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mFailedPutBytes == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mFailedPutBytes == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2616); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (0)" ")"); do { *((volatile int*)__null) = 2616; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); }; | |||
2617 | ||||
2618 | blockIndex = cb.PutObject(123); | |||
2619 | MOZ_RELEASE_ASSERT(!blockIndex)do { static_assert( mozilla::detail::AssertionConditionType< decltype(!blockIndex)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!blockIndex))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!blockIndex", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2619); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!blockIndex" ")"); do { *((volatile int*)__null) = 2619; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2620 | VERIFY_PCB_START_END_PUSHED_CLEARED_FAILED(cb, 1, 1, 0, 0, 0){ ProfileChunkedBuffer::State state = (cb).GetState(); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mRangeStart == (1))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mRangeStart == (1)))), 0))) { do { } while (false ); MOZ_ReportAssertionFailure("state.mRangeStart == (1)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2620); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (1)" ")"); do { *((volatile int*)__null) = 2620; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd == (1))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mRangeEnd == (1)))), 0))) { do { } while (false ); MOZ_ReportAssertionFailure("state.mRangeEnd == (1)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2620); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (1)" ")"); do { *((volatile int*)__null) = 2620; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mPushedBlockCount == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mPushedBlockCount == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2620); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (0)" ")"); do { *((volatile int*)__null) = 2620; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2620); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)" ")"); do { *((volatile int*)__null) = 2620; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mFailedPutBytes == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mFailedPutBytes == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2620); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (0)" ")"); do { *((volatile int*)__null) = 2620; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); }; | |||
2621 | ||||
2622 | auto chunks = cb.GetAllChunks(); | |||
2623 | static_assert(std::is_same_v<decltype(chunks), UniquePtr<ProfileBufferChunk>>, | |||
2624 | "ProfileChunkedBuffer::GetAllChunks() should return a " | |||
2625 | "UniquePtr<ProfileBufferChunk>"); | |||
2626 | MOZ_RELEASE_ASSERT(!chunks, "Expected no chunks when out-of-session")do { static_assert( mozilla::detail::AssertionConditionType< decltype(!chunks)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!chunks))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!chunks" " (" "Expected no chunks when out-of-session" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2626); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!chunks" ") (" "Expected no chunks when out-of-session" ")"); do { *( (volatile int*)__null) = 2626; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
2627 | ||||
2628 | bool ran = false; | |||
2629 | result = 0; | |||
2630 | result = cb.Read([&](ProfileChunkedBuffer::Reader* aReader) { | |||
2631 | ran = true; | |||
2632 | MOZ_RELEASE_ASSERT(!aReader)do { static_assert( mozilla::detail::AssertionConditionType< decltype(!aReader)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!aReader))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!aReader", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2632); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!aReader" ")"); do { *((volatile int*)__null) = 2632; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2633 | return 3; | |||
2634 | }); | |||
2635 | MOZ_RELEASE_ASSERT(ran)do { static_assert( mozilla::detail::AssertionConditionType< decltype(ran)>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(!!(ran))), 0))) { do { } while (false ); MOZ_ReportAssertionFailure("ran", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2635); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "ran" ")"); do { *((volatile int*)__null) = 2635; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2636 | MOZ_RELEASE_ASSERT(result == 3)do { static_assert( mozilla::detail::AssertionConditionType< decltype(result == 3)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(result == 3))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("result == 3", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2636); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "result == 3" ")"); do { *((volatile int*)__null) = 2636; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2637 | ||||
2638 | cb.ReadEach([](ProfileBufferEntryReader&) { MOZ_RELEASE_ASSERT(false)do { static_assert( mozilla::detail::AssertionConditionType< decltype(false)>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(!!(false))), 0))) { do { } while ( false); MOZ_ReportAssertionFailure("false", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2638); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "false" ")"); do { *((volatile int*)__null) = 2638; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); }); | |||
2639 | ||||
2640 | result = 0; | |||
2641 | result = cb.ReadAt(nullptr, [](Maybe<ProfileBufferEntryReader>&& er) { | |||
2642 | MOZ_RELEASE_ASSERT(er.isNothing())do { static_assert( mozilla::detail::AssertionConditionType< decltype(er.isNothing())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(er.isNothing()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("er.isNothing()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2642); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "er.isNothing()" ")"); do { *((volatile int*)__null) = 2642; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2643 | return 4; | |||
2644 | }); | |||
2645 | MOZ_RELEASE_ASSERT(result == 4)do { static_assert( mozilla::detail::AssertionConditionType< decltype(result == 4)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(result == 4))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("result == 4", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2645); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "result == 4" ")"); do { *((volatile int*)__null) = 2645; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2646 | ||||
2647 | // Use ProfileBufferChunkManagerWithLocalLimit, which will give away | |||
2648 | // ProfileBufferChunks that can contain 128 bytes, using up to 1KB of memory | |||
2649 | // (including usable 128 bytes and headers). | |||
2650 | constexpr size_t bufferMaxSize = 1024; | |||
2651 | constexpr ProfileChunkedBuffer::Length chunkMinSize = 128; | |||
2652 | ProfileBufferChunkManagerWithLocalLimit cm(bufferMaxSize, chunkMinSize); | |||
2653 | cb.SetChunkManager(cm); | |||
2654 | VERIFY_PCB_START_END_PUSHED_CLEARED_FAILED(cb, 1, 1, 0, 0, 0){ ProfileChunkedBuffer::State state = (cb).GetState(); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mRangeStart == (1))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mRangeStart == (1)))), 0))) { do { } while (false ); MOZ_ReportAssertionFailure("state.mRangeStart == (1)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2654); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (1)" ")"); do { *((volatile int*)__null) = 2654; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd == (1))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mRangeEnd == (1)))), 0))) { do { } while (false ); MOZ_ReportAssertionFailure("state.mRangeEnd == (1)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2654); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (1)" ")"); do { *((volatile int*)__null) = 2654; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mPushedBlockCount == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mPushedBlockCount == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2654); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (0)" ")"); do { *((volatile int*)__null) = 2654; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2654); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)" ")"); do { *((volatile int*)__null) = 2654; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mFailedPutBytes == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mFailedPutBytes == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2654); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (0)" ")"); do { *((volatile int*)__null) = 2654; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); }; | |||
2655 | ||||
2656 | // Let the chunk manager fulfill the initial request for an extra chunk. | |||
2657 | cm.FulfillChunkRequests(); | |||
2658 | ||||
2659 | MOZ_RELEASE_ASSERT(cm.MaxTotalSize() == bufferMaxSize)do { static_assert( mozilla::detail::AssertionConditionType< decltype(cm.MaxTotalSize() == bufferMaxSize)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(cm.MaxTotalSize() == bufferMaxSize ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "cm.MaxTotalSize() == bufferMaxSize", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2659); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "cm.MaxTotalSize() == bufferMaxSize" ")"); do { *((volatile int*)__null) = 2659; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2660 | MOZ_RELEASE_ASSERT(cb.BufferLength().isSome())do { static_assert( mozilla::detail::AssertionConditionType< decltype(cb.BufferLength().isSome())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(cb.BufferLength().isSome())) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("cb.BufferLength().isSome()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2660); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "cb.BufferLength().isSome()" ")"); do { *((volatile int*)__null) = 2660; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2661 | MOZ_RELEASE_ASSERT(*cb.BufferLength() == bufferMaxSize)do { static_assert( mozilla::detail::AssertionConditionType< decltype(*cb.BufferLength() == bufferMaxSize)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(*cb.BufferLength() == bufferMaxSize ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "*cb.BufferLength() == bufferMaxSize", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2661); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "*cb.BufferLength() == bufferMaxSize" ")"); do { *((volatile int*)__null) = 2661; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2662 | VERIFY_PCB_START_END_PUSHED_CLEARED_FAILED(cb, 1, 1, 0, 0, 0){ ProfileChunkedBuffer::State state = (cb).GetState(); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mRangeStart == (1))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mRangeStart == (1)))), 0))) { do { } while (false ); MOZ_ReportAssertionFailure("state.mRangeStart == (1)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2662); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (1)" ")"); do { *((volatile int*)__null) = 2662; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd == (1))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mRangeEnd == (1)))), 0))) { do { } while (false ); MOZ_ReportAssertionFailure("state.mRangeEnd == (1)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2662); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (1)" ")"); do { *((volatile int*)__null) = 2662; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mPushedBlockCount == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mPushedBlockCount == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2662); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (0)" ")"); do { *((volatile int*)__null) = 2662; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2662); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)" ")"); do { *((volatile int*)__null) = 2662; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mFailedPutBytes == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mFailedPutBytes == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2662); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (0)" ")"); do { *((volatile int*)__null) = 2662; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); }; | |||
2663 | ||||
2664 | // Write an int with the main `ReserveAndPut` function. | |||
2665 | const int test = 123; | |||
2666 | ran = false; | |||
2667 | blockIndex = nullptr; | |||
2668 | bool success = cb.ReserveAndPut( | |||
2669 | []() { return sizeof(test); }, | |||
2670 | [&](Maybe<ProfileBufferEntryWriter>& aEW) { | |||
2671 | ran = true; | |||
2672 | if (!aEW) { | |||
2673 | return false; | |||
2674 | } | |||
2675 | blockIndex = aEW->CurrentBlockIndex(); | |||
2676 | MOZ_RELEASE_ASSERT(aEW->RemainingBytes() == sizeof(test))do { static_assert( mozilla::detail::AssertionConditionType< decltype(aEW->RemainingBytes() == sizeof(test))>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(aEW->RemainingBytes() == sizeof(test)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("aEW->RemainingBytes() == sizeof(test)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2676); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "aEW->RemainingBytes() == sizeof(test)" ")"); do { *((volatile int*)__null) = 2676; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2677 | aEW->WriteObject(test); | |||
2678 | MOZ_RELEASE_ASSERT(aEW->RemainingBytes() == 0)do { static_assert( mozilla::detail::AssertionConditionType< decltype(aEW->RemainingBytes() == 0)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(aEW->RemainingBytes() == 0 ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "aEW->RemainingBytes() == 0", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2678); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "aEW->RemainingBytes() == 0" ")"); do { *((volatile int*)__null) = 2678; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2679 | return true; | |||
2680 | }); | |||
2681 | MOZ_RELEASE_ASSERT(ran)do { static_assert( mozilla::detail::AssertionConditionType< decltype(ran)>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(!!(ran))), 0))) { do { } while (false ); MOZ_ReportAssertionFailure("ran", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2681); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "ran" ")"); do { *((volatile int*)__null) = 2681; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2682 | MOZ_RELEASE_ASSERT(success)do { static_assert( mozilla::detail::AssertionConditionType< decltype(success)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(success))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("success", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2682); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "success" ")"); do { *((volatile int*)__null) = 2682; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2683 | MOZ_RELEASE_ASSERT(blockIndex.ConvertToProfileBufferIndex() == 1)do { static_assert( mozilla::detail::AssertionConditionType< decltype(blockIndex.ConvertToProfileBufferIndex() == 1)>:: isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(blockIndex.ConvertToProfileBufferIndex() == 1))), 0) )) { do { } while (false); MOZ_ReportAssertionFailure("blockIndex.ConvertToProfileBufferIndex() == 1" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2683); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "blockIndex.ConvertToProfileBufferIndex() == 1" ")"); do { *((volatile int*)__null) = 2683; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2684 | VERIFY_PCB_START_END_PUSHED_CLEARED_FAILED({ ProfileChunkedBuffer::State state = (cb).GetState(); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mRangeStart == (1))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mRangeStart == (1)))), 0))) { do { } while (false ); MOZ_ReportAssertionFailure("state.mRangeStart == (1)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2685); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (1)" ")"); do { *((volatile int*)__null) = 2685; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd == (1 + ULEB128Size(sizeof(test)) + sizeof(test)))>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(state.mRangeEnd == (1 + ULEB128Size(sizeof(test)) + sizeof (test))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mRangeEnd == (1 + ULEB128Size(sizeof(test)) + sizeof(test))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2685); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (1 + ULEB128Size(sizeof(test)) + sizeof(test))" ")"); do { *((volatile int*)__null) = 2685; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount == (1))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mPushedBlockCount == (1)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mPushedBlockCount == (1)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2685); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (1)" ")"); do { *((volatile int*)__null) = 2685; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2685); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)" ")"); do { *((volatile int*)__null) = 2685; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mFailedPutBytes == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mFailedPutBytes == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2685); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (0)" ")"); do { *((volatile int*)__null) = 2685; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); } | |||
2685 | cb, 1, 1 + ULEB128Size(sizeof(test)) + sizeof(test), 1, 0, 0){ ProfileChunkedBuffer::State state = (cb).GetState(); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mRangeStart == (1))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mRangeStart == (1)))), 0))) { do { } while (false ); MOZ_ReportAssertionFailure("state.mRangeStart == (1)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2685); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (1)" ")"); do { *((volatile int*)__null) = 2685; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd == (1 + ULEB128Size(sizeof(test)) + sizeof(test)))>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(state.mRangeEnd == (1 + ULEB128Size(sizeof(test)) + sizeof (test))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mRangeEnd == (1 + ULEB128Size(sizeof(test)) + sizeof(test))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2685); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (1 + ULEB128Size(sizeof(test)) + sizeof(test))" ")"); do { *((volatile int*)__null) = 2685; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount == (1))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mPushedBlockCount == (1)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mPushedBlockCount == (1)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2685); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (1)" ")"); do { *((volatile int*)__null) = 2685; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2685); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)" ")"); do { *((volatile int*)__null) = 2685; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mFailedPutBytes == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mFailedPutBytes == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2685); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (0)" ")"); do { *((volatile int*)__null) = 2685; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); }; | |||
2686 | ||||
2687 | ran = false; | |||
2688 | result = 0; | |||
2689 | result = cb.Read([&](ProfileChunkedBuffer::Reader* aReader) { | |||
2690 | ran = true; | |||
2691 | MOZ_RELEASE_ASSERT(!!aReader)do { static_assert( mozilla::detail::AssertionConditionType< decltype(!!aReader)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!!aReader))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!!aReader", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2691); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!!aReader" ")"); do { *((volatile int*)__null) = 2691; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2692 | // begin() and end() should be at the range edges (verified above). | |||
2693 | MOZ_RELEASE_ASSERT(do { static_assert( mozilla::detail::AssertionConditionType< decltype(aReader->begin().CurrentBlockIndex().ConvertToProfileBufferIndex () == 1)>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(aReader->begin().CurrentBlockIndex().ConvertToProfileBufferIndex () == 1))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("aReader->begin().CurrentBlockIndex().ConvertToProfileBufferIndex() == 1" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2695); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "aReader->begin().CurrentBlockIndex().ConvertToProfileBufferIndex() == 1" ")"); do { *((volatile int*)__null) = 2695; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
2694 | aReader->begin().CurrentBlockIndex().ConvertToProfileBufferIndex() ==do { static_assert( mozilla::detail::AssertionConditionType< decltype(aReader->begin().CurrentBlockIndex().ConvertToProfileBufferIndex () == 1)>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(aReader->begin().CurrentBlockIndex().ConvertToProfileBufferIndex () == 1))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("aReader->begin().CurrentBlockIndex().ConvertToProfileBufferIndex() == 1" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2695); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "aReader->begin().CurrentBlockIndex().ConvertToProfileBufferIndex() == 1" ")"); do { *((volatile int*)__null) = 2695; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
2695 | 1)do { static_assert( mozilla::detail::AssertionConditionType< decltype(aReader->begin().CurrentBlockIndex().ConvertToProfileBufferIndex () == 1)>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(aReader->begin().CurrentBlockIndex().ConvertToProfileBufferIndex () == 1))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("aReader->begin().CurrentBlockIndex().ConvertToProfileBufferIndex() == 1" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2695); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "aReader->begin().CurrentBlockIndex().ConvertToProfileBufferIndex() == 1" ")"); do { *((volatile int*)__null) = 2695; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2696 | MOZ_RELEASE_ASSERT(do { static_assert( mozilla::detail::AssertionConditionType< decltype(aReader->end().CurrentBlockIndex().ConvertToProfileBufferIndex () == 0)>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(aReader->end().CurrentBlockIndex().ConvertToProfileBufferIndex () == 0))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("aReader->end().CurrentBlockIndex().ConvertToProfileBufferIndex() == 0" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2697); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "aReader->end().CurrentBlockIndex().ConvertToProfileBufferIndex() == 0" ")"); do { *((volatile int*)__null) = 2697; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
2697 | aReader->end().CurrentBlockIndex().ConvertToProfileBufferIndex() == 0)do { static_assert( mozilla::detail::AssertionConditionType< decltype(aReader->end().CurrentBlockIndex().ConvertToProfileBufferIndex () == 0)>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(aReader->end().CurrentBlockIndex().ConvertToProfileBufferIndex () == 0))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("aReader->end().CurrentBlockIndex().ConvertToProfileBufferIndex() == 0" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2697); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "aReader->end().CurrentBlockIndex().ConvertToProfileBufferIndex() == 0" ")"); do { *((volatile int*)__null) = 2697; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2698 | // Null ProfileBufferBlockIndex clamped to the beginning. | |||
2699 | MOZ_RELEASE_ASSERT(aReader->At(nullptr) == aReader->begin())do { static_assert( mozilla::detail::AssertionConditionType< decltype(aReader->At(nullptr) == aReader->begin())>:: isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(aReader->At(nullptr) == aReader->begin()))), 0 ))) { do { } while (false); MOZ_ReportAssertionFailure("aReader->At(nullptr) == aReader->begin()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2699); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "aReader->At(nullptr) == aReader->begin()" ")"); do { *((volatile int*)__null) = 2699; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2700 | MOZ_RELEASE_ASSERT(aReader->At(blockIndex) == aReader->begin())do { static_assert( mozilla::detail::AssertionConditionType< decltype(aReader->At(blockIndex) == aReader->begin())> ::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(aReader->At(blockIndex) == aReader->begin()))) , 0))) { do { } while (false); MOZ_ReportAssertionFailure("aReader->At(blockIndex) == aReader->begin()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2700); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "aReader->At(blockIndex) == aReader->begin()" ")"); do { *((volatile int*)__null) = 2700; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2701 | // At(begin) same as begin(). | |||
2702 | MOZ_RELEASE_ASSERT(aReader->At(aReader->begin().CurrentBlockIndex()) ==do { static_assert( mozilla::detail::AssertionConditionType< decltype(aReader->At(aReader->begin().CurrentBlockIndex ()) == aReader->begin())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(aReader->At(aReader->begin ().CurrentBlockIndex()) == aReader->begin()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("aReader->At(aReader->begin().CurrentBlockIndex()) == aReader->begin()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2703); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "aReader->At(aReader->begin().CurrentBlockIndex()) == aReader->begin()" ")"); do { *((volatile int*)__null) = 2703; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
2703 | aReader->begin())do { static_assert( mozilla::detail::AssertionConditionType< decltype(aReader->At(aReader->begin().CurrentBlockIndex ()) == aReader->begin())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(aReader->At(aReader->begin ().CurrentBlockIndex()) == aReader->begin()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("aReader->At(aReader->begin().CurrentBlockIndex()) == aReader->begin()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2703); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "aReader->At(aReader->begin().CurrentBlockIndex()) == aReader->begin()" ")"); do { *((volatile int*)__null) = 2703; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2704 | // At(past block) same as end(). | |||
2705 | MOZ_RELEASE_ASSERT(do { static_assert( mozilla::detail::AssertionConditionType< decltype(aReader->At(ProfileBufferBlockIndex::CreateFromProfileBufferIndex ( 1 + 1 + sizeof(test))) == aReader->end())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(aReader->At(ProfileBufferBlockIndex ::CreateFromProfileBufferIndex( 1 + 1 + sizeof(test))) == aReader ->end()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("aReader->At(ProfileBufferBlockIndex::CreateFromProfileBufferIndex( 1 + 1 + sizeof(test))) == aReader->end()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2707); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "aReader->At(ProfileBufferBlockIndex::CreateFromProfileBufferIndex( 1 + 1 + sizeof(test))) == aReader->end()" ")"); do { *((volatile int*)__null) = 2707; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
2706 | aReader->At(ProfileBufferBlockIndex::CreateFromProfileBufferIndex(do { static_assert( mozilla::detail::AssertionConditionType< decltype(aReader->At(ProfileBufferBlockIndex::CreateFromProfileBufferIndex ( 1 + 1 + sizeof(test))) == aReader->end())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(aReader->At(ProfileBufferBlockIndex ::CreateFromProfileBufferIndex( 1 + 1 + sizeof(test))) == aReader ->end()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("aReader->At(ProfileBufferBlockIndex::CreateFromProfileBufferIndex( 1 + 1 + sizeof(test))) == aReader->end()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2707); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "aReader->At(ProfileBufferBlockIndex::CreateFromProfileBufferIndex( 1 + 1 + sizeof(test))) == aReader->end()" ")"); do { *((volatile int*)__null) = 2707; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
2707 | 1 + 1 + sizeof(test))) == aReader->end())do { static_assert( mozilla::detail::AssertionConditionType< decltype(aReader->At(ProfileBufferBlockIndex::CreateFromProfileBufferIndex ( 1 + 1 + sizeof(test))) == aReader->end())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(aReader->At(ProfileBufferBlockIndex ::CreateFromProfileBufferIndex( 1 + 1 + sizeof(test))) == aReader ->end()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("aReader->At(ProfileBufferBlockIndex::CreateFromProfileBufferIndex( 1 + 1 + sizeof(test))) == aReader->end()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2707); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "aReader->At(ProfileBufferBlockIndex::CreateFromProfileBufferIndex( 1 + 1 + sizeof(test))) == aReader->end()" ")"); do { *((volatile int*)__null) = 2707; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2708 | ||||
2709 | size_t read = 0; | |||
2710 | aReader->ForEach([&](ProfileBufferEntryReader& er) { | |||
2711 | ++read; | |||
2712 | MOZ_RELEASE_ASSERT(er.RemainingBytes() == sizeof(test))do { static_assert( mozilla::detail::AssertionConditionType< decltype(er.RemainingBytes() == sizeof(test))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(er.RemainingBytes() == sizeof (test)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("er.RemainingBytes() == sizeof(test)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2712); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "er.RemainingBytes() == sizeof(test)" ")"); do { *((volatile int*)__null) = 2712; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2713 | const auto value = er.ReadObject<decltype(test)>(); | |||
2714 | MOZ_RELEASE_ASSERT(value == test)do { static_assert( mozilla::detail::AssertionConditionType< decltype(value == test)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(value == test))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("value == test", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2714); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "value == test" ")"); do { *((volatile int*)__null) = 2714; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2715 | MOZ_RELEASE_ASSERT(er.RemainingBytes() == 0)do { static_assert( mozilla::detail::AssertionConditionType< decltype(er.RemainingBytes() == 0)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(er.RemainingBytes() == 0))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("er.RemainingBytes() == 0" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2715); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "er.RemainingBytes() == 0" ")"); do { *((volatile int*)__null) = 2715; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2716 | }); | |||
2717 | MOZ_RELEASE_ASSERT(read == 1)do { static_assert( mozilla::detail::AssertionConditionType< decltype(read == 1)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(read == 1))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("read == 1", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2717); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "read == 1" ")"); do { *((volatile int*)__null) = 2717; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2718 | ||||
2719 | read = 0; | |||
2720 | for (auto er : *aReader) { | |||
2721 | static_assert(std::is_same_v<decltype(er), ProfileBufferEntryReader>, | |||
2722 | "ProfileChunkedBuffer::Reader range-for should produce " | |||
2723 | "ProfileBufferEntryReader objects"); | |||
2724 | ++read; | |||
2725 | MOZ_RELEASE_ASSERT(er.RemainingBytes() == sizeof(test))do { static_assert( mozilla::detail::AssertionConditionType< decltype(er.RemainingBytes() == sizeof(test))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(er.RemainingBytes() == sizeof (test)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("er.RemainingBytes() == sizeof(test)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2725); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "er.RemainingBytes() == sizeof(test)" ")"); do { *((volatile int*)__null) = 2725; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2726 | const auto value = er.ReadObject<decltype(test)>(); | |||
2727 | MOZ_RELEASE_ASSERT(value == test)do { static_assert( mozilla::detail::AssertionConditionType< decltype(value == test)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(value == test))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("value == test", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2727); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "value == test" ")"); do { *((volatile int*)__null) = 2727; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2728 | MOZ_RELEASE_ASSERT(er.RemainingBytes() == 0)do { static_assert( mozilla::detail::AssertionConditionType< decltype(er.RemainingBytes() == 0)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(er.RemainingBytes() == 0))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("er.RemainingBytes() == 0" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2728); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "er.RemainingBytes() == 0" ")"); do { *((volatile int*)__null) = 2728; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2729 | }; | |||
2730 | MOZ_RELEASE_ASSERT(read == 1)do { static_assert( mozilla::detail::AssertionConditionType< decltype(read == 1)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(read == 1))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("read == 1", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2730); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "read == 1" ")"); do { *((volatile int*)__null) = 2730; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2731 | return 5; | |||
2732 | }); | |||
2733 | MOZ_RELEASE_ASSERT(ran)do { static_assert( mozilla::detail::AssertionConditionType< decltype(ran)>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(!!(ran))), 0))) { do { } while (false ); MOZ_ReportAssertionFailure("ran", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2733); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "ran" ")"); do { *((volatile int*)__null) = 2733; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2734 | MOZ_RELEASE_ASSERT(result == 5)do { static_assert( mozilla::detail::AssertionConditionType< decltype(result == 5)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(result == 5))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("result == 5", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2734); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "result == 5" ")"); do { *((volatile int*)__null) = 2734; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2735 | ||||
2736 | // Read the int directly from the ProfileChunkedBuffer, without block index. | |||
2737 | size_t read = 0; | |||
2738 | cb.ReadEach([&](ProfileBufferEntryReader& er) { | |||
2739 | ++read; | |||
2740 | MOZ_RELEASE_ASSERT(er.RemainingBytes() == sizeof(test))do { static_assert( mozilla::detail::AssertionConditionType< decltype(er.RemainingBytes() == sizeof(test))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(er.RemainingBytes() == sizeof (test)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("er.RemainingBytes() == sizeof(test)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2740); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "er.RemainingBytes() == sizeof(test)" ")"); do { *((volatile int*)__null) = 2740; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2741 | const auto value = er.ReadObject<decltype(test)>(); | |||
2742 | MOZ_RELEASE_ASSERT(value == test)do { static_assert( mozilla::detail::AssertionConditionType< decltype(value == test)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(value == test))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("value == test", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2742); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "value == test" ")"); do { *((volatile int*)__null) = 2742; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2743 | MOZ_RELEASE_ASSERT(er.RemainingBytes() == 0)do { static_assert( mozilla::detail::AssertionConditionType< decltype(er.RemainingBytes() == 0)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(er.RemainingBytes() == 0))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("er.RemainingBytes() == 0" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2743); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "er.RemainingBytes() == 0" ")"); do { *((volatile int*)__null) = 2743; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2744 | }); | |||
2745 | MOZ_RELEASE_ASSERT(read == 1)do { static_assert( mozilla::detail::AssertionConditionType< decltype(read == 1)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(read == 1))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("read == 1", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2745); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "read == 1" ")"); do { *((volatile int*)__null) = 2745; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2746 | ||||
2747 | // Read the int directly from the ProfileChunkedBuffer, with block index. | |||
2748 | read = 0; | |||
2749 | blockIndex = nullptr; | |||
2750 | cb.ReadEach( | |||
2751 | [&](ProfileBufferEntryReader& er, ProfileBufferBlockIndex aBlockIndex) { | |||
2752 | ++read; | |||
2753 | MOZ_RELEASE_ASSERT(!!aBlockIndex)do { static_assert( mozilla::detail::AssertionConditionType< decltype(!!aBlockIndex)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!!aBlockIndex))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!!aBlockIndex", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2753); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!!aBlockIndex" ")"); do { *((volatile int*)__null) = 2753; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2754 | MOZ_RELEASE_ASSERT(!blockIndex)do { static_assert( mozilla::detail::AssertionConditionType< decltype(!blockIndex)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!blockIndex))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!blockIndex", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2754); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!blockIndex" ")"); do { *((volatile int*)__null) = 2754; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2755 | blockIndex = aBlockIndex; | |||
2756 | MOZ_RELEASE_ASSERT(er.RemainingBytes() == sizeof(test))do { static_assert( mozilla::detail::AssertionConditionType< decltype(er.RemainingBytes() == sizeof(test))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(er.RemainingBytes() == sizeof (test)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("er.RemainingBytes() == sizeof(test)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2756); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "er.RemainingBytes() == sizeof(test)" ")"); do { *((volatile int*)__null) = 2756; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2757 | const auto value = er.ReadObject<decltype(test)>(); | |||
2758 | MOZ_RELEASE_ASSERT(value == test)do { static_assert( mozilla::detail::AssertionConditionType< decltype(value == test)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(value == test))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("value == test", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2758); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "value == test" ")"); do { *((volatile int*)__null) = 2758; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2759 | MOZ_RELEASE_ASSERT(er.RemainingBytes() == 0)do { static_assert( mozilla::detail::AssertionConditionType< decltype(er.RemainingBytes() == 0)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(er.RemainingBytes() == 0))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("er.RemainingBytes() == 0" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2759); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "er.RemainingBytes() == 0" ")"); do { *((volatile int*)__null) = 2759; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2760 | }); | |||
2761 | MOZ_RELEASE_ASSERT(read == 1)do { static_assert( mozilla::detail::AssertionConditionType< decltype(read == 1)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(read == 1))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("read == 1", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2761); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "read == 1" ")"); do { *((volatile int*)__null) = 2761; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2762 | MOZ_RELEASE_ASSERT(!!blockIndex)do { static_assert( mozilla::detail::AssertionConditionType< decltype(!!blockIndex)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!!blockIndex))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!!blockIndex", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2762); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!!blockIndex" ")"); do { *((volatile int*)__null) = 2762; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2763 | MOZ_RELEASE_ASSERT(blockIndex != nullptr)do { static_assert( mozilla::detail::AssertionConditionType< decltype(blockIndex != nullptr)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(blockIndex != nullptr))), 0) )) { do { } while (false); MOZ_ReportAssertionFailure("blockIndex != nullptr" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2763); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "blockIndex != nullptr" ")"); do { *((volatile int*)__null) = 2763; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2764 | ||||
2765 | // Read the int from its block index. | |||
2766 | read = 0; | |||
2767 | result = 0; | |||
2768 | result = cb.ReadAt(blockIndex, [&](Maybe<ProfileBufferEntryReader>&& er) { | |||
2769 | ++read; | |||
2770 | MOZ_RELEASE_ASSERT(er.isSome())do { static_assert( mozilla::detail::AssertionConditionType< decltype(er.isSome())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(er.isSome()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("er.isSome()", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2770); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "er.isSome()" ")"); do { *((volatile int*)__null) = 2770; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2771 | MOZ_RELEASE_ASSERT(er->CurrentBlockIndex() == blockIndex)do { static_assert( mozilla::detail::AssertionConditionType< decltype(er->CurrentBlockIndex() == blockIndex)>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(er->CurrentBlockIndex() == blockIndex))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("er->CurrentBlockIndex() == blockIndex" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2771); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "er->CurrentBlockIndex() == blockIndex" ")"); do { *((volatile int*)__null) = 2771; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2772 | MOZ_RELEASE_ASSERT(!er->NextBlockIndex())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!er->NextBlockIndex())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!er->NextBlockIndex()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!er->NextBlockIndex()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2772); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!er->NextBlockIndex()" ")"); do { *((volatile int*)__null) = 2772; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2773 | MOZ_RELEASE_ASSERT(er->RemainingBytes() == sizeof(test))do { static_assert( mozilla::detail::AssertionConditionType< decltype(er->RemainingBytes() == sizeof(test))>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(er->RemainingBytes() == sizeof(test)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("er->RemainingBytes() == sizeof(test)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2773); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "er->RemainingBytes() == sizeof(test)" ")"); do { *((volatile int*)__null) = 2773; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2774 | const auto value = er->ReadObject<decltype(test)>(); | |||
2775 | MOZ_RELEASE_ASSERT(value == test)do { static_assert( mozilla::detail::AssertionConditionType< decltype(value == test)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(value == test))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("value == test", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2775); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "value == test" ")"); do { *((volatile int*)__null) = 2775; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2776 | MOZ_RELEASE_ASSERT(er->RemainingBytes() == 0)do { static_assert( mozilla::detail::AssertionConditionType< decltype(er->RemainingBytes() == 0)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(er->RemainingBytes() == 0 ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "er->RemainingBytes() == 0", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2776); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "er->RemainingBytes() == 0" ")"); do { *((volatile int*)__null) = 2776; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2777 | return 6; | |||
2778 | }); | |||
2779 | MOZ_RELEASE_ASSERT(result == 6)do { static_assert( mozilla::detail::AssertionConditionType< decltype(result == 6)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(result == 6))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("result == 6", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2779); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "result == 6" ")"); do { *((volatile int*)__null) = 2779; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2780 | MOZ_RELEASE_ASSERT(read == 1)do { static_assert( mozilla::detail::AssertionConditionType< decltype(read == 1)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(read == 1))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("read == 1", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2780); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "read == 1" ")"); do { *((volatile int*)__null) = 2780; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2781 | ||||
2782 | MOZ_RELEASE_ASSERT(!cb.IsIndexInCurrentChunk(ProfileBufferIndex{}))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!cb.IsIndexInCurrentChunk(ProfileBufferIndex{}))> ::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(!cb.IsIndexInCurrentChunk(ProfileBufferIndex{})))), 0 ))) { do { } while (false); MOZ_ReportAssertionFailure("!cb.IsIndexInCurrentChunk(ProfileBufferIndex{})" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2782); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!cb.IsIndexInCurrentChunk(ProfileBufferIndex{})" ")"); do { *((volatile int*)__null) = 2782; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2783 | MOZ_RELEASE_ASSERT(do { static_assert( mozilla::detail::AssertionConditionType< decltype(cb.IsIndexInCurrentChunk(blockIndex.ConvertToProfileBufferIndex ()))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(cb.IsIndexInCurrentChunk(blockIndex.ConvertToProfileBufferIndex ())))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("cb.IsIndexInCurrentChunk(blockIndex.ConvertToProfileBufferIndex())" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2784); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "cb.IsIndexInCurrentChunk(blockIndex.ConvertToProfileBufferIndex())" ")"); do { *((volatile int*)__null) = 2784; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
2784 | cb.IsIndexInCurrentChunk(blockIndex.ConvertToProfileBufferIndex()))do { static_assert( mozilla::detail::AssertionConditionType< decltype(cb.IsIndexInCurrentChunk(blockIndex.ConvertToProfileBufferIndex ()))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(cb.IsIndexInCurrentChunk(blockIndex.ConvertToProfileBufferIndex ())))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("cb.IsIndexInCurrentChunk(blockIndex.ConvertToProfileBufferIndex())" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2784); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "cb.IsIndexInCurrentChunk(blockIndex.ConvertToProfileBufferIndex())" ")"); do { *((volatile int*)__null) = 2784; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2785 | MOZ_RELEASE_ASSERT(cb.IsIndexInCurrentChunk(cb.GetState().mRangeEnd - 1))do { static_assert( mozilla::detail::AssertionConditionType< decltype(cb.IsIndexInCurrentChunk(cb.GetState().mRangeEnd - 1 ))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(cb.IsIndexInCurrentChunk(cb.GetState().mRangeEnd - 1 )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("cb.IsIndexInCurrentChunk(cb.GetState().mRangeEnd - 1)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2785); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "cb.IsIndexInCurrentChunk(cb.GetState().mRangeEnd - 1)" ")"); do { *((volatile int*)__null) = 2785; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2786 | MOZ_RELEASE_ASSERT(!cb.IsIndexInCurrentChunk(cb.GetState().mRangeEnd))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!cb.IsIndexInCurrentChunk(cb.GetState().mRangeEnd))> ::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(!cb.IsIndexInCurrentChunk(cb.GetState().mRangeEnd))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!cb.IsIndexInCurrentChunk(cb.GetState().mRangeEnd)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2786); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!cb.IsIndexInCurrentChunk(cb.GetState().mRangeEnd)" ")"); do { *((volatile int*)__null) = 2786; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2787 | ||||
2788 | // No changes after reads. | |||
2789 | VERIFY_PCB_START_END_PUSHED_CLEARED_FAILED({ ProfileChunkedBuffer::State state = (cb).GetState(); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mRangeStart == (1))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mRangeStart == (1)))), 0))) { do { } while (false ); MOZ_ReportAssertionFailure("state.mRangeStart == (1)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2790); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (1)" ")"); do { *((volatile int*)__null) = 2790; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd == (1 + ULEB128Size(sizeof(test)) + sizeof(test)))>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(state.mRangeEnd == (1 + ULEB128Size(sizeof(test)) + sizeof (test))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mRangeEnd == (1 + ULEB128Size(sizeof(test)) + sizeof(test))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2790); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (1 + ULEB128Size(sizeof(test)) + sizeof(test))" ")"); do { *((volatile int*)__null) = 2790; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount == (1))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mPushedBlockCount == (1)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mPushedBlockCount == (1)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2790); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (1)" ")"); do { *((volatile int*)__null) = 2790; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2790); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)" ")"); do { *((volatile int*)__null) = 2790; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mFailedPutBytes == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mFailedPutBytes == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2790); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (0)" ")"); do { *((volatile int*)__null) = 2790; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); } | |||
2790 | cb, 1, 1 + ULEB128Size(sizeof(test)) + sizeof(test), 1, 0, 0){ ProfileChunkedBuffer::State state = (cb).GetState(); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mRangeStart == (1))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mRangeStart == (1)))), 0))) { do { } while (false ); MOZ_ReportAssertionFailure("state.mRangeStart == (1)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2790); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (1)" ")"); do { *((volatile int*)__null) = 2790; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd == (1 + ULEB128Size(sizeof(test)) + sizeof(test)))>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(state.mRangeEnd == (1 + ULEB128Size(sizeof(test)) + sizeof (test))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mRangeEnd == (1 + ULEB128Size(sizeof(test)) + sizeof(test))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2790); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (1 + ULEB128Size(sizeof(test)) + sizeof(test))" ")"); do { *((volatile int*)__null) = 2790; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount == (1))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mPushedBlockCount == (1)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mPushedBlockCount == (1)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2790); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (1)" ")"); do { *((volatile int*)__null) = 2790; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2790); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)" ")"); do { *((volatile int*)__null) = 2790; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mFailedPutBytes == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mFailedPutBytes == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2790); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (0)" ")"); do { *((volatile int*)__null) = 2790; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); }; | |||
2791 | ||||
2792 | // Steal the underlying ProfileBufferChunks from the ProfileChunkedBuffer. | |||
2793 | chunks = cb.GetAllChunks(); | |||
2794 | MOZ_RELEASE_ASSERT(!!chunks, "Expected at least one chunk")do { static_assert( mozilla::detail::AssertionConditionType< decltype(!!chunks)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!!chunks))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!!chunks" " (" "Expected at least one chunk" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2794); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!!chunks" ") (" "Expected at least one chunk" ")"); do { *((volatile int *)__null) = 2794; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | |||
2795 | MOZ_RELEASE_ASSERT(!!chunks->GetNext(), "Expected two chunks")do { static_assert( mozilla::detail::AssertionConditionType< decltype(!!chunks->GetNext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!!chunks->GetNext()))), 0 ))) { do { } while (false); MOZ_ReportAssertionFailure("!!chunks->GetNext()" " (" "Expected two chunks" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2795); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!!chunks->GetNext()" ") (" "Expected two chunks" ")"); do { *((volatile int*)__null ) = 2795; __attribute__((nomerge)) ::abort(); } while (false) ; } } while (false); | |||
2796 | MOZ_RELEASE_ASSERT(!chunks->GetNext()->GetNext(), "Expected only two chunks")do { static_assert( mozilla::detail::AssertionConditionType< decltype(!chunks->GetNext()->GetNext())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!chunks->GetNext()->GetNext ()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("!chunks->GetNext()->GetNext()" " (" "Expected only two chunks" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2796); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!chunks->GetNext()->GetNext()" ") (" "Expected only two chunks" ")"); do { *((volatile int* )__null) = 2796; __attribute__((nomerge)) ::abort(); } while ( false); } } while (false); | |||
2797 | const ProfileChunkedBuffer::Length chunkActualSize = chunks->BufferBytes(); | |||
2798 | MOZ_RELEASE_ASSERT(chunkActualSize >= chunkMinSize)do { static_assert( mozilla::detail::AssertionConditionType< decltype(chunkActualSize >= chunkMinSize)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(chunkActualSize >= chunkMinSize ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "chunkActualSize >= chunkMinSize", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2798); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunkActualSize >= chunkMinSize" ")"); do { *((volatile int*)__null) = 2798; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2799 | MOZ_RELEASE_ASSERT(chunks->RangeStart() == 1)do { static_assert( mozilla::detail::AssertionConditionType< decltype(chunks->RangeStart() == 1)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(chunks->RangeStart() == 1 ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "chunks->RangeStart() == 1", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2799); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunks->RangeStart() == 1" ")"); do { *((volatile int*)__null) = 2799; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2800 | MOZ_RELEASE_ASSERT(chunks->OffsetFirstBlock() == 0)do { static_assert( mozilla::detail::AssertionConditionType< decltype(chunks->OffsetFirstBlock() == 0)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(chunks->OffsetFirstBlock( ) == 0))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("chunks->OffsetFirstBlock() == 0", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2800); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunks->OffsetFirstBlock() == 0" ")"); do { *((volatile int*)__null) = 2800; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2801 | MOZ_RELEASE_ASSERT(chunks->OffsetPastLastBlock() == 1 + sizeof(test))do { static_assert( mozilla::detail::AssertionConditionType< decltype(chunks->OffsetPastLastBlock() == 1 + sizeof(test) )>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(chunks->OffsetPastLastBlock() == 1 + sizeof(test) ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "chunks->OffsetPastLastBlock() == 1 + sizeof(test)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2801); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "chunks->OffsetPastLastBlock() == 1 + sizeof(test)" ")"); do { *((volatile int*)__null) = 2801; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2802 | ||||
2803 | // GetAllChunks() should have advanced the index one full chunk forward. | |||
2804 | VERIFY_PCB_START_END_PUSHED_CLEARED_FAILED(cb, 1 + chunkActualSize,{ ProfileChunkedBuffer::State state = (cb).GetState(); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mRangeStart == (1 + chunkActualSize))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(state.mRangeStart == (1 + chunkActualSize )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mRangeStart == (1 + chunkActualSize)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2805); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (1 + chunkActualSize)" ")"); do { *((volatile int*)__null) = 2805; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd == (1 + chunkActualSize))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(state.mRangeEnd == (1 + chunkActualSize )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mRangeEnd == (1 + chunkActualSize)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2805); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (1 + chunkActualSize)" ")"); do { *((volatile int*)__null) = 2805; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount == (1))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mPushedBlockCount == (1)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mPushedBlockCount == (1)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2805); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (1)" ")"); do { *((volatile int*)__null) = 2805; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2805); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)" ")"); do { *((volatile int*)__null) = 2805; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mFailedPutBytes == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mFailedPutBytes == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2805); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (0)" ")"); do { *((volatile int*)__null) = 2805; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); } | |||
2805 | 1 + chunkActualSize, 1, 0, 0){ ProfileChunkedBuffer::State state = (cb).GetState(); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mRangeStart == (1 + chunkActualSize))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(state.mRangeStart == (1 + chunkActualSize )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mRangeStart == (1 + chunkActualSize)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2805); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (1 + chunkActualSize)" ")"); do { *((volatile int*)__null) = 2805; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd == (1 + chunkActualSize))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(state.mRangeEnd == (1 + chunkActualSize )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mRangeEnd == (1 + chunkActualSize)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2805); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (1 + chunkActualSize)" ")"); do { *((volatile int*)__null) = 2805; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount == (1))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mPushedBlockCount == (1)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mPushedBlockCount == (1)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2805); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (1)" ")"); do { *((volatile int*)__null) = 2805; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2805); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)" ")"); do { *((volatile int*)__null) = 2805; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mFailedPutBytes == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mFailedPutBytes == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2805); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (0)" ")"); do { *((volatile int*)__null) = 2805; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); }; | |||
2806 | ||||
2807 | // Nothing more to read from the now-empty ProfileChunkedBuffer. | |||
2808 | cb.ReadEach([](ProfileBufferEntryReader&) { MOZ_RELEASE_ASSERT(false)do { static_assert( mozilla::detail::AssertionConditionType< decltype(false)>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(!!(false))), 0))) { do { } while ( false); MOZ_ReportAssertionFailure("false", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2808); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "false" ")"); do { *((volatile int*)__null) = 2808; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); }); | |||
2809 | cb.ReadEach([](ProfileBufferEntryReader&, ProfileBufferBlockIndex) { | |||
2810 | MOZ_RELEASE_ASSERT(false)do { static_assert( mozilla::detail::AssertionConditionType< decltype(false)>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(!!(false))), 0))) { do { } while ( false); MOZ_ReportAssertionFailure("false", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2810); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "false" ")"); do { *((volatile int*)__null) = 2810; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2811 | }); | |||
2812 | result = 0; | |||
2813 | result = cb.ReadAt(nullptr, [](Maybe<ProfileBufferEntryReader>&& er) { | |||
2814 | MOZ_RELEASE_ASSERT(er.isNothing())do { static_assert( mozilla::detail::AssertionConditionType< decltype(er.isNothing())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(er.isNothing()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("er.isNothing()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2814); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "er.isNothing()" ")"); do { *((volatile int*)__null) = 2814; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2815 | return 7; | |||
2816 | }); | |||
2817 | MOZ_RELEASE_ASSERT(result == 7)do { static_assert( mozilla::detail::AssertionConditionType< decltype(result == 7)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(result == 7))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("result == 7", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2817); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "result == 7" ")"); do { *((volatile int*)__null) = 2817; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2818 | ||||
2819 | // Read the int from the stolen chunks. | |||
2820 | read = 0; | |||
2821 | ProfileChunkedBuffer::ReadEach( | |||
2822 | chunks.get(), nullptr, | |||
2823 | [&](ProfileBufferEntryReader& er, ProfileBufferBlockIndex aBlockIndex) { | |||
2824 | ++read; | |||
2825 | MOZ_RELEASE_ASSERT(aBlockIndex == blockIndex)do { static_assert( mozilla::detail::AssertionConditionType< decltype(aBlockIndex == blockIndex)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(aBlockIndex == blockIndex))) , 0))) { do { } while (false); MOZ_ReportAssertionFailure("aBlockIndex == blockIndex" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2825); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "aBlockIndex == blockIndex" ")"); do { *((volatile int*)__null) = 2825; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2826 | MOZ_RELEASE_ASSERT(er.RemainingBytes() == sizeof(test))do { static_assert( mozilla::detail::AssertionConditionType< decltype(er.RemainingBytes() == sizeof(test))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(er.RemainingBytes() == sizeof (test)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("er.RemainingBytes() == sizeof(test)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2826); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "er.RemainingBytes() == sizeof(test)" ")"); do { *((volatile int*)__null) = 2826; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2827 | const auto value = er.ReadObject<decltype(test)>(); | |||
2828 | MOZ_RELEASE_ASSERT(value == test)do { static_assert( mozilla::detail::AssertionConditionType< decltype(value == test)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(value == test))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("value == test", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2828); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "value == test" ")"); do { *((volatile int*)__null) = 2828; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2829 | MOZ_RELEASE_ASSERT(er.RemainingBytes() == 0)do { static_assert( mozilla::detail::AssertionConditionType< decltype(er.RemainingBytes() == 0)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(er.RemainingBytes() == 0))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("er.RemainingBytes() == 0" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2829); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "er.RemainingBytes() == 0" ")"); do { *((volatile int*)__null) = 2829; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2830 | }); | |||
2831 | MOZ_RELEASE_ASSERT(read == 1)do { static_assert( mozilla::detail::AssertionConditionType< decltype(read == 1)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(read == 1))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("read == 1", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2831); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "read == 1" ")"); do { *((volatile int*)__null) = 2831; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2832 | ||||
2833 | // No changes after reads. | |||
2834 | VERIFY_PCB_START_END_PUSHED_CLEARED_FAILED(cb, 1 + chunkActualSize,{ ProfileChunkedBuffer::State state = (cb).GetState(); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mRangeStart == (1 + chunkActualSize))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(state.mRangeStart == (1 + chunkActualSize )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mRangeStart == (1 + chunkActualSize)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2835); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (1 + chunkActualSize)" ")"); do { *((volatile int*)__null) = 2835; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd == (1 + chunkActualSize))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(state.mRangeEnd == (1 + chunkActualSize )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mRangeEnd == (1 + chunkActualSize)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2835); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (1 + chunkActualSize)" ")"); do { *((volatile int*)__null) = 2835; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount == (1))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mPushedBlockCount == (1)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mPushedBlockCount == (1)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2835); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (1)" ")"); do { *((volatile int*)__null) = 2835; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2835); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)" ")"); do { *((volatile int*)__null) = 2835; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mFailedPutBytes == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mFailedPutBytes == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2835); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (0)" ")"); do { *((volatile int*)__null) = 2835; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); } | |||
2835 | 1 + chunkActualSize, 1, 0, 0){ ProfileChunkedBuffer::State state = (cb).GetState(); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mRangeStart == (1 + chunkActualSize))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(state.mRangeStart == (1 + chunkActualSize )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mRangeStart == (1 + chunkActualSize)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2835); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (1 + chunkActualSize)" ")"); do { *((volatile int*)__null) = 2835; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd == (1 + chunkActualSize))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(state.mRangeEnd == (1 + chunkActualSize )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mRangeEnd == (1 + chunkActualSize)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2835); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (1 + chunkActualSize)" ")"); do { *((volatile int*)__null) = 2835; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount == (1))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mPushedBlockCount == (1)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mPushedBlockCount == (1)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2835); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (1)" ")"); do { *((volatile int*)__null) = 2835; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2835); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)" ")"); do { *((volatile int*)__null) = 2835; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mFailedPutBytes == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mFailedPutBytes == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2835); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (0)" ")"); do { *((volatile int*)__null) = 2835; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); }; | |||
2836 | ||||
2837 | // Write lots of numbers (by memcpy), which should trigger Chunk destructions. | |||
2838 | ProfileBufferBlockIndex firstBlockIndex; | |||
2839 | MOZ_RELEASE_ASSERT(!firstBlockIndex)do { static_assert( mozilla::detail::AssertionConditionType< decltype(!firstBlockIndex)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!firstBlockIndex))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!firstBlockIndex" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2839); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!firstBlockIndex" ")"); do { *((volatile int*)__null) = 2839; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2840 | ProfileBufferBlockIndex lastBlockIndex; | |||
2841 | MOZ_RELEASE_ASSERT(!lastBlockIndex)do { static_assert( mozilla::detail::AssertionConditionType< decltype(!lastBlockIndex)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!lastBlockIndex))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!lastBlockIndex" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2841); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!lastBlockIndex" ")"); do { *((volatile int*)__null) = 2841; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2842 | const size_t lots = 2 * bufferMaxSize / (1 + sizeof(int)); | |||
2843 | for (size_t i = 1; i < lots; ++i) { | |||
2844 | ProfileBufferBlockIndex blockIndex = cb.PutFrom(&i, sizeof(i)); | |||
2845 | MOZ_RELEASE_ASSERT(!!blockIndex)do { static_assert( mozilla::detail::AssertionConditionType< decltype(!!blockIndex)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!!blockIndex))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!!blockIndex", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2845); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!!blockIndex" ")"); do { *((volatile int*)__null) = 2845; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2846 | MOZ_RELEASE_ASSERT(blockIndex > firstBlockIndex)do { static_assert( mozilla::detail::AssertionConditionType< decltype(blockIndex > firstBlockIndex)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(blockIndex > firstBlockIndex ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "blockIndex > firstBlockIndex", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2846); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "blockIndex > firstBlockIndex" ")"); do { *((volatile int*)__null) = 2846; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2847 | if (!firstBlockIndex) { | |||
2848 | firstBlockIndex = blockIndex; | |||
2849 | } | |||
2850 | MOZ_RELEASE_ASSERT(blockIndex > lastBlockIndex)do { static_assert( mozilla::detail::AssertionConditionType< decltype(blockIndex > lastBlockIndex)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(blockIndex > lastBlockIndex ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "blockIndex > lastBlockIndex", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2850); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "blockIndex > lastBlockIndex" ")"); do { *((volatile int*)__null) = 2850; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2851 | lastBlockIndex = blockIndex; | |||
2852 | } | |||
2853 | ||||
2854 | ProfileChunkedBuffer::State stateAfterPuts = cb.GetState(); | |||
2855 | ProfileBufferIndex startAfterPuts = stateAfterPuts.mRangeStart; | |||
2856 | MOZ_RELEASE_ASSERT(startAfterPuts > 1 + chunkActualSize)do { static_assert( mozilla::detail::AssertionConditionType< decltype(startAfterPuts > 1 + chunkActualSize)>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(startAfterPuts > 1 + chunkActualSize))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("startAfterPuts > 1 + chunkActualSize" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2856); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "startAfterPuts > 1 + chunkActualSize" ")"); do { *((volatile int*)__null) = 2856; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2857 | ProfileBufferIndex endAfterPuts = stateAfterPuts.mRangeEnd; | |||
2858 | MOZ_RELEASE_ASSERT(endAfterPuts > startAfterPuts)do { static_assert( mozilla::detail::AssertionConditionType< decltype(endAfterPuts > startAfterPuts)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(endAfterPuts > startAfterPuts ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "endAfterPuts > startAfterPuts", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2858); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "endAfterPuts > startAfterPuts" ")"); do { *((volatile int*)__null) = 2858; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2859 | uint64_t pushedAfterPuts = stateAfterPuts.mPushedBlockCount; | |||
2860 | MOZ_RELEASE_ASSERT(pushedAfterPuts > 0)do { static_assert( mozilla::detail::AssertionConditionType< decltype(pushedAfterPuts > 0)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(pushedAfterPuts > 0))), 0 ))) { do { } while (false); MOZ_ReportAssertionFailure("pushedAfterPuts > 0" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2860); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "pushedAfterPuts > 0" ")"); do { *((volatile int*)__null) = 2860; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2861 | uint64_t clearedAfterPuts = stateAfterPuts.mClearedBlockCount; | |||
2862 | MOZ_RELEASE_ASSERT(clearedAfterPuts > 0)do { static_assert( mozilla::detail::AssertionConditionType< decltype(clearedAfterPuts > 0)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(clearedAfterPuts > 0))), 0 ))) { do { } while (false); MOZ_ReportAssertionFailure("clearedAfterPuts > 0" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2862); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "clearedAfterPuts > 0" ")"); do { *((volatile int*)__null) = 2862; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2863 | MOZ_RELEASE_ASSERT(stateAfterPuts.mFailedPutBytes == 0)do { static_assert( mozilla::detail::AssertionConditionType< decltype(stateAfterPuts.mFailedPutBytes == 0)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(stateAfterPuts.mFailedPutBytes == 0))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("stateAfterPuts.mFailedPutBytes == 0", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2863); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "stateAfterPuts.mFailedPutBytes == 0" ")"); do { *((volatile int*)__null) = 2863; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2864 | MOZ_RELEASE_ASSERT(!cb.IsIndexInCurrentChunk(ProfileBufferIndex{}))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!cb.IsIndexInCurrentChunk(ProfileBufferIndex{}))> ::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(!cb.IsIndexInCurrentChunk(ProfileBufferIndex{})))), 0 ))) { do { } while (false); MOZ_ReportAssertionFailure("!cb.IsIndexInCurrentChunk(ProfileBufferIndex{})" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2864); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!cb.IsIndexInCurrentChunk(ProfileBufferIndex{})" ")"); do { *((volatile int*)__null) = 2864; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2865 | MOZ_RELEASE_ASSERT(do { static_assert( mozilla::detail::AssertionConditionType< decltype(!cb.IsIndexInCurrentChunk(blockIndex.ConvertToProfileBufferIndex ()))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(!cb.IsIndexInCurrentChunk(blockIndex.ConvertToProfileBufferIndex ())))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("!cb.IsIndexInCurrentChunk(blockIndex.ConvertToProfileBufferIndex())" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2866); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!cb.IsIndexInCurrentChunk(blockIndex.ConvertToProfileBufferIndex())" ")"); do { *((volatile int*)__null) = 2866; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
2866 | !cb.IsIndexInCurrentChunk(blockIndex.ConvertToProfileBufferIndex()))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!cb.IsIndexInCurrentChunk(blockIndex.ConvertToProfileBufferIndex ()))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(!cb.IsIndexInCurrentChunk(blockIndex.ConvertToProfileBufferIndex ())))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("!cb.IsIndexInCurrentChunk(blockIndex.ConvertToProfileBufferIndex())" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2866); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!cb.IsIndexInCurrentChunk(blockIndex.ConvertToProfileBufferIndex())" ")"); do { *((volatile int*)__null) = 2866; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2867 | MOZ_RELEASE_ASSERT(do { static_assert( mozilla::detail::AssertionConditionType< decltype(!cb.IsIndexInCurrentChunk(firstBlockIndex.ConvertToProfileBufferIndex ()))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(!cb.IsIndexInCurrentChunk(firstBlockIndex.ConvertToProfileBufferIndex ())))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("!cb.IsIndexInCurrentChunk(firstBlockIndex.ConvertToProfileBufferIndex())" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2868); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!cb.IsIndexInCurrentChunk(firstBlockIndex.ConvertToProfileBufferIndex())" ")"); do { *((volatile int*)__null) = 2868; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
2868 | !cb.IsIndexInCurrentChunk(firstBlockIndex.ConvertToProfileBufferIndex()))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!cb.IsIndexInCurrentChunk(firstBlockIndex.ConvertToProfileBufferIndex ()))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(!cb.IsIndexInCurrentChunk(firstBlockIndex.ConvertToProfileBufferIndex ())))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("!cb.IsIndexInCurrentChunk(firstBlockIndex.ConvertToProfileBufferIndex())" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2868); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!cb.IsIndexInCurrentChunk(firstBlockIndex.ConvertToProfileBufferIndex())" ")"); do { *((volatile int*)__null) = 2868; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2869 | ||||
2870 | // Read extant numbers, which should at least follow each other. | |||
2871 | read = 0; | |||
2872 | size_t i = 0; | |||
2873 | cb.ReadEach( | |||
2874 | [&](ProfileBufferEntryReader& er, ProfileBufferBlockIndex aBlockIndex) { | |||
2875 | ++read; | |||
2876 | MOZ_RELEASE_ASSERT(!!aBlockIndex)do { static_assert( mozilla::detail::AssertionConditionType< decltype(!!aBlockIndex)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!!aBlockIndex))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!!aBlockIndex", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2876); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!!aBlockIndex" ")"); do { *((volatile int*)__null) = 2876; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2877 | MOZ_RELEASE_ASSERT(aBlockIndex > firstBlockIndex)do { static_assert( mozilla::detail::AssertionConditionType< decltype(aBlockIndex > firstBlockIndex)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(aBlockIndex > firstBlockIndex ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "aBlockIndex > firstBlockIndex", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2877); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "aBlockIndex > firstBlockIndex" ")"); do { *((volatile int*)__null) = 2877; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2878 | MOZ_RELEASE_ASSERT(aBlockIndex <= lastBlockIndex)do { static_assert( mozilla::detail::AssertionConditionType< decltype(aBlockIndex <= lastBlockIndex)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(aBlockIndex <= lastBlockIndex ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "aBlockIndex <= lastBlockIndex", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2878); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "aBlockIndex <= lastBlockIndex" ")"); do { *((volatile int*)__null) = 2878; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2879 | MOZ_RELEASE_ASSERT(er.RemainingBytes() == sizeof(size_t))do { static_assert( mozilla::detail::AssertionConditionType< decltype(er.RemainingBytes() == sizeof(size_t))>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(! !(er.RemainingBytes() == sizeof(size_t)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("er.RemainingBytes() == sizeof(size_t)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2879); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "er.RemainingBytes() == sizeof(size_t)" ")"); do { *((volatile int*)__null) = 2879; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2880 | const auto value = er.ReadObject<size_t>(); | |||
2881 | if (i == 0) { | |||
2882 | i = value; | |||
2883 | } else { | |||
2884 | MOZ_RELEASE_ASSERT(value == ++i)do { static_assert( mozilla::detail::AssertionConditionType< decltype(value == ++i)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(value == ++i))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("value == ++i", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2884); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "value == ++i" ")"); do { *((volatile int*)__null) = 2884; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2885 | } | |||
2886 | MOZ_RELEASE_ASSERT(er.RemainingBytes() == 0)do { static_assert( mozilla::detail::AssertionConditionType< decltype(er.RemainingBytes() == 0)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(er.RemainingBytes() == 0))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("er.RemainingBytes() == 0" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2886); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "er.RemainingBytes() == 0" ")"); do { *((volatile int*)__null) = 2886; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2887 | }); | |||
2888 | MOZ_RELEASE_ASSERT(read != 0)do { static_assert( mozilla::detail::AssertionConditionType< decltype(read != 0)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(read != 0))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("read != 0", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2888); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "read != 0" ")"); do { *((volatile int*)__null) = 2888; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2889 | MOZ_RELEASE_ASSERT(read < lots)do { static_assert( mozilla::detail::AssertionConditionType< decltype(read < lots)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(read < lots))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("read < lots" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2889); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "read < lots" ")"); do { *((volatile int*)__null) = 2889; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2890 | ||||
2891 | // Read first extant number. | |||
2892 | read = 0; | |||
2893 | i = 0; | |||
2894 | blockIndex = nullptr; | |||
2895 | success = | |||
2896 | cb.ReadAt(firstBlockIndex, [&](Maybe<ProfileBufferEntryReader>&& er) { | |||
2897 | MOZ_ASSERT(er.isSome())do { static_assert( mozilla::detail::AssertionConditionType< decltype(er.isSome())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(er.isSome()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("er.isSome()", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2897); AnnotateMozCrashReason("MOZ_ASSERT" "(" "er.isSome()" ")"); do { *((volatile int*)__null) = 2897; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2898 | ++read; | |||
2899 | MOZ_RELEASE_ASSERT(er->CurrentBlockIndex() > firstBlockIndex)do { static_assert( mozilla::detail::AssertionConditionType< decltype(er->CurrentBlockIndex() > firstBlockIndex)> ::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(er->CurrentBlockIndex() > firstBlockIndex))), 0 ))) { do { } while (false); MOZ_ReportAssertionFailure("er->CurrentBlockIndex() > firstBlockIndex" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2899); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "er->CurrentBlockIndex() > firstBlockIndex" ")"); do { *((volatile int*)__null) = 2899; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2900 | MOZ_RELEASE_ASSERT(!!er->NextBlockIndex())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!!er->NextBlockIndex())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!!er->NextBlockIndex()))) , 0))) { do { } while (false); MOZ_ReportAssertionFailure("!!er->NextBlockIndex()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2900); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!!er->NextBlockIndex()" ")"); do { *((volatile int*)__null) = 2900; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2901 | MOZ_RELEASE_ASSERT(er->NextBlockIndex() > firstBlockIndex)do { static_assert( mozilla::detail::AssertionConditionType< decltype(er->NextBlockIndex() > firstBlockIndex)>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(er->NextBlockIndex() > firstBlockIndex))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("er->NextBlockIndex() > firstBlockIndex" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2901); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "er->NextBlockIndex() > firstBlockIndex" ")"); do { *((volatile int*)__null) = 2901; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2902 | MOZ_RELEASE_ASSERT(er->NextBlockIndex() < lastBlockIndex)do { static_assert( mozilla::detail::AssertionConditionType< decltype(er->NextBlockIndex() < lastBlockIndex)>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(er->NextBlockIndex() < lastBlockIndex))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("er->NextBlockIndex() < lastBlockIndex" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2902); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "er->NextBlockIndex() < lastBlockIndex" ")"); do { *((volatile int*)__null) = 2902; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2903 | blockIndex = er->NextBlockIndex(); | |||
2904 | MOZ_RELEASE_ASSERT(er->RemainingBytes() == sizeof(size_t))do { static_assert( mozilla::detail::AssertionConditionType< decltype(er->RemainingBytes() == sizeof(size_t))>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(er->RemainingBytes() == sizeof(size_t)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("er->RemainingBytes() == sizeof(size_t)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2904); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "er->RemainingBytes() == sizeof(size_t)" ")"); do { *((volatile int*)__null) = 2904; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2905 | const auto value = er->ReadObject<size_t>(); | |||
2906 | MOZ_RELEASE_ASSERT(i == 0)do { static_assert( mozilla::detail::AssertionConditionType< decltype(i == 0)>::isValid, "invalid assertion condition") ; if ((__builtin_expect(!!(!(!!(i == 0))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("i == 0", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2906); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "i == 0" ")"); do { *((volatile int*)__null) = 2906; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2907 | i = value; | |||
2908 | MOZ_RELEASE_ASSERT(er->RemainingBytes() == 0)do { static_assert( mozilla::detail::AssertionConditionType< decltype(er->RemainingBytes() == 0)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(er->RemainingBytes() == 0 ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "er->RemainingBytes() == 0", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2908); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "er->RemainingBytes() == 0" ")"); do { *((volatile int*)__null) = 2908; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2909 | return 7; | |||
2910 | }); | |||
2911 | MOZ_RELEASE_ASSERT(success)do { static_assert( mozilla::detail::AssertionConditionType< decltype(success)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(success))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("success", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2911); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "success" ")"); do { *((volatile int*)__null) = 2911; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2912 | MOZ_RELEASE_ASSERT(read == 1)do { static_assert( mozilla::detail::AssertionConditionType< decltype(read == 1)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(read == 1))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("read == 1", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2912); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "read == 1" ")"); do { *((volatile int*)__null) = 2912; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2913 | // Read other extant numbers one by one. | |||
2914 | do { | |||
2915 | bool success = | |||
2916 | cb.ReadAt(blockIndex, [&](Maybe<ProfileBufferEntryReader>&& er) { | |||
2917 | MOZ_ASSERT(er.isSome())do { static_assert( mozilla::detail::AssertionConditionType< decltype(er.isSome())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(er.isSome()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("er.isSome()", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2917); AnnotateMozCrashReason("MOZ_ASSERT" "(" "er.isSome()" ")"); do { *((volatile int*)__null) = 2917; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2918 | ++read; | |||
2919 | MOZ_RELEASE_ASSERT(er->CurrentBlockIndex() == blockIndex)do { static_assert( mozilla::detail::AssertionConditionType< decltype(er->CurrentBlockIndex() == blockIndex)>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(er->CurrentBlockIndex() == blockIndex))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("er->CurrentBlockIndex() == blockIndex" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2919); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "er->CurrentBlockIndex() == blockIndex" ")"); do { *((volatile int*)__null) = 2919; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2920 | MOZ_RELEASE_ASSERT(!er->NextBlockIndex() ||do { static_assert( mozilla::detail::AssertionConditionType< decltype(!er->NextBlockIndex() || er->NextBlockIndex() > blockIndex)>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(!!(!er->NextBlockIndex() || er-> NextBlockIndex() > blockIndex))), 0))) { do { } while (false ); MOZ_ReportAssertionFailure("!er->NextBlockIndex() || er->NextBlockIndex() > blockIndex" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2921); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!er->NextBlockIndex() || er->NextBlockIndex() > blockIndex" ")"); do { *((volatile int*)__null) = 2921; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
2921 | er->NextBlockIndex() > blockIndex)do { static_assert( mozilla::detail::AssertionConditionType< decltype(!er->NextBlockIndex() || er->NextBlockIndex() > blockIndex)>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(!!(!er->NextBlockIndex() || er-> NextBlockIndex() > blockIndex))), 0))) { do { } while (false ); MOZ_ReportAssertionFailure("!er->NextBlockIndex() || er->NextBlockIndex() > blockIndex" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2921); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!er->NextBlockIndex() || er->NextBlockIndex() > blockIndex" ")"); do { *((volatile int*)__null) = 2921; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2922 | MOZ_RELEASE_ASSERT(!er->NextBlockIndex() ||do { static_assert( mozilla::detail::AssertionConditionType< decltype(!er->NextBlockIndex() || er->NextBlockIndex() > firstBlockIndex)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!er->NextBlockIndex() || er ->NextBlockIndex() > firstBlockIndex))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!er->NextBlockIndex() || er->NextBlockIndex() > firstBlockIndex" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2923); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!er->NextBlockIndex() || er->NextBlockIndex() > firstBlockIndex" ")"); do { *((volatile int*)__null) = 2923; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
2923 | er->NextBlockIndex() > firstBlockIndex)do { static_assert( mozilla::detail::AssertionConditionType< decltype(!er->NextBlockIndex() || er->NextBlockIndex() > firstBlockIndex)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!er->NextBlockIndex() || er ->NextBlockIndex() > firstBlockIndex))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!er->NextBlockIndex() || er->NextBlockIndex() > firstBlockIndex" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2923); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!er->NextBlockIndex() || er->NextBlockIndex() > firstBlockIndex" ")"); do { *((volatile int*)__null) = 2923; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2924 | MOZ_RELEASE_ASSERT(!er->NextBlockIndex() ||do { static_assert( mozilla::detail::AssertionConditionType< decltype(!er->NextBlockIndex() || er->NextBlockIndex() <= lastBlockIndex)>::isValid, "invalid assertion condition") ; if ((__builtin_expect(!!(!(!!(!er->NextBlockIndex() || er ->NextBlockIndex() <= lastBlockIndex))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!er->NextBlockIndex() || er->NextBlockIndex() <= lastBlockIndex" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2925); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!er->NextBlockIndex() || er->NextBlockIndex() <= lastBlockIndex" ")"); do { *((volatile int*)__null) = 2925; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
2925 | er->NextBlockIndex() <= lastBlockIndex)do { static_assert( mozilla::detail::AssertionConditionType< decltype(!er->NextBlockIndex() || er->NextBlockIndex() <= lastBlockIndex)>::isValid, "invalid assertion condition") ; if ((__builtin_expect(!!(!(!!(!er->NextBlockIndex() || er ->NextBlockIndex() <= lastBlockIndex))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!er->NextBlockIndex() || er->NextBlockIndex() <= lastBlockIndex" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2925); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!er->NextBlockIndex() || er->NextBlockIndex() <= lastBlockIndex" ")"); do { *((volatile int*)__null) = 2925; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2926 | MOZ_RELEASE_ASSERT(er->NextBlockIndex()do { static_assert( mozilla::detail::AssertionConditionType< decltype(er->NextBlockIndex() ? blockIndex < lastBlockIndex : blockIndex == lastBlockIndex)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(er->NextBlockIndex() ? blockIndex < lastBlockIndex : blockIndex == lastBlockIndex))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("er->NextBlockIndex() ? blockIndex < lastBlockIndex : blockIndex == lastBlockIndex" " (" "er->NextBlockIndex() should only be null when " "blockIndex is at the last block" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2930); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "er->NextBlockIndex() ? blockIndex < lastBlockIndex : blockIndex == lastBlockIndex" ") (" "er->NextBlockIndex() should only be null when " "blockIndex is at the last block" ")"); do { *((volatile int*)__null) = 2930; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
2927 | ? blockIndex < lastBlockIndexdo { static_assert( mozilla::detail::AssertionConditionType< decltype(er->NextBlockIndex() ? blockIndex < lastBlockIndex : blockIndex == lastBlockIndex)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(er->NextBlockIndex() ? blockIndex < lastBlockIndex : blockIndex == lastBlockIndex))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("er->NextBlockIndex() ? blockIndex < lastBlockIndex : blockIndex == lastBlockIndex" " (" "er->NextBlockIndex() should only be null when " "blockIndex is at the last block" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2930); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "er->NextBlockIndex() ? blockIndex < lastBlockIndex : blockIndex == lastBlockIndex" ") (" "er->NextBlockIndex() should only be null when " "blockIndex is at the last block" ")"); do { *((volatile int*)__null) = 2930; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
2928 | : blockIndex == lastBlockIndex,do { static_assert( mozilla::detail::AssertionConditionType< decltype(er->NextBlockIndex() ? blockIndex < lastBlockIndex : blockIndex == lastBlockIndex)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(er->NextBlockIndex() ? blockIndex < lastBlockIndex : blockIndex == lastBlockIndex))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("er->NextBlockIndex() ? blockIndex < lastBlockIndex : blockIndex == lastBlockIndex" " (" "er->NextBlockIndex() should only be null when " "blockIndex is at the last block" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2930); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "er->NextBlockIndex() ? blockIndex < lastBlockIndex : blockIndex == lastBlockIndex" ") (" "er->NextBlockIndex() should only be null when " "blockIndex is at the last block" ")"); do { *((volatile int*)__null) = 2930; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
2929 | "er->NextBlockIndex() should only be null when "do { static_assert( mozilla::detail::AssertionConditionType< decltype(er->NextBlockIndex() ? blockIndex < lastBlockIndex : blockIndex == lastBlockIndex)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(er->NextBlockIndex() ? blockIndex < lastBlockIndex : blockIndex == lastBlockIndex))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("er->NextBlockIndex() ? blockIndex < lastBlockIndex : blockIndex == lastBlockIndex" " (" "er->NextBlockIndex() should only be null when " "blockIndex is at the last block" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2930); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "er->NextBlockIndex() ? blockIndex < lastBlockIndex : blockIndex == lastBlockIndex" ") (" "er->NextBlockIndex() should only be null when " "blockIndex is at the last block" ")"); do { *((volatile int*)__null) = 2930; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
2930 | "blockIndex is at the last block")do { static_assert( mozilla::detail::AssertionConditionType< decltype(er->NextBlockIndex() ? blockIndex < lastBlockIndex : blockIndex == lastBlockIndex)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(er->NextBlockIndex() ? blockIndex < lastBlockIndex : blockIndex == lastBlockIndex))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("er->NextBlockIndex() ? blockIndex < lastBlockIndex : blockIndex == lastBlockIndex" " (" "er->NextBlockIndex() should only be null when " "blockIndex is at the last block" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2930); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "er->NextBlockIndex() ? blockIndex < lastBlockIndex : blockIndex == lastBlockIndex" ") (" "er->NextBlockIndex() should only be null when " "blockIndex is at the last block" ")"); do { *((volatile int*)__null) = 2930; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2931 | blockIndex = er->NextBlockIndex(); | |||
2932 | MOZ_RELEASE_ASSERT(er->RemainingBytes() == sizeof(size_t))do { static_assert( mozilla::detail::AssertionConditionType< decltype(er->RemainingBytes() == sizeof(size_t))>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(er->RemainingBytes() == sizeof(size_t)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("er->RemainingBytes() == sizeof(size_t)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2932); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "er->RemainingBytes() == sizeof(size_t)" ")"); do { *((volatile int*)__null) = 2932; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2933 | const auto value = er->ReadObject<size_t>(); | |||
2934 | MOZ_RELEASE_ASSERT(value == ++i)do { static_assert( mozilla::detail::AssertionConditionType< decltype(value == ++i)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(value == ++i))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("value == ++i", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2934); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "value == ++i" ")"); do { *((volatile int*)__null) = 2934; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2935 | MOZ_RELEASE_ASSERT(er->RemainingBytes() == 0)do { static_assert( mozilla::detail::AssertionConditionType< decltype(er->RemainingBytes() == 0)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(er->RemainingBytes() == 0 ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "er->RemainingBytes() == 0", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2935); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "er->RemainingBytes() == 0" ")"); do { *((volatile int*)__null) = 2935; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2936 | return true; | |||
2937 | }); | |||
2938 | MOZ_RELEASE_ASSERT(success)do { static_assert( mozilla::detail::AssertionConditionType< decltype(success)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(success))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("success", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2938); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "success" ")"); do { *((volatile int*)__null) = 2938; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2939 | } while (blockIndex); | |||
2940 | MOZ_RELEASE_ASSERT(read > 1)do { static_assert( mozilla::detail::AssertionConditionType< decltype(read > 1)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(read > 1))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("read > 1", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2940); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "read > 1" ")"); do { *((volatile int*)__null) = 2940; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2941 | ||||
2942 | // No changes after reads. | |||
2943 | VERIFY_PCB_START_END_PUSHED_CLEARED_FAILED({ ProfileChunkedBuffer::State state = (cb).GetState(); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mRangeStart == (startAfterPuts))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(state.mRangeStart == (startAfterPuts )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mRangeStart == (startAfterPuts)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2944); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (startAfterPuts)" ")"); do { *((volatile int*)__null) = 2944; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd == (endAfterPuts))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(state.mRangeEnd == (endAfterPuts )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mRangeEnd == (endAfterPuts)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2944); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (endAfterPuts)" ")"); do { *((volatile int*)__null) = 2944; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount == (pushedAfterPuts))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(state.mPushedBlockCount == ( pushedAfterPuts)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mPushedBlockCount == (pushedAfterPuts)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2944); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (pushedAfterPuts)" ")"); do { *((volatile int*)__null) = 2944; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount == (clearedAfterPuts))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(state.mClearedBlockCount == ( clearedAfterPuts)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mClearedBlockCount == (clearedAfterPuts)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2944); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (clearedAfterPuts)" ")"); do { *((volatile int*)__null) = 2944; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mFailedPutBytes == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mFailedPutBytes == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2944); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (0)" ")"); do { *((volatile int*)__null) = 2944; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); } | |||
2944 | cb, startAfterPuts, endAfterPuts, pushedAfterPuts, clearedAfterPuts, 0){ ProfileChunkedBuffer::State state = (cb).GetState(); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mRangeStart == (startAfterPuts))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(state.mRangeStart == (startAfterPuts )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mRangeStart == (startAfterPuts)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2944); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (startAfterPuts)" ")"); do { *((volatile int*)__null) = 2944; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd == (endAfterPuts))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(state.mRangeEnd == (endAfterPuts )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mRangeEnd == (endAfterPuts)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2944); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (endAfterPuts)" ")"); do { *((volatile int*)__null) = 2944; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount == (pushedAfterPuts))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(state.mPushedBlockCount == ( pushedAfterPuts)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mPushedBlockCount == (pushedAfterPuts)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2944); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (pushedAfterPuts)" ")"); do { *((volatile int*)__null) = 2944; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount == (clearedAfterPuts))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(state.mClearedBlockCount == ( clearedAfterPuts)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mClearedBlockCount == (clearedAfterPuts)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2944); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (clearedAfterPuts)" ")"); do { *((volatile int*)__null) = 2944; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mFailedPutBytes == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mFailedPutBytes == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2944); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (0)" ")"); do { *((volatile int*)__null) = 2944; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); }; | |||
2945 | ||||
2946 | # ifdef DEBUG1 | |||
2947 | // cb.Dump(); | |||
2948 | # endif | |||
2949 | ||||
2950 | cb.Clear(); | |||
2951 | ||||
2952 | # ifdef DEBUG1 | |||
2953 | // cb.Dump(); | |||
2954 | # endif | |||
2955 | ||||
2956 | ProfileChunkedBuffer::State stateAfterClear = cb.GetState(); | |||
2957 | ProfileBufferIndex startAfterClear = stateAfterClear.mRangeStart; | |||
2958 | MOZ_RELEASE_ASSERT(startAfterClear > startAfterPuts)do { static_assert( mozilla::detail::AssertionConditionType< decltype(startAfterClear > startAfterPuts)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(startAfterClear > startAfterPuts ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "startAfterClear > startAfterPuts", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2958); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "startAfterClear > startAfterPuts" ")"); do { *((volatile int*)__null) = 2958; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2959 | ProfileBufferIndex endAfterClear = stateAfterClear.mRangeEnd; | |||
2960 | MOZ_RELEASE_ASSERT(endAfterClear == startAfterClear)do { static_assert( mozilla::detail::AssertionConditionType< decltype(endAfterClear == startAfterClear)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(endAfterClear == startAfterClear ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "endAfterClear == startAfterClear", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2960); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "endAfterClear == startAfterClear" ")"); do { *((volatile int*)__null) = 2960; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2961 | MOZ_RELEASE_ASSERT(stateAfterClear.mPushedBlockCount == 0)do { static_assert( mozilla::detail::AssertionConditionType< decltype(stateAfterClear.mPushedBlockCount == 0)>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(stateAfterClear.mPushedBlockCount == 0))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("stateAfterClear.mPushedBlockCount == 0" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2961); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "stateAfterClear.mPushedBlockCount == 0" ")"); do { *((volatile int*)__null) = 2961; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2962 | MOZ_RELEASE_ASSERT(stateAfterClear.mClearedBlockCount == 0)do { static_assert( mozilla::detail::AssertionConditionType< decltype(stateAfterClear.mClearedBlockCount == 0)>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(stateAfterClear.mClearedBlockCount == 0))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("stateAfterClear.mClearedBlockCount == 0" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2962); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "stateAfterClear.mClearedBlockCount == 0" ")"); do { *((volatile int*)__null) = 2962; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2963 | MOZ_RELEASE_ASSERT(stateAfterClear.mFailedPutBytes == 0)do { static_assert( mozilla::detail::AssertionConditionType< decltype(stateAfterClear.mFailedPutBytes == 0)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(stateAfterClear.mFailedPutBytes == 0))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("stateAfterClear.mFailedPutBytes == 0", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2963); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "stateAfterClear.mFailedPutBytes == 0" ")"); do { *((volatile int*)__null) = 2963; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2964 | MOZ_RELEASE_ASSERT(!cb.IsIndexInCurrentChunk(ProfileBufferIndex{}))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!cb.IsIndexInCurrentChunk(ProfileBufferIndex{}))> ::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(!cb.IsIndexInCurrentChunk(ProfileBufferIndex{})))), 0 ))) { do { } while (false); MOZ_ReportAssertionFailure("!cb.IsIndexInCurrentChunk(ProfileBufferIndex{})" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2964); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!cb.IsIndexInCurrentChunk(ProfileBufferIndex{})" ")"); do { *((volatile int*)__null) = 2964; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2965 | MOZ_RELEASE_ASSERT(do { static_assert( mozilla::detail::AssertionConditionType< decltype(!cb.IsIndexInCurrentChunk(blockIndex.ConvertToProfileBufferIndex ()))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(!cb.IsIndexInCurrentChunk(blockIndex.ConvertToProfileBufferIndex ())))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("!cb.IsIndexInCurrentChunk(blockIndex.ConvertToProfileBufferIndex())" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2966); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!cb.IsIndexInCurrentChunk(blockIndex.ConvertToProfileBufferIndex())" ")"); do { *((volatile int*)__null) = 2966; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
2966 | !cb.IsIndexInCurrentChunk(blockIndex.ConvertToProfileBufferIndex()))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!cb.IsIndexInCurrentChunk(blockIndex.ConvertToProfileBufferIndex ()))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(!cb.IsIndexInCurrentChunk(blockIndex.ConvertToProfileBufferIndex ())))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("!cb.IsIndexInCurrentChunk(blockIndex.ConvertToProfileBufferIndex())" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2966); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!cb.IsIndexInCurrentChunk(blockIndex.ConvertToProfileBufferIndex())" ")"); do { *((volatile int*)__null) = 2966; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2967 | MOZ_RELEASE_ASSERT(!cb.IsIndexInCurrentChunk(stateAfterClear.mRangeEnd - 1))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!cb.IsIndexInCurrentChunk(stateAfterClear.mRangeEnd - 1))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(!cb.IsIndexInCurrentChunk(stateAfterClear.mRangeEnd - 1)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("!cb.IsIndexInCurrentChunk(stateAfterClear.mRangeEnd - 1)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2967); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!cb.IsIndexInCurrentChunk(stateAfterClear.mRangeEnd - 1)" ")"); do { *((volatile int*)__null) = 2967; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2968 | MOZ_RELEASE_ASSERT(!cb.IsIndexInCurrentChunk(stateAfterClear.mRangeEnd))do { static_assert( mozilla::detail::AssertionConditionType< decltype(!cb.IsIndexInCurrentChunk(stateAfterClear.mRangeEnd) )>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(!cb.IsIndexInCurrentChunk(stateAfterClear.mRangeEnd) ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "!cb.IsIndexInCurrentChunk(stateAfterClear.mRangeEnd)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2968); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!cb.IsIndexInCurrentChunk(stateAfterClear.mRangeEnd)" ")"); do { *((volatile int*)__null) = 2968; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2969 | ||||
2970 | // Start writer threads. | |||
2971 | constexpr int ThreadCount = 32; | |||
2972 | std::thread threads[ThreadCount]; | |||
2973 | for (int threadNo = 0; threadNo < ThreadCount; ++threadNo) { | |||
2974 | threads[threadNo] = std::thread( | |||
2975 | [&](int aThreadNo) { | |||
2976 | ::SleepMilli(1); | |||
2977 | constexpr int pushCount = 1024; | |||
2978 | for (int push = 0; push < pushCount; ++push) { | |||
2979 | // Reserve as many bytes as the thread number (but at least enough | |||
2980 | // to store an int), and write an increasing int. | |||
2981 | const bool success = | |||
2982 | cb.Put(std::max(aThreadNo, int(sizeof(push))), | |||
2983 | [&](Maybe<ProfileBufferEntryWriter>& aEW) { | |||
2984 | if (!aEW) { | |||
2985 | return false; | |||
2986 | } | |||
2987 | aEW->WriteObject(aThreadNo * 1000000 + push); | |||
2988 | // Advance writer to the end. | |||
2989 | for (size_t r = aEW->RemainingBytes(); r != 0; --r) { | |||
2990 | aEW->WriteObject<char>('_'); | |||
2991 | } | |||
2992 | return true; | |||
2993 | }); | |||
2994 | MOZ_RELEASE_ASSERT(success)do { static_assert( mozilla::detail::AssertionConditionType< decltype(success)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(success))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("success", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 2994); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "success" ")"); do { *((volatile int*)__null) = 2994; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
2995 | } | |||
2996 | }, | |||
2997 | threadNo); | |||
2998 | } | |||
2999 | ||||
3000 | // Wait for all writer threads to die. | |||
3001 | for (auto&& thread : threads) { | |||
3002 | thread.join(); | |||
3003 | } | |||
3004 | ||||
3005 | # ifdef DEBUG1 | |||
3006 | // cb.Dump(); | |||
3007 | # endif | |||
3008 | ||||
3009 | ProfileChunkedBuffer::State stateAfterMTPuts = cb.GetState(); | |||
3010 | ProfileBufferIndex startAfterMTPuts = stateAfterMTPuts.mRangeStart; | |||
3011 | MOZ_RELEASE_ASSERT(startAfterMTPuts > startAfterClear)do { static_assert( mozilla::detail::AssertionConditionType< decltype(startAfterMTPuts > startAfterClear)>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(! !(startAfterMTPuts > startAfterClear))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("startAfterMTPuts > startAfterClear" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3011); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "startAfterMTPuts > startAfterClear" ")"); do { *((volatile int*)__null) = 3011; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3012 | ProfileBufferIndex endAfterMTPuts = stateAfterMTPuts.mRangeEnd; | |||
3013 | MOZ_RELEASE_ASSERT(endAfterMTPuts > startAfterMTPuts)do { static_assert( mozilla::detail::AssertionConditionType< decltype(endAfterMTPuts > startAfterMTPuts)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(endAfterMTPuts > startAfterMTPuts ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "endAfterMTPuts > startAfterMTPuts", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3013); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "endAfterMTPuts > startAfterMTPuts" ")"); do { *((volatile int*)__null) = 3013; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3014 | MOZ_RELEASE_ASSERT(stateAfterMTPuts.mPushedBlockCount > 0)do { static_assert( mozilla::detail::AssertionConditionType< decltype(stateAfterMTPuts.mPushedBlockCount > 0)>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(stateAfterMTPuts.mPushedBlockCount > 0))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("stateAfterMTPuts.mPushedBlockCount > 0" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3014); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "stateAfterMTPuts.mPushedBlockCount > 0" ")"); do { *((volatile int*)__null) = 3014; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3015 | MOZ_RELEASE_ASSERT(stateAfterMTPuts.mClearedBlockCount > 0)do { static_assert( mozilla::detail::AssertionConditionType< decltype(stateAfterMTPuts.mClearedBlockCount > 0)>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(stateAfterMTPuts.mClearedBlockCount > 0))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("stateAfterMTPuts.mClearedBlockCount > 0" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3015); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "stateAfterMTPuts.mClearedBlockCount > 0" ")"); do { *((volatile int*)__null) = 3015; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3016 | MOZ_RELEASE_ASSERT(stateAfterMTPuts.mFailedPutBytes == 0)do { static_assert( mozilla::detail::AssertionConditionType< decltype(stateAfterMTPuts.mFailedPutBytes == 0)>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(! !(stateAfterMTPuts.mFailedPutBytes == 0))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("stateAfterMTPuts.mFailedPutBytes == 0" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3016); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "stateAfterMTPuts.mFailedPutBytes == 0" ")"); do { *((volatile int*)__null) = 3016; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3017 | ||||
3018 | // Reset to out-of-session. | |||
3019 | cb.ResetChunkManager(); | |||
3020 | ||||
3021 | ProfileChunkedBuffer::State stateAfterReset = cb.GetState(); | |||
3022 | ProfileBufferIndex startAfterReset = stateAfterReset.mRangeStart; | |||
3023 | MOZ_RELEASE_ASSERT(startAfterReset == endAfterMTPuts)do { static_assert( mozilla::detail::AssertionConditionType< decltype(startAfterReset == endAfterMTPuts)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(startAfterReset == endAfterMTPuts ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "startAfterReset == endAfterMTPuts", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3023); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "startAfterReset == endAfterMTPuts" ")"); do { *((volatile int*)__null) = 3023; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3024 | ProfileBufferIndex endAfterReset = stateAfterReset.mRangeEnd; | |||
3025 | MOZ_RELEASE_ASSERT(endAfterReset == startAfterReset)do { static_assert( mozilla::detail::AssertionConditionType< decltype(endAfterReset == startAfterReset)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(endAfterReset == startAfterReset ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "endAfterReset == startAfterReset", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3025); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "endAfterReset == startAfterReset" ")"); do { *((volatile int*)__null) = 3025; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3026 | MOZ_RELEASE_ASSERT(stateAfterReset.mPushedBlockCount == 0)do { static_assert( mozilla::detail::AssertionConditionType< decltype(stateAfterReset.mPushedBlockCount == 0)>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(stateAfterReset.mPushedBlockCount == 0))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("stateAfterReset.mPushedBlockCount == 0" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3026); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "stateAfterReset.mPushedBlockCount == 0" ")"); do { *((volatile int*)__null) = 3026; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3027 | MOZ_RELEASE_ASSERT(stateAfterReset.mClearedBlockCount == 0)do { static_assert( mozilla::detail::AssertionConditionType< decltype(stateAfterReset.mClearedBlockCount == 0)>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(stateAfterReset.mClearedBlockCount == 0))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("stateAfterReset.mClearedBlockCount == 0" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3027); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "stateAfterReset.mClearedBlockCount == 0" ")"); do { *((volatile int*)__null) = 3027; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3028 | MOZ_RELEASE_ASSERT(stateAfterReset.mFailedPutBytes == 0)do { static_assert( mozilla::detail::AssertionConditionType< decltype(stateAfterReset.mFailedPutBytes == 0)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(stateAfterReset.mFailedPutBytes == 0))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("stateAfterReset.mFailedPutBytes == 0", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3028); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "stateAfterReset.mFailedPutBytes == 0" ")"); do { *((volatile int*)__null) = 3028; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3029 | ||||
3030 | success = cb.ReserveAndPut( | |||
3031 | []() { | |||
3032 | MOZ_RELEASE_ASSERT(false)do { static_assert( mozilla::detail::AssertionConditionType< decltype(false)>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(!!(false))), 0))) { do { } while ( false); MOZ_ReportAssertionFailure("false", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3032); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "false" ")"); do { *((volatile int*)__null) = 3032; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3033 | return 1; | |||
3034 | }, | |||
3035 | [](Maybe<ProfileBufferEntryWriter>& aEW) { return !!aEW; }); | |||
3036 | MOZ_RELEASE_ASSERT(!success)do { static_assert( mozilla::detail::AssertionConditionType< decltype(!success)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!success))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!success", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3036); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!success" ")"); do { *((volatile int*)__null) = 3036; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3037 | VERIFY_PCB_START_END_PUSHED_CLEARED_FAILED(cb, startAfterReset, endAfterReset,{ ProfileChunkedBuffer::State state = (cb).GetState(); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mRangeStart == (startAfterReset))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(state.mRangeStart == (startAfterReset )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mRangeStart == (startAfterReset)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3038); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (startAfterReset)" ")"); do { *((volatile int*)__null) = 3038; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd == (endAfterReset))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(state.mRangeEnd == (endAfterReset )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mRangeEnd == (endAfterReset)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3038); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (endAfterReset)" ")"); do { *((volatile int*)__null) = 3038; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mPushedBlockCount == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mPushedBlockCount == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3038); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (0)" ")"); do { *((volatile int*)__null) = 3038; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3038); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)" ")"); do { *((volatile int*)__null) = 3038; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mFailedPutBytes == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mFailedPutBytes == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3038); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (0)" ")"); do { *((volatile int*)__null) = 3038; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); } | |||
3038 | 0, 0, 0){ ProfileChunkedBuffer::State state = (cb).GetState(); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mRangeStart == (startAfterReset))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(state.mRangeStart == (startAfterReset )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mRangeStart == (startAfterReset)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3038); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (startAfterReset)" ")"); do { *((volatile int*)__null) = 3038; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd == (endAfterReset))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(state.mRangeEnd == (endAfterReset )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mRangeEnd == (endAfterReset)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3038); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (endAfterReset)" ")"); do { *((volatile int*)__null) = 3038; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mPushedBlockCount == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mPushedBlockCount == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3038); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (0)" ")"); do { *((volatile int*)__null) = 3038; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3038); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)" ")"); do { *((volatile int*)__null) = 3038; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mFailedPutBytes == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mFailedPutBytes == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3038); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (0)" ")"); do { *((volatile int*)__null) = 3038; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); }; | |||
3039 | ||||
3040 | success = | |||
3041 | cb.Put(1, [](Maybe<ProfileBufferEntryWriter>& aEW) { return !!aEW; }); | |||
3042 | MOZ_RELEASE_ASSERT(!success)do { static_assert( mozilla::detail::AssertionConditionType< decltype(!success)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!success))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!success", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3042); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!success" ")"); do { *((volatile int*)__null) = 3042; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3043 | VERIFY_PCB_START_END_PUSHED_CLEARED_FAILED(cb, startAfterReset, endAfterReset,{ ProfileChunkedBuffer::State state = (cb).GetState(); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mRangeStart == (startAfterReset))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(state.mRangeStart == (startAfterReset )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mRangeStart == (startAfterReset)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3044); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (startAfterReset)" ")"); do { *((volatile int*)__null) = 3044; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd == (endAfterReset))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(state.mRangeEnd == (endAfterReset )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mRangeEnd == (endAfterReset)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3044); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (endAfterReset)" ")"); do { *((volatile int*)__null) = 3044; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mPushedBlockCount == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mPushedBlockCount == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3044); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (0)" ")"); do { *((volatile int*)__null) = 3044; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3044); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)" ")"); do { *((volatile int*)__null) = 3044; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mFailedPutBytes == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mFailedPutBytes == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3044); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (0)" ")"); do { *((volatile int*)__null) = 3044; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); } | |||
3044 | 0, 0, 0){ ProfileChunkedBuffer::State state = (cb).GetState(); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mRangeStart == (startAfterReset))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(state.mRangeStart == (startAfterReset )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mRangeStart == (startAfterReset)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3044); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (startAfterReset)" ")"); do { *((volatile int*)__null) = 3044; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd == (endAfterReset))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(state.mRangeEnd == (endAfterReset )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mRangeEnd == (endAfterReset)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3044); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (endAfterReset)" ")"); do { *((volatile int*)__null) = 3044; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mPushedBlockCount == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mPushedBlockCount == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3044); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (0)" ")"); do { *((volatile int*)__null) = 3044; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3044); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)" ")"); do { *((volatile int*)__null) = 3044; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mFailedPutBytes == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mFailedPutBytes == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3044); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (0)" ")"); do { *((volatile int*)__null) = 3044; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); }; | |||
3045 | ||||
3046 | blockIndex = cb.PutFrom(&success, 1); | |||
3047 | MOZ_RELEASE_ASSERT(!blockIndex)do { static_assert( mozilla::detail::AssertionConditionType< decltype(!blockIndex)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!blockIndex))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!blockIndex", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3047); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!blockIndex" ")"); do { *((volatile int*)__null) = 3047; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3048 | VERIFY_PCB_START_END_PUSHED_CLEARED_FAILED(cb, startAfterReset, endAfterReset,{ ProfileChunkedBuffer::State state = (cb).GetState(); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mRangeStart == (startAfterReset))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(state.mRangeStart == (startAfterReset )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mRangeStart == (startAfterReset)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3049); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (startAfterReset)" ")"); do { *((volatile int*)__null) = 3049; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd == (endAfterReset))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(state.mRangeEnd == (endAfterReset )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mRangeEnd == (endAfterReset)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3049); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (endAfterReset)" ")"); do { *((volatile int*)__null) = 3049; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mPushedBlockCount == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mPushedBlockCount == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3049); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (0)" ")"); do { *((volatile int*)__null) = 3049; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3049); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)" ")"); do { *((volatile int*)__null) = 3049; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mFailedPutBytes == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mFailedPutBytes == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3049); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (0)" ")"); do { *((volatile int*)__null) = 3049; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); } | |||
3049 | 0, 0, 0){ ProfileChunkedBuffer::State state = (cb).GetState(); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mRangeStart == (startAfterReset))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(state.mRangeStart == (startAfterReset )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mRangeStart == (startAfterReset)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3049); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (startAfterReset)" ")"); do { *((volatile int*)__null) = 3049; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd == (endAfterReset))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(state.mRangeEnd == (endAfterReset )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mRangeEnd == (endAfterReset)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3049); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (endAfterReset)" ")"); do { *((volatile int*)__null) = 3049; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mPushedBlockCount == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mPushedBlockCount == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3049); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (0)" ")"); do { *((volatile int*)__null) = 3049; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3049); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)" ")"); do { *((volatile int*)__null) = 3049; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mFailedPutBytes == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mFailedPutBytes == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3049); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (0)" ")"); do { *((volatile int*)__null) = 3049; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); }; | |||
3050 | ||||
3051 | blockIndex = cb.PutObjects(123, success, "hello"); | |||
3052 | MOZ_RELEASE_ASSERT(!blockIndex)do { static_assert( mozilla::detail::AssertionConditionType< decltype(!blockIndex)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!blockIndex))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!blockIndex", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3052); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!blockIndex" ")"); do { *((volatile int*)__null) = 3052; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3053 | VERIFY_PCB_START_END_PUSHED_CLEARED_FAILED(cb, startAfterReset, endAfterReset,{ ProfileChunkedBuffer::State state = (cb).GetState(); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mRangeStart == (startAfterReset))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(state.mRangeStart == (startAfterReset )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mRangeStart == (startAfterReset)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3054); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (startAfterReset)" ")"); do { *((volatile int*)__null) = 3054; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd == (endAfterReset))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(state.mRangeEnd == (endAfterReset )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mRangeEnd == (endAfterReset)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3054); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (endAfterReset)" ")"); do { *((volatile int*)__null) = 3054; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mPushedBlockCount == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mPushedBlockCount == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3054); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (0)" ")"); do { *((volatile int*)__null) = 3054; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3054); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)" ")"); do { *((volatile int*)__null) = 3054; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mFailedPutBytes == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mFailedPutBytes == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3054); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (0)" ")"); do { *((volatile int*)__null) = 3054; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); } | |||
3054 | 0, 0, 0){ ProfileChunkedBuffer::State state = (cb).GetState(); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mRangeStart == (startAfterReset))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(state.mRangeStart == (startAfterReset )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mRangeStart == (startAfterReset)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3054); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (startAfterReset)" ")"); do { *((volatile int*)__null) = 3054; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd == (endAfterReset))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(state.mRangeEnd == (endAfterReset )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mRangeEnd == (endAfterReset)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3054); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (endAfterReset)" ")"); do { *((volatile int*)__null) = 3054; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mPushedBlockCount == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mPushedBlockCount == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3054); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (0)" ")"); do { *((volatile int*)__null) = 3054; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3054); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)" ")"); do { *((volatile int*)__null) = 3054; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mFailedPutBytes == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mFailedPutBytes == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3054); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (0)" ")"); do { *((volatile int*)__null) = 3054; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); }; | |||
3055 | ||||
3056 | blockIndex = cb.PutObject(123); | |||
3057 | MOZ_RELEASE_ASSERT(!blockIndex)do { static_assert( mozilla::detail::AssertionConditionType< decltype(!blockIndex)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!blockIndex))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!blockIndex", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3057); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!blockIndex" ")"); do { *((volatile int*)__null) = 3057; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3058 | VERIFY_PCB_START_END_PUSHED_CLEARED_FAILED(cb, startAfterReset, endAfterReset,{ ProfileChunkedBuffer::State state = (cb).GetState(); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mRangeStart == (startAfterReset))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(state.mRangeStart == (startAfterReset )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mRangeStart == (startAfterReset)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3059); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (startAfterReset)" ")"); do { *((volatile int*)__null) = 3059; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd == (endAfterReset))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(state.mRangeEnd == (endAfterReset )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mRangeEnd == (endAfterReset)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3059); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (endAfterReset)" ")"); do { *((volatile int*)__null) = 3059; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mPushedBlockCount == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mPushedBlockCount == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3059); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (0)" ")"); do { *((volatile int*)__null) = 3059; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3059); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)" ")"); do { *((volatile int*)__null) = 3059; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mFailedPutBytes == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mFailedPutBytes == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3059); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (0)" ")"); do { *((volatile int*)__null) = 3059; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); } | |||
3059 | 0, 0, 0){ ProfileChunkedBuffer::State state = (cb).GetState(); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mRangeStart == (startAfterReset))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(state.mRangeStart == (startAfterReset )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mRangeStart == (startAfterReset)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3059); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (startAfterReset)" ")"); do { *((volatile int*)__null) = 3059; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd == (endAfterReset))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(state.mRangeEnd == (endAfterReset )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mRangeEnd == (endAfterReset)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3059); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (endAfterReset)" ")"); do { *((volatile int*)__null) = 3059; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mPushedBlockCount == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mPushedBlockCount == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3059); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (0)" ")"); do { *((volatile int*)__null) = 3059; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3059); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)" ")"); do { *((volatile int*)__null) = 3059; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mFailedPutBytes == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mFailedPutBytes == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3059); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (0)" ")"); do { *((volatile int*)__null) = 3059; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); }; | |||
3060 | ||||
3061 | chunks = cb.GetAllChunks(); | |||
3062 | MOZ_RELEASE_ASSERT(!chunks, "Expected no chunks when out-of-session")do { static_assert( mozilla::detail::AssertionConditionType< decltype(!chunks)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!chunks))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!chunks" " (" "Expected no chunks when out-of-session" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3062); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!chunks" ") (" "Expected no chunks when out-of-session" ")"); do { *( (volatile int*)__null) = 3062; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
3063 | VERIFY_PCB_START_END_PUSHED_CLEARED_FAILED(cb, startAfterReset, endAfterReset,{ ProfileChunkedBuffer::State state = (cb).GetState(); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mRangeStart == (startAfterReset))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(state.mRangeStart == (startAfterReset )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mRangeStart == (startAfterReset)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3064); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (startAfterReset)" ")"); do { *((volatile int*)__null) = 3064; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd == (endAfterReset))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(state.mRangeEnd == (endAfterReset )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mRangeEnd == (endAfterReset)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3064); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (endAfterReset)" ")"); do { *((volatile int*)__null) = 3064; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mPushedBlockCount == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mPushedBlockCount == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3064); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (0)" ")"); do { *((volatile int*)__null) = 3064; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3064); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)" ")"); do { *((volatile int*)__null) = 3064; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mFailedPutBytes == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mFailedPutBytes == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3064); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (0)" ")"); do { *((volatile int*)__null) = 3064; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); } | |||
3064 | 0, 0, 0){ ProfileChunkedBuffer::State state = (cb).GetState(); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mRangeStart == (startAfterReset))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(state.mRangeStart == (startAfterReset )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mRangeStart == (startAfterReset)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3064); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (startAfterReset)" ")"); do { *((volatile int*)__null) = 3064; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd == (endAfterReset))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(state.mRangeEnd == (endAfterReset )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mRangeEnd == (endAfterReset)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3064); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (endAfterReset)" ")"); do { *((volatile int*)__null) = 3064; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mPushedBlockCount == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mPushedBlockCount == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3064); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (0)" ")"); do { *((volatile int*)__null) = 3064; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3064); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)" ")"); do { *((volatile int*)__null) = 3064; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mFailedPutBytes == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mFailedPutBytes == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3064); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (0)" ")"); do { *((volatile int*)__null) = 3064; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); }; | |||
3065 | ||||
3066 | cb.ReadEach([](ProfileBufferEntryReader&) { MOZ_RELEASE_ASSERT(false)do { static_assert( mozilla::detail::AssertionConditionType< decltype(false)>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(!!(false))), 0))) { do { } while ( false); MOZ_ReportAssertionFailure("false", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3066); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "false" ")"); do { *((volatile int*)__null) = 3066; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); }); | |||
3067 | VERIFY_PCB_START_END_PUSHED_CLEARED_FAILED(cb, startAfterReset, endAfterReset,{ ProfileChunkedBuffer::State state = (cb).GetState(); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mRangeStart == (startAfterReset))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(state.mRangeStart == (startAfterReset )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mRangeStart == (startAfterReset)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3068); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (startAfterReset)" ")"); do { *((volatile int*)__null) = 3068; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd == (endAfterReset))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(state.mRangeEnd == (endAfterReset )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mRangeEnd == (endAfterReset)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3068); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (endAfterReset)" ")"); do { *((volatile int*)__null) = 3068; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mPushedBlockCount == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mPushedBlockCount == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3068); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (0)" ")"); do { *((volatile int*)__null) = 3068; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3068); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)" ")"); do { *((volatile int*)__null) = 3068; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mFailedPutBytes == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mFailedPutBytes == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3068); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (0)" ")"); do { *((volatile int*)__null) = 3068; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); } | |||
3068 | 0, 0, 0){ ProfileChunkedBuffer::State state = (cb).GetState(); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mRangeStart == (startAfterReset))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(state.mRangeStart == (startAfterReset )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mRangeStart == (startAfterReset)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3068); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (startAfterReset)" ")"); do { *((volatile int*)__null) = 3068; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd == (endAfterReset))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(state.mRangeEnd == (endAfterReset )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mRangeEnd == (endAfterReset)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3068); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (endAfterReset)" ")"); do { *((volatile int*)__null) = 3068; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mPushedBlockCount == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mPushedBlockCount == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3068); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (0)" ")"); do { *((volatile int*)__null) = 3068; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3068); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)" ")"); do { *((volatile int*)__null) = 3068; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mFailedPutBytes == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mFailedPutBytes == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3068); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (0)" ")"); do { *((volatile int*)__null) = 3068; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); }; | |||
3069 | ||||
3070 | success = cb.ReadAt(nullptr, [](Maybe<ProfileBufferEntryReader>&& er) { | |||
3071 | MOZ_RELEASE_ASSERT(er.isNothing())do { static_assert( mozilla::detail::AssertionConditionType< decltype(er.isNothing())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(er.isNothing()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("er.isNothing()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3071); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "er.isNothing()" ")"); do { *((volatile int*)__null) = 3071; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3072 | return true; | |||
3073 | }); | |||
3074 | MOZ_RELEASE_ASSERT(success)do { static_assert( mozilla::detail::AssertionConditionType< decltype(success)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(success))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("success", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3074); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "success" ")"); do { *((volatile int*)__null) = 3074; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3075 | VERIFY_PCB_START_END_PUSHED_CLEARED_FAILED(cb, startAfterReset, endAfterReset,{ ProfileChunkedBuffer::State state = (cb).GetState(); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mRangeStart == (startAfterReset))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(state.mRangeStart == (startAfterReset )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mRangeStart == (startAfterReset)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3076); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (startAfterReset)" ")"); do { *((volatile int*)__null) = 3076; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd == (endAfterReset))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(state.mRangeEnd == (endAfterReset )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mRangeEnd == (endAfterReset)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3076); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (endAfterReset)" ")"); do { *((volatile int*)__null) = 3076; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mPushedBlockCount == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mPushedBlockCount == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3076); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (0)" ")"); do { *((volatile int*)__null) = 3076; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3076); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)" ")"); do { *((volatile int*)__null) = 3076; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mFailedPutBytes == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mFailedPutBytes == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3076); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (0)" ")"); do { *((volatile int*)__null) = 3076; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); } | |||
3076 | 0, 0, 0){ ProfileChunkedBuffer::State state = (cb).GetState(); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mRangeStart == (startAfterReset))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(state.mRangeStart == (startAfterReset )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mRangeStart == (startAfterReset)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3076); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (startAfterReset)" ")"); do { *((volatile int*)__null) = 3076; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd == (endAfterReset))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(state.mRangeEnd == (endAfterReset )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mRangeEnd == (endAfterReset)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3076); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (endAfterReset)" ")"); do { *((volatile int*)__null) = 3076; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mPushedBlockCount == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mPushedBlockCount == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3076); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (0)" ")"); do { *((volatile int*)__null) = 3076; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3076); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)" ")"); do { *((volatile int*)__null) = 3076; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mFailedPutBytes == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mFailedPutBytes == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3076); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (0)" ")"); do { *((volatile int*)__null) = 3076; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); }; | |||
3077 | ||||
3078 | printf("TestChunkedBuffer done\n"); | |||
3079 | } | |||
3080 | ||||
3081 | static void TestChunkedBufferSingle() { | |||
3082 | printf("TestChunkedBufferSingle...\n"); | |||
3083 | ||||
3084 | constexpr ProfileChunkedBuffer::Length chunkMinSize = 128; | |||
3085 | ||||
3086 | // Create a ProfileChunkedBuffer that will own&use a | |||
3087 | // ProfileBufferChunkManagerSingle, which will give away one | |||
3088 | // ProfileBufferChunk that can contain 128 bytes. | |||
3089 | ProfileChunkedBuffer cbSingle( | |||
3090 | ProfileChunkedBuffer::ThreadSafety::WithoutMutex, | |||
3091 | MakeUnique<ProfileBufferChunkManagerSingle>(chunkMinSize)); | |||
3092 | ||||
3093 | MOZ_RELEASE_ASSERT(cbSingle.BufferLength().isSome())do { static_assert( mozilla::detail::AssertionConditionType< decltype(cbSingle.BufferLength().isSome())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(cbSingle.BufferLength().isSome ()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("cbSingle.BufferLength().isSome()", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3093); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "cbSingle.BufferLength().isSome()" ")"); do { *((volatile int*)__null) = 3093; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3094 | const ProfileChunkedBuffer::Length bufferBytes = *cbSingle.BufferLength(); | |||
3095 | MOZ_RELEASE_ASSERT(bufferBytes >= chunkMinSize)do { static_assert( mozilla::detail::AssertionConditionType< decltype(bufferBytes >= chunkMinSize)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(bufferBytes >= chunkMinSize ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "bufferBytes >= chunkMinSize", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3095); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "bufferBytes >= chunkMinSize" ")"); do { *((volatile int*)__null) = 3095; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3096 | ||||
3097 | VERIFY_PCB_START_END_PUSHED_CLEARED_FAILED(cbSingle, 1, 1, 0, 0, 0){ ProfileChunkedBuffer::State state = (cbSingle).GetState(); do { static_assert( mozilla::detail::AssertionConditionType< decltype(state.mRangeStart == (1))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(state.mRangeStart == (1)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mRangeStart == (1)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3097); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (1)" ")"); do { *((volatile int*)__null) = 3097; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd == (1))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mRangeEnd == (1)))), 0))) { do { } while (false ); MOZ_ReportAssertionFailure("state.mRangeEnd == (1)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3097); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (1)" ")"); do { *((volatile int*)__null) = 3097; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mPushedBlockCount == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mPushedBlockCount == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3097); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (0)" ")"); do { *((volatile int*)__null) = 3097; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3097); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)" ")"); do { *((volatile int*)__null) = 3097; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mFailedPutBytes == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mFailedPutBytes == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3097); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (0)" ")"); do { *((volatile int*)__null) = 3097; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); }; | |||
3098 | ||||
3099 | // We will write this many blocks to fill the chunk. | |||
3100 | constexpr size_t testBlocks = 4; | |||
3101 | const ProfileChunkedBuffer::Length blockBytes = bufferBytes / testBlocks; | |||
3102 | MOZ_RELEASE_ASSERT(ULEB128Size(blockBytes) == 1,do { static_assert( mozilla::detail::AssertionConditionType< decltype(ULEB128Size(blockBytes) == 1)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(ULEB128Size(blockBytes) == 1 ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "ULEB128Size(blockBytes) == 1" " (" "This test assumes block sizes are small enough so that " "their ULEB128-encoded size is 1 byte" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3104); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "ULEB128Size(blockBytes) == 1" ") (" "This test assumes block sizes are small enough so that " "their ULEB128-encoded size is 1 byte" ")"); do { *((volatile int*)__null) = 3104; __attribute__((nomerge)) ::abort(); } while (false); } } while (false) | |||
3103 | "This test assumes block sizes are small enough so that "do { static_assert( mozilla::detail::AssertionConditionType< decltype(ULEB128Size(blockBytes) == 1)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(ULEB128Size(blockBytes) == 1 ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "ULEB128Size(blockBytes) == 1" " (" "This test assumes block sizes are small enough so that " "their ULEB128-encoded size is 1 byte" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3104); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "ULEB128Size(blockBytes) == 1" ") (" "This test assumes block sizes are small enough so that " "their ULEB128-encoded size is 1 byte" ")"); do { *((volatile int*)__null) = 3104; __attribute__((nomerge)) ::abort(); } while (false); } } while (false) | |||
3104 | "their ULEB128-encoded size is 1 byte")do { static_assert( mozilla::detail::AssertionConditionType< decltype(ULEB128Size(blockBytes) == 1)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(ULEB128Size(blockBytes) == 1 ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "ULEB128Size(blockBytes) == 1" " (" "This test assumes block sizes are small enough so that " "their ULEB128-encoded size is 1 byte" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3104); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "ULEB128Size(blockBytes) == 1" ") (" "This test assumes block sizes are small enough so that " "their ULEB128-encoded size is 1 byte" ")"); do { *((volatile int*)__null) = 3104; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | |||
3105 | const ProfileChunkedBuffer::Length entryBytes = | |||
3106 | blockBytes - ULEB128Size(blockBytes); | |||
3107 | ||||
3108 | // First buffer-filling test: Try to write a too-big entry at the end of the | |||
3109 | // chunk. | |||
3110 | ||||
3111 | // Write all but one block. | |||
3112 | for (size_t i = 0; i < testBlocks - 1; ++i) { | |||
3113 | cbSingle.Put(entryBytes, [&](Maybe<ProfileBufferEntryWriter>& aEW) { | |||
3114 | MOZ_RELEASE_ASSERT(aEW.isSome())do { static_assert( mozilla::detail::AssertionConditionType< decltype(aEW.isSome())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(aEW.isSome()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("aEW.isSome()", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3114); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "aEW.isSome()" ")"); do { *((volatile int*)__null) = 3114; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3115 | while (aEW->RemainingBytes() > 0) { | |||
3116 | **aEW = '0' + i; | |||
3117 | ++(*aEW); | |||
3118 | } | |||
3119 | }); | |||
3120 | VERIFY_PCB_START_END_PUSHED_CLEARED_FAILED({ ProfileChunkedBuffer::State state = (cbSingle).GetState(); do { static_assert( mozilla::detail::AssertionConditionType< decltype(state.mRangeStart == (1))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(state.mRangeStart == (1)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mRangeStart == (1)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3121); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (1)" ")"); do { *((volatile int*)__null) = 3121; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd == (1 + blockBytes * (i + 1)))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(state.mRangeEnd == (1 + blockBytes * (i + 1))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mRangeEnd == (1 + blockBytes * (i + 1))", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3121); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (1 + blockBytes * (i + 1))" ")"); do { *((volatile int*)__null) = 3121; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount == (i + 1))>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(!!(state.mPushedBlockCount == (i + 1 )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mPushedBlockCount == (i + 1)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3121); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (i + 1)" ")"); do { *((volatile int*)__null) = 3121; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3121); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)" ")"); do { *((volatile int*)__null) = 3121; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mFailedPutBytes == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mFailedPutBytes == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3121); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (0)" ")"); do { *((volatile int*)__null) = 3121; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); } | |||
3121 | cbSingle, 1, 1 + blockBytes * (i + 1), i + 1, 0, 0){ ProfileChunkedBuffer::State state = (cbSingle).GetState(); do { static_assert( mozilla::detail::AssertionConditionType< decltype(state.mRangeStart == (1))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(state.mRangeStart == (1)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mRangeStart == (1)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3121); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (1)" ")"); do { *((volatile int*)__null) = 3121; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd == (1 + blockBytes * (i + 1)))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(state.mRangeEnd == (1 + blockBytes * (i + 1))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mRangeEnd == (1 + blockBytes * (i + 1))", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3121); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (1 + blockBytes * (i + 1))" ")"); do { *((volatile int*)__null) = 3121; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount == (i + 1))>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(!!(state.mPushedBlockCount == (i + 1 )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mPushedBlockCount == (i + 1)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3121); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (i + 1)" ")"); do { *((volatile int*)__null) = 3121; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3121); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)" ")"); do { *((volatile int*)__null) = 3121; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mFailedPutBytes == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mFailedPutBytes == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3121); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (0)" ")"); do { *((volatile int*)__null) = 3121; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); }; | |||
3122 | } | |||
3123 | ||||
3124 | // Write the last block so that it's too big (by 1 byte) to fit in the chunk, | |||
3125 | // this should fail. | |||
3126 | const ProfileChunkedBuffer::Length remainingBytesForLastBlock = | |||
3127 | bufferBytes - blockBytes * (testBlocks - 1); | |||
3128 | MOZ_RELEASE_ASSERT(ULEB128Size(remainingBytesForLastBlock) == 1,do { static_assert( mozilla::detail::AssertionConditionType< decltype(ULEB128Size(remainingBytesForLastBlock) == 1)>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(ULEB128Size(remainingBytesForLastBlock) == 1))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("ULEB128Size(remainingBytesForLastBlock) == 1" " (" "This test assumes block sizes are small enough so that " "their ULEB128-encoded size is 1 byte" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3130); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "ULEB128Size(remainingBytesForLastBlock) == 1" ") (" "This test assumes block sizes are small enough so that " "their ULEB128-encoded size is 1 byte" ")"); do { *((volatile int*)__null) = 3130; __attribute__((nomerge)) ::abort(); } while (false); } } while (false) | |||
3129 | "This test assumes block sizes are small enough so that "do { static_assert( mozilla::detail::AssertionConditionType< decltype(ULEB128Size(remainingBytesForLastBlock) == 1)>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(ULEB128Size(remainingBytesForLastBlock) == 1))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("ULEB128Size(remainingBytesForLastBlock) == 1" " (" "This test assumes block sizes are small enough so that " "their ULEB128-encoded size is 1 byte" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3130); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "ULEB128Size(remainingBytesForLastBlock) == 1" ") (" "This test assumes block sizes are small enough so that " "their ULEB128-encoded size is 1 byte" ")"); do { *((volatile int*)__null) = 3130; __attribute__((nomerge)) ::abort(); } while (false); } } while (false) | |||
3130 | "their ULEB128-encoded size is 1 byte")do { static_assert( mozilla::detail::AssertionConditionType< decltype(ULEB128Size(remainingBytesForLastBlock) == 1)>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(ULEB128Size(remainingBytesForLastBlock) == 1))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("ULEB128Size(remainingBytesForLastBlock) == 1" " (" "This test assumes block sizes are small enough so that " "their ULEB128-encoded size is 1 byte" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3130); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "ULEB128Size(remainingBytesForLastBlock) == 1" ") (" "This test assumes block sizes are small enough so that " "their ULEB128-encoded size is 1 byte" ")"); do { *((volatile int*)__null) = 3130; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | |||
3131 | const ProfileChunkedBuffer::Length entryToFitRemainingBytes = | |||
3132 | remainingBytesForLastBlock - ULEB128Size(remainingBytesForLastBlock); | |||
3133 | cbSingle.Put(entryToFitRemainingBytes + 1, | |||
3134 | [&](Maybe<ProfileBufferEntryWriter>& aEW) { | |||
3135 | MOZ_RELEASE_ASSERT(aEW.isNothing())do { static_assert( mozilla::detail::AssertionConditionType< decltype(aEW.isNothing())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(aEW.isNothing()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("aEW.isNothing()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3135); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "aEW.isNothing()" ")"); do { *((volatile int*)__null) = 3135; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3136 | }); | |||
3137 | // The buffer state should not have changed, apart from the failed bytes. | |||
3138 | VERIFY_PCB_START_END_PUSHED_CLEARED_FAILED({ ProfileChunkedBuffer::State state = (cbSingle).GetState(); do { static_assert( mozilla::detail::AssertionConditionType< decltype(state.mRangeStart == (1))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(state.mRangeStart == (1)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mRangeStart == (1)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3140); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (1)" ")"); do { *((volatile int*)__null) = 3140; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd == (1 + blockBytes * (testBlocks - 1)))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(state.mRangeEnd == (1 + blockBytes * (testBlocks - 1))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mRangeEnd == (1 + blockBytes * (testBlocks - 1))", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3140); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (1 + blockBytes * (testBlocks - 1))" ")"); do { *((volatile int*)__null) = 3140; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount == (testBlocks - 1))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(state.mPushedBlockCount == ( testBlocks - 1)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mPushedBlockCount == (testBlocks - 1)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3140); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (testBlocks - 1)" ")"); do { *((volatile int*)__null) = 3140; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3140); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)" ")"); do { *((volatile int*)__null) = 3140; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes == (remainingBytesForLastBlock + 1))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(state.mFailedPutBytes == (remainingBytesForLastBlock + 1)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mFailedPutBytes == (remainingBytesForLastBlock + 1)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3140); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (remainingBytesForLastBlock + 1)" ")"); do { *((volatile int*)__null) = 3140; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); } | |||
3139 | cbSingle, 1, 1 + blockBytes * (testBlocks - 1), testBlocks - 1, 0,{ ProfileChunkedBuffer::State state = (cbSingle).GetState(); do { static_assert( mozilla::detail::AssertionConditionType< decltype(state.mRangeStart == (1))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(state.mRangeStart == (1)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mRangeStart == (1)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3140); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (1)" ")"); do { *((volatile int*)__null) = 3140; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd == (1 + blockBytes * (testBlocks - 1)))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(state.mRangeEnd == (1 + blockBytes * (testBlocks - 1))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mRangeEnd == (1 + blockBytes * (testBlocks - 1))", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3140); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (1 + blockBytes * (testBlocks - 1))" ")"); do { *((volatile int*)__null) = 3140; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount == (testBlocks - 1))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(state.mPushedBlockCount == ( testBlocks - 1)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mPushedBlockCount == (testBlocks - 1)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3140); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (testBlocks - 1)" ")"); do { *((volatile int*)__null) = 3140; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3140); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)" ")"); do { *((volatile int*)__null) = 3140; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes == (remainingBytesForLastBlock + 1))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(state.mFailedPutBytes == (remainingBytesForLastBlock + 1)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mFailedPutBytes == (remainingBytesForLastBlock + 1)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3140); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (remainingBytesForLastBlock + 1)" ")"); do { *((volatile int*)__null) = 3140; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); } | |||
3140 | remainingBytesForLastBlock + 1){ ProfileChunkedBuffer::State state = (cbSingle).GetState(); do { static_assert( mozilla::detail::AssertionConditionType< decltype(state.mRangeStart == (1))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(state.mRangeStart == (1)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mRangeStart == (1)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3140); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (1)" ")"); do { *((volatile int*)__null) = 3140; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd == (1 + blockBytes * (testBlocks - 1)))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(state.mRangeEnd == (1 + blockBytes * (testBlocks - 1))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mRangeEnd == (1 + blockBytes * (testBlocks - 1))", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3140); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (1 + blockBytes * (testBlocks - 1))" ")"); do { *((volatile int*)__null) = 3140; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount == (testBlocks - 1))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(state.mPushedBlockCount == ( testBlocks - 1)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mPushedBlockCount == (testBlocks - 1)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3140); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (testBlocks - 1)" ")"); do { *((volatile int*)__null) = 3140; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3140); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)" ")"); do { *((volatile int*)__null) = 3140; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes == (remainingBytesForLastBlock + 1))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(state.mFailedPutBytes == (remainingBytesForLastBlock + 1)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mFailedPutBytes == (remainingBytesForLastBlock + 1)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3140); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (remainingBytesForLastBlock + 1)" ")"); do { *((volatile int*)__null) = 3140; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); }; | |||
3141 | ||||
3142 | size_t read = 0; | |||
3143 | cbSingle.ReadEach([&](ProfileBufferEntryReader& aER) { | |||
3144 | MOZ_RELEASE_ASSERT(aER.RemainingBytes() == entryBytes)do { static_assert( mozilla::detail::AssertionConditionType< decltype(aER.RemainingBytes() == entryBytes)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(aER.RemainingBytes() == entryBytes ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "aER.RemainingBytes() == entryBytes", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3144); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "aER.RemainingBytes() == entryBytes" ")"); do { *((volatile int*)__null) = 3144; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3145 | while (aER.RemainingBytes() > 0) { | |||
3146 | MOZ_RELEASE_ASSERT(*aER == '0' + read)do { static_assert( mozilla::detail::AssertionConditionType< decltype(*aER == '0' + read)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(*aER == '0' + read))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("*aER == '0' + read" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3146); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "*aER == '0' + read" ")"); do { *((volatile int*)__null) = 3146; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3147 | ++aER; | |||
3148 | } | |||
3149 | ++read; | |||
3150 | }); | |||
3151 | MOZ_RELEASE_ASSERT(read == testBlocks - 1)do { static_assert( mozilla::detail::AssertionConditionType< decltype(read == testBlocks - 1)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(read == testBlocks - 1))), 0 ))) { do { } while (false); MOZ_ReportAssertionFailure("read == testBlocks - 1" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3151); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "read == testBlocks - 1" ")"); do { *((volatile int*)__null) = 3151; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3152 | ||||
3153 | // ~Interlude~ Test AppendContent: | |||
3154 | // Create another ProfileChunkedBuffer that will use a | |||
3155 | // ProfileBufferChunkManagerWithLocalLimit, which will give away | |||
3156 | // ProfileBufferChunks that can contain 128 bytes, using up to 1KB of memory | |||
3157 | // (including usable 128 bytes and headers). | |||
3158 | constexpr size_t bufferMaxSize = 1024; | |||
3159 | ProfileBufferChunkManagerWithLocalLimit cmTarget(bufferMaxSize, chunkMinSize); | |||
3160 | ProfileChunkedBuffer cbTarget(ProfileChunkedBuffer::ThreadSafety::WithMutex, | |||
3161 | cmTarget); | |||
3162 | ||||
3163 | // It should start empty. | |||
3164 | cbTarget.ReadEach( | |||
3165 | [](ProfileBufferEntryReader&) { MOZ_RELEASE_ASSERT(false)do { static_assert( mozilla::detail::AssertionConditionType< decltype(false)>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(!!(false))), 0))) { do { } while ( false); MOZ_ReportAssertionFailure("false", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3165); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "false" ")"); do { *((volatile int*)__null) = 3165; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); }); | |||
3166 | VERIFY_PCB_START_END_PUSHED_CLEARED_FAILED(cbTarget, 1, 1, 0, 0, 0){ ProfileChunkedBuffer::State state = (cbTarget).GetState(); do { static_assert( mozilla::detail::AssertionConditionType< decltype(state.mRangeStart == (1))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(state.mRangeStart == (1)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mRangeStart == (1)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3166); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (1)" ")"); do { *((volatile int*)__null) = 3166; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd == (1))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mRangeEnd == (1)))), 0))) { do { } while (false ); MOZ_ReportAssertionFailure("state.mRangeEnd == (1)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3166); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (1)" ")"); do { *((volatile int*)__null) = 3166; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mPushedBlockCount == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mPushedBlockCount == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3166); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (0)" ")"); do { *((volatile int*)__null) = 3166; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3166); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)" ")"); do { *((volatile int*)__null) = 3166; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mFailedPutBytes == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mFailedPutBytes == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3166); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (0)" ")"); do { *((volatile int*)__null) = 3166; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); }; | |||
3167 | ||||
3168 | // Copy the contents from cbSingle to cbTarget. | |||
3169 | cbTarget.AppendContents(cbSingle); | |||
3170 | ||||
3171 | // And verify that we now have the same contents in cbTarget. | |||
3172 | read = 0; | |||
3173 | cbTarget.ReadEach([&](ProfileBufferEntryReader& aER) { | |||
3174 | MOZ_RELEASE_ASSERT(aER.RemainingBytes() == entryBytes)do { static_assert( mozilla::detail::AssertionConditionType< decltype(aER.RemainingBytes() == entryBytes)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(aER.RemainingBytes() == entryBytes ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "aER.RemainingBytes() == entryBytes", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3174); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "aER.RemainingBytes() == entryBytes" ")"); do { *((volatile int*)__null) = 3174; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3175 | while (aER.RemainingBytes() > 0) { | |||
3176 | MOZ_RELEASE_ASSERT(*aER == '0' + read)do { static_assert( mozilla::detail::AssertionConditionType< decltype(*aER == '0' + read)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(*aER == '0' + read))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("*aER == '0' + read" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3176); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "*aER == '0' + read" ")"); do { *((volatile int*)__null) = 3176; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3177 | ++aER; | |||
3178 | } | |||
3179 | ++read; | |||
3180 | }); | |||
3181 | MOZ_RELEASE_ASSERT(read == testBlocks - 1)do { static_assert( mozilla::detail::AssertionConditionType< decltype(read == testBlocks - 1)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(read == testBlocks - 1))), 0 ))) { do { } while (false); MOZ_ReportAssertionFailure("read == testBlocks - 1" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3181); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "read == testBlocks - 1" ")"); do { *((volatile int*)__null) = 3181; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3182 | // The state should be the same as the source. | |||
3183 | VERIFY_PCB_START_END_PUSHED_CLEARED_FAILED({ ProfileChunkedBuffer::State state = (cbTarget).GetState(); do { static_assert( mozilla::detail::AssertionConditionType< decltype(state.mRangeStart == (1))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(state.mRangeStart == (1)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mRangeStart == (1)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3184); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (1)" ")"); do { *((volatile int*)__null) = 3184; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd == (1 + blockBytes * (testBlocks - 1)))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(state.mRangeEnd == (1 + blockBytes * (testBlocks - 1))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mRangeEnd == (1 + blockBytes * (testBlocks - 1))", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3184); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (1 + blockBytes * (testBlocks - 1))" ")"); do { *((volatile int*)__null) = 3184; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount == (testBlocks - 1))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(state.mPushedBlockCount == ( testBlocks - 1)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mPushedBlockCount == (testBlocks - 1)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3184); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (testBlocks - 1)" ")"); do { *((volatile int*)__null) = 3184; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3184); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)" ")"); do { *((volatile int*)__null) = 3184; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mFailedPutBytes == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mFailedPutBytes == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3184); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (0)" ")"); do { *((volatile int*)__null) = 3184; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); } | |||
3184 | cbTarget, 1, 1 + blockBytes * (testBlocks - 1), testBlocks - 1, 0, 0){ ProfileChunkedBuffer::State state = (cbTarget).GetState(); do { static_assert( mozilla::detail::AssertionConditionType< decltype(state.mRangeStart == (1))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(state.mRangeStart == (1)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mRangeStart == (1)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3184); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (1)" ")"); do { *((volatile int*)__null) = 3184; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd == (1 + blockBytes * (testBlocks - 1)))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(state.mRangeEnd == (1 + blockBytes * (testBlocks - 1))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mRangeEnd == (1 + blockBytes * (testBlocks - 1))", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3184); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (1 + blockBytes * (testBlocks - 1))" ")"); do { *((volatile int*)__null) = 3184; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount == (testBlocks - 1))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(state.mPushedBlockCount == ( testBlocks - 1)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mPushedBlockCount == (testBlocks - 1)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3184); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (testBlocks - 1)" ")"); do { *((volatile int*)__null) = 3184; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3184); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)" ")"); do { *((volatile int*)__null) = 3184; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mFailedPutBytes == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mFailedPutBytes == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3184); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (0)" ")"); do { *((volatile int*)__null) = 3184; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); }; | |||
3185 | ||||
3186 | # ifdef DEBUG1 | |||
3187 | // cbSingle.Dump(); | |||
3188 | // cbTarget.Dump(); | |||
3189 | # endif | |||
3190 | ||||
3191 | // Because we failed to write a too-big chunk above, the chunk was marked | |||
3192 | // full, so that entries should be consistently rejected from now on. | |||
3193 | cbSingle.Put(1, [&](Maybe<ProfileBufferEntryWriter>& aEW) { | |||
3194 | MOZ_RELEASE_ASSERT(aEW.isNothing())do { static_assert( mozilla::detail::AssertionConditionType< decltype(aEW.isNothing())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(aEW.isNothing()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("aEW.isNothing()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3194); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "aEW.isNothing()" ")"); do { *((volatile int*)__null) = 3194; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3195 | }); | |||
3196 | VERIFY_PCB_START_END_PUSHED_CLEARED_FAILED({ ProfileChunkedBuffer::State state = (cbSingle).GetState(); do { static_assert( mozilla::detail::AssertionConditionType< decltype(state.mRangeStart == (1))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(state.mRangeStart == (1)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mRangeStart == (1)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3198); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (1)" ")"); do { *((volatile int*)__null) = 3198; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd == (1 + blockBytes * ((testBlocks - 1))))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(state.mRangeEnd == (1 + blockBytes * ((testBlocks - 1)))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mRangeEnd == (1 + blockBytes * ((testBlocks - 1)))", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3198); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (1 + blockBytes * ((testBlocks - 1)))" ")"); do { *((volatile int*)__null) = 3198; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount == (testBlocks - 1))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(state.mPushedBlockCount == ( testBlocks - 1)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mPushedBlockCount == (testBlocks - 1)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3198); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (testBlocks - 1)" ")"); do { *((volatile int*)__null) = 3198; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3198); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)" ")"); do { *((volatile int*)__null) = 3198; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes == (remainingBytesForLastBlock + 1 + ULEB128Size(1u) + 1))> ::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mFailedPutBytes == (remainingBytesForLastBlock + 1 + ULEB128Size(1u) + 1)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mFailedPutBytes == (remainingBytesForLastBlock + 1 + ULEB128Size(1u) + 1)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3198); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (remainingBytesForLastBlock + 1 + ULEB128Size(1u) + 1)" ")"); do { *((volatile int*)__null) = 3198; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); } | |||
3197 | cbSingle, 1, 1 + blockBytes * ((testBlocks - 1)), testBlocks - 1, 0,{ ProfileChunkedBuffer::State state = (cbSingle).GetState(); do { static_assert( mozilla::detail::AssertionConditionType< decltype(state.mRangeStart == (1))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(state.mRangeStart == (1)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mRangeStart == (1)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3198); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (1)" ")"); do { *((volatile int*)__null) = 3198; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd == (1 + blockBytes * ((testBlocks - 1))))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(state.mRangeEnd == (1 + blockBytes * ((testBlocks - 1)))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mRangeEnd == (1 + blockBytes * ((testBlocks - 1)))", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3198); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (1 + blockBytes * ((testBlocks - 1)))" ")"); do { *((volatile int*)__null) = 3198; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount == (testBlocks - 1))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(state.mPushedBlockCount == ( testBlocks - 1)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mPushedBlockCount == (testBlocks - 1)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3198); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (testBlocks - 1)" ")"); do { *((volatile int*)__null) = 3198; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3198); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)" ")"); do { *((volatile int*)__null) = 3198; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes == (remainingBytesForLastBlock + 1 + ULEB128Size(1u) + 1))> ::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mFailedPutBytes == (remainingBytesForLastBlock + 1 + ULEB128Size(1u) + 1)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mFailedPutBytes == (remainingBytesForLastBlock + 1 + ULEB128Size(1u) + 1)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3198); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (remainingBytesForLastBlock + 1 + ULEB128Size(1u) + 1)" ")"); do { *((volatile int*)__null) = 3198; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); } | |||
3198 | remainingBytesForLastBlock + 1 + ULEB128Size(1u) + 1){ ProfileChunkedBuffer::State state = (cbSingle).GetState(); do { static_assert( mozilla::detail::AssertionConditionType< decltype(state.mRangeStart == (1))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(state.mRangeStart == (1)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mRangeStart == (1)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3198); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (1)" ")"); do { *((volatile int*)__null) = 3198; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd == (1 + blockBytes * ((testBlocks - 1))))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(state.mRangeEnd == (1 + blockBytes * ((testBlocks - 1)))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mRangeEnd == (1 + blockBytes * ((testBlocks - 1)))", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3198); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (1 + blockBytes * ((testBlocks - 1)))" ")"); do { *((volatile int*)__null) = 3198; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount == (testBlocks - 1))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(state.mPushedBlockCount == ( testBlocks - 1)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mPushedBlockCount == (testBlocks - 1)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3198); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (testBlocks - 1)" ")"); do { *((volatile int*)__null) = 3198; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3198); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)" ")"); do { *((volatile int*)__null) = 3198; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes == (remainingBytesForLastBlock + 1 + ULEB128Size(1u) + 1))> ::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mFailedPutBytes == (remainingBytesForLastBlock + 1 + ULEB128Size(1u) + 1)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mFailedPutBytes == (remainingBytesForLastBlock + 1 + ULEB128Size(1u) + 1)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3198); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (remainingBytesForLastBlock + 1 + ULEB128Size(1u) + 1)" ")"); do { *((volatile int*)__null) = 3198; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); }; | |||
3199 | ||||
3200 | // Clear the buffer before the next test. | |||
3201 | ||||
3202 | cbSingle.Clear(); | |||
3203 | // Clear() should move the index to the next chunk range -- even if it's | |||
3204 | // really reusing the same chunk. | |||
3205 | VERIFY_PCB_START_END_PUSHED_CLEARED_FAILED(cbSingle, 1 + bufferBytes,{ ProfileChunkedBuffer::State state = (cbSingle).GetState(); do { static_assert( mozilla::detail::AssertionConditionType< decltype(state.mRangeStart == (1 + bufferBytes))>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(state.mRangeStart == (1 + bufferBytes)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mRangeStart == (1 + bufferBytes)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3206); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (1 + bufferBytes)" ")"); do { *((volatile int*)__null) = 3206; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd == (1 + bufferBytes))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(state.mRangeEnd == (1 + bufferBytes )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mRangeEnd == (1 + bufferBytes)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3206); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (1 + bufferBytes)" ")"); do { *((volatile int*)__null) = 3206; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mPushedBlockCount == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mPushedBlockCount == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3206); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (0)" ")"); do { *((volatile int*)__null) = 3206; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3206); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)" ")"); do { *((volatile int*)__null) = 3206; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mFailedPutBytes == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mFailedPutBytes == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3206); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (0)" ")"); do { *((volatile int*)__null) = 3206; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); } | |||
3206 | 1 + bufferBytes, 0, 0, 0){ ProfileChunkedBuffer::State state = (cbSingle).GetState(); do { static_assert( mozilla::detail::AssertionConditionType< decltype(state.mRangeStart == (1 + bufferBytes))>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(state.mRangeStart == (1 + bufferBytes)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mRangeStart == (1 + bufferBytes)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3206); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (1 + bufferBytes)" ")"); do { *((volatile int*)__null) = 3206; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd == (1 + bufferBytes))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(state.mRangeEnd == (1 + bufferBytes )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mRangeEnd == (1 + bufferBytes)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3206); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (1 + bufferBytes)" ")"); do { *((volatile int*)__null) = 3206; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mPushedBlockCount == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mPushedBlockCount == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3206); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (0)" ")"); do { *((volatile int*)__null) = 3206; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3206); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)" ")"); do { *((volatile int*)__null) = 3206; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mFailedPutBytes == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mFailedPutBytes == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3206); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (0)" ")"); do { *((volatile int*)__null) = 3206; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); }; | |||
3207 | cbSingle.ReadEach( | |||
3208 | [&](ProfileBufferEntryReader& aER) { MOZ_RELEASE_ASSERT(false)do { static_assert( mozilla::detail::AssertionConditionType< decltype(false)>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(!!(false))), 0))) { do { } while ( false); MOZ_ReportAssertionFailure("false", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3208); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "false" ")"); do { *((volatile int*)__null) = 3208; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); }); | |||
3209 | ||||
3210 | // Second buffer-filling test: Try to write a final entry that just fits at | |||
3211 | // the end of the chunk. | |||
3212 | ||||
3213 | // Write all but one block. | |||
3214 | for (size_t i = 0; i < testBlocks - 1; ++i) { | |||
3215 | cbSingle.Put(entryBytes, [&](Maybe<ProfileBufferEntryWriter>& aEW) { | |||
3216 | MOZ_RELEASE_ASSERT(aEW.isSome())do { static_assert( mozilla::detail::AssertionConditionType< decltype(aEW.isSome())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(aEW.isSome()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("aEW.isSome()", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3216); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "aEW.isSome()" ")"); do { *((volatile int*)__null) = 3216; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3217 | while (aEW->RemainingBytes() > 0) { | |||
3218 | **aEW = 'a' + i; | |||
3219 | ++(*aEW); | |||
3220 | } | |||
3221 | }); | |||
3222 | VERIFY_PCB_START_END_PUSHED_CLEARED_FAILED({ ProfileChunkedBuffer::State state = (cbSingle).GetState(); do { static_assert( mozilla::detail::AssertionConditionType< decltype(state.mRangeStart == (1 + bufferBytes))>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(state.mRangeStart == (1 + bufferBytes)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mRangeStart == (1 + bufferBytes)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3224); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (1 + bufferBytes)" ")"); do { *((volatile int*)__null) = 3224; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd == (1 + bufferBytes + blockBytes * (i + 1)))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(state.mRangeEnd == (1 + bufferBytes + blockBytes * (i + 1))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mRangeEnd == (1 + bufferBytes + blockBytes * (i + 1))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3224); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (1 + bufferBytes + blockBytes * (i + 1))" ")"); do { *((volatile int*)__null) = 3224; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount == (i + 1))>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(!!(state.mPushedBlockCount == (i + 1 )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mPushedBlockCount == (i + 1)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3224); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (i + 1)" ")"); do { *((volatile int*)__null) = 3224; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3224); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)" ")"); do { *((volatile int*)__null) = 3224; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mFailedPutBytes == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mFailedPutBytes == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3224); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (0)" ")"); do { *((volatile int*)__null) = 3224; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); } | |||
3223 | cbSingle, 1 + bufferBytes, 1 + bufferBytes + blockBytes * (i + 1),{ ProfileChunkedBuffer::State state = (cbSingle).GetState(); do { static_assert( mozilla::detail::AssertionConditionType< decltype(state.mRangeStart == (1 + bufferBytes))>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(state.mRangeStart == (1 + bufferBytes)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mRangeStart == (1 + bufferBytes)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3224); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (1 + bufferBytes)" ")"); do { *((volatile int*)__null) = 3224; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd == (1 + bufferBytes + blockBytes * (i + 1)))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(state.mRangeEnd == (1 + bufferBytes + blockBytes * (i + 1))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mRangeEnd == (1 + bufferBytes + blockBytes * (i + 1))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3224); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (1 + bufferBytes + blockBytes * (i + 1))" ")"); do { *((volatile int*)__null) = 3224; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount == (i + 1))>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(!!(state.mPushedBlockCount == (i + 1 )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mPushedBlockCount == (i + 1)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3224); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (i + 1)" ")"); do { *((volatile int*)__null) = 3224; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3224); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)" ")"); do { *((volatile int*)__null) = 3224; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mFailedPutBytes == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mFailedPutBytes == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3224); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (0)" ")"); do { *((volatile int*)__null) = 3224; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); } | |||
3224 | i + 1, 0, 0){ ProfileChunkedBuffer::State state = (cbSingle).GetState(); do { static_assert( mozilla::detail::AssertionConditionType< decltype(state.mRangeStart == (1 + bufferBytes))>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(state.mRangeStart == (1 + bufferBytes)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mRangeStart == (1 + bufferBytes)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3224); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (1 + bufferBytes)" ")"); do { *((volatile int*)__null) = 3224; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd == (1 + bufferBytes + blockBytes * (i + 1)))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(state.mRangeEnd == (1 + bufferBytes + blockBytes * (i + 1))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mRangeEnd == (1 + bufferBytes + blockBytes * (i + 1))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3224); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (1 + bufferBytes + blockBytes * (i + 1))" ")"); do { *((volatile int*)__null) = 3224; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount == (i + 1))>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(!!(state.mPushedBlockCount == (i + 1 )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mPushedBlockCount == (i + 1)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3224); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (i + 1)" ")"); do { *((volatile int*)__null) = 3224; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3224); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)" ")"); do { *((volatile int*)__null) = 3224; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mFailedPutBytes == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mFailedPutBytes == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3224); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (0)" ")"); do { *((volatile int*)__null) = 3224; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); }; | |||
3225 | } | |||
3226 | ||||
3227 | read = 0; | |||
3228 | cbSingle.ReadEach([&](ProfileBufferEntryReader& aER) { | |||
3229 | MOZ_RELEASE_ASSERT(aER.RemainingBytes() == entryBytes)do { static_assert( mozilla::detail::AssertionConditionType< decltype(aER.RemainingBytes() == entryBytes)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(aER.RemainingBytes() == entryBytes ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "aER.RemainingBytes() == entryBytes", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3229); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "aER.RemainingBytes() == entryBytes" ")"); do { *((volatile int*)__null) = 3229; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3230 | while (aER.RemainingBytes() > 0) { | |||
3231 | MOZ_RELEASE_ASSERT(*aER == 'a' + read)do { static_assert( mozilla::detail::AssertionConditionType< decltype(*aER == 'a' + read)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(*aER == 'a' + read))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("*aER == 'a' + read" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3231); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "*aER == 'a' + read" ")"); do { *((volatile int*)__null) = 3231; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3232 | ++aER; | |||
3233 | } | |||
3234 | ++read; | |||
3235 | }); | |||
3236 | MOZ_RELEASE_ASSERT(read == testBlocks - 1)do { static_assert( mozilla::detail::AssertionConditionType< decltype(read == testBlocks - 1)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(read == testBlocks - 1))), 0 ))) { do { } while (false); MOZ_ReportAssertionFailure("read == testBlocks - 1" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3236); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "read == testBlocks - 1" ")"); do { *((volatile int*)__null) = 3236; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3237 | ||||
3238 | // Write the last block so that it fits exactly in the chunk. | |||
3239 | cbSingle.Put(entryToFitRemainingBytes, | |||
3240 | [&](Maybe<ProfileBufferEntryWriter>& aEW) { | |||
3241 | MOZ_RELEASE_ASSERT(aEW.isSome())do { static_assert( mozilla::detail::AssertionConditionType< decltype(aEW.isSome())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(aEW.isSome()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("aEW.isSome()", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3241); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "aEW.isSome()" ")"); do { *((volatile int*)__null) = 3241; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3242 | while (aEW->RemainingBytes() > 0) { | |||
3243 | **aEW = 'a' + (testBlocks - 1); | |||
3244 | ++(*aEW); | |||
3245 | } | |||
3246 | }); | |||
3247 | VERIFY_PCB_START_END_PUSHED_CLEARED_FAILED({ ProfileChunkedBuffer::State state = (cbSingle).GetState(); do { static_assert( mozilla::detail::AssertionConditionType< decltype(state.mRangeStart == (1 + bufferBytes))>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(state.mRangeStart == (1 + bufferBytes)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mRangeStart == (1 + bufferBytes)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3249); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (1 + bufferBytes)" ")"); do { *((volatile int*)__null) = 3249; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd == (1 + bufferBytes + blockBytes * testBlocks))>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(state.mRangeEnd == (1 + bufferBytes + blockBytes * testBlocks )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mRangeEnd == (1 + bufferBytes + blockBytes * testBlocks)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3249); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (1 + bufferBytes + blockBytes * testBlocks)" ")"); do { *((volatile int*)__null) = 3249; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount == (testBlocks))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(state.mPushedBlockCount == ( testBlocks)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mPushedBlockCount == (testBlocks)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3249); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (testBlocks)" ")"); do { *((volatile int*)__null) = 3249; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3249); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)" ")"); do { *((volatile int*)__null) = 3249; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mFailedPutBytes == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mFailedPutBytes == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3249); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (0)" ")"); do { *((volatile int*)__null) = 3249; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); } | |||
3248 | cbSingle, 1 + bufferBytes, 1 + bufferBytes + blockBytes * testBlocks,{ ProfileChunkedBuffer::State state = (cbSingle).GetState(); do { static_assert( mozilla::detail::AssertionConditionType< decltype(state.mRangeStart == (1 + bufferBytes))>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(state.mRangeStart == (1 + bufferBytes)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mRangeStart == (1 + bufferBytes)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3249); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (1 + bufferBytes)" ")"); do { *((volatile int*)__null) = 3249; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd == (1 + bufferBytes + blockBytes * testBlocks))>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(state.mRangeEnd == (1 + bufferBytes + blockBytes * testBlocks )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mRangeEnd == (1 + bufferBytes + blockBytes * testBlocks)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3249); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (1 + bufferBytes + blockBytes * testBlocks)" ")"); do { *((volatile int*)__null) = 3249; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount == (testBlocks))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(state.mPushedBlockCount == ( testBlocks)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mPushedBlockCount == (testBlocks)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3249); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (testBlocks)" ")"); do { *((volatile int*)__null) = 3249; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3249); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)" ")"); do { *((volatile int*)__null) = 3249; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mFailedPutBytes == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mFailedPutBytes == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3249); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (0)" ")"); do { *((volatile int*)__null) = 3249; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); } | |||
3249 | testBlocks, 0, 0){ ProfileChunkedBuffer::State state = (cbSingle).GetState(); do { static_assert( mozilla::detail::AssertionConditionType< decltype(state.mRangeStart == (1 + bufferBytes))>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(state.mRangeStart == (1 + bufferBytes)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mRangeStart == (1 + bufferBytes)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3249); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (1 + bufferBytes)" ")"); do { *((volatile int*)__null) = 3249; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd == (1 + bufferBytes + blockBytes * testBlocks))>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(state.mRangeEnd == (1 + bufferBytes + blockBytes * testBlocks )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mRangeEnd == (1 + bufferBytes + blockBytes * testBlocks)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3249); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (1 + bufferBytes + blockBytes * testBlocks)" ")"); do { *((volatile int*)__null) = 3249; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount == (testBlocks))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(state.mPushedBlockCount == ( testBlocks)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mPushedBlockCount == (testBlocks)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3249); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (testBlocks)" ")"); do { *((volatile int*)__null) = 3249; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3249); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)" ")"); do { *((volatile int*)__null) = 3249; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mFailedPutBytes == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mFailedPutBytes == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3249); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (0)" ")"); do { *((volatile int*)__null) = 3249; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); }; | |||
3250 | ||||
3251 | read = 0; | |||
3252 | cbSingle.ReadEach([&](ProfileBufferEntryReader& aER) { | |||
3253 | MOZ_RELEASE_ASSERT(do { static_assert( mozilla::detail::AssertionConditionType< decltype(aER.RemainingBytes() == ((read < testBlocks) ? entryBytes : entryToFitRemainingBytes))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(aER.RemainingBytes() == ((read < testBlocks) ? entryBytes : entryToFitRemainingBytes)))) , 0))) { do { } while (false); MOZ_ReportAssertionFailure("aER.RemainingBytes() == ((read < testBlocks) ? entryBytes : entryToFitRemainingBytes)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3255); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "aER.RemainingBytes() == ((read < testBlocks) ? entryBytes : entryToFitRemainingBytes)" ")"); do { *((volatile int*)__null) = 3255; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
3254 | aER.RemainingBytes() ==do { static_assert( mozilla::detail::AssertionConditionType< decltype(aER.RemainingBytes() == ((read < testBlocks) ? entryBytes : entryToFitRemainingBytes))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(aER.RemainingBytes() == ((read < testBlocks) ? entryBytes : entryToFitRemainingBytes)))) , 0))) { do { } while (false); MOZ_ReportAssertionFailure("aER.RemainingBytes() == ((read < testBlocks) ? entryBytes : entryToFitRemainingBytes)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3255); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "aER.RemainingBytes() == ((read < testBlocks) ? entryBytes : entryToFitRemainingBytes)" ")"); do { *((volatile int*)__null) = 3255; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
3255 | ((read < testBlocks) ? entryBytes : entryToFitRemainingBytes))do { static_assert( mozilla::detail::AssertionConditionType< decltype(aER.RemainingBytes() == ((read < testBlocks) ? entryBytes : entryToFitRemainingBytes))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(aER.RemainingBytes() == ((read < testBlocks) ? entryBytes : entryToFitRemainingBytes)))) , 0))) { do { } while (false); MOZ_ReportAssertionFailure("aER.RemainingBytes() == ((read < testBlocks) ? entryBytes : entryToFitRemainingBytes)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3255); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "aER.RemainingBytes() == ((read < testBlocks) ? entryBytes : entryToFitRemainingBytes)" ")"); do { *((volatile int*)__null) = 3255; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3256 | while (aER.RemainingBytes() > 0) { | |||
3257 | MOZ_RELEASE_ASSERT(*aER == 'a' + read)do { static_assert( mozilla::detail::AssertionConditionType< decltype(*aER == 'a' + read)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(*aER == 'a' + read))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("*aER == 'a' + read" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3257); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "*aER == 'a' + read" ")"); do { *((volatile int*)__null) = 3257; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3258 | ++aER; | |||
3259 | } | |||
3260 | ++read; | |||
3261 | }); | |||
3262 | MOZ_RELEASE_ASSERT(read == testBlocks)do { static_assert( mozilla::detail::AssertionConditionType< decltype(read == testBlocks)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(read == testBlocks))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("read == testBlocks" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3262); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "read == testBlocks" ")"); do { *((volatile int*)__null) = 3262; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3263 | ||||
3264 | // Because the single chunk has been filled, it shouldn't be possible to write | |||
3265 | // more entries. | |||
3266 | cbSingle.Put(1, [&](Maybe<ProfileBufferEntryWriter>& aEW) { | |||
3267 | MOZ_RELEASE_ASSERT(aEW.isNothing())do { static_assert( mozilla::detail::AssertionConditionType< decltype(aEW.isNothing())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(aEW.isNothing()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("aEW.isNothing()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3267); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "aEW.isNothing()" ")"); do { *((volatile int*)__null) = 3267; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3268 | }); | |||
3269 | VERIFY_PCB_START_END_PUSHED_CLEARED_FAILED({ ProfileChunkedBuffer::State state = (cbSingle).GetState(); do { static_assert( mozilla::detail::AssertionConditionType< decltype(state.mRangeStart == (1 + bufferBytes))>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(state.mRangeStart == (1 + bufferBytes)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mRangeStart == (1 + bufferBytes)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3271); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (1 + bufferBytes)" ")"); do { *((volatile int*)__null) = 3271; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd == (1 + bufferBytes + blockBytes * testBlocks))>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(state.mRangeEnd == (1 + bufferBytes + blockBytes * testBlocks )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mRangeEnd == (1 + bufferBytes + blockBytes * testBlocks)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3271); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (1 + bufferBytes + blockBytes * testBlocks)" ")"); do { *((volatile int*)__null) = 3271; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount == (testBlocks))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(state.mPushedBlockCount == ( testBlocks)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mPushedBlockCount == (testBlocks)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3271); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (testBlocks)" ")"); do { *((volatile int*)__null) = 3271; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3271); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)" ")"); do { *((volatile int*)__null) = 3271; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes == (ULEB128Size(1u) + 1))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(state.mFailedPutBytes == (ULEB128Size (1u) + 1)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mFailedPutBytes == (ULEB128Size(1u) + 1)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3271); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (ULEB128Size(1u) + 1)" ")"); do { *((volatile int*)__null) = 3271; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); } | |||
3270 | cbSingle, 1 + bufferBytes, 1 + bufferBytes + blockBytes * testBlocks,{ ProfileChunkedBuffer::State state = (cbSingle).GetState(); do { static_assert( mozilla::detail::AssertionConditionType< decltype(state.mRangeStart == (1 + bufferBytes))>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(state.mRangeStart == (1 + bufferBytes)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mRangeStart == (1 + bufferBytes)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3271); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (1 + bufferBytes)" ")"); do { *((volatile int*)__null) = 3271; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd == (1 + bufferBytes + blockBytes * testBlocks))>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(state.mRangeEnd == (1 + bufferBytes + blockBytes * testBlocks )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mRangeEnd == (1 + bufferBytes + blockBytes * testBlocks)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3271); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (1 + bufferBytes + blockBytes * testBlocks)" ")"); do { *((volatile int*)__null) = 3271; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount == (testBlocks))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(state.mPushedBlockCount == ( testBlocks)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mPushedBlockCount == (testBlocks)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3271); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (testBlocks)" ")"); do { *((volatile int*)__null) = 3271; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3271); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)" ")"); do { *((volatile int*)__null) = 3271; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes == (ULEB128Size(1u) + 1))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(state.mFailedPutBytes == (ULEB128Size (1u) + 1)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mFailedPutBytes == (ULEB128Size(1u) + 1)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3271); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (ULEB128Size(1u) + 1)" ")"); do { *((volatile int*)__null) = 3271; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); } | |||
3271 | testBlocks, 0, ULEB128Size(1u) + 1){ ProfileChunkedBuffer::State state = (cbSingle).GetState(); do { static_assert( mozilla::detail::AssertionConditionType< decltype(state.mRangeStart == (1 + bufferBytes))>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(state.mRangeStart == (1 + bufferBytes)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mRangeStart == (1 + bufferBytes)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3271); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (1 + bufferBytes)" ")"); do { *((volatile int*)__null) = 3271; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd == (1 + bufferBytes + blockBytes * testBlocks))>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(state.mRangeEnd == (1 + bufferBytes + blockBytes * testBlocks )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mRangeEnd == (1 + bufferBytes + blockBytes * testBlocks)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3271); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (1 + bufferBytes + blockBytes * testBlocks)" ")"); do { *((volatile int*)__null) = 3271; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount == (testBlocks))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(state.mPushedBlockCount == ( testBlocks)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mPushedBlockCount == (testBlocks)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3271); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (testBlocks)" ")"); do { *((volatile int*)__null) = 3271; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3271); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)" ")"); do { *((volatile int*)__null) = 3271; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes == (ULEB128Size(1u) + 1))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(state.mFailedPutBytes == (ULEB128Size (1u) + 1)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mFailedPutBytes == (ULEB128Size(1u) + 1)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3271); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (ULEB128Size(1u) + 1)" ")"); do { *((volatile int*)__null) = 3271; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); }; | |||
3272 | ||||
3273 | cbSingle.Clear(); | |||
3274 | // Clear() should move the index to the next chunk range -- even if it's | |||
3275 | // really reusing the same chunk. | |||
3276 | VERIFY_PCB_START_END_PUSHED_CLEARED_FAILED(cbSingle, 1 + bufferBytes * 2,{ ProfileChunkedBuffer::State state = (cbSingle).GetState(); do { static_assert( mozilla::detail::AssertionConditionType< decltype(state.mRangeStart == (1 + bufferBytes * 2))>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(state.mRangeStart == (1 + bufferBytes * 2)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mRangeStart == (1 + bufferBytes * 2)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3277); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (1 + bufferBytes * 2)" ")"); do { *((volatile int*)__null) = 3277; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd == (1 + bufferBytes * 2))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(state.mRangeEnd == (1 + bufferBytes * 2)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mRangeEnd == (1 + bufferBytes * 2)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3277); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (1 + bufferBytes * 2)" ")"); do { *((volatile int*)__null) = 3277; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mPushedBlockCount == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mPushedBlockCount == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3277); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (0)" ")"); do { *((volatile int*)__null) = 3277; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3277); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)" ")"); do { *((volatile int*)__null) = 3277; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mFailedPutBytes == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mFailedPutBytes == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3277); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (0)" ")"); do { *((volatile int*)__null) = 3277; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); } | |||
3277 | 1 + bufferBytes * 2, 0, 0, 0){ ProfileChunkedBuffer::State state = (cbSingle).GetState(); do { static_assert( mozilla::detail::AssertionConditionType< decltype(state.mRangeStart == (1 + bufferBytes * 2))>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(state.mRangeStart == (1 + bufferBytes * 2)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mRangeStart == (1 + bufferBytes * 2)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3277); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (1 + bufferBytes * 2)" ")"); do { *((volatile int*)__null) = 3277; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd == (1 + bufferBytes * 2))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(state.mRangeEnd == (1 + bufferBytes * 2)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mRangeEnd == (1 + bufferBytes * 2)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3277); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (1 + bufferBytes * 2)" ")"); do { *((volatile int*)__null) = 3277; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mPushedBlockCount == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mPushedBlockCount == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3277); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (0)" ")"); do { *((volatile int*)__null) = 3277; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3277); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)" ")"); do { *((volatile int*)__null) = 3277; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mFailedPutBytes == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mFailedPutBytes == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3277); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (0)" ")"); do { *((volatile int*)__null) = 3277; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); }; | |||
3278 | cbSingle.ReadEach( | |||
3279 | [&](ProfileBufferEntryReader& aER) { MOZ_RELEASE_ASSERT(false)do { static_assert( mozilla::detail::AssertionConditionType< decltype(false)>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(!!(false))), 0))) { do { } while ( false); MOZ_ReportAssertionFailure("false", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3279); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "false" ")"); do { *((volatile int*)__null) = 3279; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); }); | |||
3280 | ||||
3281 | // Clear() recycles the released chunk, so we should be able to record new | |||
3282 | // entries. | |||
3283 | cbSingle.Put(entryBytes, [&](Maybe<ProfileBufferEntryWriter>& aEW) { | |||
3284 | MOZ_RELEASE_ASSERT(aEW.isSome())do { static_assert( mozilla::detail::AssertionConditionType< decltype(aEW.isSome())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(aEW.isSome()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("aEW.isSome()", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3284); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "aEW.isSome()" ")"); do { *((volatile int*)__null) = 3284; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3285 | while (aEW->RemainingBytes() > 0) { | |||
3286 | **aEW = 'x'; | |||
3287 | ++(*aEW); | |||
3288 | } | |||
3289 | }); | |||
3290 | VERIFY_PCB_START_END_PUSHED_CLEARED_FAILED({ ProfileChunkedBuffer::State state = (cbSingle).GetState(); do { static_assert( mozilla::detail::AssertionConditionType< decltype(state.mRangeStart == (1 + bufferBytes * 2))>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(state.mRangeStart == (1 + bufferBytes * 2)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mRangeStart == (1 + bufferBytes * 2)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3292); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (1 + bufferBytes * 2)" ")"); do { *((volatile int*)__null) = 3292; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd == (1 + bufferBytes * 2 + ULEB128Size(entryBytes) + entryBytes ))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mRangeEnd == (1 + bufferBytes * 2 + ULEB128Size (entryBytes) + entryBytes)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mRangeEnd == (1 + bufferBytes * 2 + ULEB128Size(entryBytes) + entryBytes)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3292); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (1 + bufferBytes * 2 + ULEB128Size(entryBytes) + entryBytes)" ")"); do { *((volatile int*)__null) = 3292; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount == (1))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mPushedBlockCount == (1)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mPushedBlockCount == (1)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3292); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (1)" ")"); do { *((volatile int*)__null) = 3292; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3292); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)" ")"); do { *((volatile int*)__null) = 3292; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mFailedPutBytes == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mFailedPutBytes == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3292); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (0)" ")"); do { *((volatile int*)__null) = 3292; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); } | |||
3291 | cbSingle, 1 + bufferBytes * 2,{ ProfileChunkedBuffer::State state = (cbSingle).GetState(); do { static_assert( mozilla::detail::AssertionConditionType< decltype(state.mRangeStart == (1 + bufferBytes * 2))>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(state.mRangeStart == (1 + bufferBytes * 2)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mRangeStart == (1 + bufferBytes * 2)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3292); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (1 + bufferBytes * 2)" ")"); do { *((volatile int*)__null) = 3292; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd == (1 + bufferBytes * 2 + ULEB128Size(entryBytes) + entryBytes ))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mRangeEnd == (1 + bufferBytes * 2 + ULEB128Size (entryBytes) + entryBytes)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mRangeEnd == (1 + bufferBytes * 2 + ULEB128Size(entryBytes) + entryBytes)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3292); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (1 + bufferBytes * 2 + ULEB128Size(entryBytes) + entryBytes)" ")"); do { *((volatile int*)__null) = 3292; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount == (1))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mPushedBlockCount == (1)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mPushedBlockCount == (1)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3292); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (1)" ")"); do { *((volatile int*)__null) = 3292; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3292); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)" ")"); do { *((volatile int*)__null) = 3292; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mFailedPutBytes == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mFailedPutBytes == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3292); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (0)" ")"); do { *((volatile int*)__null) = 3292; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); } | |||
3292 | 1 + bufferBytes * 2 + ULEB128Size(entryBytes) + entryBytes, 1, 0, 0){ ProfileChunkedBuffer::State state = (cbSingle).GetState(); do { static_assert( mozilla::detail::AssertionConditionType< decltype(state.mRangeStart == (1 + bufferBytes * 2))>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(state.mRangeStart == (1 + bufferBytes * 2)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mRangeStart == (1 + bufferBytes * 2)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3292); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeStart == (1 + bufferBytes * 2)" ")"); do { *((volatile int*)__null) = 3292; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mRangeEnd == (1 + bufferBytes * 2 + ULEB128Size(entryBytes) + entryBytes ))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mRangeEnd == (1 + bufferBytes * 2 + ULEB128Size (entryBytes) + entryBytes)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("state.mRangeEnd == (1 + bufferBytes * 2 + ULEB128Size(entryBytes) + entryBytes)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3292); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mRangeEnd == (1 + bufferBytes * 2 + ULEB128Size(entryBytes) + entryBytes)" ")"); do { *((volatile int*)__null) = 3292; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mPushedBlockCount == (1))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mPushedBlockCount == (1)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mPushedBlockCount == (1)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3292); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mPushedBlockCount == (1)" ")"); do { *((volatile int*)__null) = 3292; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mClearedBlockCount == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mClearedBlockCount == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mClearedBlockCount == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3292); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mClearedBlockCount == (0)" ")"); do { *((volatile int*)__null) = 3292; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); do { static_assert ( mozilla::detail::AssertionConditionType<decltype(state.mFailedPutBytes == (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(state.mFailedPutBytes == (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("state.mFailedPutBytes == (0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3292); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "state.mFailedPutBytes == (0)" ")"); do { *((volatile int*)__null) = 3292; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); }; | |||
3293 | read = 0; | |||
3294 | cbSingle.ReadEach([&](ProfileBufferEntryReader& aER) { | |||
3295 | MOZ_RELEASE_ASSERT(read == 0)do { static_assert( mozilla::detail::AssertionConditionType< decltype(read == 0)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(read == 0))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("read == 0", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3295); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "read == 0" ")"); do { *((volatile int*)__null) = 3295; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3296 | MOZ_RELEASE_ASSERT(aER.RemainingBytes() == entryBytes)do { static_assert( mozilla::detail::AssertionConditionType< decltype(aER.RemainingBytes() == entryBytes)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(aER.RemainingBytes() == entryBytes ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "aER.RemainingBytes() == entryBytes", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3296); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "aER.RemainingBytes() == entryBytes" ")"); do { *((volatile int*)__null) = 3296; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3297 | while (aER.RemainingBytes() > 0) { | |||
3298 | MOZ_RELEASE_ASSERT(*aER == 'x')do { static_assert( mozilla::detail::AssertionConditionType< decltype(*aER == 'x')>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(*aER == 'x'))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("*aER == 'x'", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3298); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "*aER == 'x'" ")"); do { *((volatile int*)__null) = 3298; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3299 | ++aER; | |||
3300 | } | |||
3301 | ++read; | |||
3302 | }); | |||
3303 | MOZ_RELEASE_ASSERT(read == 1)do { static_assert( mozilla::detail::AssertionConditionType< decltype(read == 1)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(read == 1))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("read == 1", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3303); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "read == 1" ")"); do { *((volatile int*)__null) = 3303; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3304 | ||||
3305 | printf("TestChunkedBufferSingle done\n"); | |||
3306 | } | |||
3307 | ||||
3308 | static void TestModuloBuffer(ModuloBuffer<>& mb, uint32_t MBSize) { | |||
3309 | using MB = ModuloBuffer<>; | |||
3310 | ||||
3311 | MOZ_RELEASE_ASSERT(mb.BufferLength().Value() == MBSize)do { static_assert( mozilla::detail::AssertionConditionType< decltype(mb.BufferLength().Value() == MBSize)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(mb.BufferLength().Value() == MBSize))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("mb.BufferLength().Value() == MBSize", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3311); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mb.BufferLength().Value() == MBSize" ")"); do { *((volatile int*)__null) = 3311; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3312 | ||||
3313 | // Iterator comparisons. | |||
3314 | MOZ_RELEASE_ASSERT(mb.ReaderAt(2) == mb.ReaderAt(2))do { static_assert( mozilla::detail::AssertionConditionType< decltype(mb.ReaderAt(2) == mb.ReaderAt(2))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(mb.ReaderAt(2) == mb.ReaderAt (2)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("mb.ReaderAt(2) == mb.ReaderAt(2)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3314); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mb.ReaderAt(2) == mb.ReaderAt(2)" ")"); do { *((volatile int*)__null) = 3314; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3315 | MOZ_RELEASE_ASSERT(mb.ReaderAt(2) != mb.ReaderAt(3))do { static_assert( mozilla::detail::AssertionConditionType< decltype(mb.ReaderAt(2) != mb.ReaderAt(3))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(mb.ReaderAt(2) != mb.ReaderAt (3)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("mb.ReaderAt(2) != mb.ReaderAt(3)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3315); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mb.ReaderAt(2) != mb.ReaderAt(3)" ")"); do { *((volatile int*)__null) = 3315; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3316 | MOZ_RELEASE_ASSERT(mb.ReaderAt(2) < mb.ReaderAt(3))do { static_assert( mozilla::detail::AssertionConditionType< decltype(mb.ReaderAt(2) < mb.ReaderAt(3))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(mb.ReaderAt(2) < mb.ReaderAt (3)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("mb.ReaderAt(2) < mb.ReaderAt(3)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3316); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mb.ReaderAt(2) < mb.ReaderAt(3)" ")"); do { *((volatile int*)__null) = 3316; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3317 | MOZ_RELEASE_ASSERT(mb.ReaderAt(2) <= mb.ReaderAt(2))do { static_assert( mozilla::detail::AssertionConditionType< decltype(mb.ReaderAt(2) <= mb.ReaderAt(2))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(mb.ReaderAt(2) <= mb.ReaderAt (2)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("mb.ReaderAt(2) <= mb.ReaderAt(2)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3317); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mb.ReaderAt(2) <= mb.ReaderAt(2)" ")"); do { *((volatile int*)__null) = 3317; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3318 | MOZ_RELEASE_ASSERT(mb.ReaderAt(2) <= mb.ReaderAt(3))do { static_assert( mozilla::detail::AssertionConditionType< decltype(mb.ReaderAt(2) <= mb.ReaderAt(3))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(mb.ReaderAt(2) <= mb.ReaderAt (3)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("mb.ReaderAt(2) <= mb.ReaderAt(3)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3318); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mb.ReaderAt(2) <= mb.ReaderAt(3)" ")"); do { *((volatile int*)__null) = 3318; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3319 | MOZ_RELEASE_ASSERT(mb.ReaderAt(3) > mb.ReaderAt(2))do { static_assert( mozilla::detail::AssertionConditionType< decltype(mb.ReaderAt(3) > mb.ReaderAt(2))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(mb.ReaderAt(3) > mb.ReaderAt (2)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("mb.ReaderAt(3) > mb.ReaderAt(2)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3319); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mb.ReaderAt(3) > mb.ReaderAt(2)" ")"); do { *((volatile int*)__null) = 3319; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3320 | MOZ_RELEASE_ASSERT(mb.ReaderAt(2) >= mb.ReaderAt(2))do { static_assert( mozilla::detail::AssertionConditionType< decltype(mb.ReaderAt(2) >= mb.ReaderAt(2))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(mb.ReaderAt(2) >= mb.ReaderAt (2)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("mb.ReaderAt(2) >= mb.ReaderAt(2)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3320); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mb.ReaderAt(2) >= mb.ReaderAt(2)" ")"); do { *((volatile int*)__null) = 3320; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3321 | MOZ_RELEASE_ASSERT(mb.ReaderAt(3) >= mb.ReaderAt(2))do { static_assert( mozilla::detail::AssertionConditionType< decltype(mb.ReaderAt(3) >= mb.ReaderAt(2))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(mb.ReaderAt(3) >= mb.ReaderAt (2)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("mb.ReaderAt(3) >= mb.ReaderAt(2)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3321); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mb.ReaderAt(3) >= mb.ReaderAt(2)" ")"); do { *((volatile int*)__null) = 3321; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3322 | ||||
3323 | // Iterators indices don't wrap around (even though they may be pointing at | |||
3324 | // the same location). | |||
3325 | MOZ_RELEASE_ASSERT(mb.ReaderAt(2) != mb.ReaderAt(MBSize + 2))do { static_assert( mozilla::detail::AssertionConditionType< decltype(mb.ReaderAt(2) != mb.ReaderAt(MBSize + 2))>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(mb.ReaderAt(2) != mb.ReaderAt(MBSize + 2)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("mb.ReaderAt(2) != mb.ReaderAt(MBSize + 2)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3325); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mb.ReaderAt(2) != mb.ReaderAt(MBSize + 2)" ")"); do { *((volatile int*)__null) = 3325; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3326 | MOZ_RELEASE_ASSERT(mb.ReaderAt(MBSize + 2) != mb.ReaderAt(2))do { static_assert( mozilla::detail::AssertionConditionType< decltype(mb.ReaderAt(MBSize + 2) != mb.ReaderAt(2))>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(mb.ReaderAt(MBSize + 2) != mb.ReaderAt(2)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("mb.ReaderAt(MBSize + 2) != mb.ReaderAt(2)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3326); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mb.ReaderAt(MBSize + 2) != mb.ReaderAt(2)" ")"); do { *((volatile int*)__null) = 3326; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3327 | ||||
3328 | // Dereference. | |||
3329 | static_assert(std::is_same<decltype(*mb.ReaderAt(0)), const MB::Byte&>::value, | |||
3330 | "Dereferencing from a reader should return const Byte*"); | |||
3331 | static_assert(std::is_same<decltype(*mb.WriterAt(0)), MB::Byte&>::value, | |||
3332 | "Dereferencing from a writer should return Byte*"); | |||
3333 | // Contiguous between 0 and MBSize-1. | |||
3334 | MOZ_RELEASE_ASSERT(&*mb.ReaderAt(MBSize - 1) ==do { static_assert( mozilla::detail::AssertionConditionType< decltype(&*mb.ReaderAt(MBSize - 1) == &*mb.ReaderAt(0 ) + (MBSize - 1))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(&*mb.ReaderAt(MBSize - 1 ) == &*mb.ReaderAt(0) + (MBSize - 1)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("&*mb.ReaderAt(MBSize - 1) == &*mb.ReaderAt(0) + (MBSize - 1)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3335); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&*mb.ReaderAt(MBSize - 1) == &*mb.ReaderAt(0) + (MBSize - 1)" ")"); do { *((volatile int*)__null) = 3335; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
3335 | &*mb.ReaderAt(0) + (MBSize - 1))do { static_assert( mozilla::detail::AssertionConditionType< decltype(&*mb.ReaderAt(MBSize - 1) == &*mb.ReaderAt(0 ) + (MBSize - 1))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(&*mb.ReaderAt(MBSize - 1 ) == &*mb.ReaderAt(0) + (MBSize - 1)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("&*mb.ReaderAt(MBSize - 1) == &*mb.ReaderAt(0) + (MBSize - 1)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3335); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&*mb.ReaderAt(MBSize - 1) == &*mb.ReaderAt(0) + (MBSize - 1)" ")"); do { *((volatile int*)__null) = 3335; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3336 | // Wraps around. | |||
3337 | MOZ_RELEASE_ASSERT(&*mb.ReaderAt(MBSize) == &*mb.ReaderAt(0))do { static_assert( mozilla::detail::AssertionConditionType< decltype(&*mb.ReaderAt(MBSize) == &*mb.ReaderAt(0))> ::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(&*mb.ReaderAt(MBSize) == &*mb.ReaderAt(0)))) , 0))) { do { } while (false); MOZ_ReportAssertionFailure("&*mb.ReaderAt(MBSize) == &*mb.ReaderAt(0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3337); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&*mb.ReaderAt(MBSize) == &*mb.ReaderAt(0)" ")"); do { *((volatile int*)__null) = 3337; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3338 | MOZ_RELEASE_ASSERT(&*mb.ReaderAt(MBSize + MBSize - 1) ==do { static_assert( mozilla::detail::AssertionConditionType< decltype(&*mb.ReaderAt(MBSize + MBSize - 1) == &*mb.ReaderAt (MBSize - 1))>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(!!(&*mb.ReaderAt(MBSize + MBSize - 1) == &*mb.ReaderAt(MBSize - 1)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("&*mb.ReaderAt(MBSize + MBSize - 1) == &*mb.ReaderAt(MBSize - 1)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3339); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&*mb.ReaderAt(MBSize + MBSize - 1) == &*mb.ReaderAt(MBSize - 1)" ")"); do { *((volatile int*)__null) = 3339; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
3339 | &*mb.ReaderAt(MBSize - 1))do { static_assert( mozilla::detail::AssertionConditionType< decltype(&*mb.ReaderAt(MBSize + MBSize - 1) == &*mb.ReaderAt (MBSize - 1))>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(!!(&*mb.ReaderAt(MBSize + MBSize - 1) == &*mb.ReaderAt(MBSize - 1)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("&*mb.ReaderAt(MBSize + MBSize - 1) == &*mb.ReaderAt(MBSize - 1)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3339); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&*mb.ReaderAt(MBSize + MBSize - 1) == &*mb.ReaderAt(MBSize - 1)" ")"); do { *((volatile int*)__null) = 3339; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3340 | MOZ_RELEASE_ASSERT(&*mb.ReaderAt(MBSize + MBSize) == &*mb.ReaderAt(0))do { static_assert( mozilla::detail::AssertionConditionType< decltype(&*mb.ReaderAt(MBSize + MBSize) == &*mb.ReaderAt (0))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(&*mb.ReaderAt(MBSize + MBSize) == &*mb.ReaderAt (0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("&*mb.ReaderAt(MBSize + MBSize) == &*mb.ReaderAt(0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3340); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&*mb.ReaderAt(MBSize + MBSize) == &*mb.ReaderAt(0)" ")"); do { *((volatile int*)__null) = 3340; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3341 | // Power of 2 modulo wrapping. | |||
3342 | MOZ_RELEASE_ASSERT(&*mb.ReaderAt(uint32_t(-1)) == &*mb.ReaderAt(MBSize - 1))do { static_assert( mozilla::detail::AssertionConditionType< decltype(&*mb.ReaderAt(uint32_t(-1)) == &*mb.ReaderAt (MBSize - 1))>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(!!(&*mb.ReaderAt(uint32_t(-1)) == &*mb.ReaderAt(MBSize - 1)))), 0))) { do { } while (false ); MOZ_ReportAssertionFailure("&*mb.ReaderAt(uint32_t(-1)) == &*mb.ReaderAt(MBSize - 1)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3342); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&*mb.ReaderAt(uint32_t(-1)) == &*mb.ReaderAt(MBSize - 1)" ")"); do { *((volatile int*)__null) = 3342; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3343 | MOZ_RELEASE_ASSERT(&*mb.ReaderAt(static_cast<MB::Index>(-1)) ==do { static_assert( mozilla::detail::AssertionConditionType< decltype(&*mb.ReaderAt(static_cast<MB::Index>(-1)) == &*mb.ReaderAt(MBSize - 1))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(&*mb.ReaderAt(static_cast <MB::Index>(-1)) == &*mb.ReaderAt(MBSize - 1)))), 0 ))) { do { } while (false); MOZ_ReportAssertionFailure("&*mb.ReaderAt(static_cast<MB::Index>(-1)) == &*mb.ReaderAt(MBSize - 1)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3344); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&*mb.ReaderAt(static_cast<MB::Index>(-1)) == &*mb.ReaderAt(MBSize - 1)" ")"); do { *((volatile int*)__null) = 3344; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
3344 | &*mb.ReaderAt(MBSize - 1))do { static_assert( mozilla::detail::AssertionConditionType< decltype(&*mb.ReaderAt(static_cast<MB::Index>(-1)) == &*mb.ReaderAt(MBSize - 1))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(&*mb.ReaderAt(static_cast <MB::Index>(-1)) == &*mb.ReaderAt(MBSize - 1)))), 0 ))) { do { } while (false); MOZ_ReportAssertionFailure("&*mb.ReaderAt(static_cast<MB::Index>(-1)) == &*mb.ReaderAt(MBSize - 1)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3344); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&*mb.ReaderAt(static_cast<MB::Index>(-1)) == &*mb.ReaderAt(MBSize - 1)" ")"); do { *((volatile int*)__null) = 3344; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3345 | ||||
3346 | // Arithmetic. | |||
3347 | MB::Reader arit = mb.ReaderAt(0); | |||
3348 | MOZ_RELEASE_ASSERT(++arit == mb.ReaderAt(1))do { static_assert( mozilla::detail::AssertionConditionType< decltype(++arit == mb.ReaderAt(1))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(++arit == mb.ReaderAt(1)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("++arit == mb.ReaderAt(1)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3348); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "++arit == mb.ReaderAt(1)" ")"); do { *((volatile int*)__null) = 3348; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3349 | MOZ_RELEASE_ASSERT(arit == mb.ReaderAt(1))do { static_assert( mozilla::detail::AssertionConditionType< decltype(arit == mb.ReaderAt(1))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(arit == mb.ReaderAt(1)))), 0 ))) { do { } while (false); MOZ_ReportAssertionFailure("arit == mb.ReaderAt(1)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3349); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "arit == mb.ReaderAt(1)" ")"); do { *((volatile int*)__null) = 3349; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3350 | ||||
3351 | MOZ_RELEASE_ASSERT(--arit == mb.ReaderAt(0))do { static_assert( mozilla::detail::AssertionConditionType< decltype(--arit == mb.ReaderAt(0))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(--arit == mb.ReaderAt(0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("--arit == mb.ReaderAt(0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3351); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "--arit == mb.ReaderAt(0)" ")"); do { *((volatile int*)__null) = 3351; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3352 | MOZ_RELEASE_ASSERT(arit == mb.ReaderAt(0))do { static_assert( mozilla::detail::AssertionConditionType< decltype(arit == mb.ReaderAt(0))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(arit == mb.ReaderAt(0)))), 0 ))) { do { } while (false); MOZ_ReportAssertionFailure("arit == mb.ReaderAt(0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3352); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "arit == mb.ReaderAt(0)" ")"); do { *((volatile int*)__null) = 3352; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3353 | ||||
3354 | MOZ_RELEASE_ASSERT(arit++ == mb.ReaderAt(0))do { static_assert( mozilla::detail::AssertionConditionType< decltype(arit++ == mb.ReaderAt(0))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(arit++ == mb.ReaderAt(0)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("arit++ == mb.ReaderAt(0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3354); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "arit++ == mb.ReaderAt(0)" ")"); do { *((volatile int*)__null) = 3354; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3355 | MOZ_RELEASE_ASSERT(arit == mb.ReaderAt(1))do { static_assert( mozilla::detail::AssertionConditionType< decltype(arit == mb.ReaderAt(1))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(arit == mb.ReaderAt(1)))), 0 ))) { do { } while (false); MOZ_ReportAssertionFailure("arit == mb.ReaderAt(1)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3355); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "arit == mb.ReaderAt(1)" ")"); do { *((volatile int*)__null) = 3355; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3356 | ||||
3357 | MOZ_RELEASE_ASSERT(arit-- == mb.ReaderAt(1))do { static_assert( mozilla::detail::AssertionConditionType< decltype(arit-- == mb.ReaderAt(1))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(arit-- == mb.ReaderAt(1)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("arit-- == mb.ReaderAt(1)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3357); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "arit-- == mb.ReaderAt(1)" ")"); do { *((volatile int*)__null) = 3357; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3358 | MOZ_RELEASE_ASSERT(arit == mb.ReaderAt(0))do { static_assert( mozilla::detail::AssertionConditionType< decltype(arit == mb.ReaderAt(0))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(arit == mb.ReaderAt(0)))), 0 ))) { do { } while (false); MOZ_ReportAssertionFailure("arit == mb.ReaderAt(0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3358); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "arit == mb.ReaderAt(0)" ")"); do { *((volatile int*)__null) = 3358; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3359 | ||||
3360 | MOZ_RELEASE_ASSERT(arit + 3 == mb.ReaderAt(3))do { static_assert( mozilla::detail::AssertionConditionType< decltype(arit + 3 == mb.ReaderAt(3))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(arit + 3 == mb.ReaderAt(3))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("arit + 3 == mb.ReaderAt(3)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3360); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "arit + 3 == mb.ReaderAt(3)" ")"); do { *((volatile int*)__null) = 3360; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3361 | MOZ_RELEASE_ASSERT(arit == mb.ReaderAt(0))do { static_assert( mozilla::detail::AssertionConditionType< decltype(arit == mb.ReaderAt(0))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(arit == mb.ReaderAt(0)))), 0 ))) { do { } while (false); MOZ_ReportAssertionFailure("arit == mb.ReaderAt(0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3361); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "arit == mb.ReaderAt(0)" ")"); do { *((volatile int*)__null) = 3361; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3362 | ||||
3363 | MOZ_RELEASE_ASSERT(4 + arit == mb.ReaderAt(4))do { static_assert( mozilla::detail::AssertionConditionType< decltype(4 + arit == mb.ReaderAt(4))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(4 + arit == mb.ReaderAt(4))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("4 + arit == mb.ReaderAt(4)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3363); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "4 + arit == mb.ReaderAt(4)" ")"); do { *((volatile int*)__null) = 3363; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3364 | MOZ_RELEASE_ASSERT(arit == mb.ReaderAt(0))do { static_assert( mozilla::detail::AssertionConditionType< decltype(arit == mb.ReaderAt(0))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(arit == mb.ReaderAt(0)))), 0 ))) { do { } while (false); MOZ_ReportAssertionFailure("arit == mb.ReaderAt(0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3364); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "arit == mb.ReaderAt(0)" ")"); do { *((volatile int*)__null) = 3364; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3365 | ||||
3366 | // (Can't have assignments inside asserts, hence the split.) | |||
3367 | const bool checkPlusEq = ((arit += 3) == mb.ReaderAt(3)); | |||
3368 | MOZ_RELEASE_ASSERT(checkPlusEq)do { static_assert( mozilla::detail::AssertionConditionType< decltype(checkPlusEq)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(checkPlusEq))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("checkPlusEq", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3368); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "checkPlusEq" ")"); do { *((volatile int*)__null) = 3368; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3369 | MOZ_RELEASE_ASSERT(arit == mb.ReaderAt(3))do { static_assert( mozilla::detail::AssertionConditionType< decltype(arit == mb.ReaderAt(3))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(arit == mb.ReaderAt(3)))), 0 ))) { do { } while (false); MOZ_ReportAssertionFailure("arit == mb.ReaderAt(3)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3369); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "arit == mb.ReaderAt(3)" ")"); do { *((volatile int*)__null) = 3369; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3370 | ||||
3371 | MOZ_RELEASE_ASSERT((arit - 2) == mb.ReaderAt(1))do { static_assert( mozilla::detail::AssertionConditionType< decltype((arit - 2) == mb.ReaderAt(1))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!((arit - 2) == mb.ReaderAt(1) ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "(arit - 2) == mb.ReaderAt(1)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3371); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "(arit - 2) == mb.ReaderAt(1)" ")"); do { *((volatile int*)__null) = 3371; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3372 | MOZ_RELEASE_ASSERT(arit == mb.ReaderAt(3))do { static_assert( mozilla::detail::AssertionConditionType< decltype(arit == mb.ReaderAt(3))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(arit == mb.ReaderAt(3)))), 0 ))) { do { } while (false); MOZ_ReportAssertionFailure("arit == mb.ReaderAt(3)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3372); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "arit == mb.ReaderAt(3)" ")"); do { *((volatile int*)__null) = 3372; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3373 | ||||
3374 | const bool checkMinusEq = ((arit -= 2) == mb.ReaderAt(1)); | |||
3375 | MOZ_RELEASE_ASSERT(checkMinusEq)do { static_assert( mozilla::detail::AssertionConditionType< decltype(checkMinusEq)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(checkMinusEq))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("checkMinusEq", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3375); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "checkMinusEq" ")"); do { *((volatile int*)__null) = 3375; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3376 | MOZ_RELEASE_ASSERT(arit == mb.ReaderAt(1))do { static_assert( mozilla::detail::AssertionConditionType< decltype(arit == mb.ReaderAt(1))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(arit == mb.ReaderAt(1)))), 0 ))) { do { } while (false); MOZ_ReportAssertionFailure("arit == mb.ReaderAt(1)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3376); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "arit == mb.ReaderAt(1)" ")"); do { *((volatile int*)__null) = 3376; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3377 | ||||
3378 | // Random access. | |||
3379 | MOZ_RELEASE_ASSERT(&arit[3] == &*(arit + 3))do { static_assert( mozilla::detail::AssertionConditionType< decltype(&arit[3] == &*(arit + 3))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(&arit[3] == &*(arit + 3)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("&arit[3] == &*(arit + 3)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3379); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&arit[3] == &*(arit + 3)" ")"); do { *((volatile int*)__null) = 3379; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3380 | MOZ_RELEASE_ASSERT(arit == mb.ReaderAt(1))do { static_assert( mozilla::detail::AssertionConditionType< decltype(arit == mb.ReaderAt(1))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(arit == mb.ReaderAt(1)))), 0 ))) { do { } while (false); MOZ_ReportAssertionFailure("arit == mb.ReaderAt(1)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3380); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "arit == mb.ReaderAt(1)" ")"); do { *((volatile int*)__null) = 3380; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3381 | ||||
3382 | // Iterator difference. | |||
3383 | MOZ_RELEASE_ASSERT(mb.ReaderAt(3) - mb.ReaderAt(1) == 2)do { static_assert( mozilla::detail::AssertionConditionType< decltype(mb.ReaderAt(3) - mb.ReaderAt(1) == 2)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(mb.ReaderAt(3) - mb.ReaderAt (1) == 2))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("mb.ReaderAt(3) - mb.ReaderAt(1) == 2", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3383); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mb.ReaderAt(3) - mb.ReaderAt(1) == 2" ")"); do { *((volatile int*)__null) = 3383; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3384 | MOZ_RELEASE_ASSERT(mb.ReaderAt(1) - mb.ReaderAt(3) == MB::Index(-2))do { static_assert( mozilla::detail::AssertionConditionType< decltype(mb.ReaderAt(1) - mb.ReaderAt(3) == MB::Index(-2))> ::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(mb.ReaderAt(1) - mb.ReaderAt(3) == MB::Index(-2)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("mb.ReaderAt(1) - mb.ReaderAt(3) == MB::Index(-2)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3384); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mb.ReaderAt(1) - mb.ReaderAt(3) == MB::Index(-2)" ")"); do { *((volatile int*)__null) = 3384; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3385 | ||||
3386 | // Only testing Writer, as Reader is just a subset with no code differences. | |||
3387 | MB::Writer it = mb.WriterAt(0); | |||
3388 | MOZ_RELEASE_ASSERT(it.CurrentIndex() == 0)do { static_assert( mozilla::detail::AssertionConditionType< decltype(it.CurrentIndex() == 0)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(it.CurrentIndex() == 0))), 0 ))) { do { } while (false); MOZ_ReportAssertionFailure("it.CurrentIndex() == 0" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3388); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "it.CurrentIndex() == 0" ")"); do { *((volatile int*)__null) = 3388; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3389 | ||||
3390 | // Write two characters at the start. | |||
3391 | it.WriteObject('x'); | |||
3392 | it.WriteObject('y'); | |||
3393 | ||||
3394 | // Backtrack to read them. | |||
3395 | it -= 2; | |||
3396 | // PeekObject should read without moving. | |||
3397 | MOZ_RELEASE_ASSERT(it.PeekObject<char>() == 'x')do { static_assert( mozilla::detail::AssertionConditionType< decltype(it.PeekObject<char>() == 'x')>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(it.PeekObject<char>() == 'x'))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("it.PeekObject<char>() == 'x'", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3397); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "it.PeekObject<char>() == 'x'" ")"); do { *((volatile int*)__null) = 3397; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3398 | MOZ_RELEASE_ASSERT(it.CurrentIndex() == 0)do { static_assert( mozilla::detail::AssertionConditionType< decltype(it.CurrentIndex() == 0)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(it.CurrentIndex() == 0))), 0 ))) { do { } while (false); MOZ_ReportAssertionFailure("it.CurrentIndex() == 0" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3398); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "it.CurrentIndex() == 0" ")"); do { *((volatile int*)__null) = 3398; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3399 | // ReadObject should read and move past the character. | |||
3400 | MOZ_RELEASE_ASSERT(it.ReadObject<char>() == 'x')do { static_assert( mozilla::detail::AssertionConditionType< decltype(it.ReadObject<char>() == 'x')>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(it.ReadObject<char>() == 'x'))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("it.ReadObject<char>() == 'x'", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3400); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "it.ReadObject<char>() == 'x'" ")"); do { *((volatile int*)__null) = 3400; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3401 | MOZ_RELEASE_ASSERT(it.CurrentIndex() == 1)do { static_assert( mozilla::detail::AssertionConditionType< decltype(it.CurrentIndex() == 1)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(it.CurrentIndex() == 1))), 0 ))) { do { } while (false); MOZ_ReportAssertionFailure("it.CurrentIndex() == 1" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3401); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "it.CurrentIndex() == 1" ")"); do { *((volatile int*)__null) = 3401; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3402 | MOZ_RELEASE_ASSERT(it.PeekObject<char>() == 'y')do { static_assert( mozilla::detail::AssertionConditionType< decltype(it.PeekObject<char>() == 'y')>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(it.PeekObject<char>() == 'y'))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("it.PeekObject<char>() == 'y'", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3402); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "it.PeekObject<char>() == 'y'" ")"); do { *((volatile int*)__null) = 3402; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3403 | MOZ_RELEASE_ASSERT(it.CurrentIndex() == 1)do { static_assert( mozilla::detail::AssertionConditionType< decltype(it.CurrentIndex() == 1)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(it.CurrentIndex() == 1))), 0 ))) { do { } while (false); MOZ_ReportAssertionFailure("it.CurrentIndex() == 1" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3403); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "it.CurrentIndex() == 1" ")"); do { *((volatile int*)__null) = 3403; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3404 | MOZ_RELEASE_ASSERT(it.ReadObject<char>() == 'y')do { static_assert( mozilla::detail::AssertionConditionType< decltype(it.ReadObject<char>() == 'y')>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(it.ReadObject<char>() == 'y'))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("it.ReadObject<char>() == 'y'", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3404); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "it.ReadObject<char>() == 'y'" ")"); do { *((volatile int*)__null) = 3404; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3405 | MOZ_RELEASE_ASSERT(it.CurrentIndex() == 2)do { static_assert( mozilla::detail::AssertionConditionType< decltype(it.CurrentIndex() == 2)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(it.CurrentIndex() == 2))), 0 ))) { do { } while (false); MOZ_ReportAssertionFailure("it.CurrentIndex() == 2" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3405); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "it.CurrentIndex() == 2" ")"); do { *((volatile int*)__null) = 3405; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3406 | ||||
3407 | // Checking that a reader can be created from a writer. | |||
3408 | MB::Reader it2(it); | |||
3409 | MOZ_RELEASE_ASSERT(it2.CurrentIndex() == 2)do { static_assert( mozilla::detail::AssertionConditionType< decltype(it2.CurrentIndex() == 2)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(it2.CurrentIndex() == 2))), 0 ))) { do { } while (false); MOZ_ReportAssertionFailure("it2.CurrentIndex() == 2" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3409); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "it2.CurrentIndex() == 2" ")"); do { *((volatile int*)__null) = 3409; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3410 | // Or assigned. | |||
3411 | it2 = it; | |||
3412 | MOZ_RELEASE_ASSERT(it2.CurrentIndex() == 2)do { static_assert( mozilla::detail::AssertionConditionType< decltype(it2.CurrentIndex() == 2)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(it2.CurrentIndex() == 2))), 0 ))) { do { } while (false); MOZ_ReportAssertionFailure("it2.CurrentIndex() == 2" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3412); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "it2.CurrentIndex() == 2" ")"); do { *((volatile int*)__null) = 3412; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3413 | ||||
3414 | // Iterator traits. | |||
3415 | static_assert(std::is_same<std::iterator_traits<MB::Reader>::difference_type, | |||
3416 | MB::Index>::value, | |||
3417 | "ModuloBuffer::Reader::difference_type should be Index"); | |||
3418 | static_assert(std::is_same<std::iterator_traits<MB::Reader>::value_type, | |||
3419 | MB::Byte>::value, | |||
3420 | "ModuloBuffer::Reader::value_type should be Byte"); | |||
3421 | static_assert(std::is_same<std::iterator_traits<MB::Reader>::pointer, | |||
3422 | const MB::Byte*>::value, | |||
3423 | "ModuloBuffer::Reader::pointer should be const Byte*"); | |||
3424 | static_assert(std::is_same<std::iterator_traits<MB::Reader>::reference, | |||
3425 | const MB::Byte&>::value, | |||
3426 | "ModuloBuffer::Reader::reference should be const Byte&"); | |||
3427 | static_assert(std::is_base_of< | |||
3428 | std::input_iterator_tag, | |||
3429 | std::iterator_traits<MB::Reader>::iterator_category>::value, | |||
3430 | "ModuloBuffer::Reader::iterator_category should be derived " | |||
3431 | "from input_iterator_tag"); | |||
3432 | static_assert(std::is_base_of< | |||
3433 | std::forward_iterator_tag, | |||
3434 | std::iterator_traits<MB::Reader>::iterator_category>::value, | |||
3435 | "ModuloBuffer::Reader::iterator_category should be derived " | |||
3436 | "from forward_iterator_tag"); | |||
3437 | static_assert(std::is_base_of< | |||
3438 | std::bidirectional_iterator_tag, | |||
3439 | std::iterator_traits<MB::Reader>::iterator_category>::value, | |||
3440 | "ModuloBuffer::Reader::iterator_category should be derived " | |||
3441 | "from bidirectional_iterator_tag"); | |||
3442 | static_assert( | |||
3443 | std::is_same<std::iterator_traits<MB::Reader>::iterator_category, | |||
3444 | std::random_access_iterator_tag>::value, | |||
3445 | "ModuloBuffer::Reader::iterator_category should be " | |||
3446 | "random_access_iterator_tag"); | |||
3447 | ||||
3448 | // Use as input iterator by std::string constructor (which is only considered | |||
3449 | // with proper input iterators.) | |||
3450 | std::string s(mb.ReaderAt(0), mb.ReaderAt(2)); | |||
3451 | MOZ_RELEASE_ASSERT(s == "xy")do { static_assert( mozilla::detail::AssertionConditionType< decltype(s == "xy")>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(s == "xy"))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("s == \"xy\"", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3451); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "s == \"xy\"" ")"); do { *((volatile int*)__null) = 3451; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3452 | ||||
3453 | // Write 4-byte number at index 2. | |||
3454 | it.WriteObject(int32_t(123)); | |||
3455 | MOZ_RELEASE_ASSERT(it.CurrentIndex() == 6)do { static_assert( mozilla::detail::AssertionConditionType< decltype(it.CurrentIndex() == 6)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(it.CurrentIndex() == 6))), 0 ))) { do { } while (false); MOZ_ReportAssertionFailure("it.CurrentIndex() == 6" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3455); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "it.CurrentIndex() == 6" ")"); do { *((volatile int*)__null) = 3455; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3456 | // And another, which should now wrap around (but index continues on.) | |||
3457 | it.WriteObject(int32_t(456)); | |||
3458 | MOZ_RELEASE_ASSERT(it.CurrentIndex() == MBSize + 2)do { static_assert( mozilla::detail::AssertionConditionType< decltype(it.CurrentIndex() == MBSize + 2)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(it.CurrentIndex() == MBSize + 2))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("it.CurrentIndex() == MBSize + 2", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3458); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "it.CurrentIndex() == MBSize + 2" ")"); do { *((volatile int*)__null) = 3458; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3459 | // Even though index==MBSize+2, we can read the object we wrote at 2. | |||
3460 | MOZ_RELEASE_ASSERT(it.ReadObject<int32_t>() == 123)do { static_assert( mozilla::detail::AssertionConditionType< decltype(it.ReadObject<int32_t>() == 123)>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(! !(it.ReadObject<int32_t>() == 123))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("it.ReadObject<int32_t>() == 123" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3460); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "it.ReadObject<int32_t>() == 123" ")"); do { *((volatile int*)__null) = 3460; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3461 | MOZ_RELEASE_ASSERT(it.CurrentIndex() == MBSize + 6)do { static_assert( mozilla::detail::AssertionConditionType< decltype(it.CurrentIndex() == MBSize + 6)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(it.CurrentIndex() == MBSize + 6))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("it.CurrentIndex() == MBSize + 6", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3461); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "it.CurrentIndex() == MBSize + 6" ")"); do { *((volatile int*)__null) = 3461; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3462 | // And similarly, index MBSize+6 points at the same location as index 6. | |||
3463 | MOZ_RELEASE_ASSERT(it.ReadObject<int32_t>() == 456)do { static_assert( mozilla::detail::AssertionConditionType< decltype(it.ReadObject<int32_t>() == 456)>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(! !(it.ReadObject<int32_t>() == 456))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("it.ReadObject<int32_t>() == 456" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3463); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "it.ReadObject<int32_t>() == 456" ")"); do { *((volatile int*)__null) = 3463; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3464 | MOZ_RELEASE_ASSERT(it.CurrentIndex() == MBSize + MBSize + 2)do { static_assert( mozilla::detail::AssertionConditionType< decltype(it.CurrentIndex() == MBSize + MBSize + 2)>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(it.CurrentIndex() == MBSize + MBSize + 2))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("it.CurrentIndex() == MBSize + MBSize + 2" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3464); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "it.CurrentIndex() == MBSize + MBSize + 2" ")"); do { *((volatile int*)__null) = 3464; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3465 | } | |||
3466 | ||||
3467 | void TestModuloBuffer() { | |||
3468 | printf("TestModuloBuffer...\n"); | |||
3469 | ||||
3470 | // Testing ModuloBuffer with default template arguments. | |||
3471 | using MB = ModuloBuffer<>; | |||
3472 | ||||
3473 | // Only 8-byte buffers, to easily test wrap-around. | |||
3474 | constexpr uint32_t MBSize = 8; | |||
3475 | ||||
3476 | // MB with self-allocated heap buffer. | |||
3477 | MB mbByLength(MakePowerOfTwo32<MBSize>()); | |||
3478 | TestModuloBuffer(mbByLength, MBSize); | |||
3479 | ||||
3480 | // MB taking ownership of a provided UniquePtr to a buffer. | |||
3481 | auto uniqueBuffer = MakeUnique<uint8_t[]>(MBSize); | |||
3482 | MB mbByUniquePtr(MakeUnique<uint8_t[]>(MBSize), MakePowerOfTwo32<MBSize>()); | |||
3483 | TestModuloBuffer(mbByUniquePtr, MBSize); | |||
3484 | ||||
3485 | // MB using part of a buffer on the stack. The buffer is three times the | |||
3486 | // required size: The middle third is where ModuloBuffer will work, the first | |||
3487 | // and last thirds are only used to later verify that ModuloBuffer didn't go | |||
3488 | // out of its bounds. | |||
3489 | uint8_t buffer[MBSize * 3]; | |||
3490 | // Pre-fill the buffer with a known pattern, so we can later see what changed. | |||
3491 | for (size_t i = 0; i < MBSize * 3; ++i) { | |||
3492 | buffer[i] = uint8_t('A' + i); | |||
3493 | } | |||
3494 | MB mbByBuffer(&buffer[MBSize], MakePowerOfTwo32<MBSize>()); | |||
3495 | TestModuloBuffer(mbByBuffer, MBSize); | |||
3496 | ||||
3497 | // Check that only the provided stack-based sub-buffer was modified. | |||
3498 | uint32_t changed = 0; | |||
3499 | for (size_t i = MBSize; i < MBSize * 2; ++i) { | |||
3500 | changed += (buffer[i] == uint8_t('A' + i)) ? 0 : 1; | |||
3501 | } | |||
3502 | // Expect at least 75% changes. | |||
3503 | MOZ_RELEASE_ASSERT(changed >= MBSize * 6 / 8)do { static_assert( mozilla::detail::AssertionConditionType< decltype(changed >= MBSize * 6 / 8)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(changed >= MBSize * 6 / 8 ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "changed >= MBSize * 6 / 8", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3503); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "changed >= MBSize * 6 / 8" ")"); do { *((volatile int*)__null) = 3503; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3504 | ||||
3505 | // Everything around the sub-buffer should be unchanged. | |||
3506 | for (size_t i = 0; i < MBSize; ++i) { | |||
3507 | MOZ_RELEASE_ASSERT(buffer[i] == uint8_t('A' + i))do { static_assert( mozilla::detail::AssertionConditionType< decltype(buffer[i] == uint8_t('A' + i))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(buffer[i] == uint8_t('A' + i )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("buffer[i] == uint8_t('A' + i)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3507); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "buffer[i] == uint8_t('A' + i)" ")"); do { *((volatile int*)__null) = 3507; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3508 | } | |||
3509 | for (size_t i = MBSize * 2; i < MBSize * 3; ++i) { | |||
3510 | MOZ_RELEASE_ASSERT(buffer[i] == uint8_t('A' + i))do { static_assert( mozilla::detail::AssertionConditionType< decltype(buffer[i] == uint8_t('A' + i))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(buffer[i] == uint8_t('A' + i )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("buffer[i] == uint8_t('A' + i)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3510); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "buffer[i] == uint8_t('A' + i)" ")"); do { *((volatile int*)__null) = 3510; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3511 | } | |||
3512 | ||||
3513 | // Check that move-construction is allowed. This verifies that we do not | |||
3514 | // crash from a double free, when `mbByBuffer` and `mbByStolenBuffer` are both | |||
3515 | // destroyed at the end of this function. | |||
3516 | MB mbByStolenBuffer = std::move(mbByBuffer); | |||
3517 | TestModuloBuffer(mbByStolenBuffer, MBSize); | |||
3518 | ||||
3519 | // Check that only the provided stack-based sub-buffer was modified. | |||
3520 | changed = 0; | |||
3521 | for (size_t i = MBSize; i < MBSize * 2; ++i) { | |||
3522 | changed += (buffer[i] == uint8_t('A' + i)) ? 0 : 1; | |||
3523 | } | |||
3524 | // Expect at least 75% changes. | |||
3525 | MOZ_RELEASE_ASSERT(changed >= MBSize * 6 / 8)do { static_assert( mozilla::detail::AssertionConditionType< decltype(changed >= MBSize * 6 / 8)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(changed >= MBSize * 6 / 8 ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "changed >= MBSize * 6 / 8", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3525); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "changed >= MBSize * 6 / 8" ")"); do { *((volatile int*)__null) = 3525; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3526 | ||||
3527 | // Everything around the sub-buffer should be unchanged. | |||
3528 | for (size_t i = 0; i < MBSize; ++i) { | |||
3529 | MOZ_RELEASE_ASSERT(buffer[i] == uint8_t('A' + i))do { static_assert( mozilla::detail::AssertionConditionType< decltype(buffer[i] == uint8_t('A' + i))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(buffer[i] == uint8_t('A' + i )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("buffer[i] == uint8_t('A' + i)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3529); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "buffer[i] == uint8_t('A' + i)" ")"); do { *((volatile int*)__null) = 3529; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3530 | } | |||
3531 | for (size_t i = MBSize * 2; i < MBSize * 3; ++i) { | |||
3532 | MOZ_RELEASE_ASSERT(buffer[i] == uint8_t('A' + i))do { static_assert( mozilla::detail::AssertionConditionType< decltype(buffer[i] == uint8_t('A' + i))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(buffer[i] == uint8_t('A' + i )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("buffer[i] == uint8_t('A' + i)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3532); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "buffer[i] == uint8_t('A' + i)" ")"); do { *((volatile int*)__null) = 3532; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3533 | } | |||
3534 | ||||
3535 | // This test function does a `ReadInto` as directed, and checks that the | |||
3536 | // result is the same as if the copy had been done manually byte-by-byte. | |||
3537 | // `TestReadInto(3, 7, 2)` copies from index 3 to index 7, 2 bytes long. | |||
3538 | // Return the output string (from `ReadInto`) for external checks. | |||
3539 | auto TestReadInto = [](MB::Index aReadFrom, MB::Index aWriteTo, | |||
3540 | MB::Length aBytes) { | |||
3541 | constexpr uint32_t TRISize = 16; | |||
3542 | ||||
3543 | // Prepare an input buffer, all different elements. | |||
3544 | uint8_t input[TRISize + 1] = "ABCDEFGHIJKLMNOP"; | |||
3545 | const MB mbInput(input, MakePowerOfTwo32<TRISize>()); | |||
3546 | ||||
3547 | // Prepare an output buffer, different from input. | |||
3548 | uint8_t output[TRISize + 1] = "abcdefghijklmnop"; | |||
3549 | MB mbOutput(output, MakePowerOfTwo32<TRISize>()); | |||
3550 | ||||
3551 | // Run ReadInto. | |||
3552 | auto writer = mbOutput.WriterAt(aWriteTo); | |||
3553 | mbInput.ReaderAt(aReadFrom).ReadInto(writer, aBytes); | |||
3554 | ||||
3555 | // Do the same operation manually. | |||
3556 | uint8_t outputCheck[TRISize + 1] = "abcdefghijklmnop"; | |||
3557 | MB mbOutputCheck(outputCheck, MakePowerOfTwo32<TRISize>()); | |||
3558 | auto readerCheck = mbInput.ReaderAt(aReadFrom); | |||
3559 | auto writerCheck = mbOutputCheck.WriterAt(aWriteTo); | |||
3560 | for (MB::Length i = 0; i < aBytes; ++i) { | |||
3561 | *writerCheck++ = *readerCheck++; | |||
3562 | } | |||
3563 | ||||
3564 | // Compare the two outputs. | |||
3565 | for (uint32_t i = 0; i < TRISize; ++i) { | |||
3566 | # ifdef TEST_MODULOBUFFER_FAILURE_DEBUG | |||
3567 | // Only used when debugging failures. | |||
3568 | if (output[i] != outputCheck[i]) { | |||
3569 | printf( | |||
3570 | "*** from=%u to=%u bytes=%u i=%u\ninput: '%s'\noutput: " | |||
3571 | "'%s'\ncheck: '%s'\n", | |||
3572 | unsigned(aReadFrom), unsigned(aWriteTo), unsigned(aBytes), | |||
3573 | unsigned(i), input, output, outputCheck); | |||
3574 | } | |||
3575 | # endif | |||
3576 | MOZ_RELEASE_ASSERT(output[i] == outputCheck[i])do { static_assert( mozilla::detail::AssertionConditionType< decltype(output[i] == outputCheck[i])>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(output[i] == outputCheck[i]) )), 0))) { do { } while (false); MOZ_ReportAssertionFailure("output[i] == outputCheck[i]" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3576); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "output[i] == outputCheck[i]" ")"); do { *((volatile int*)__null) = 3576; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3577 | } | |||
3578 | ||||
3579 | # ifdef TEST_MODULOBUFFER_HELPER | |||
3580 | // Only used when adding more tests. | |||
3581 | printf("*** from=%u to=%u bytes=%u output: %s\n", unsigned(aReadFrom), | |||
3582 | unsigned(aWriteTo), unsigned(aBytes), output); | |||
3583 | # endif | |||
3584 | ||||
3585 | return std::string(reinterpret_cast<const char*>(output)); | |||
3586 | }; | |||
3587 | ||||
3588 | // A few manual checks: | |||
3589 | constexpr uint32_t TRISize = 16; | |||
3590 | MOZ_RELEASE_ASSERT(TestReadInto(0, 0, 0) == "abcdefghijklmnop")do { static_assert( mozilla::detail::AssertionConditionType< decltype(TestReadInto(0, 0, 0) == "abcdefghijklmnop")>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(TestReadInto(0, 0, 0) == "abcdefghijklmnop"))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("TestReadInto(0, 0, 0) == \"abcdefghijklmnop\"" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3590); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "TestReadInto(0, 0, 0) == \"abcdefghijklmnop\"" ")"); do { *((volatile int*)__null) = 3590; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3591 | MOZ_RELEASE_ASSERT(TestReadInto(0, 0, TRISize) == "ABCDEFGHIJKLMNOP")do { static_assert( mozilla::detail::AssertionConditionType< decltype(TestReadInto(0, 0, TRISize) == "ABCDEFGHIJKLMNOP")> ::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(TestReadInto(0, 0, TRISize) == "ABCDEFGHIJKLMNOP"))) , 0))) { do { } while (false); MOZ_ReportAssertionFailure("TestReadInto(0, 0, TRISize) == \"ABCDEFGHIJKLMNOP\"" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3591); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "TestReadInto(0, 0, TRISize) == \"ABCDEFGHIJKLMNOP\"" ")"); do { *((volatile int*)__null) = 3591; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3592 | MOZ_RELEASE_ASSERT(TestReadInto(0, 5, TRISize) == "LMNOPABCDEFGHIJK")do { static_assert( mozilla::detail::AssertionConditionType< decltype(TestReadInto(0, 5, TRISize) == "LMNOPABCDEFGHIJK")> ::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(TestReadInto(0, 5, TRISize) == "LMNOPABCDEFGHIJK"))) , 0))) { do { } while (false); MOZ_ReportAssertionFailure("TestReadInto(0, 5, TRISize) == \"LMNOPABCDEFGHIJK\"" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3592); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "TestReadInto(0, 5, TRISize) == \"LMNOPABCDEFGHIJK\"" ")"); do { *((volatile int*)__null) = 3592; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3593 | MOZ_RELEASE_ASSERT(TestReadInto(5, 0, TRISize) == "FGHIJKLMNOPABCDE")do { static_assert( mozilla::detail::AssertionConditionType< decltype(TestReadInto(5, 0, TRISize) == "FGHIJKLMNOPABCDE")> ::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(TestReadInto(5, 0, TRISize) == "FGHIJKLMNOPABCDE"))) , 0))) { do { } while (false); MOZ_ReportAssertionFailure("TestReadInto(5, 0, TRISize) == \"FGHIJKLMNOPABCDE\"" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3593); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "TestReadInto(5, 0, TRISize) == \"FGHIJKLMNOPABCDE\"" ")"); do { *((volatile int*)__null) = 3593; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3594 | ||||
3595 | // Test everything! (16^3 = 4096, not too much.) | |||
3596 | for (MB::Index r = 0; r < TRISize; ++r) { | |||
3597 | for (MB::Index w = 0; w < TRISize; ++w) { | |||
3598 | for (MB::Length len = 0; len < TRISize; ++len) { | |||
3599 | TestReadInto(r, w, len); | |||
3600 | } | |||
3601 | } | |||
3602 | } | |||
3603 | ||||
3604 | printf("TestModuloBuffer done\n"); | |||
3605 | } | |||
3606 | ||||
3607 | void TestLiteralEmptyStringView() { | |||
3608 | printf("TestLiteralEmptyStringView...\n"); | |||
3609 | ||||
3610 | static_assert(mozilla::LiteralEmptyStringView<char>() == | |||
3611 | std::string_view("")); | |||
3612 | static_assert(!!mozilla::LiteralEmptyStringView<char>().data()); | |||
3613 | static_assert(mozilla::LiteralEmptyStringView<char>().length() == 0); | |||
3614 | ||||
3615 | static_assert(mozilla::LiteralEmptyStringView<char16_t>() == | |||
3616 | std::basic_string_view<char16_t>(u"")); | |||
3617 | static_assert(!!mozilla::LiteralEmptyStringView<char16_t>().data()); | |||
3618 | static_assert(mozilla::LiteralEmptyStringView<char16_t>().length() == 0); | |||
3619 | ||||
3620 | printf("TestLiteralEmptyStringView done\n"); | |||
3621 | } | |||
3622 | ||||
3623 | template <typename CHAR> | |||
3624 | void TestProfilerStringView() { | |||
3625 | if constexpr (std::is_same_v<CHAR, char>) { | |||
3626 | printf("TestProfilerStringView<char>...\n"); | |||
3627 | } else if constexpr (std::is_same_v<CHAR, char16_t>) { | |||
3628 | printf("TestProfilerStringView<char16_t>...\n"); | |||
3629 | } else { | |||
3630 | MOZ_RELEASE_ASSERT(false,do { static_assert( mozilla::detail::AssertionConditionType< decltype(false)>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(!!(false))), 0))) { do { } while ( false); MOZ_ReportAssertionFailure("false" " (" "TestProfilerStringView only handles char and char16_t" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3631); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "false" ") (" "TestProfilerStringView only handles char and char16_t" ")"); do { *((volatile int*)__null) = 3631; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
3631 | "TestProfilerStringView only handles char and char16_t")do { static_assert( mozilla::detail::AssertionConditionType< decltype(false)>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(!!(false))), 0))) { do { } while ( false); MOZ_ReportAssertionFailure("false" " (" "TestProfilerStringView only handles char and char16_t" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3631); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "false" ") (" "TestProfilerStringView only handles char and char16_t" ")"); do { *((volatile int*)__null) = 3631; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3632 | } | |||
3633 | ||||
3634 | // Used to verify implicit constructions, as this will normally be used in | |||
3635 | // function parameters. | |||
3636 | auto BSV = [](mozilla::ProfilerStringView<CHAR>&& aBSV) { | |||
3637 | return std::move(aBSV); | |||
3638 | }; | |||
3639 | ||||
3640 | // These look like string literals, as expected by some string constructors. | |||
3641 | const CHAR empty[0 + 1] = {CHAR('\0')}; | |||
3642 | const CHAR hi[2 + 1] = { | |||
3643 | CHAR('h'), | |||
3644 | CHAR('i'), | |||
3645 | CHAR('\0'), | |||
3646 | }; | |||
3647 | ||||
3648 | // Literal empty string. | |||
3649 | MOZ_RELEASE_ASSERT(BSV(empty).Length() == 0)do { static_assert( mozilla::detail::AssertionConditionType< decltype(BSV(empty).Length() == 0)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(BSV(empty).Length() == 0))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("BSV(empty).Length() == 0" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3649); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(empty).Length() == 0" ")"); do { *((volatile int*)__null) = 3649; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3650 | MOZ_RELEASE_ASSERT(BSV(empty).AsSpan().IsEmpty())do { static_assert( mozilla::detail::AssertionConditionType< decltype(BSV(empty).AsSpan().IsEmpty())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(BSV(empty).AsSpan().IsEmpty( )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("BSV(empty).AsSpan().IsEmpty()", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3650); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(empty).AsSpan().IsEmpty()" ")"); do { *((volatile int*)__null) = 3650; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3651 | MOZ_RELEASE_ASSERT(BSV(empty).IsLiteral())do { static_assert( mozilla::detail::AssertionConditionType< decltype(BSV(empty).IsLiteral())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(BSV(empty).IsLiteral()))), 0 ))) { do { } while (false); MOZ_ReportAssertionFailure("BSV(empty).IsLiteral()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3651); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(empty).IsLiteral()" ")"); do { *((volatile int*)__null) = 3651; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3652 | MOZ_RELEASE_ASSERT(!BSV(empty).IsReference())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!BSV(empty).IsReference())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!BSV(empty).IsReference()))) , 0))) { do { } while (false); MOZ_ReportAssertionFailure("!BSV(empty).IsReference()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3652); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!BSV(empty).IsReference()" ")"); do { *((volatile int*)__null) = 3652; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3653 | ||||
3654 | // Literal non-empty string. | |||
3655 | MOZ_RELEASE_ASSERT(BSV(hi).Length() == 2)do { static_assert( mozilla::detail::AssertionConditionType< decltype(BSV(hi).Length() == 2)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(BSV(hi).Length() == 2))), 0) )) { do { } while (false); MOZ_ReportAssertionFailure("BSV(hi).Length() == 2" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3655); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(hi).Length() == 2" ")"); do { *((volatile int*)__null) = 3655; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3656 | MOZ_RELEASE_ASSERT(BSV(hi).AsSpan().Elements())do { static_assert( mozilla::detail::AssertionConditionType< decltype(BSV(hi).AsSpan().Elements())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(BSV(hi).AsSpan().Elements()) )), 0))) { do { } while (false); MOZ_ReportAssertionFailure("BSV(hi).AsSpan().Elements()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3656); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(hi).AsSpan().Elements()" ")"); do { *((volatile int*)__null) = 3656; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3657 | MOZ_RELEASE_ASSERT(BSV(hi).AsSpan().Elements()[0] == CHAR('h'))do { static_assert( mozilla::detail::AssertionConditionType< decltype(BSV(hi).AsSpan().Elements()[0] == CHAR('h'))>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(BSV(hi).AsSpan().Elements()[0] == CHAR('h')))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("BSV(hi).AsSpan().Elements()[0] == CHAR('h')" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3657); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(hi).AsSpan().Elements()[0] == CHAR('h')" ")"); do { *((volatile int*)__null) = 3657; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3658 | MOZ_RELEASE_ASSERT(BSV(hi).AsSpan().Elements()[1] == CHAR('i'))do { static_assert( mozilla::detail::AssertionConditionType< decltype(BSV(hi).AsSpan().Elements()[1] == CHAR('i'))>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(BSV(hi).AsSpan().Elements()[1] == CHAR('i')))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("BSV(hi).AsSpan().Elements()[1] == CHAR('i')" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3658); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(hi).AsSpan().Elements()[1] == CHAR('i')" ")"); do { *((volatile int*)__null) = 3658; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3659 | MOZ_RELEASE_ASSERT(BSV(hi).IsLiteral())do { static_assert( mozilla::detail::AssertionConditionType< decltype(BSV(hi).IsLiteral())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(BSV(hi).IsLiteral()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("BSV(hi).IsLiteral()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3659); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(hi).IsLiteral()" ")"); do { *((volatile int*)__null) = 3659; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3660 | MOZ_RELEASE_ASSERT(!BSV(hi).IsReference())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!BSV(hi).IsReference())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!BSV(hi).IsReference()))), 0 ))) { do { } while (false); MOZ_ReportAssertionFailure("!BSV(hi).IsReference()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3660); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!BSV(hi).IsReference()" ")"); do { *((volatile int*)__null) = 3660; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3661 | ||||
3662 | // std::string_view to a literal empty string. | |||
3663 | MOZ_RELEASE_ASSERT(BSV(std::basic_string_view<CHAR>(empty)).Length() == 0)do { static_assert( mozilla::detail::AssertionConditionType< decltype(BSV(std::basic_string_view<CHAR>(empty)).Length () == 0)>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(BSV(std::basic_string_view<CHAR>(empty)).Length () == 0))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("BSV(std::basic_string_view<CHAR>(empty)).Length() == 0" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3663); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(std::basic_string_view<CHAR>(empty)).Length() == 0" ")"); do { *((volatile int*)__null) = 3663; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3664 | MOZ_RELEASE_ASSERT(do { static_assert( mozilla::detail::AssertionConditionType< decltype(BSV(std::basic_string_view<CHAR>(empty)).AsSpan ().IsEmpty())>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(!!(BSV(std::basic_string_view<CHAR >(empty)).AsSpan().IsEmpty()))), 0))) { do { } while (false ); MOZ_ReportAssertionFailure("BSV(std::basic_string_view<CHAR>(empty)).AsSpan().IsEmpty()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3665); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(std::basic_string_view<CHAR>(empty)).AsSpan().IsEmpty()" ")"); do { *((volatile int*)__null) = 3665; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
3665 | BSV(std::basic_string_view<CHAR>(empty)).AsSpan().IsEmpty())do { static_assert( mozilla::detail::AssertionConditionType< decltype(BSV(std::basic_string_view<CHAR>(empty)).AsSpan ().IsEmpty())>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(!!(BSV(std::basic_string_view<CHAR >(empty)).AsSpan().IsEmpty()))), 0))) { do { } while (false ); MOZ_ReportAssertionFailure("BSV(std::basic_string_view<CHAR>(empty)).AsSpan().IsEmpty()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3665); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(std::basic_string_view<CHAR>(empty)).AsSpan().IsEmpty()" ")"); do { *((volatile int*)__null) = 3665; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3666 | MOZ_RELEASE_ASSERT(!BSV(std::basic_string_view<CHAR>(empty)).IsLiteral())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!BSV(std::basic_string_view<CHAR>(empty)).IsLiteral ())>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(!BSV(std::basic_string_view<CHAR>(empty)).IsLiteral ()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("!BSV(std::basic_string_view<CHAR>(empty)).IsLiteral()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3666); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!BSV(std::basic_string_view<CHAR>(empty)).IsLiteral()" ")"); do { *((volatile int*)__null) = 3666; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3667 | MOZ_RELEASE_ASSERT(BSV(std::basic_string_view<CHAR>(empty)).IsReference())do { static_assert( mozilla::detail::AssertionConditionType< decltype(BSV(std::basic_string_view<CHAR>(empty)).IsReference ())>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(BSV(std::basic_string_view<CHAR>(empty)).IsReference ()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("BSV(std::basic_string_view<CHAR>(empty)).IsReference()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3667); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(std::basic_string_view<CHAR>(empty)).IsReference()" ")"); do { *((volatile int*)__null) = 3667; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3668 | ||||
3669 | // std::string_view to a literal non-empty string. | |||
3670 | MOZ_RELEASE_ASSERT(BSV(std::basic_string_view<CHAR>(hi)).Length() == 2)do { static_assert( mozilla::detail::AssertionConditionType< decltype(BSV(std::basic_string_view<CHAR>(hi)).Length() == 2)>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(BSV(std::basic_string_view<CHAR>(hi)).Length() == 2))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("BSV(std::basic_string_view<CHAR>(hi)).Length() == 2", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3670); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(std::basic_string_view<CHAR>(hi)).Length() == 2" ")"); do { *((volatile int*)__null) = 3670; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3671 | MOZ_RELEASE_ASSERT(BSV(std::basic_string_view<CHAR>(hi)).AsSpan().Elements())do { static_assert( mozilla::detail::AssertionConditionType< decltype(BSV(std::basic_string_view<CHAR>(hi)).AsSpan() .Elements())>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(!!(BSV(std::basic_string_view<CHAR >(hi)).AsSpan().Elements()))), 0))) { do { } while (false) ; MOZ_ReportAssertionFailure("BSV(std::basic_string_view<CHAR>(hi)).AsSpan().Elements()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3671); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(std::basic_string_view<CHAR>(hi)).AsSpan().Elements()" ")"); do { *((volatile int*)__null) = 3671; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3672 | MOZ_RELEASE_ASSERT(do { static_assert( mozilla::detail::AssertionConditionType< decltype(BSV(std::basic_string_view<CHAR>(hi)).AsSpan() .Elements()[0] == CHAR('h'))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(BSV(std::basic_string_view< CHAR>(hi)).AsSpan().Elements()[0] == CHAR('h')))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("BSV(std::basic_string_view<CHAR>(hi)).AsSpan().Elements()[0] == CHAR('h')" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3674); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(std::basic_string_view<CHAR>(hi)).AsSpan().Elements()[0] == CHAR('h')" ")"); do { *((volatile int*)__null) = 3674; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
3673 | BSV(std::basic_string_view<CHAR>(hi)).AsSpan().Elements()[0] ==do { static_assert( mozilla::detail::AssertionConditionType< decltype(BSV(std::basic_string_view<CHAR>(hi)).AsSpan() .Elements()[0] == CHAR('h'))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(BSV(std::basic_string_view< CHAR>(hi)).AsSpan().Elements()[0] == CHAR('h')))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("BSV(std::basic_string_view<CHAR>(hi)).AsSpan().Elements()[0] == CHAR('h')" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3674); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(std::basic_string_view<CHAR>(hi)).AsSpan().Elements()[0] == CHAR('h')" ")"); do { *((volatile int*)__null) = 3674; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
3674 | CHAR('h'))do { static_assert( mozilla::detail::AssertionConditionType< decltype(BSV(std::basic_string_view<CHAR>(hi)).AsSpan() .Elements()[0] == CHAR('h'))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(BSV(std::basic_string_view< CHAR>(hi)).AsSpan().Elements()[0] == CHAR('h')))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("BSV(std::basic_string_view<CHAR>(hi)).AsSpan().Elements()[0] == CHAR('h')" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3674); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(std::basic_string_view<CHAR>(hi)).AsSpan().Elements()[0] == CHAR('h')" ")"); do { *((volatile int*)__null) = 3674; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3675 | MOZ_RELEASE_ASSERT(do { static_assert( mozilla::detail::AssertionConditionType< decltype(BSV(std::basic_string_view<CHAR>(hi)).AsSpan() .Elements()[1] == CHAR('i'))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(BSV(std::basic_string_view< CHAR>(hi)).AsSpan().Elements()[1] == CHAR('i')))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("BSV(std::basic_string_view<CHAR>(hi)).AsSpan().Elements()[1] == CHAR('i')" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3677); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(std::basic_string_view<CHAR>(hi)).AsSpan().Elements()[1] == CHAR('i')" ")"); do { *((volatile int*)__null) = 3677; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
3676 | BSV(std::basic_string_view<CHAR>(hi)).AsSpan().Elements()[1] ==do { static_assert( mozilla::detail::AssertionConditionType< decltype(BSV(std::basic_string_view<CHAR>(hi)).AsSpan() .Elements()[1] == CHAR('i'))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(BSV(std::basic_string_view< CHAR>(hi)).AsSpan().Elements()[1] == CHAR('i')))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("BSV(std::basic_string_view<CHAR>(hi)).AsSpan().Elements()[1] == CHAR('i')" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3677); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(std::basic_string_view<CHAR>(hi)).AsSpan().Elements()[1] == CHAR('i')" ")"); do { *((volatile int*)__null) = 3677; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
3677 | CHAR('i'))do { static_assert( mozilla::detail::AssertionConditionType< decltype(BSV(std::basic_string_view<CHAR>(hi)).AsSpan() .Elements()[1] == CHAR('i'))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(BSV(std::basic_string_view< CHAR>(hi)).AsSpan().Elements()[1] == CHAR('i')))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("BSV(std::basic_string_view<CHAR>(hi)).AsSpan().Elements()[1] == CHAR('i')" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3677); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(std::basic_string_view<CHAR>(hi)).AsSpan().Elements()[1] == CHAR('i')" ")"); do { *((volatile int*)__null) = 3677; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3678 | MOZ_RELEASE_ASSERT(!BSV(std::basic_string_view<CHAR>(hi)).IsLiteral())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!BSV(std::basic_string_view<CHAR>(hi)).IsLiteral ())>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(!BSV(std::basic_string_view<CHAR>(hi)).IsLiteral ()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("!BSV(std::basic_string_view<CHAR>(hi)).IsLiteral()", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3678); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!BSV(std::basic_string_view<CHAR>(hi)).IsLiteral()" ")"); do { *((volatile int*)__null) = 3678; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3679 | MOZ_RELEASE_ASSERT(BSV(std::basic_string_view<CHAR>(hi)).IsReference())do { static_assert( mozilla::detail::AssertionConditionType< decltype(BSV(std::basic_string_view<CHAR>(hi)).IsReference ())>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(BSV(std::basic_string_view<CHAR>(hi)).IsReference ()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("BSV(std::basic_string_view<CHAR>(hi)).IsReference()", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3679); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(std::basic_string_view<CHAR>(hi)).IsReference()" ")"); do { *((volatile int*)__null) = 3679; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3680 | ||||
3681 | // Default std::string_view points at nullptr, ProfilerStringView converts it | |||
3682 | // to the literal empty string. | |||
3683 | MOZ_RELEASE_ASSERT(BSV(std::basic_string_view<CHAR>()).Length() == 0)do { static_assert( mozilla::detail::AssertionConditionType< decltype(BSV(std::basic_string_view<CHAR>()).Length() == 0)>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(BSV(std::basic_string_view<CHAR>()).Length() == 0))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("BSV(std::basic_string_view<CHAR>()).Length() == 0", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3683); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(std::basic_string_view<CHAR>()).Length() == 0" ")"); do { *((volatile int*)__null) = 3683; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3684 | MOZ_RELEASE_ASSERT(!std::basic_string_view<CHAR>().data())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!std::basic_string_view<CHAR>().data())>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(!std::basic_string_view<CHAR>().data()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!std::basic_string_view<CHAR>().data()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3684); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!std::basic_string_view<CHAR>().data()" ")"); do { *((volatile int*)__null) = 3684; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3685 | MOZ_RELEASE_ASSERT(BSV(std::basic_string_view<CHAR>()).AsSpan().IsEmpty())do { static_assert( mozilla::detail::AssertionConditionType< decltype(BSV(std::basic_string_view<CHAR>()).AsSpan().IsEmpty ())>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(BSV(std::basic_string_view<CHAR>()).AsSpan().IsEmpty ()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("BSV(std::basic_string_view<CHAR>()).AsSpan().IsEmpty()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3685); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(std::basic_string_view<CHAR>()).AsSpan().IsEmpty()" ")"); do { *((volatile int*)__null) = 3685; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3686 | MOZ_RELEASE_ASSERT(BSV(std::basic_string_view<CHAR>()).IsLiteral())do { static_assert( mozilla::detail::AssertionConditionType< decltype(BSV(std::basic_string_view<CHAR>()).IsLiteral( ))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(BSV(std::basic_string_view<CHAR>()).IsLiteral( )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("BSV(std::basic_string_view<CHAR>()).IsLiteral()", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3686); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(std::basic_string_view<CHAR>()).IsLiteral()" ")"); do { *((volatile int*)__null) = 3686; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3687 | MOZ_RELEASE_ASSERT(!BSV(std::basic_string_view<CHAR>()).IsReference())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!BSV(std::basic_string_view<CHAR>()).IsReference ())>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(!BSV(std::basic_string_view<CHAR>()).IsReference ()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("!BSV(std::basic_string_view<CHAR>()).IsReference()", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3687); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!BSV(std::basic_string_view<CHAR>()).IsReference()" ")"); do { *((volatile int*)__null) = 3687; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3688 | ||||
3689 | // std::string to a literal empty string. | |||
3690 | MOZ_RELEASE_ASSERT(BSV(std::basic_string<CHAR>(empty)).Length() == 0)do { static_assert( mozilla::detail::AssertionConditionType< decltype(BSV(std::basic_string<CHAR>(empty)).Length() == 0)>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(BSV(std::basic_string<CHAR>(empty)).Length() == 0))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("BSV(std::basic_string<CHAR>(empty)).Length() == 0", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3690); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(std::basic_string<CHAR>(empty)).Length() == 0" ")"); do { *((volatile int*)__null) = 3690; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3691 | MOZ_RELEASE_ASSERT(BSV(std::basic_string<CHAR>(empty)).AsSpan().IsEmpty())do { static_assert( mozilla::detail::AssertionConditionType< decltype(BSV(std::basic_string<CHAR>(empty)).AsSpan().IsEmpty ())>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(BSV(std::basic_string<CHAR>(empty)).AsSpan().IsEmpty ()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("BSV(std::basic_string<CHAR>(empty)).AsSpan().IsEmpty()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3691); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(std::basic_string<CHAR>(empty)).AsSpan().IsEmpty()" ")"); do { *((volatile int*)__null) = 3691; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3692 | MOZ_RELEASE_ASSERT(!BSV(std::basic_string<CHAR>(empty)).IsLiteral())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!BSV(std::basic_string<CHAR>(empty)).IsLiteral ())>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(!BSV(std::basic_string<CHAR>(empty)).IsLiteral ()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("!BSV(std::basic_string<CHAR>(empty)).IsLiteral()", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3692); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!BSV(std::basic_string<CHAR>(empty)).IsLiteral()" ")"); do { *((volatile int*)__null) = 3692; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3693 | MOZ_RELEASE_ASSERT(BSV(std::basic_string<CHAR>(empty)).IsReference())do { static_assert( mozilla::detail::AssertionConditionType< decltype(BSV(std::basic_string<CHAR>(empty)).IsReference ())>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(BSV(std::basic_string<CHAR>(empty)).IsReference ()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("BSV(std::basic_string<CHAR>(empty)).IsReference()", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3693); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(std::basic_string<CHAR>(empty)).IsReference()" ")"); do { *((volatile int*)__null) = 3693; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3694 | ||||
3695 | // std::string to a literal non-empty string. | |||
3696 | MOZ_RELEASE_ASSERT(BSV(std::basic_string<CHAR>(hi)).Length() == 2)do { static_assert( mozilla::detail::AssertionConditionType< decltype(BSV(std::basic_string<CHAR>(hi)).Length() == 2 )>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(BSV(std::basic_string<CHAR>(hi)).Length() == 2 ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "BSV(std::basic_string<CHAR>(hi)).Length() == 2", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3696); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(std::basic_string<CHAR>(hi)).Length() == 2" ")"); do { *((volatile int*)__null) = 3696; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3697 | MOZ_RELEASE_ASSERT(BSV(std::basic_string<CHAR>(hi)).AsSpan().Elements())do { static_assert( mozilla::detail::AssertionConditionType< decltype(BSV(std::basic_string<CHAR>(hi)).AsSpan().Elements ())>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(BSV(std::basic_string<CHAR>(hi)).AsSpan().Elements ()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("BSV(std::basic_string<CHAR>(hi)).AsSpan().Elements()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3697); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(std::basic_string<CHAR>(hi)).AsSpan().Elements()" ")"); do { *((volatile int*)__null) = 3697; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3698 | MOZ_RELEASE_ASSERT(BSV(std::basic_string<CHAR>(hi)).AsSpan().Elements()[0] ==do { static_assert( mozilla::detail::AssertionConditionType< decltype(BSV(std::basic_string<CHAR>(hi)).AsSpan().Elements ()[0] == CHAR('h'))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(BSV(std::basic_string<CHAR >(hi)).AsSpan().Elements()[0] == CHAR('h')))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("BSV(std::basic_string<CHAR>(hi)).AsSpan().Elements()[0] == CHAR('h')" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3699); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(std::basic_string<CHAR>(hi)).AsSpan().Elements()[0] == CHAR('h')" ")"); do { *((volatile int*)__null) = 3699; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
3699 | CHAR('h'))do { static_assert( mozilla::detail::AssertionConditionType< decltype(BSV(std::basic_string<CHAR>(hi)).AsSpan().Elements ()[0] == CHAR('h'))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(BSV(std::basic_string<CHAR >(hi)).AsSpan().Elements()[0] == CHAR('h')))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("BSV(std::basic_string<CHAR>(hi)).AsSpan().Elements()[0] == CHAR('h')" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3699); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(std::basic_string<CHAR>(hi)).AsSpan().Elements()[0] == CHAR('h')" ")"); do { *((volatile int*)__null) = 3699; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3700 | MOZ_RELEASE_ASSERT(BSV(std::basic_string<CHAR>(hi)).AsSpan().Elements()[1] ==do { static_assert( mozilla::detail::AssertionConditionType< decltype(BSV(std::basic_string<CHAR>(hi)).AsSpan().Elements ()[1] == CHAR('i'))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(BSV(std::basic_string<CHAR >(hi)).AsSpan().Elements()[1] == CHAR('i')))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("BSV(std::basic_string<CHAR>(hi)).AsSpan().Elements()[1] == CHAR('i')" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3701); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(std::basic_string<CHAR>(hi)).AsSpan().Elements()[1] == CHAR('i')" ")"); do { *((volatile int*)__null) = 3701; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
3701 | CHAR('i'))do { static_assert( mozilla::detail::AssertionConditionType< decltype(BSV(std::basic_string<CHAR>(hi)).AsSpan().Elements ()[1] == CHAR('i'))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(BSV(std::basic_string<CHAR >(hi)).AsSpan().Elements()[1] == CHAR('i')))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("BSV(std::basic_string<CHAR>(hi)).AsSpan().Elements()[1] == CHAR('i')" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3701); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(std::basic_string<CHAR>(hi)).AsSpan().Elements()[1] == CHAR('i')" ")"); do { *((volatile int*)__null) = 3701; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3702 | MOZ_RELEASE_ASSERT(!BSV(std::basic_string<CHAR>(hi)).IsLiteral())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!BSV(std::basic_string<CHAR>(hi)).IsLiteral()) >::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(!BSV(std::basic_string<CHAR>(hi)).IsLiteral()) )), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!BSV(std::basic_string<CHAR>(hi)).IsLiteral()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3702); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!BSV(std::basic_string<CHAR>(hi)).IsLiteral()" ")"); do { *((volatile int*)__null) = 3702; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3703 | MOZ_RELEASE_ASSERT(BSV(std::basic_string<CHAR>(hi)).IsReference())do { static_assert( mozilla::detail::AssertionConditionType< decltype(BSV(std::basic_string<CHAR>(hi)).IsReference() )>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(BSV(std::basic_string<CHAR>(hi)).IsReference() ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "BSV(std::basic_string<CHAR>(hi)).IsReference()", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3703); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(std::basic_string<CHAR>(hi)).IsReference()" ")"); do { *((volatile int*)__null) = 3703; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3704 | ||||
3705 | // Default std::string contains an empty null-terminated string. | |||
3706 | MOZ_RELEASE_ASSERT(BSV(std::basic_string<CHAR>()).Length() == 0)do { static_assert( mozilla::detail::AssertionConditionType< decltype(BSV(std::basic_string<CHAR>()).Length() == 0)> ::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(BSV(std::basic_string<CHAR>()).Length() == 0)) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("BSV(std::basic_string<CHAR>()).Length() == 0" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3706); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(std::basic_string<CHAR>()).Length() == 0" ")"); do { *((volatile int*)__null) = 3706; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3707 | MOZ_RELEASE_ASSERT(std::basic_string<CHAR>().data())do { static_assert( mozilla::detail::AssertionConditionType< decltype(std::basic_string<CHAR>().data())>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(std::basic_string<CHAR>().data()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("std::basic_string<CHAR>().data()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3707); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "std::basic_string<CHAR>().data()" ")"); do { *((volatile int*)__null) = 3707; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3708 | MOZ_RELEASE_ASSERT(BSV(std::basic_string<CHAR>()).AsSpan().IsEmpty())do { static_assert( mozilla::detail::AssertionConditionType< decltype(BSV(std::basic_string<CHAR>()).AsSpan().IsEmpty ())>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(BSV(std::basic_string<CHAR>()).AsSpan().IsEmpty ()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("BSV(std::basic_string<CHAR>()).AsSpan().IsEmpty()", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3708); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(std::basic_string<CHAR>()).AsSpan().IsEmpty()" ")"); do { *((volatile int*)__null) = 3708; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3709 | MOZ_RELEASE_ASSERT(!BSV(std::basic_string<CHAR>()).IsLiteral())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!BSV(std::basic_string<CHAR>()).IsLiteral())> ::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(!BSV(std::basic_string<CHAR>()).IsLiteral()))) , 0))) { do { } while (false); MOZ_ReportAssertionFailure("!BSV(std::basic_string<CHAR>()).IsLiteral()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3709); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!BSV(std::basic_string<CHAR>()).IsLiteral()" ")"); do { *((volatile int*)__null) = 3709; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3710 | MOZ_RELEASE_ASSERT(BSV(std::basic_string<CHAR>()).IsReference())do { static_assert( mozilla::detail::AssertionConditionType< decltype(BSV(std::basic_string<CHAR>()).IsReference())> ::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(BSV(std::basic_string<CHAR>()).IsReference())) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("BSV(std::basic_string<CHAR>()).IsReference()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3710); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(std::basic_string<CHAR>()).IsReference()" ")"); do { *((volatile int*)__null) = 3710; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3711 | ||||
3712 | // Class that quacks like nsTString (with Data(), Length(), IsLiteral()), to | |||
3713 | // check that ProfilerStringView can read from them. | |||
3714 | class FakeNsTString { | |||
3715 | public: | |||
3716 | FakeNsTString(const CHAR* aData, size_t aLength, bool aIsLiteral) | |||
3717 | : mData(aData), mLength(aLength), mIsLiteral(aIsLiteral) {} | |||
3718 | ||||
3719 | const CHAR* Data() const { return mData; } | |||
3720 | size_t Length() const { return mLength; } | |||
3721 | bool IsLiteral() const { return mIsLiteral; } | |||
3722 | ||||
3723 | private: | |||
3724 | const CHAR* mData; | |||
3725 | size_t mLength; | |||
3726 | bool mIsLiteral; | |||
3727 | }; | |||
3728 | ||||
3729 | // FakeNsTString to nullptr. | |||
3730 | MOZ_RELEASE_ASSERT(BSV(FakeNsTString(nullptr, 0, true)).Length() == 0)do { static_assert( mozilla::detail::AssertionConditionType< decltype(BSV(FakeNsTString(nullptr, 0, true)).Length() == 0)> ::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(BSV(FakeNsTString(nullptr, 0, true)).Length() == 0)) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("BSV(FakeNsTString(nullptr, 0, true)).Length() == 0" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3730); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(FakeNsTString(nullptr, 0, true)).Length() == 0" ")"); do { *((volatile int*)__null) = 3730; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3731 | MOZ_RELEASE_ASSERT(BSV(FakeNsTString(nullptr, 0, true)).AsSpan().IsEmpty())do { static_assert( mozilla::detail::AssertionConditionType< decltype(BSV(FakeNsTString(nullptr, 0, true)).AsSpan().IsEmpty ())>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(BSV(FakeNsTString(nullptr, 0, true)).AsSpan().IsEmpty ()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("BSV(FakeNsTString(nullptr, 0, true)).AsSpan().IsEmpty()", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3731); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(FakeNsTString(nullptr, 0, true)).AsSpan().IsEmpty()" ")"); do { *((volatile int*)__null) = 3731; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3732 | MOZ_RELEASE_ASSERT(BSV(FakeNsTString(nullptr, 0, true)).IsLiteral())do { static_assert( mozilla::detail::AssertionConditionType< decltype(BSV(FakeNsTString(nullptr, 0, true)).IsLiteral())> ::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(BSV(FakeNsTString(nullptr, 0, true)).IsLiteral()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("BSV(FakeNsTString(nullptr, 0, true)).IsLiteral()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3732); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(FakeNsTString(nullptr, 0, true)).IsLiteral()" ")"); do { *((volatile int*)__null) = 3732; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3733 | MOZ_RELEASE_ASSERT(!BSV(FakeNsTString(nullptr, 0, true)).IsReference())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!BSV(FakeNsTString(nullptr, 0, true)).IsReference()) >::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(!BSV(FakeNsTString(nullptr, 0, true)).IsReference()) )), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!BSV(FakeNsTString(nullptr, 0, true)).IsReference()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3733); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!BSV(FakeNsTString(nullptr, 0, true)).IsReference()" ")"); do { *((volatile int*)__null) = 3733; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3734 | ||||
3735 | // FakeNsTString to a literal empty string. | |||
3736 | MOZ_RELEASE_ASSERT(BSV(FakeNsTString(empty, 0, true)).Length() == 0)do { static_assert( mozilla::detail::AssertionConditionType< decltype(BSV(FakeNsTString(empty, 0, true)).Length() == 0)> ::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(BSV(FakeNsTString(empty, 0, true)).Length() == 0))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("BSV(FakeNsTString(empty, 0, true)).Length() == 0" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3736); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(FakeNsTString(empty, 0, true)).Length() == 0" ")"); do { *((volatile int*)__null) = 3736; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3737 | MOZ_RELEASE_ASSERT(BSV(FakeNsTString(empty, 0, true)).AsSpan().IsEmpty())do { static_assert( mozilla::detail::AssertionConditionType< decltype(BSV(FakeNsTString(empty, 0, true)).AsSpan().IsEmpty( ))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(BSV(FakeNsTString(empty, 0, true)).AsSpan().IsEmpty( )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("BSV(FakeNsTString(empty, 0, true)).AsSpan().IsEmpty()", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3737); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(FakeNsTString(empty, 0, true)).AsSpan().IsEmpty()" ")"); do { *((volatile int*)__null) = 3737; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3738 | MOZ_RELEASE_ASSERT(BSV(FakeNsTString(empty, 0, true)).IsLiteral())do { static_assert( mozilla::detail::AssertionConditionType< decltype(BSV(FakeNsTString(empty, 0, true)).IsLiteral())>:: isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(BSV(FakeNsTString(empty, 0, true)).IsLiteral()))), 0 ))) { do { } while (false); MOZ_ReportAssertionFailure("BSV(FakeNsTString(empty, 0, true)).IsLiteral()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3738); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(FakeNsTString(empty, 0, true)).IsLiteral()" ")"); do { *((volatile int*)__null) = 3738; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3739 | MOZ_RELEASE_ASSERT(!BSV(FakeNsTString(empty, 0, true)).IsReference())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!BSV(FakeNsTString(empty, 0, true)).IsReference())> ::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(!BSV(FakeNsTString(empty, 0, true)).IsReference()))) , 0))) { do { } while (false); MOZ_ReportAssertionFailure("!BSV(FakeNsTString(empty, 0, true)).IsReference()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3739); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!BSV(FakeNsTString(empty, 0, true)).IsReference()" ")"); do { *((volatile int*)__null) = 3739; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3740 | ||||
3741 | // FakeNsTString to a literal non-empty string. | |||
3742 | MOZ_RELEASE_ASSERT(BSV(FakeNsTString(hi, 2, true)).Length() == 2)do { static_assert( mozilla::detail::AssertionConditionType< decltype(BSV(FakeNsTString(hi, 2, true)).Length() == 2)>:: isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(BSV(FakeNsTString(hi, 2, true)).Length() == 2))), 0) )) { do { } while (false); MOZ_ReportAssertionFailure("BSV(FakeNsTString(hi, 2, true)).Length() == 2" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3742); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(FakeNsTString(hi, 2, true)).Length() == 2" ")"); do { *((volatile int*)__null) = 3742; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3743 | MOZ_RELEASE_ASSERT(BSV(FakeNsTString(hi, 2, true)).AsSpan().Elements())do { static_assert( mozilla::detail::AssertionConditionType< decltype(BSV(FakeNsTString(hi, 2, true)).AsSpan().Elements()) >::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(BSV(FakeNsTString(hi, 2, true)).AsSpan().Elements()) )), 0))) { do { } while (false); MOZ_ReportAssertionFailure("BSV(FakeNsTString(hi, 2, true)).AsSpan().Elements()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3743); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(FakeNsTString(hi, 2, true)).AsSpan().Elements()" ")"); do { *((volatile int*)__null) = 3743; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3744 | MOZ_RELEASE_ASSERT(BSV(FakeNsTString(hi, 2, true)).AsSpan().Elements()[0] ==do { static_assert( mozilla::detail::AssertionConditionType< decltype(BSV(FakeNsTString(hi, 2, true)).AsSpan().Elements()[ 0] == CHAR('h'))>::isValid, "invalid assertion condition") ; if ((__builtin_expect(!!(!(!!(BSV(FakeNsTString(hi, 2, true )).AsSpan().Elements()[0] == CHAR('h')))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("BSV(FakeNsTString(hi, 2, true)).AsSpan().Elements()[0] == CHAR('h')" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3745); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(FakeNsTString(hi, 2, true)).AsSpan().Elements()[0] == CHAR('h')" ")"); do { *((volatile int*)__null) = 3745; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
3745 | CHAR('h'))do { static_assert( mozilla::detail::AssertionConditionType< decltype(BSV(FakeNsTString(hi, 2, true)).AsSpan().Elements()[ 0] == CHAR('h'))>::isValid, "invalid assertion condition") ; if ((__builtin_expect(!!(!(!!(BSV(FakeNsTString(hi, 2, true )).AsSpan().Elements()[0] == CHAR('h')))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("BSV(FakeNsTString(hi, 2, true)).AsSpan().Elements()[0] == CHAR('h')" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3745); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(FakeNsTString(hi, 2, true)).AsSpan().Elements()[0] == CHAR('h')" ")"); do { *((volatile int*)__null) = 3745; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3746 | MOZ_RELEASE_ASSERT(BSV(FakeNsTString(hi, 2, true)).AsSpan().Elements()[1] ==do { static_assert( mozilla::detail::AssertionConditionType< decltype(BSV(FakeNsTString(hi, 2, true)).AsSpan().Elements()[ 1] == CHAR('i'))>::isValid, "invalid assertion condition") ; if ((__builtin_expect(!!(!(!!(BSV(FakeNsTString(hi, 2, true )).AsSpan().Elements()[1] == CHAR('i')))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("BSV(FakeNsTString(hi, 2, true)).AsSpan().Elements()[1] == CHAR('i')" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3747); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(FakeNsTString(hi, 2, true)).AsSpan().Elements()[1] == CHAR('i')" ")"); do { *((volatile int*)__null) = 3747; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
3747 | CHAR('i'))do { static_assert( mozilla::detail::AssertionConditionType< decltype(BSV(FakeNsTString(hi, 2, true)).AsSpan().Elements()[ 1] == CHAR('i'))>::isValid, "invalid assertion condition") ; if ((__builtin_expect(!!(!(!!(BSV(FakeNsTString(hi, 2, true )).AsSpan().Elements()[1] == CHAR('i')))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("BSV(FakeNsTString(hi, 2, true)).AsSpan().Elements()[1] == CHAR('i')" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3747); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(FakeNsTString(hi, 2, true)).AsSpan().Elements()[1] == CHAR('i')" ")"); do { *((volatile int*)__null) = 3747; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3748 | MOZ_RELEASE_ASSERT(BSV(FakeNsTString(hi, 2, true)).IsLiteral())do { static_assert( mozilla::detail::AssertionConditionType< decltype(BSV(FakeNsTString(hi, 2, true)).IsLiteral())>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(BSV(FakeNsTString(hi, 2, true)).IsLiteral()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("BSV(FakeNsTString(hi, 2, true)).IsLiteral()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3748); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(FakeNsTString(hi, 2, true)).IsLiteral()" ")"); do { *((volatile int*)__null) = 3748; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3749 | MOZ_RELEASE_ASSERT(!BSV(FakeNsTString(hi, 2, true)).IsReference())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!BSV(FakeNsTString(hi, 2, true)).IsReference())>:: isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(!BSV(FakeNsTString(hi, 2, true)).IsReference()))), 0 ))) { do { } while (false); MOZ_ReportAssertionFailure("!BSV(FakeNsTString(hi, 2, true)).IsReference()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3749); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!BSV(FakeNsTString(hi, 2, true)).IsReference()" ")"); do { *((volatile int*)__null) = 3749; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3750 | ||||
3751 | // FakeNsTString to a non-literal non-empty string. | |||
3752 | MOZ_RELEASE_ASSERT(BSV(FakeNsTString(hi, 2, false)).Length() == 2)do { static_assert( mozilla::detail::AssertionConditionType< decltype(BSV(FakeNsTString(hi, 2, false)).Length() == 2)>:: isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(BSV(FakeNsTString(hi, 2, false)).Length() == 2))), 0 ))) { do { } while (false); MOZ_ReportAssertionFailure("BSV(FakeNsTString(hi, 2, false)).Length() == 2" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3752); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(FakeNsTString(hi, 2, false)).Length() == 2" ")"); do { *((volatile int*)__null) = 3752; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3753 | MOZ_RELEASE_ASSERT(BSV(FakeNsTString(hi, 2, false)).AsSpan().Elements())do { static_assert( mozilla::detail::AssertionConditionType< decltype(BSV(FakeNsTString(hi, 2, false)).AsSpan().Elements() )>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(BSV(FakeNsTString(hi, 2, false)).AsSpan().Elements() ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "BSV(FakeNsTString(hi, 2, false)).AsSpan().Elements()", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3753); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(FakeNsTString(hi, 2, false)).AsSpan().Elements()" ")"); do { *((volatile int*)__null) = 3753; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3754 | MOZ_RELEASE_ASSERT(BSV(FakeNsTString(hi, 2, false)).AsSpan().Elements()[0] ==do { static_assert( mozilla::detail::AssertionConditionType< decltype(BSV(FakeNsTString(hi, 2, false)).AsSpan().Elements() [0] == CHAR('h'))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(BSV(FakeNsTString(hi, 2, false )).AsSpan().Elements()[0] == CHAR('h')))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("BSV(FakeNsTString(hi, 2, false)).AsSpan().Elements()[0] == CHAR('h')" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3755); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(FakeNsTString(hi, 2, false)).AsSpan().Elements()[0] == CHAR('h')" ")"); do { *((volatile int*)__null) = 3755; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
3755 | CHAR('h'))do { static_assert( mozilla::detail::AssertionConditionType< decltype(BSV(FakeNsTString(hi, 2, false)).AsSpan().Elements() [0] == CHAR('h'))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(BSV(FakeNsTString(hi, 2, false )).AsSpan().Elements()[0] == CHAR('h')))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("BSV(FakeNsTString(hi, 2, false)).AsSpan().Elements()[0] == CHAR('h')" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3755); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(FakeNsTString(hi, 2, false)).AsSpan().Elements()[0] == CHAR('h')" ")"); do { *((volatile int*)__null) = 3755; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3756 | MOZ_RELEASE_ASSERT(BSV(FakeNsTString(hi, 2, false)).AsSpan().Elements()[1] ==do { static_assert( mozilla::detail::AssertionConditionType< decltype(BSV(FakeNsTString(hi, 2, false)).AsSpan().Elements() [1] == CHAR('i'))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(BSV(FakeNsTString(hi, 2, false )).AsSpan().Elements()[1] == CHAR('i')))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("BSV(FakeNsTString(hi, 2, false)).AsSpan().Elements()[1] == CHAR('i')" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3757); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(FakeNsTString(hi, 2, false)).AsSpan().Elements()[1] == CHAR('i')" ")"); do { *((volatile int*)__null) = 3757; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
3757 | CHAR('i'))do { static_assert( mozilla::detail::AssertionConditionType< decltype(BSV(FakeNsTString(hi, 2, false)).AsSpan().Elements() [1] == CHAR('i'))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(BSV(FakeNsTString(hi, 2, false )).AsSpan().Elements()[1] == CHAR('i')))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("BSV(FakeNsTString(hi, 2, false)).AsSpan().Elements()[1] == CHAR('i')" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3757); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(FakeNsTString(hi, 2, false)).AsSpan().Elements()[1] == CHAR('i')" ")"); do { *((volatile int*)__null) = 3757; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3758 | MOZ_RELEASE_ASSERT(!BSV(FakeNsTString(hi, 2, false)).IsLiteral())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!BSV(FakeNsTString(hi, 2, false)).IsLiteral())>:: isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(!BSV(FakeNsTString(hi, 2, false)).IsLiteral()))), 0) )) { do { } while (false); MOZ_ReportAssertionFailure("!BSV(FakeNsTString(hi, 2, false)).IsLiteral()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3758); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!BSV(FakeNsTString(hi, 2, false)).IsLiteral()" ")"); do { *((volatile int*)__null) = 3758; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3759 | MOZ_RELEASE_ASSERT(BSV(FakeNsTString(hi, 2, false)).IsReference())do { static_assert( mozilla::detail::AssertionConditionType< decltype(BSV(FakeNsTString(hi, 2, false)).IsReference())>:: isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(BSV(FakeNsTString(hi, 2, false)).IsReference()))), 0 ))) { do { } while (false); MOZ_ReportAssertionFailure("BSV(FakeNsTString(hi, 2, false)).IsReference()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3759); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "BSV(FakeNsTString(hi, 2, false)).IsReference()" ")"); do { *((volatile int*)__null) = 3759; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3760 | ||||
3761 | // Serialization and deserialization (with ownership). | |||
3762 | constexpr size_t bufferMaxSize = 1024; | |||
3763 | constexpr ProfileChunkedBuffer::Length chunkMinSize = 128; | |||
3764 | ProfileBufferChunkManagerWithLocalLimit cm(bufferMaxSize, chunkMinSize); | |||
3765 | ProfileChunkedBuffer cb(ProfileChunkedBuffer::ThreadSafety::WithMutex, cm); | |||
3766 | ||||
3767 | // Literal string, serialized as raw pointer. | |||
3768 | MOZ_RELEASE_ASSERT(cb.PutObject(BSV(hi)))do { static_assert( mozilla::detail::AssertionConditionType< decltype(cb.PutObject(BSV(hi)))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(cb.PutObject(BSV(hi))))), 0) )) { do { } while (false); MOZ_ReportAssertionFailure("cb.PutObject(BSV(hi))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3768); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "cb.PutObject(BSV(hi))" ")"); do { *((volatile int*)__null) = 3768; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3769 | { | |||
3770 | unsigned read = 0; | |||
3771 | ProfilerStringView<CHAR> outerBSV; | |||
3772 | cb.ReadEach([&](ProfileBufferEntryReader& aER) { | |||
3773 | ++read; | |||
3774 | auto bsv = aER.ReadObject<ProfilerStringView<CHAR>>(); | |||
3775 | MOZ_RELEASE_ASSERT(bsv.Length() == 2)do { static_assert( mozilla::detail::AssertionConditionType< decltype(bsv.Length() == 2)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(bsv.Length() == 2))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("bsv.Length() == 2" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3775); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "bsv.Length() == 2" ")"); do { *((volatile int*)__null) = 3775; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3776 | MOZ_RELEASE_ASSERT(bsv.AsSpan().Elements())do { static_assert( mozilla::detail::AssertionConditionType< decltype(bsv.AsSpan().Elements())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(bsv.AsSpan().Elements()))), 0 ))) { do { } while (false); MOZ_ReportAssertionFailure("bsv.AsSpan().Elements()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3776); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "bsv.AsSpan().Elements()" ")"); do { *((volatile int*)__null) = 3776; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3777 | MOZ_RELEASE_ASSERT(bsv.AsSpan().Elements()[0] == CHAR('h'))do { static_assert( mozilla::detail::AssertionConditionType< decltype(bsv.AsSpan().Elements()[0] == CHAR('h'))>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(bsv.AsSpan().Elements()[0] == CHAR('h')))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("bsv.AsSpan().Elements()[0] == CHAR('h')" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3777); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "bsv.AsSpan().Elements()[0] == CHAR('h')" ")"); do { *((volatile int*)__null) = 3777; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3778 | MOZ_RELEASE_ASSERT(bsv.AsSpan().Elements()[1] == CHAR('i'))do { static_assert( mozilla::detail::AssertionConditionType< decltype(bsv.AsSpan().Elements()[1] == CHAR('i'))>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(bsv.AsSpan().Elements()[1] == CHAR('i')))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("bsv.AsSpan().Elements()[1] == CHAR('i')" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3778); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "bsv.AsSpan().Elements()[1] == CHAR('i')" ")"); do { *((volatile int*)__null) = 3778; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3779 | MOZ_RELEASE_ASSERT(bsv.IsLiteral())do { static_assert( mozilla::detail::AssertionConditionType< decltype(bsv.IsLiteral())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(bsv.IsLiteral()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("bsv.IsLiteral()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3779); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "bsv.IsLiteral()" ")"); do { *((volatile int*)__null) = 3779; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3780 | MOZ_RELEASE_ASSERT(!bsv.IsReference())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!bsv.IsReference())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!bsv.IsReference()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!bsv.IsReference()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3780); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!bsv.IsReference()" ")"); do { *((volatile int*)__null) = 3780; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3781 | outerBSV = std::move(bsv); | |||
3782 | }); | |||
3783 | MOZ_RELEASE_ASSERT(read == 1)do { static_assert( mozilla::detail::AssertionConditionType< decltype(read == 1)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(read == 1))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("read == 1", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3783); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "read == 1" ")"); do { *((volatile int*)__null) = 3783; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3784 | MOZ_RELEASE_ASSERT(outerBSV.Length() == 2)do { static_assert( mozilla::detail::AssertionConditionType< decltype(outerBSV.Length() == 2)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(outerBSV.Length() == 2))), 0 ))) { do { } while (false); MOZ_ReportAssertionFailure("outerBSV.Length() == 2" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3784); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "outerBSV.Length() == 2" ")"); do { *((volatile int*)__null) = 3784; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3785 | MOZ_RELEASE_ASSERT(outerBSV.AsSpan().Elements())do { static_assert( mozilla::detail::AssertionConditionType< decltype(outerBSV.AsSpan().Elements())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(outerBSV.AsSpan().Elements() ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "outerBSV.AsSpan().Elements()", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3785); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "outerBSV.AsSpan().Elements()" ")"); do { *((volatile int*)__null) = 3785; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3786 | MOZ_RELEASE_ASSERT(outerBSV.AsSpan().Elements()[0] == CHAR('h'))do { static_assert( mozilla::detail::AssertionConditionType< decltype(outerBSV.AsSpan().Elements()[0] == CHAR('h'))>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(outerBSV.AsSpan().Elements()[0] == CHAR('h')))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("outerBSV.AsSpan().Elements()[0] == CHAR('h')" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3786); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "outerBSV.AsSpan().Elements()[0] == CHAR('h')" ")"); do { *((volatile int*)__null) = 3786; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3787 | MOZ_RELEASE_ASSERT(outerBSV.AsSpan().Elements()[1] == CHAR('i'))do { static_assert( mozilla::detail::AssertionConditionType< decltype(outerBSV.AsSpan().Elements()[1] == CHAR('i'))>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(outerBSV.AsSpan().Elements()[1] == CHAR('i')))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("outerBSV.AsSpan().Elements()[1] == CHAR('i')" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3787); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "outerBSV.AsSpan().Elements()[1] == CHAR('i')" ")"); do { *((volatile int*)__null) = 3787; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3788 | MOZ_RELEASE_ASSERT(outerBSV.IsLiteral())do { static_assert( mozilla::detail::AssertionConditionType< decltype(outerBSV.IsLiteral())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(outerBSV.IsLiteral()))), 0)) ) { do { } while (false); MOZ_ReportAssertionFailure("outerBSV.IsLiteral()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3788); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "outerBSV.IsLiteral()" ")"); do { *((volatile int*)__null) = 3788; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3789 | MOZ_RELEASE_ASSERT(!outerBSV.IsReference())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!outerBSV.IsReference())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!outerBSV.IsReference()))), 0 ))) { do { } while (false); MOZ_ReportAssertionFailure("!outerBSV.IsReference()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3789); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!outerBSV.IsReference()" ")"); do { *((volatile int*)__null) = 3789; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3790 | } | |||
3791 | ||||
3792 | MOZ_RELEASE_ASSERT(cb.GetState().mRangeStart == 1u)do { static_assert( mozilla::detail::AssertionConditionType< decltype(cb.GetState().mRangeStart == 1u)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(cb.GetState().mRangeStart == 1u))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("cb.GetState().mRangeStart == 1u", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3792); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "cb.GetState().mRangeStart == 1u" ")"); do { *((volatile int*)__null) = 3792; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3793 | ||||
3794 | cb.Clear(); | |||
3795 | ||||
3796 | // Non-literal string, content is serialized. | |||
3797 | ||||
3798 | // We'll try to write 4 strings, such that the 4th one will cross into the | |||
3799 | // next chunk. | |||
3800 | unsigned guessedChunkBytes = unsigned(cb.GetState().mRangeStart) - 1u; | |||
3801 | static constexpr unsigned stringCount = 4u; | |||
3802 | const unsigned stringSize = | |||
3803 | guessedChunkBytes / stringCount / sizeof(CHAR) + 3u; | |||
3804 | ||||
3805 | std::basic_string<CHAR> longString; | |||
3806 | longString.reserve(stringSize); | |||
3807 | for (unsigned i = 0; i < stringSize; ++i) { | |||
3808 | longString += CHAR('0' + i); | |||
3809 | } | |||
3810 | ||||
3811 | for (unsigned i = 0; i < stringCount; ++i) { | |||
3812 | MOZ_RELEASE_ASSERT(cb.PutObject(BSV(longString)))do { static_assert( mozilla::detail::AssertionConditionType< decltype(cb.PutObject(BSV(longString)))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(cb.PutObject(BSV(longString) )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("cb.PutObject(BSV(longString))", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3812); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "cb.PutObject(BSV(longString))" ")"); do { *((volatile int*)__null) = 3812; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3813 | } | |||
3814 | ||||
3815 | { | |||
3816 | unsigned read = 0; | |||
3817 | ProfilerStringView<CHAR> outerBSV; | |||
3818 | cb.ReadEach([&](ProfileBufferEntryReader& aER) { | |||
3819 | ++read; | |||
3820 | { | |||
3821 | auto bsv = aER.ReadObject<ProfilerStringView<CHAR>>(); | |||
3822 | MOZ_RELEASE_ASSERT(bsv.Length() == stringSize)do { static_assert( mozilla::detail::AssertionConditionType< decltype(bsv.Length() == stringSize)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(bsv.Length() == stringSize)) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("bsv.Length() == stringSize" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3822); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "bsv.Length() == stringSize" ")"); do { *((volatile int*)__null) = 3822; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3823 | MOZ_RELEASE_ASSERT(bsv.AsSpan().Elements())do { static_assert( mozilla::detail::AssertionConditionType< decltype(bsv.AsSpan().Elements())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(bsv.AsSpan().Elements()))), 0 ))) { do { } while (false); MOZ_ReportAssertionFailure("bsv.AsSpan().Elements()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3823); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "bsv.AsSpan().Elements()" ")"); do { *((volatile int*)__null) = 3823; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3824 | for (unsigned i = 0; i < stringSize; ++i) { | |||
3825 | MOZ_RELEASE_ASSERT(bsv.AsSpan().Elements()[i] == CHAR('0' + i))do { static_assert( mozilla::detail::AssertionConditionType< decltype(bsv.AsSpan().Elements()[i] == CHAR('0' + i))>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(bsv.AsSpan().Elements()[i] == CHAR('0' + i)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("bsv.AsSpan().Elements()[i] == CHAR('0' + i)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3825); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "bsv.AsSpan().Elements()[i] == CHAR('0' + i)" ")"); do { *((volatile int*)__null) = 3825; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3826 | longString += '0' + i; | |||
3827 | } | |||
3828 | MOZ_RELEASE_ASSERT(!bsv.IsLiteral())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!bsv.IsLiteral())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!bsv.IsLiteral()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!bsv.IsLiteral()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3828); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!bsv.IsLiteral()" ")"); do { *((volatile int*)__null) = 3828; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3829 | // The first 3 should be references (because they fit in one chunk, so | |||
3830 | // they can be referenced directly), which the 4th one have to be copied | |||
3831 | // out of two chunks and stitched back together. | |||
3832 | MOZ_RELEASE_ASSERT(bsv.IsReference() == (read != 4))do { static_assert( mozilla::detail::AssertionConditionType< decltype(bsv.IsReference() == (read != 4))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(bsv.IsReference() == (read != 4)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("bsv.IsReference() == (read != 4)", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3832); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "bsv.IsReference() == (read != 4)" ")"); do { *((volatile int*)__null) = 3832; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3833 | ||||
3834 | // Test move of ownership. | |||
3835 | outerBSV = std::move(bsv); | |||
3836 | // After a move, references stay complete, while a non-reference had a | |||
3837 | // buffer that has been moved out. | |||
3838 | // NOLINTNEXTLINE(bugprone-use-after-move,clang-analyzer-cplusplus.Move) | |||
3839 | MOZ_RELEASE_ASSERT(bsv.Length() == ((read != 4) ? stringSize : 0))do { static_assert( mozilla::detail::AssertionConditionType< decltype(bsv.Length() == ((read != 4) ? stringSize : 0))>:: isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(bsv.Length() == ((read != 4) ? stringSize : 0)))), 0 ))) { do { } while (false); MOZ_ReportAssertionFailure("bsv.Length() == ((read != 4) ? stringSize : 0)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3839); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "bsv.Length() == ((read != 4) ? stringSize : 0)" ")"); do { *((volatile int*)__null) = 3839; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3840 | } | |||
3841 | ||||
3842 | MOZ_RELEASE_ASSERT(outerBSV.Length() == stringSize)do { static_assert( mozilla::detail::AssertionConditionType< decltype(outerBSV.Length() == stringSize)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(outerBSV.Length() == stringSize ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "outerBSV.Length() == stringSize", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3842); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "outerBSV.Length() == stringSize" ")"); do { *((volatile int*)__null) = 3842; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3843 | MOZ_RELEASE_ASSERT(outerBSV.AsSpan().Elements())do { static_assert( mozilla::detail::AssertionConditionType< decltype(outerBSV.AsSpan().Elements())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(outerBSV.AsSpan().Elements() ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "outerBSV.AsSpan().Elements()", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3843); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "outerBSV.AsSpan().Elements()" ")"); do { *((volatile int*)__null) = 3843; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3844 | for (unsigned i = 0; i < stringSize; ++i) { | |||
3845 | MOZ_RELEASE_ASSERT(outerBSV.AsSpan().Elements()[i] == CHAR('0' + i))do { static_assert( mozilla::detail::AssertionConditionType< decltype(outerBSV.AsSpan().Elements()[i] == CHAR('0' + i))> ::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(outerBSV.AsSpan().Elements()[i] == CHAR('0' + i)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("outerBSV.AsSpan().Elements()[i] == CHAR('0' + i)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3845); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "outerBSV.AsSpan().Elements()[i] == CHAR('0' + i)" ")"); do { *((volatile int*)__null) = 3845; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3846 | longString += '0' + i; | |||
3847 | } | |||
3848 | MOZ_RELEASE_ASSERT(!outerBSV.IsLiteral())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!outerBSV.IsLiteral())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!outerBSV.IsLiteral()))), 0) )) { do { } while (false); MOZ_ReportAssertionFailure("!outerBSV.IsLiteral()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3848); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!outerBSV.IsLiteral()" ")"); do { *((volatile int*)__null) = 3848; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3849 | MOZ_RELEASE_ASSERT(outerBSV.IsReference() == (read != 4))do { static_assert( mozilla::detail::AssertionConditionType< decltype(outerBSV.IsReference() == (read != 4))>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(! !(outerBSV.IsReference() == (read != 4)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("outerBSV.IsReference() == (read != 4)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3849); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "outerBSV.IsReference() == (read != 4)" ")"); do { *((volatile int*)__null) = 3849; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3850 | }); | |||
3851 | MOZ_RELEASE_ASSERT(read == 4)do { static_assert( mozilla::detail::AssertionConditionType< decltype(read == 4)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(read == 4))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("read == 4", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3851); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "read == 4" ")"); do { *((volatile int*)__null) = 3851; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3852 | } | |||
3853 | ||||
3854 | if constexpr (std::is_same_v<CHAR, char>) { | |||
3855 | printf("TestProfilerStringView<char> done\n"); | |||
3856 | } else if constexpr (std::is_same_v<CHAR, char16_t>) { | |||
3857 | printf("TestProfilerStringView<char16_t> done\n"); | |||
3858 | } | |||
3859 | } | |||
3860 | ||||
3861 | void TestProfilerDependencies() { | |||
3862 | TestPowerOfTwoMask(); | |||
3863 | TestPowerOfTwo(); | |||
3864 | TestLEB128(); | |||
3865 | TestJSONTimeOutput(); | |||
3866 | TestChunk(); | |||
3867 | TestChunkManagerSingle(); | |||
3868 | TestChunkManagerWithLocalLimit(); | |||
3869 | TestControlledChunkManagerUpdate(); | |||
3870 | TestControlledChunkManagerWithLocalLimit(); | |||
3871 | TestChunkedBuffer(); | |||
3872 | TestChunkedBufferSingle(); | |||
3873 | TestModuloBuffer(); | |||
3874 | TestLiteralEmptyStringView(); | |||
3875 | TestProfilerStringView<char>(); | |||
3876 | TestProfilerStringView<char16_t>(); | |||
3877 | } | |||
3878 | ||||
3879 | // Increase the depth, to a maximum (to avoid too-deep recursion). | |||
3880 | static constexpr size_t NextDepth(size_t aDepth) { | |||
3881 | constexpr size_t MAX_DEPTH = 128; | |||
3882 | return (aDepth < MAX_DEPTH) ? (aDepth + 1) : aDepth; | |||
3883 | } | |||
3884 | ||||
3885 | Atomic<bool, Relaxed> sStopFibonacci; | |||
3886 | ||||
3887 | // Compute fibonacci the hard way (recursively: `f(n)=f(n-1)+f(n-2)`), and | |||
3888 | // prevent inlining. | |||
3889 | // The template parameter makes each depth be a separate function, to better | |||
3890 | // distinguish them in the profiler output. | |||
3891 | template <size_t DEPTH = 0> | |||
3892 | MOZ_NEVER_INLINE__attribute__((noinline)) unsigned long long Fibonacci(unsigned long long n) { | |||
3893 | AUTO_BASE_PROFILER_LABEL_DYNAMIC_STRING("fib", OTHER, std::to_string(DEPTH))Maybe<std::string> autoStr; Maybe<::mozilla::baseprofiler ::AutoProfilerLabel> raiiObjectString; if (::mozilla::baseprofiler ::profiler_is_active()) { autoStr.emplace(std::to_string(DEPTH )); raiiObjectString.emplace( "fib", autoStr->c_str(), ::mozilla ::baseprofiler::ProfilingCategoryPair::OTHER); }; | |||
3894 | if (n == 0) { | |||
3895 | return 0; | |||
3896 | } | |||
3897 | if (n == 1) { | |||
3898 | return 1; | |||
3899 | } | |||
3900 | if (DEPTH < 5 && sStopFibonacci) { | |||
3901 | return 1'000'000'000; | |||
3902 | } | |||
3903 | TimeStamp start = TimeStamp::Now(); | |||
3904 | static constexpr size_t MAX_MARKER_DEPTH = 10; | |||
3905 | unsigned long long f2 = Fibonacci<NextDepth(DEPTH)>(n - 2); | |||
3906 | if (DEPTH == 0) { | |||
3907 | BASE_PROFILER_MARKER_UNTYPED("Half-way through Fibonacci", OTHER)do { ; ::mozilla::baseprofiler::AddMarker( "Half-way through Fibonacci" , ::mozilla::baseprofiler::category::OTHER); } while (false); | |||
3908 | } | |||
3909 | unsigned long long f1 = Fibonacci<NextDepth(DEPTH)>(n - 1); | |||
3910 | if (DEPTH < MAX_MARKER_DEPTH) { | |||
3911 | BASE_PROFILER_MARKER_TEXT("fib", OTHER,do { ; ::mozilla::baseprofiler::AddMarker( "fib", ::mozilla:: baseprofiler::category::OTHER, MarkerTiming::IntervalUntilNowFrom (start), ::mozilla::baseprofiler::markers::TextMarker{}, std:: to_string(DEPTH)); } while (false) | |||
3912 | MarkerTiming::IntervalUntilNowFrom(start),do { ; ::mozilla::baseprofiler::AddMarker( "fib", ::mozilla:: baseprofiler::category::OTHER, MarkerTiming::IntervalUntilNowFrom (start), ::mozilla::baseprofiler::markers::TextMarker{}, std:: to_string(DEPTH)); } while (false) | |||
3913 | std::to_string(DEPTH))do { ; ::mozilla::baseprofiler::AddMarker( "fib", ::mozilla:: baseprofiler::category::OTHER, MarkerTiming::IntervalUntilNowFrom (start), ::mozilla::baseprofiler::markers::TextMarker{}, std:: to_string(DEPTH)); } while (false); | |||
3914 | } | |||
3915 | return f2 + f1; | |||
3916 | } | |||
3917 | ||||
3918 | void TestProfiler() { | |||
3919 | printf("TestProfiler starting -- pid: %" PRIu64"l" "u" ", tid: %" PRIu64"l" "u" "\n", | |||
3920 | uint64_t(baseprofiler::profiler_current_process_id().ToNumber()), | |||
3921 | uint64_t(baseprofiler::profiler_current_thread_id().ToNumber())); | |||
3922 | // ::SleepMilli(10000); | |||
3923 | ||||
3924 | TestProfilerDependencies(); | |||
3925 | ||||
3926 | { | |||
3927 | MOZ_RELEASE_ASSERT(!baseprofiler::profiler_is_active())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!baseprofiler::profiler_is_active())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!baseprofiler::profiler_is_active ()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("!baseprofiler::profiler_is_active()", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3927); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!baseprofiler::profiler_is_active()" ")"); do { *((volatile int*)__null) = 3927; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3928 | MOZ_RELEASE_ASSERT(!baseprofiler::profiler_thread_is_being_profiled())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!baseprofiler::profiler_thread_is_being_profiled())> ::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(!baseprofiler::profiler_thread_is_being_profiled())) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!baseprofiler::profiler_thread_is_being_profiled()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3928); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!baseprofiler::profiler_thread_is_being_profiled()" ")"); do { *((volatile int*)__null) = 3928; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3929 | MOZ_RELEASE_ASSERT(!baseprofiler::profiler_thread_is_sleeping())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!baseprofiler::profiler_thread_is_sleeping())>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(!baseprofiler::profiler_thread_is_sleeping()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!baseprofiler::profiler_thread_is_sleeping()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3929); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!baseprofiler::profiler_thread_is_sleeping()" ")"); do { *((volatile int*)__null) = 3929; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3930 | ||||
3931 | const baseprofiler::BaseProfilerThreadId mainThreadId = | |||
3932 | mozilla::baseprofiler::profiler_current_thread_id(); | |||
3933 | ||||
3934 | MOZ_RELEASE_ASSERT(mozilla::baseprofiler::profiler_main_thread_id() ==do { static_assert( mozilla::detail::AssertionConditionType< decltype(mozilla::baseprofiler::profiler_main_thread_id() == mainThreadId )>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(mozilla::baseprofiler::profiler_main_thread_id() == mainThreadId ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "mozilla::baseprofiler::profiler_main_thread_id() == mainThreadId" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3935); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::profiler_main_thread_id() == mainThreadId" ")"); do { *((volatile int*)__null) = 3935; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
3935 | mainThreadId)do { static_assert( mozilla::detail::AssertionConditionType< decltype(mozilla::baseprofiler::profiler_main_thread_id() == mainThreadId )>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(mozilla::baseprofiler::profiler_main_thread_id() == mainThreadId ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "mozilla::baseprofiler::profiler_main_thread_id() == mainThreadId" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3935); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::profiler_main_thread_id() == mainThreadId" ")"); do { *((volatile int*)__null) = 3935; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3936 | MOZ_RELEASE_ASSERT(mozilla::baseprofiler::profiler_is_main_thread())do { static_assert( mozilla::detail::AssertionConditionType< decltype(mozilla::baseprofiler::profiler_is_main_thread())> ::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(mozilla::baseprofiler::profiler_is_main_thread()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("mozilla::baseprofiler::profiler_is_main_thread()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3936); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::profiler_is_main_thread()" ")"); do { *((volatile int*)__null) = 3936; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3937 | ||||
3938 | std::thread testThread([&]() { | |||
3939 | const baseprofiler::BaseProfilerThreadId testThreadId = | |||
3940 | mozilla::baseprofiler::profiler_current_thread_id(); | |||
3941 | MOZ_RELEASE_ASSERT(testThreadId != mainThreadId)do { static_assert( mozilla::detail::AssertionConditionType< decltype(testThreadId != mainThreadId)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(testThreadId != mainThreadId ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "testThreadId != mainThreadId", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3941); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "testThreadId != mainThreadId" ")"); do { *((volatile int*)__null) = 3941; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3942 | ||||
3943 | MOZ_RELEASE_ASSERT(mozilla::baseprofiler::profiler_main_thread_id() !=do { static_assert( mozilla::detail::AssertionConditionType< decltype(mozilla::baseprofiler::profiler_main_thread_id() != testThreadId )>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(mozilla::baseprofiler::profiler_main_thread_id() != testThreadId ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "mozilla::baseprofiler::profiler_main_thread_id() != testThreadId" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3944); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::profiler_main_thread_id() != testThreadId" ")"); do { *((volatile int*)__null) = 3944; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
3944 | testThreadId)do { static_assert( mozilla::detail::AssertionConditionType< decltype(mozilla::baseprofiler::profiler_main_thread_id() != testThreadId )>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(mozilla::baseprofiler::profiler_main_thread_id() != testThreadId ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "mozilla::baseprofiler::profiler_main_thread_id() != testThreadId" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3944); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::profiler_main_thread_id() != testThreadId" ")"); do { *((volatile int*)__null) = 3944; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3945 | MOZ_RELEASE_ASSERT(!mozilla::baseprofiler::profiler_is_main_thread())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!mozilla::baseprofiler::profiler_is_main_thread())> ::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(!mozilla::baseprofiler::profiler_is_main_thread()))) , 0))) { do { } while (false); MOZ_ReportAssertionFailure("!mozilla::baseprofiler::profiler_is_main_thread()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3945); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!mozilla::baseprofiler::profiler_is_main_thread()" ")"); do { *((volatile int*)__null) = 3945; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3946 | }); | |||
3947 | testThread.join(); | |||
3948 | ||||
3949 | printf("profiler_start()...\n"); | |||
3950 | Vector<const char*> filters; | |||
3951 | // Profile all registered threads. | |||
3952 | MOZ_RELEASE_ASSERT(filters.append(""))do { static_assert( mozilla::detail::AssertionConditionType< decltype(filters.append(""))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(filters.append("")))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("filters.append(\"\")" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3952); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "filters.append(\"\")" ")"); do { *((volatile int*)__null) = 3952; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3953 | const uint32_t features = baseprofiler::ProfilerFeature::StackWalk; | |||
3954 | baseprofiler::profiler_start(baseprofiler::BASE_PROFILER_DEFAULT_ENTRIES, | |||
3955 | BASE_PROFILER_DEFAULT_INTERVAL1, features, | |||
3956 | filters.begin(), filters.length()); | |||
3957 | ||||
3958 | MOZ_RELEASE_ASSERT(baseprofiler::profiler_is_active())do { static_assert( mozilla::detail::AssertionConditionType< decltype(baseprofiler::profiler_is_active())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(baseprofiler::profiler_is_active ()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("baseprofiler::profiler_is_active()", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3958); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::profiler_is_active()" ")"); do { *((volatile int*)__null) = 3958; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3959 | MOZ_RELEASE_ASSERT(baseprofiler::profiler_thread_is_being_profiled())do { static_assert( mozilla::detail::AssertionConditionType< decltype(baseprofiler::profiler_thread_is_being_profiled())> ::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(baseprofiler::profiler_thread_is_being_profiled()))) , 0))) { do { } while (false); MOZ_ReportAssertionFailure("baseprofiler::profiler_thread_is_being_profiled()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3959); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::profiler_thread_is_being_profiled()" ")"); do { *((volatile int*)__null) = 3959; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3960 | MOZ_RELEASE_ASSERT(!baseprofiler::profiler_thread_is_sleeping())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!baseprofiler::profiler_thread_is_sleeping())>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(!baseprofiler::profiler_thread_is_sleeping()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!baseprofiler::profiler_thread_is_sleeping()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 3960); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!baseprofiler::profiler_thread_is_sleeping()" ")"); do { *((volatile int*)__null) = 3960; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
3961 | ||||
3962 | sStopFibonacci = false; | |||
3963 | ||||
3964 | std::thread threadFib([]() { | |||
3965 | AUTO_BASE_PROFILER_REGISTER_THREAD("fibonacci")::mozilla::baseprofiler::AutoProfilerRegisterThread raiiObject3965 ("fibonacci"); | |||
3966 | SleepMilli(5); | |||
3967 | auto cause = baseprofiler::profiler_capture_backtrace(); | |||
3968 | AUTO_BASE_PROFILER_MARKER_TEXT(::mozilla::baseprofiler::AutoProfilerTextMarker raiiObject3970 ( "fibonacci", ::mozilla::baseprofiler::category::OTHER, MarkerStack ::TakeBacktrace(std::move(cause)), "First leaf call") | |||
| ||||
3969 | "fibonacci", OTHER, MarkerStack::TakeBacktrace(std::move(cause)),::mozilla::baseprofiler::AutoProfilerTextMarker raiiObject3970 ( "fibonacci", ::mozilla::baseprofiler::category::OTHER, MarkerStack ::TakeBacktrace(std::move(cause)), "First leaf call") | |||
3970 | "First leaf call")::mozilla::baseprofiler::AutoProfilerTextMarker raiiObject3970 ( "fibonacci", ::mozilla::baseprofiler::category::OTHER, MarkerStack ::TakeBacktrace(std::move(cause)), "First leaf call"); | |||
3971 | static const unsigned long long fibStart = 37; | |||
3972 | printf("Fibonacci(%llu)...\n", fibStart); | |||
3973 | AUTO_BASE_PROFILER_LABEL("Label around Fibonacci", OTHER)::mozilla::baseprofiler::AutoProfilerLabel raiiObject3973( "Label around Fibonacci" , nullptr, ::mozilla::baseprofiler::ProfilingCategoryPair::OTHER ); | |||
3974 | ||||
3975 | unsigned long long f = Fibonacci(fibStart); | |||
3976 | printf("Fibonacci(%llu) = %llu\n", fibStart, f); | |||
3977 | }); | |||
3978 | ||||
3979 | std::thread threadCancelFib([]() { | |||
3980 | AUTO_BASE_PROFILER_REGISTER_THREAD("fibonacci canceller")::mozilla::baseprofiler::AutoProfilerRegisterThread raiiObject3980 ("fibonacci canceller"); | |||
3981 | SleepMilli(5); | |||
3982 | AUTO_BASE_PROFILER_MARKER_TEXT("fibonacci", OTHER, {}, "Canceller")::mozilla::baseprofiler::AutoProfilerTextMarker raiiObject3982 ( "fibonacci", ::mozilla::baseprofiler::category::OTHER, {}, "Canceller" ); | |||
3983 | static const int waitMaxSeconds = 10; | |||
3984 | for (int i = 0; i < waitMaxSeconds; ++i) { | |||
3985 | if (sStopFibonacci) { | |||
3986 | AUTO_BASE_PROFILER_LABEL_DYNAMIC_STRING("fibCancel", OTHER,Maybe<std::string> autoStr; Maybe<::mozilla::baseprofiler ::AutoProfilerLabel> raiiObjectString; if (::mozilla::baseprofiler ::profiler_is_active()) { autoStr.emplace(std::to_string(i)); raiiObjectString.emplace( "fibCancel", autoStr->c_str(), :: mozilla::baseprofiler::ProfilingCategoryPair::OTHER); } | |||
3987 | std::to_string(i))Maybe<std::string> autoStr; Maybe<::mozilla::baseprofiler ::AutoProfilerLabel> raiiObjectString; if (::mozilla::baseprofiler ::profiler_is_active()) { autoStr.emplace(std::to_string(i)); raiiObjectString.emplace( "fibCancel", autoStr->c_str(), :: mozilla::baseprofiler::ProfilingCategoryPair::OTHER); }; | |||
3988 | return; | |||
3989 | } | |||
3990 | AUTO_BASE_PROFILER_THREAD_SLEEP::mozilla::baseprofiler::AutoProfilerThreadSleep raiiObject3990; | |||
3991 | SleepMilli(1000); | |||
3992 | } | |||
3993 | AUTO_BASE_PROFILER_LABEL_DYNAMIC_STRING("fibCancel", OTHER,Maybe<std::string> autoStr; Maybe<::mozilla::baseprofiler ::AutoProfilerLabel> raiiObjectString; if (::mozilla::baseprofiler ::profiler_is_active()) { autoStr.emplace("Cancelling!"); raiiObjectString .emplace( "fibCancel", autoStr->c_str(), ::mozilla::baseprofiler ::ProfilingCategoryPair::OTHER); } | |||
3994 | "Cancelling!")Maybe<std::string> autoStr; Maybe<::mozilla::baseprofiler ::AutoProfilerLabel> raiiObjectString; if (::mozilla::baseprofiler ::profiler_is_active()) { autoStr.emplace("Cancelling!"); raiiObjectString .emplace( "fibCancel", autoStr->c_str(), ::mozilla::baseprofiler ::ProfilingCategoryPair::OTHER); }; | |||
3995 | sStopFibonacci = true; | |||
3996 | }); | |||
3997 | ||||
3998 | { | |||
3999 | AUTO_BASE_PROFILER_MARKER_TEXT("main thread", OTHER, {},::mozilla::baseprofiler::AutoProfilerTextMarker raiiObject4000 ( "main thread", ::mozilla::baseprofiler::category::OTHER, {} , "joining fibonacci thread") | |||
4000 | "joining fibonacci thread")::mozilla::baseprofiler::AutoProfilerTextMarker raiiObject4000 ( "main thread", ::mozilla::baseprofiler::category::OTHER, {} , "joining fibonacci thread"); | |||
4001 | AUTO_BASE_PROFILER_THREAD_SLEEP::mozilla::baseprofiler::AutoProfilerThreadSleep raiiObject4001; | |||
4002 | threadFib.join(); | |||
4003 | } | |||
4004 | ||||
4005 | { | |||
4006 | AUTO_BASE_PROFILER_MARKER_TEXT("main thread", OTHER, {},::mozilla::baseprofiler::AutoProfilerTextMarker raiiObject4007 ( "main thread", ::mozilla::baseprofiler::category::OTHER, {} , "joining fibonacci-canceller thread") | |||
4007 | "joining fibonacci-canceller thread")::mozilla::baseprofiler::AutoProfilerTextMarker raiiObject4007 ( "main thread", ::mozilla::baseprofiler::category::OTHER, {} , "joining fibonacci-canceller thread"); | |||
4008 | sStopFibonacci = true; | |||
4009 | AUTO_BASE_PROFILER_THREAD_SLEEP::mozilla::baseprofiler::AutoProfilerThreadSleep raiiObject4009; | |||
4010 | threadCancelFib.join(); | |||
4011 | } | |||
4012 | ||||
4013 | // Just making sure all payloads know how to (de)serialize and stream. | |||
4014 | ||||
4015 | MOZ_RELEASE_ASSERT(do { static_assert( mozilla::detail::AssertionConditionType< decltype(baseprofiler::AddMarker("markers 2.0 without options (omitted)" , mozilla::baseprofiler::category::OTHER))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(baseprofiler::AddMarker("markers 2.0 without options (omitted)" , mozilla::baseprofiler::category::OTHER)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("baseprofiler::AddMarker(\"markers 2.0 without options (omitted)\", mozilla::baseprofiler::category::OTHER)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4017); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker(\"markers 2.0 without options (omitted)\", mozilla::baseprofiler::category::OTHER)" ")"); do { *((volatile int*)__null) = 4017; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4016 | baseprofiler::AddMarker("markers 2.0 without options (omitted)",do { static_assert( mozilla::detail::AssertionConditionType< decltype(baseprofiler::AddMarker("markers 2.0 without options (omitted)" , mozilla::baseprofiler::category::OTHER))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(baseprofiler::AddMarker("markers 2.0 without options (omitted)" , mozilla::baseprofiler::category::OTHER)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("baseprofiler::AddMarker(\"markers 2.0 without options (omitted)\", mozilla::baseprofiler::category::OTHER)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4017); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker(\"markers 2.0 without options (omitted)\", mozilla::baseprofiler::category::OTHER)" ")"); do { *((volatile int*)__null) = 4017; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4017 | mozilla::baseprofiler::category::OTHER))do { static_assert( mozilla::detail::AssertionConditionType< decltype(baseprofiler::AddMarker("markers 2.0 without options (omitted)" , mozilla::baseprofiler::category::OTHER))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(baseprofiler::AddMarker("markers 2.0 without options (omitted)" , mozilla::baseprofiler::category::OTHER)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("baseprofiler::AddMarker(\"markers 2.0 without options (omitted)\", mozilla::baseprofiler::category::OTHER)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4017); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker(\"markers 2.0 without options (omitted)\", mozilla::baseprofiler::category::OTHER)" ")"); do { *((volatile int*)__null) = 4017; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
4018 | ||||
4019 | MOZ_RELEASE_ASSERT(baseprofiler::AddMarker(do { static_assert( mozilla::detail::AssertionConditionType< decltype(baseprofiler::AddMarker( "markers 2.0 without options (implicit brace-init)" , mozilla::baseprofiler::category::OTHER, {}))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(baseprofiler::AddMarker( "markers 2.0 without options (implicit brace-init)" , mozilla::baseprofiler::category::OTHER, {})))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("baseprofiler::AddMarker( \"markers 2.0 without options (implicit brace-init)\", mozilla::baseprofiler::category::OTHER, {})" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4021); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"markers 2.0 without options (implicit brace-init)\", mozilla::baseprofiler::category::OTHER, {})" ")"); do { *((volatile int*)__null) = 4021; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4020 | "markers 2.0 without options (implicit brace-init)",do { static_assert( mozilla::detail::AssertionConditionType< decltype(baseprofiler::AddMarker( "markers 2.0 without options (implicit brace-init)" , mozilla::baseprofiler::category::OTHER, {}))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(baseprofiler::AddMarker( "markers 2.0 without options (implicit brace-init)" , mozilla::baseprofiler::category::OTHER, {})))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("baseprofiler::AddMarker( \"markers 2.0 without options (implicit brace-init)\", mozilla::baseprofiler::category::OTHER, {})" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4021); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"markers 2.0 without options (implicit brace-init)\", mozilla::baseprofiler::category::OTHER, {})" ")"); do { *((volatile int*)__null) = 4021; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4021 | mozilla::baseprofiler::category::OTHER, {}))do { static_assert( mozilla::detail::AssertionConditionType< decltype(baseprofiler::AddMarker( "markers 2.0 without options (implicit brace-init)" , mozilla::baseprofiler::category::OTHER, {}))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(baseprofiler::AddMarker( "markers 2.0 without options (implicit brace-init)" , mozilla::baseprofiler::category::OTHER, {})))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("baseprofiler::AddMarker( \"markers 2.0 without options (implicit brace-init)\", mozilla::baseprofiler::category::OTHER, {})" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4021); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"markers 2.0 without options (implicit brace-init)\", mozilla::baseprofiler::category::OTHER, {})" ")"); do { *((volatile int*)__null) = 4021; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
4022 | ||||
4023 | MOZ_RELEASE_ASSERT(baseprofiler::AddMarker(do { static_assert( mozilla::detail::AssertionConditionType< decltype(baseprofiler::AddMarker( "markers 2.0 without options (explicit init)" , mozilla::baseprofiler::category::OTHER, MarkerOptions()))> ::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(baseprofiler::AddMarker( "markers 2.0 without options (explicit init)" , mozilla::baseprofiler::category::OTHER, MarkerOptions())))) , 0))) { do { } while (false); MOZ_ReportAssertionFailure("baseprofiler::AddMarker( \"markers 2.0 without options (explicit init)\", mozilla::baseprofiler::category::OTHER, MarkerOptions())" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4025); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"markers 2.0 without options (explicit init)\", mozilla::baseprofiler::category::OTHER, MarkerOptions())" ")"); do { *((volatile int*)__null) = 4025; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4024 | "markers 2.0 without options (explicit init)",do { static_assert( mozilla::detail::AssertionConditionType< decltype(baseprofiler::AddMarker( "markers 2.0 without options (explicit init)" , mozilla::baseprofiler::category::OTHER, MarkerOptions()))> ::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(baseprofiler::AddMarker( "markers 2.0 without options (explicit init)" , mozilla::baseprofiler::category::OTHER, MarkerOptions())))) , 0))) { do { } while (false); MOZ_ReportAssertionFailure("baseprofiler::AddMarker( \"markers 2.0 without options (explicit init)\", mozilla::baseprofiler::category::OTHER, MarkerOptions())" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4025); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"markers 2.0 without options (explicit init)\", mozilla::baseprofiler::category::OTHER, MarkerOptions())" ")"); do { *((volatile int*)__null) = 4025; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4025 | mozilla::baseprofiler::category::OTHER, MarkerOptions()))do { static_assert( mozilla::detail::AssertionConditionType< decltype(baseprofiler::AddMarker( "markers 2.0 without options (explicit init)" , mozilla::baseprofiler::category::OTHER, MarkerOptions()))> ::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(baseprofiler::AddMarker( "markers 2.0 without options (explicit init)" , mozilla::baseprofiler::category::OTHER, MarkerOptions())))) , 0))) { do { } while (false); MOZ_ReportAssertionFailure("baseprofiler::AddMarker( \"markers 2.0 without options (explicit init)\", mozilla::baseprofiler::category::OTHER, MarkerOptions())" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4025); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"markers 2.0 without options (explicit init)\", mozilla::baseprofiler::category::OTHER, MarkerOptions())" ")"); do { *((volatile int*)__null) = 4025; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
4026 | ||||
4027 | MOZ_RELEASE_ASSERT(baseprofiler::AddMarker(do { static_assert( mozilla::detail::AssertionConditionType< decltype(baseprofiler::AddMarker( "markers 2.0 without options (explicit brace-init)" , mozilla::baseprofiler::category::OTHER, MarkerOptions{}))> ::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(baseprofiler::AddMarker( "markers 2.0 without options (explicit brace-init)" , mozilla::baseprofiler::category::OTHER, MarkerOptions{})))) , 0))) { do { } while (false); MOZ_ReportAssertionFailure("baseprofiler::AddMarker( \"markers 2.0 without options (explicit brace-init)\", mozilla::baseprofiler::category::OTHER, MarkerOptions{})" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4029); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"markers 2.0 without options (explicit brace-init)\", mozilla::baseprofiler::category::OTHER, MarkerOptions{})" ")"); do { *((volatile int*)__null) = 4029; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4028 | "markers 2.0 without options (explicit brace-init)",do { static_assert( mozilla::detail::AssertionConditionType< decltype(baseprofiler::AddMarker( "markers 2.0 without options (explicit brace-init)" , mozilla::baseprofiler::category::OTHER, MarkerOptions{}))> ::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(baseprofiler::AddMarker( "markers 2.0 without options (explicit brace-init)" , mozilla::baseprofiler::category::OTHER, MarkerOptions{})))) , 0))) { do { } while (false); MOZ_ReportAssertionFailure("baseprofiler::AddMarker( \"markers 2.0 without options (explicit brace-init)\", mozilla::baseprofiler::category::OTHER, MarkerOptions{})" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4029); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"markers 2.0 without options (explicit brace-init)\", mozilla::baseprofiler::category::OTHER, MarkerOptions{})" ")"); do { *((volatile int*)__null) = 4029; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4029 | mozilla::baseprofiler::category::OTHER, MarkerOptions{}))do { static_assert( mozilla::detail::AssertionConditionType< decltype(baseprofiler::AddMarker( "markers 2.0 without options (explicit brace-init)" , mozilla::baseprofiler::category::OTHER, MarkerOptions{}))> ::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(baseprofiler::AddMarker( "markers 2.0 without options (explicit brace-init)" , mozilla::baseprofiler::category::OTHER, MarkerOptions{})))) , 0))) { do { } while (false); MOZ_ReportAssertionFailure("baseprofiler::AddMarker( \"markers 2.0 without options (explicit brace-init)\", mozilla::baseprofiler::category::OTHER, MarkerOptions{})" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4029); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"markers 2.0 without options (explicit brace-init)\", mozilla::baseprofiler::category::OTHER, MarkerOptions{})" ")"); do { *((volatile int*)__null) = 4029; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
4030 | ||||
4031 | MOZ_RELEASE_ASSERT(baseprofiler::AddMarker(do { static_assert( mozilla::detail::AssertionConditionType< decltype(baseprofiler::AddMarker( "markers 2.0 with one option (implicit)" , mozilla::baseprofiler::category::OTHER, MarkerInnerWindowId (123)))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(baseprofiler::AddMarker( "markers 2.0 with one option (implicit)" , mozilla::baseprofiler::category::OTHER, MarkerInnerWindowId (123))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("baseprofiler::AddMarker( \"markers 2.0 with one option (implicit)\", mozilla::baseprofiler::category::OTHER, MarkerInnerWindowId(123))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4033); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"markers 2.0 with one option (implicit)\", mozilla::baseprofiler::category::OTHER, MarkerInnerWindowId(123))" ")"); do { *((volatile int*)__null) = 4033; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4032 | "markers 2.0 with one option (implicit)",do { static_assert( mozilla::detail::AssertionConditionType< decltype(baseprofiler::AddMarker( "markers 2.0 with one option (implicit)" , mozilla::baseprofiler::category::OTHER, MarkerInnerWindowId (123)))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(baseprofiler::AddMarker( "markers 2.0 with one option (implicit)" , mozilla::baseprofiler::category::OTHER, MarkerInnerWindowId (123))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("baseprofiler::AddMarker( \"markers 2.0 with one option (implicit)\", mozilla::baseprofiler::category::OTHER, MarkerInnerWindowId(123))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4033); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"markers 2.0 with one option (implicit)\", mozilla::baseprofiler::category::OTHER, MarkerInnerWindowId(123))" ")"); do { *((volatile int*)__null) = 4033; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4033 | mozilla::baseprofiler::category::OTHER, MarkerInnerWindowId(123)))do { static_assert( mozilla::detail::AssertionConditionType< decltype(baseprofiler::AddMarker( "markers 2.0 with one option (implicit)" , mozilla::baseprofiler::category::OTHER, MarkerInnerWindowId (123)))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(baseprofiler::AddMarker( "markers 2.0 with one option (implicit)" , mozilla::baseprofiler::category::OTHER, MarkerInnerWindowId (123))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("baseprofiler::AddMarker( \"markers 2.0 with one option (implicit)\", mozilla::baseprofiler::category::OTHER, MarkerInnerWindowId(123))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4033); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"markers 2.0 with one option (implicit)\", mozilla::baseprofiler::category::OTHER, MarkerInnerWindowId(123))" ")"); do { *((volatile int*)__null) = 4033; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
4034 | ||||
4035 | MOZ_RELEASE_ASSERT(baseprofiler::AddMarker(do { static_assert( mozilla::detail::AssertionConditionType< decltype(baseprofiler::AddMarker( "markers 2.0 with one option (implicit brace-init)" , mozilla::baseprofiler::category::OTHER, {MarkerInnerWindowId (123)}))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(baseprofiler::AddMarker( "markers 2.0 with one option (implicit brace-init)" , mozilla::baseprofiler::category::OTHER, {MarkerInnerWindowId (123)})))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("baseprofiler::AddMarker( \"markers 2.0 with one option (implicit brace-init)\", mozilla::baseprofiler::category::OTHER, {MarkerInnerWindowId(123)})" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4037); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"markers 2.0 with one option (implicit brace-init)\", mozilla::baseprofiler::category::OTHER, {MarkerInnerWindowId(123)})" ")"); do { *((volatile int*)__null) = 4037; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4036 | "markers 2.0 with one option (implicit brace-init)",do { static_assert( mozilla::detail::AssertionConditionType< decltype(baseprofiler::AddMarker( "markers 2.0 with one option (implicit brace-init)" , mozilla::baseprofiler::category::OTHER, {MarkerInnerWindowId (123)}))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(baseprofiler::AddMarker( "markers 2.0 with one option (implicit brace-init)" , mozilla::baseprofiler::category::OTHER, {MarkerInnerWindowId (123)})))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("baseprofiler::AddMarker( \"markers 2.0 with one option (implicit brace-init)\", mozilla::baseprofiler::category::OTHER, {MarkerInnerWindowId(123)})" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4037); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"markers 2.0 with one option (implicit brace-init)\", mozilla::baseprofiler::category::OTHER, {MarkerInnerWindowId(123)})" ")"); do { *((volatile int*)__null) = 4037; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4037 | mozilla::baseprofiler::category::OTHER, {MarkerInnerWindowId(123)}))do { static_assert( mozilla::detail::AssertionConditionType< decltype(baseprofiler::AddMarker( "markers 2.0 with one option (implicit brace-init)" , mozilla::baseprofiler::category::OTHER, {MarkerInnerWindowId (123)}))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(baseprofiler::AddMarker( "markers 2.0 with one option (implicit brace-init)" , mozilla::baseprofiler::category::OTHER, {MarkerInnerWindowId (123)})))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("baseprofiler::AddMarker( \"markers 2.0 with one option (implicit brace-init)\", mozilla::baseprofiler::category::OTHER, {MarkerInnerWindowId(123)})" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4037); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"markers 2.0 with one option (implicit brace-init)\", mozilla::baseprofiler::category::OTHER, {MarkerInnerWindowId(123)})" ")"); do { *((volatile int*)__null) = 4037; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
4038 | ||||
4039 | MOZ_RELEASE_ASSERT(do { static_assert( mozilla::detail::AssertionConditionType< decltype(baseprofiler::AddMarker("markers 2.0 with one option (explicit init)" , mozilla::baseprofiler::category::OTHER, MarkerOptions(MarkerInnerWindowId (123))))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(baseprofiler::AddMarker("markers 2.0 with one option (explicit init)" , mozilla::baseprofiler::category::OTHER, MarkerOptions(MarkerInnerWindowId (123)))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("baseprofiler::AddMarker(\"markers 2.0 with one option (explicit init)\", mozilla::baseprofiler::category::OTHER, MarkerOptions(MarkerInnerWindowId(123)))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4042); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker(\"markers 2.0 with one option (explicit init)\", mozilla::baseprofiler::category::OTHER, MarkerOptions(MarkerInnerWindowId(123)))" ")"); do { *((volatile int*)__null) = 4042; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4040 | baseprofiler::AddMarker("markers 2.0 with one option (explicit init)",do { static_assert( mozilla::detail::AssertionConditionType< decltype(baseprofiler::AddMarker("markers 2.0 with one option (explicit init)" , mozilla::baseprofiler::category::OTHER, MarkerOptions(MarkerInnerWindowId (123))))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(baseprofiler::AddMarker("markers 2.0 with one option (explicit init)" , mozilla::baseprofiler::category::OTHER, MarkerOptions(MarkerInnerWindowId (123)))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("baseprofiler::AddMarker(\"markers 2.0 with one option (explicit init)\", mozilla::baseprofiler::category::OTHER, MarkerOptions(MarkerInnerWindowId(123)))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4042); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker(\"markers 2.0 with one option (explicit init)\", mozilla::baseprofiler::category::OTHER, MarkerOptions(MarkerInnerWindowId(123)))" ")"); do { *((volatile int*)__null) = 4042; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4041 | mozilla::baseprofiler::category::OTHER,do { static_assert( mozilla::detail::AssertionConditionType< decltype(baseprofiler::AddMarker("markers 2.0 with one option (explicit init)" , mozilla::baseprofiler::category::OTHER, MarkerOptions(MarkerInnerWindowId (123))))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(baseprofiler::AddMarker("markers 2.0 with one option (explicit init)" , mozilla::baseprofiler::category::OTHER, MarkerOptions(MarkerInnerWindowId (123)))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("baseprofiler::AddMarker(\"markers 2.0 with one option (explicit init)\", mozilla::baseprofiler::category::OTHER, MarkerOptions(MarkerInnerWindowId(123)))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4042); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker(\"markers 2.0 with one option (explicit init)\", mozilla::baseprofiler::category::OTHER, MarkerOptions(MarkerInnerWindowId(123)))" ")"); do { *((volatile int*)__null) = 4042; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4042 | MarkerOptions(MarkerInnerWindowId(123))))do { static_assert( mozilla::detail::AssertionConditionType< decltype(baseprofiler::AddMarker("markers 2.0 with one option (explicit init)" , mozilla::baseprofiler::category::OTHER, MarkerOptions(MarkerInnerWindowId (123))))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(baseprofiler::AddMarker("markers 2.0 with one option (explicit init)" , mozilla::baseprofiler::category::OTHER, MarkerOptions(MarkerInnerWindowId (123)))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("baseprofiler::AddMarker(\"markers 2.0 with one option (explicit init)\", mozilla::baseprofiler::category::OTHER, MarkerOptions(MarkerInnerWindowId(123)))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4042); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker(\"markers 2.0 with one option (explicit init)\", mozilla::baseprofiler::category::OTHER, MarkerOptions(MarkerInnerWindowId(123)))" ")"); do { *((volatile int*)__null) = 4042; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
4043 | ||||
4044 | MOZ_RELEASE_ASSERT(baseprofiler::AddMarker(do { static_assert( mozilla::detail::AssertionConditionType< decltype(baseprofiler::AddMarker( "markers 2.0 with one option (explicit brace-init)" , mozilla::baseprofiler::category::OTHER, MarkerOptions{MarkerInnerWindowId (123)}))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(baseprofiler::AddMarker( "markers 2.0 with one option (explicit brace-init)" , mozilla::baseprofiler::category::OTHER, MarkerOptions{MarkerInnerWindowId (123)})))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("baseprofiler::AddMarker( \"markers 2.0 with one option (explicit brace-init)\", mozilla::baseprofiler::category::OTHER, MarkerOptions{MarkerInnerWindowId(123)})" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4047); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"markers 2.0 with one option (explicit brace-init)\", mozilla::baseprofiler::category::OTHER, MarkerOptions{MarkerInnerWindowId(123)})" ")"); do { *((volatile int*)__null) = 4047; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4045 | "markers 2.0 with one option (explicit brace-init)",do { static_assert( mozilla::detail::AssertionConditionType< decltype(baseprofiler::AddMarker( "markers 2.0 with one option (explicit brace-init)" , mozilla::baseprofiler::category::OTHER, MarkerOptions{MarkerInnerWindowId (123)}))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(baseprofiler::AddMarker( "markers 2.0 with one option (explicit brace-init)" , mozilla::baseprofiler::category::OTHER, MarkerOptions{MarkerInnerWindowId (123)})))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("baseprofiler::AddMarker( \"markers 2.0 with one option (explicit brace-init)\", mozilla::baseprofiler::category::OTHER, MarkerOptions{MarkerInnerWindowId(123)})" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4047); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"markers 2.0 with one option (explicit brace-init)\", mozilla::baseprofiler::category::OTHER, MarkerOptions{MarkerInnerWindowId(123)})" ")"); do { *((volatile int*)__null) = 4047; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4046 | mozilla::baseprofiler::category::OTHER,do { static_assert( mozilla::detail::AssertionConditionType< decltype(baseprofiler::AddMarker( "markers 2.0 with one option (explicit brace-init)" , mozilla::baseprofiler::category::OTHER, MarkerOptions{MarkerInnerWindowId (123)}))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(baseprofiler::AddMarker( "markers 2.0 with one option (explicit brace-init)" , mozilla::baseprofiler::category::OTHER, MarkerOptions{MarkerInnerWindowId (123)})))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("baseprofiler::AddMarker( \"markers 2.0 with one option (explicit brace-init)\", mozilla::baseprofiler::category::OTHER, MarkerOptions{MarkerInnerWindowId(123)})" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4047); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"markers 2.0 with one option (explicit brace-init)\", mozilla::baseprofiler::category::OTHER, MarkerOptions{MarkerInnerWindowId(123)})" ")"); do { *((volatile int*)__null) = 4047; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4047 | MarkerOptions{MarkerInnerWindowId(123)}))do { static_assert( mozilla::detail::AssertionConditionType< decltype(baseprofiler::AddMarker( "markers 2.0 with one option (explicit brace-init)" , mozilla::baseprofiler::category::OTHER, MarkerOptions{MarkerInnerWindowId (123)}))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(baseprofiler::AddMarker( "markers 2.0 with one option (explicit brace-init)" , mozilla::baseprofiler::category::OTHER, MarkerOptions{MarkerInnerWindowId (123)})))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("baseprofiler::AddMarker( \"markers 2.0 with one option (explicit brace-init)\", mozilla::baseprofiler::category::OTHER, MarkerOptions{MarkerInnerWindowId(123)})" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4047); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"markers 2.0 with one option (explicit brace-init)\", mozilla::baseprofiler::category::OTHER, MarkerOptions{MarkerInnerWindowId(123)})" ")"); do { *((volatile int*)__null) = 4047; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
4048 | ||||
4049 | MOZ_RELEASE_ASSERT(baseprofiler::AddMarker(do { static_assert( mozilla::detail::AssertionConditionType< decltype(baseprofiler::AddMarker( "markers 2.0 with two options (implicit brace-init)" , mozilla::baseprofiler::category::OTHER, {MarkerInnerWindowId (123), MarkerStack::Capture()}))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(baseprofiler::AddMarker( "markers 2.0 with two options (implicit brace-init)" , mozilla::baseprofiler::category::OTHER, {MarkerInnerWindowId (123), MarkerStack::Capture()})))), 0))) { do { } while (false ); MOZ_ReportAssertionFailure("baseprofiler::AddMarker( \"markers 2.0 with two options (implicit brace-init)\", mozilla::baseprofiler::category::OTHER, {MarkerInnerWindowId(123), MarkerStack::Capture()})" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4052); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"markers 2.0 with two options (implicit brace-init)\", mozilla::baseprofiler::category::OTHER, {MarkerInnerWindowId(123), MarkerStack::Capture()})" ")"); do { *((volatile int*)__null) = 4052; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4050 | "markers 2.0 with two options (implicit brace-init)",do { static_assert( mozilla::detail::AssertionConditionType< decltype(baseprofiler::AddMarker( "markers 2.0 with two options (implicit brace-init)" , mozilla::baseprofiler::category::OTHER, {MarkerInnerWindowId (123), MarkerStack::Capture()}))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(baseprofiler::AddMarker( "markers 2.0 with two options (implicit brace-init)" , mozilla::baseprofiler::category::OTHER, {MarkerInnerWindowId (123), MarkerStack::Capture()})))), 0))) { do { } while (false ); MOZ_ReportAssertionFailure("baseprofiler::AddMarker( \"markers 2.0 with two options (implicit brace-init)\", mozilla::baseprofiler::category::OTHER, {MarkerInnerWindowId(123), MarkerStack::Capture()})" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4052); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"markers 2.0 with two options (implicit brace-init)\", mozilla::baseprofiler::category::OTHER, {MarkerInnerWindowId(123), MarkerStack::Capture()})" ")"); do { *((volatile int*)__null) = 4052; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4051 | mozilla::baseprofiler::category::OTHER,do { static_assert( mozilla::detail::AssertionConditionType< decltype(baseprofiler::AddMarker( "markers 2.0 with two options (implicit brace-init)" , mozilla::baseprofiler::category::OTHER, {MarkerInnerWindowId (123), MarkerStack::Capture()}))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(baseprofiler::AddMarker( "markers 2.0 with two options (implicit brace-init)" , mozilla::baseprofiler::category::OTHER, {MarkerInnerWindowId (123), MarkerStack::Capture()})))), 0))) { do { } while (false ); MOZ_ReportAssertionFailure("baseprofiler::AddMarker( \"markers 2.0 with two options (implicit brace-init)\", mozilla::baseprofiler::category::OTHER, {MarkerInnerWindowId(123), MarkerStack::Capture()})" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4052); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"markers 2.0 with two options (implicit brace-init)\", mozilla::baseprofiler::category::OTHER, {MarkerInnerWindowId(123), MarkerStack::Capture()})" ")"); do { *((volatile int*)__null) = 4052; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4052 | {MarkerInnerWindowId(123), MarkerStack::Capture()}))do { static_assert( mozilla::detail::AssertionConditionType< decltype(baseprofiler::AddMarker( "markers 2.0 with two options (implicit brace-init)" , mozilla::baseprofiler::category::OTHER, {MarkerInnerWindowId (123), MarkerStack::Capture()}))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(baseprofiler::AddMarker( "markers 2.0 with two options (implicit brace-init)" , mozilla::baseprofiler::category::OTHER, {MarkerInnerWindowId (123), MarkerStack::Capture()})))), 0))) { do { } while (false ); MOZ_ReportAssertionFailure("baseprofiler::AddMarker( \"markers 2.0 with two options (implicit brace-init)\", mozilla::baseprofiler::category::OTHER, {MarkerInnerWindowId(123), MarkerStack::Capture()})" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4052); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"markers 2.0 with two options (implicit brace-init)\", mozilla::baseprofiler::category::OTHER, {MarkerInnerWindowId(123), MarkerStack::Capture()})" ")"); do { *((volatile int*)__null) = 4052; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
4053 | ||||
4054 | MOZ_RELEASE_ASSERT(baseprofiler::AddMarker(do { static_assert( mozilla::detail::AssertionConditionType< decltype(baseprofiler::AddMarker( "markers 2.0 with two options (explicit init)" , mozilla::baseprofiler::category::OTHER, MarkerOptions(MarkerInnerWindowId (123), MarkerStack::Capture())))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(baseprofiler::AddMarker( "markers 2.0 with two options (explicit init)" , mozilla::baseprofiler::category::OTHER, MarkerOptions(MarkerInnerWindowId (123), MarkerStack::Capture()))))), 0))) { do { } while (false ); MOZ_ReportAssertionFailure("baseprofiler::AddMarker( \"markers 2.0 with two options (explicit init)\", mozilla::baseprofiler::category::OTHER, MarkerOptions(MarkerInnerWindowId(123), MarkerStack::Capture()))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4057); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"markers 2.0 with two options (explicit init)\", mozilla::baseprofiler::category::OTHER, MarkerOptions(MarkerInnerWindowId(123), MarkerStack::Capture()))" ")"); do { *((volatile int*)__null) = 4057; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4055 | "markers 2.0 with two options (explicit init)",do { static_assert( mozilla::detail::AssertionConditionType< decltype(baseprofiler::AddMarker( "markers 2.0 with two options (explicit init)" , mozilla::baseprofiler::category::OTHER, MarkerOptions(MarkerInnerWindowId (123), MarkerStack::Capture())))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(baseprofiler::AddMarker( "markers 2.0 with two options (explicit init)" , mozilla::baseprofiler::category::OTHER, MarkerOptions(MarkerInnerWindowId (123), MarkerStack::Capture()))))), 0))) { do { } while (false ); MOZ_ReportAssertionFailure("baseprofiler::AddMarker( \"markers 2.0 with two options (explicit init)\", mozilla::baseprofiler::category::OTHER, MarkerOptions(MarkerInnerWindowId(123), MarkerStack::Capture()))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4057); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"markers 2.0 with two options (explicit init)\", mozilla::baseprofiler::category::OTHER, MarkerOptions(MarkerInnerWindowId(123), MarkerStack::Capture()))" ")"); do { *((volatile int*)__null) = 4057; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4056 | mozilla::baseprofiler::category::OTHER,do { static_assert( mozilla::detail::AssertionConditionType< decltype(baseprofiler::AddMarker( "markers 2.0 with two options (explicit init)" , mozilla::baseprofiler::category::OTHER, MarkerOptions(MarkerInnerWindowId (123), MarkerStack::Capture())))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(baseprofiler::AddMarker( "markers 2.0 with two options (explicit init)" , mozilla::baseprofiler::category::OTHER, MarkerOptions(MarkerInnerWindowId (123), MarkerStack::Capture()))))), 0))) { do { } while (false ); MOZ_ReportAssertionFailure("baseprofiler::AddMarker( \"markers 2.0 with two options (explicit init)\", mozilla::baseprofiler::category::OTHER, MarkerOptions(MarkerInnerWindowId(123), MarkerStack::Capture()))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4057); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"markers 2.0 with two options (explicit init)\", mozilla::baseprofiler::category::OTHER, MarkerOptions(MarkerInnerWindowId(123), MarkerStack::Capture()))" ")"); do { *((volatile int*)__null) = 4057; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4057 | MarkerOptions(MarkerInnerWindowId(123), MarkerStack::Capture())))do { static_assert( mozilla::detail::AssertionConditionType< decltype(baseprofiler::AddMarker( "markers 2.0 with two options (explicit init)" , mozilla::baseprofiler::category::OTHER, MarkerOptions(MarkerInnerWindowId (123), MarkerStack::Capture())))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(baseprofiler::AddMarker( "markers 2.0 with two options (explicit init)" , mozilla::baseprofiler::category::OTHER, MarkerOptions(MarkerInnerWindowId (123), MarkerStack::Capture()))))), 0))) { do { } while (false ); MOZ_ReportAssertionFailure("baseprofiler::AddMarker( \"markers 2.0 with two options (explicit init)\", mozilla::baseprofiler::category::OTHER, MarkerOptions(MarkerInnerWindowId(123), MarkerStack::Capture()))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4057); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"markers 2.0 with two options (explicit init)\", mozilla::baseprofiler::category::OTHER, MarkerOptions(MarkerInnerWindowId(123), MarkerStack::Capture()))" ")"); do { *((volatile int*)__null) = 4057; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
4058 | ||||
4059 | MOZ_RELEASE_ASSERT(baseprofiler::AddMarker(do { static_assert( mozilla::detail::AssertionConditionType< decltype(baseprofiler::AddMarker( "markers 2.0 with two options (explicit brace-init)" , mozilla::baseprofiler::category::OTHER, MarkerOptions{MarkerInnerWindowId (123), MarkerStack::Capture()}))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(baseprofiler::AddMarker( "markers 2.0 with two options (explicit brace-init)" , mozilla::baseprofiler::category::OTHER, MarkerOptions{MarkerInnerWindowId (123), MarkerStack::Capture()})))), 0))) { do { } while (false ); MOZ_ReportAssertionFailure("baseprofiler::AddMarker( \"markers 2.0 with two options (explicit brace-init)\", mozilla::baseprofiler::category::OTHER, MarkerOptions{MarkerInnerWindowId(123), MarkerStack::Capture()})" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4062); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"markers 2.0 with two options (explicit brace-init)\", mozilla::baseprofiler::category::OTHER, MarkerOptions{MarkerInnerWindowId(123), MarkerStack::Capture()})" ")"); do { *((volatile int*)__null) = 4062; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4060 | "markers 2.0 with two options (explicit brace-init)",do { static_assert( mozilla::detail::AssertionConditionType< decltype(baseprofiler::AddMarker( "markers 2.0 with two options (explicit brace-init)" , mozilla::baseprofiler::category::OTHER, MarkerOptions{MarkerInnerWindowId (123), MarkerStack::Capture()}))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(baseprofiler::AddMarker( "markers 2.0 with two options (explicit brace-init)" , mozilla::baseprofiler::category::OTHER, MarkerOptions{MarkerInnerWindowId (123), MarkerStack::Capture()})))), 0))) { do { } while (false ); MOZ_ReportAssertionFailure("baseprofiler::AddMarker( \"markers 2.0 with two options (explicit brace-init)\", mozilla::baseprofiler::category::OTHER, MarkerOptions{MarkerInnerWindowId(123), MarkerStack::Capture()})" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4062); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"markers 2.0 with two options (explicit brace-init)\", mozilla::baseprofiler::category::OTHER, MarkerOptions{MarkerInnerWindowId(123), MarkerStack::Capture()})" ")"); do { *((volatile int*)__null) = 4062; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4061 | mozilla::baseprofiler::category::OTHER,do { static_assert( mozilla::detail::AssertionConditionType< decltype(baseprofiler::AddMarker( "markers 2.0 with two options (explicit brace-init)" , mozilla::baseprofiler::category::OTHER, MarkerOptions{MarkerInnerWindowId (123), MarkerStack::Capture()}))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(baseprofiler::AddMarker( "markers 2.0 with two options (explicit brace-init)" , mozilla::baseprofiler::category::OTHER, MarkerOptions{MarkerInnerWindowId (123), MarkerStack::Capture()})))), 0))) { do { } while (false ); MOZ_ReportAssertionFailure("baseprofiler::AddMarker( \"markers 2.0 with two options (explicit brace-init)\", mozilla::baseprofiler::category::OTHER, MarkerOptions{MarkerInnerWindowId(123), MarkerStack::Capture()})" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4062); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"markers 2.0 with two options (explicit brace-init)\", mozilla::baseprofiler::category::OTHER, MarkerOptions{MarkerInnerWindowId(123), MarkerStack::Capture()})" ")"); do { *((volatile int*)__null) = 4062; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4062 | MarkerOptions{MarkerInnerWindowId(123), MarkerStack::Capture()}))do { static_assert( mozilla::detail::AssertionConditionType< decltype(baseprofiler::AddMarker( "markers 2.0 with two options (explicit brace-init)" , mozilla::baseprofiler::category::OTHER, MarkerOptions{MarkerInnerWindowId (123), MarkerStack::Capture()}))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(baseprofiler::AddMarker( "markers 2.0 with two options (explicit brace-init)" , mozilla::baseprofiler::category::OTHER, MarkerOptions{MarkerInnerWindowId (123), MarkerStack::Capture()})))), 0))) { do { } while (false ); MOZ_ReportAssertionFailure("baseprofiler::AddMarker( \"markers 2.0 with two options (explicit brace-init)\", mozilla::baseprofiler::category::OTHER, MarkerOptions{MarkerInnerWindowId(123), MarkerStack::Capture()})" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4062); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"markers 2.0 with two options (explicit brace-init)\", mozilla::baseprofiler::category::OTHER, MarkerOptions{MarkerInnerWindowId(123), MarkerStack::Capture()})" ")"); do { *((volatile int*)__null) = 4062; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
4063 | ||||
4064 | MOZ_RELEASE_ASSERT(do { static_assert( mozilla::detail::AssertionConditionType< decltype(baseprofiler::AddMarker("default-templated markers 2.0 without options" , mozilla::baseprofiler::category::OTHER))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(baseprofiler::AddMarker("default-templated markers 2.0 without options" , mozilla::baseprofiler::category::OTHER)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("baseprofiler::AddMarker(\"default-templated markers 2.0 without options\", mozilla::baseprofiler::category::OTHER)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4066); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker(\"default-templated markers 2.0 without options\", mozilla::baseprofiler::category::OTHER)" ")"); do { *((volatile int*)__null) = 4066; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4065 | baseprofiler::AddMarker("default-templated markers 2.0 without options",do { static_assert( mozilla::detail::AssertionConditionType< decltype(baseprofiler::AddMarker("default-templated markers 2.0 without options" , mozilla::baseprofiler::category::OTHER))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(baseprofiler::AddMarker("default-templated markers 2.0 without options" , mozilla::baseprofiler::category::OTHER)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("baseprofiler::AddMarker(\"default-templated markers 2.0 without options\", mozilla::baseprofiler::category::OTHER)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4066); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker(\"default-templated markers 2.0 without options\", mozilla::baseprofiler::category::OTHER)" ")"); do { *((volatile int*)__null) = 4066; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4066 | mozilla::baseprofiler::category::OTHER))do { static_assert( mozilla::detail::AssertionConditionType< decltype(baseprofiler::AddMarker("default-templated markers 2.0 without options" , mozilla::baseprofiler::category::OTHER))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(baseprofiler::AddMarker("default-templated markers 2.0 without options" , mozilla::baseprofiler::category::OTHER)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("baseprofiler::AddMarker(\"default-templated markers 2.0 without options\", mozilla::baseprofiler::category::OTHER)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4066); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker(\"default-templated markers 2.0 without options\", mozilla::baseprofiler::category::OTHER)" ")"); do { *((volatile int*)__null) = 4066; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
4067 | ||||
4068 | MOZ_RELEASE_ASSERT(baseprofiler::AddMarker(do { static_assert( mozilla::detail::AssertionConditionType< decltype(baseprofiler::AddMarker( "default-templated markers 2.0 with option" , mozilla::baseprofiler::category::OTHER, MarkerInnerWindowId (123)))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(baseprofiler::AddMarker( "default-templated markers 2.0 with option" , mozilla::baseprofiler::category::OTHER, MarkerInnerWindowId (123))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("baseprofiler::AddMarker( \"default-templated markers 2.0 with option\", mozilla::baseprofiler::category::OTHER, MarkerInnerWindowId(123))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4070); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"default-templated markers 2.0 with option\", mozilla::baseprofiler::category::OTHER, MarkerInnerWindowId(123))" ")"); do { *((volatile int*)__null) = 4070; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4069 | "default-templated markers 2.0 with option",do { static_assert( mozilla::detail::AssertionConditionType< decltype(baseprofiler::AddMarker( "default-templated markers 2.0 with option" , mozilla::baseprofiler::category::OTHER, MarkerInnerWindowId (123)))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(baseprofiler::AddMarker( "default-templated markers 2.0 with option" , mozilla::baseprofiler::category::OTHER, MarkerInnerWindowId (123))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("baseprofiler::AddMarker( \"default-templated markers 2.0 with option\", mozilla::baseprofiler::category::OTHER, MarkerInnerWindowId(123))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4070); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"default-templated markers 2.0 with option\", mozilla::baseprofiler::category::OTHER, MarkerInnerWindowId(123))" ")"); do { *((volatile int*)__null) = 4070; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4070 | mozilla::baseprofiler::category::OTHER, MarkerInnerWindowId(123)))do { static_assert( mozilla::detail::AssertionConditionType< decltype(baseprofiler::AddMarker( "default-templated markers 2.0 with option" , mozilla::baseprofiler::category::OTHER, MarkerInnerWindowId (123)))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(baseprofiler::AddMarker( "default-templated markers 2.0 with option" , mozilla::baseprofiler::category::OTHER, MarkerInnerWindowId (123))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("baseprofiler::AddMarker( \"default-templated markers 2.0 with option\", mozilla::baseprofiler::category::OTHER, MarkerInnerWindowId(123))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4070); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"default-templated markers 2.0 with option\", mozilla::baseprofiler::category::OTHER, MarkerInnerWindowId(123))" ")"); do { *((volatile int*)__null) = 4070; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
4071 | ||||
4072 | MOZ_RELEASE_ASSERT(baseprofiler::AddMarker(do { static_assert( mozilla::detail::AssertionConditionType< decltype(baseprofiler::AddMarker( "explicitly-default-templated markers 2.0 without options" , mozilla::baseprofiler::category::OTHER, {}, ::mozilla::baseprofiler ::markers::NoPayload{}))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(baseprofiler::AddMarker( "explicitly-default-templated markers 2.0 without options" , mozilla::baseprofiler::category::OTHER, {}, ::mozilla::baseprofiler ::markers::NoPayload{})))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("baseprofiler::AddMarker( \"explicitly-default-templated markers 2.0 without options\", mozilla::baseprofiler::category::OTHER, {}, ::mozilla::baseprofiler::markers::NoPayload{})" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4075); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"explicitly-default-templated markers 2.0 without options\", mozilla::baseprofiler::category::OTHER, {}, ::mozilla::baseprofiler::markers::NoPayload{})" ")"); do { *((volatile int*)__null) = 4075; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4073 | "explicitly-default-templated markers 2.0 without options",do { static_assert( mozilla::detail::AssertionConditionType< decltype(baseprofiler::AddMarker( "explicitly-default-templated markers 2.0 without options" , mozilla::baseprofiler::category::OTHER, {}, ::mozilla::baseprofiler ::markers::NoPayload{}))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(baseprofiler::AddMarker( "explicitly-default-templated markers 2.0 without options" , mozilla::baseprofiler::category::OTHER, {}, ::mozilla::baseprofiler ::markers::NoPayload{})))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("baseprofiler::AddMarker( \"explicitly-default-templated markers 2.0 without options\", mozilla::baseprofiler::category::OTHER, {}, ::mozilla::baseprofiler::markers::NoPayload{})" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4075); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"explicitly-default-templated markers 2.0 without options\", mozilla::baseprofiler::category::OTHER, {}, ::mozilla::baseprofiler::markers::NoPayload{})" ")"); do { *((volatile int*)__null) = 4075; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4074 | mozilla::baseprofiler::category::OTHER, {},do { static_assert( mozilla::detail::AssertionConditionType< decltype(baseprofiler::AddMarker( "explicitly-default-templated markers 2.0 without options" , mozilla::baseprofiler::category::OTHER, {}, ::mozilla::baseprofiler ::markers::NoPayload{}))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(baseprofiler::AddMarker( "explicitly-default-templated markers 2.0 without options" , mozilla::baseprofiler::category::OTHER, {}, ::mozilla::baseprofiler ::markers::NoPayload{})))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("baseprofiler::AddMarker( \"explicitly-default-templated markers 2.0 without options\", mozilla::baseprofiler::category::OTHER, {}, ::mozilla::baseprofiler::markers::NoPayload{})" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4075); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"explicitly-default-templated markers 2.0 without options\", mozilla::baseprofiler::category::OTHER, {}, ::mozilla::baseprofiler::markers::NoPayload{})" ")"); do { *((volatile int*)__null) = 4075; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4075 | ::mozilla::baseprofiler::markers::NoPayload{}))do { static_assert( mozilla::detail::AssertionConditionType< decltype(baseprofiler::AddMarker( "explicitly-default-templated markers 2.0 without options" , mozilla::baseprofiler::category::OTHER, {}, ::mozilla::baseprofiler ::markers::NoPayload{}))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(baseprofiler::AddMarker( "explicitly-default-templated markers 2.0 without options" , mozilla::baseprofiler::category::OTHER, {}, ::mozilla::baseprofiler ::markers::NoPayload{})))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("baseprofiler::AddMarker( \"explicitly-default-templated markers 2.0 without options\", mozilla::baseprofiler::category::OTHER, {}, ::mozilla::baseprofiler::markers::NoPayload{})" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4075); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"explicitly-default-templated markers 2.0 without options\", mozilla::baseprofiler::category::OTHER, {}, ::mozilla::baseprofiler::markers::NoPayload{})" ")"); do { *((volatile int*)__null) = 4075; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
4076 | ||||
4077 | MOZ_RELEASE_ASSERT(baseprofiler::AddMarker(do { static_assert( mozilla::detail::AssertionConditionType< decltype(baseprofiler::AddMarker( "explicitly-default-templated markers 2.0 with option" , mozilla::baseprofiler::category::OTHER, MarkerInnerWindowId (123), ::mozilla::baseprofiler::markers::NoPayload{}))>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(baseprofiler::AddMarker( "explicitly-default-templated markers 2.0 with option" , mozilla::baseprofiler::category::OTHER, MarkerInnerWindowId (123), ::mozilla::baseprofiler::markers::NoPayload{})))), 0)) ) { do { } while (false); MOZ_ReportAssertionFailure("baseprofiler::AddMarker( \"explicitly-default-templated markers 2.0 with option\", mozilla::baseprofiler::category::OTHER, MarkerInnerWindowId(123), ::mozilla::baseprofiler::markers::NoPayload{})" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4080); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"explicitly-default-templated markers 2.0 with option\", mozilla::baseprofiler::category::OTHER, MarkerInnerWindowId(123), ::mozilla::baseprofiler::markers::NoPayload{})" ")"); do { *((volatile int*)__null) = 4080; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4078 | "explicitly-default-templated markers 2.0 with option",do { static_assert( mozilla::detail::AssertionConditionType< decltype(baseprofiler::AddMarker( "explicitly-default-templated markers 2.0 with option" , mozilla::baseprofiler::category::OTHER, MarkerInnerWindowId (123), ::mozilla::baseprofiler::markers::NoPayload{}))>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(baseprofiler::AddMarker( "explicitly-default-templated markers 2.0 with option" , mozilla::baseprofiler::category::OTHER, MarkerInnerWindowId (123), ::mozilla::baseprofiler::markers::NoPayload{})))), 0)) ) { do { } while (false); MOZ_ReportAssertionFailure("baseprofiler::AddMarker( \"explicitly-default-templated markers 2.0 with option\", mozilla::baseprofiler::category::OTHER, MarkerInnerWindowId(123), ::mozilla::baseprofiler::markers::NoPayload{})" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4080); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"explicitly-default-templated markers 2.0 with option\", mozilla::baseprofiler::category::OTHER, MarkerInnerWindowId(123), ::mozilla::baseprofiler::markers::NoPayload{})" ")"); do { *((volatile int*)__null) = 4080; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4079 | mozilla::baseprofiler::category::OTHER, MarkerInnerWindowId(123),do { static_assert( mozilla::detail::AssertionConditionType< decltype(baseprofiler::AddMarker( "explicitly-default-templated markers 2.0 with option" , mozilla::baseprofiler::category::OTHER, MarkerInnerWindowId (123), ::mozilla::baseprofiler::markers::NoPayload{}))>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(baseprofiler::AddMarker( "explicitly-default-templated markers 2.0 with option" , mozilla::baseprofiler::category::OTHER, MarkerInnerWindowId (123), ::mozilla::baseprofiler::markers::NoPayload{})))), 0)) ) { do { } while (false); MOZ_ReportAssertionFailure("baseprofiler::AddMarker( \"explicitly-default-templated markers 2.0 with option\", mozilla::baseprofiler::category::OTHER, MarkerInnerWindowId(123), ::mozilla::baseprofiler::markers::NoPayload{})" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4080); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"explicitly-default-templated markers 2.0 with option\", mozilla::baseprofiler::category::OTHER, MarkerInnerWindowId(123), ::mozilla::baseprofiler::markers::NoPayload{})" ")"); do { *((volatile int*)__null) = 4080; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4080 | ::mozilla::baseprofiler::markers::NoPayload{}))do { static_assert( mozilla::detail::AssertionConditionType< decltype(baseprofiler::AddMarker( "explicitly-default-templated markers 2.0 with option" , mozilla::baseprofiler::category::OTHER, MarkerInnerWindowId (123), ::mozilla::baseprofiler::markers::NoPayload{}))>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(baseprofiler::AddMarker( "explicitly-default-templated markers 2.0 with option" , mozilla::baseprofiler::category::OTHER, MarkerInnerWindowId (123), ::mozilla::baseprofiler::markers::NoPayload{})))), 0)) ) { do { } while (false); MOZ_ReportAssertionFailure("baseprofiler::AddMarker( \"explicitly-default-templated markers 2.0 with option\", mozilla::baseprofiler::category::OTHER, MarkerInnerWindowId(123), ::mozilla::baseprofiler::markers::NoPayload{})" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4080); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"explicitly-default-templated markers 2.0 with option\", mozilla::baseprofiler::category::OTHER, MarkerInnerWindowId(123), ::mozilla::baseprofiler::markers::NoPayload{})" ")"); do { *((volatile int*)__null) = 4080; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
4081 | ||||
4082 | MOZ_RELEASE_ASSERT(baseprofiler::AddMarker(do { static_assert( mozilla::detail::AssertionConditionType< decltype(baseprofiler::AddMarker( "tracing", mozilla::baseprofiler ::category::OTHER, {}, mozilla::baseprofiler::markers::Tracing {}, "category"))>::isValid, "invalid assertion condition") ; if ((__builtin_expect(!!(!(!!(baseprofiler::AddMarker( "tracing" , mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler ::markers::Tracing{}, "category")))), 0))) { do { } while (false ); MOZ_ReportAssertionFailure("baseprofiler::AddMarker( \"tracing\", mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::Tracing{}, \"category\")" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4084); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"tracing\", mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::Tracing{}, \"category\")" ")"); do { *((volatile int*)__null) = 4084; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4083 | "tracing", mozilla::baseprofiler::category::OTHER, {},do { static_assert( mozilla::detail::AssertionConditionType< decltype(baseprofiler::AddMarker( "tracing", mozilla::baseprofiler ::category::OTHER, {}, mozilla::baseprofiler::markers::Tracing {}, "category"))>::isValid, "invalid assertion condition") ; if ((__builtin_expect(!!(!(!!(baseprofiler::AddMarker( "tracing" , mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler ::markers::Tracing{}, "category")))), 0))) { do { } while (false ); MOZ_ReportAssertionFailure("baseprofiler::AddMarker( \"tracing\", mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::Tracing{}, \"category\")" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4084); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"tracing\", mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::Tracing{}, \"category\")" ")"); do { *((volatile int*)__null) = 4084; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4084 | mozilla::baseprofiler::markers::Tracing{}, "category"))do { static_assert( mozilla::detail::AssertionConditionType< decltype(baseprofiler::AddMarker( "tracing", mozilla::baseprofiler ::category::OTHER, {}, mozilla::baseprofiler::markers::Tracing {}, "category"))>::isValid, "invalid assertion condition") ; if ((__builtin_expect(!!(!(!!(baseprofiler::AddMarker( "tracing" , mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler ::markers::Tracing{}, "category")))), 0))) { do { } while (false ); MOZ_ReportAssertionFailure("baseprofiler::AddMarker( \"tracing\", mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::Tracing{}, \"category\")" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4084); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"tracing\", mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::Tracing{}, \"category\")" ")"); do { *((volatile int*)__null) = 4084; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
4085 | ||||
4086 | MOZ_RELEASE_ASSERT(baseprofiler::AddMarker(do { static_assert( mozilla::detail::AssertionConditionType< decltype(baseprofiler::AddMarker( "text", mozilla::baseprofiler ::category::OTHER, {}, mozilla::baseprofiler::markers::TextMarker {}, "text text"))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(baseprofiler::AddMarker( "text" , mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler ::markers::TextMarker{}, "text text")))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("baseprofiler::AddMarker( \"text\", mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::TextMarker{}, \"text text\")" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4088); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"text\", mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::TextMarker{}, \"text text\")" ")"); do { *((volatile int*)__null) = 4088; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4087 | "text", mozilla::baseprofiler::category::OTHER, {},do { static_assert( mozilla::detail::AssertionConditionType< decltype(baseprofiler::AddMarker( "text", mozilla::baseprofiler ::category::OTHER, {}, mozilla::baseprofiler::markers::TextMarker {}, "text text"))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(baseprofiler::AddMarker( "text" , mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler ::markers::TextMarker{}, "text text")))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("baseprofiler::AddMarker( \"text\", mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::TextMarker{}, \"text text\")" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4088); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"text\", mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::TextMarker{}, \"text text\")" ")"); do { *((volatile int*)__null) = 4088; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4088 | mozilla::baseprofiler::markers::TextMarker{}, "text text"))do { static_assert( mozilla::detail::AssertionConditionType< decltype(baseprofiler::AddMarker( "text", mozilla::baseprofiler ::category::OTHER, {}, mozilla::baseprofiler::markers::TextMarker {}, "text text"))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(baseprofiler::AddMarker( "text" , mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler ::markers::TextMarker{}, "text text")))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("baseprofiler::AddMarker( \"text\", mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::TextMarker{}, \"text text\")" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4088); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"text\", mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::TextMarker{}, \"text text\")" ")"); do { *((volatile int*)__null) = 4088; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
4089 | ||||
4090 | MOZ_RELEASE_ASSERT(baseprofiler::AddMarker(do { static_assert( mozilla::detail::AssertionConditionType< decltype(baseprofiler::AddMarker( "media sample", mozilla::baseprofiler ::category::OTHER, {}, mozilla::baseprofiler::markers::MediaSampleMarker {}, 123, 456, 789))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(baseprofiler::AddMarker( "media sample" , mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler ::markers::MediaSampleMarker{}, 123, 456, 789)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("baseprofiler::AddMarker( \"media sample\", mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::MediaSampleMarker{}, 123, 456, 789)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4092); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"media sample\", mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::MediaSampleMarker{}, 123, 456, 789)" ")"); do { *((volatile int*)__null) = 4092; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4091 | "media sample", mozilla::baseprofiler::category::OTHER, {},do { static_assert( mozilla::detail::AssertionConditionType< decltype(baseprofiler::AddMarker( "media sample", mozilla::baseprofiler ::category::OTHER, {}, mozilla::baseprofiler::markers::MediaSampleMarker {}, 123, 456, 789))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(baseprofiler::AddMarker( "media sample" , mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler ::markers::MediaSampleMarker{}, 123, 456, 789)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("baseprofiler::AddMarker( \"media sample\", mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::MediaSampleMarker{}, 123, 456, 789)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4092); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"media sample\", mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::MediaSampleMarker{}, 123, 456, 789)" ")"); do { *((volatile int*)__null) = 4092; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4092 | mozilla::baseprofiler::markers::MediaSampleMarker{}, 123, 456, 789))do { static_assert( mozilla::detail::AssertionConditionType< decltype(baseprofiler::AddMarker( "media sample", mozilla::baseprofiler ::category::OTHER, {}, mozilla::baseprofiler::markers::MediaSampleMarker {}, 123, 456, 789))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(baseprofiler::AddMarker( "media sample" , mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler ::markers::MediaSampleMarker{}, 123, 456, 789)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("baseprofiler::AddMarker( \"media sample\", mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::MediaSampleMarker{}, 123, 456, 789)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4092); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"media sample\", mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::MediaSampleMarker{}, 123, 456, 789)" ")"); do { *((volatile int*)__null) = 4092; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
4093 | ||||
4094 | MOZ_RELEASE_ASSERT(baseprofiler::AddMarker(do { static_assert( mozilla::detail::AssertionConditionType< decltype(baseprofiler::AddMarker( "video falling behind", mozilla ::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers ::VideoFallingBehindMarker{}, 123, 456))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(baseprofiler::AddMarker( "video falling behind" , mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler ::markers::VideoFallingBehindMarker{}, 123, 456)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("baseprofiler::AddMarker( \"video falling behind\", mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::VideoFallingBehindMarker{}, 123, 456)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4096); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"video falling behind\", mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::VideoFallingBehindMarker{}, 123, 456)" ")"); do { *((volatile int*)__null) = 4096; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4095 | "video falling behind", mozilla::baseprofiler::category::OTHER, {},do { static_assert( mozilla::detail::AssertionConditionType< decltype(baseprofiler::AddMarker( "video falling behind", mozilla ::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers ::VideoFallingBehindMarker{}, 123, 456))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(baseprofiler::AddMarker( "video falling behind" , mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler ::markers::VideoFallingBehindMarker{}, 123, 456)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("baseprofiler::AddMarker( \"video falling behind\", mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::VideoFallingBehindMarker{}, 123, 456)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4096); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"video falling behind\", mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::VideoFallingBehindMarker{}, 123, 456)" ")"); do { *((volatile int*)__null) = 4096; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4096 | mozilla::baseprofiler::markers::VideoFallingBehindMarker{}, 123, 456))do { static_assert( mozilla::detail::AssertionConditionType< decltype(baseprofiler::AddMarker( "video falling behind", mozilla ::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers ::VideoFallingBehindMarker{}, 123, 456))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(baseprofiler::AddMarker( "video falling behind" , mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler ::markers::VideoFallingBehindMarker{}, 123, 456)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("baseprofiler::AddMarker( \"video falling behind\", mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::VideoFallingBehindMarker{}, 123, 456)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4096); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"video falling behind\", mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::VideoFallingBehindMarker{}, 123, 456)" ")"); do { *((volatile int*)__null) = 4096; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
4097 | ||||
4098 | MOZ_RELEASE_ASSERT(baseprofiler::AddMarker(do { static_assert( mozilla::detail::AssertionConditionType< decltype(baseprofiler::AddMarker( "video sink render", mozilla ::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers ::VideoSinkRenderMarker{}, 123))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(baseprofiler::AddMarker( "video sink render" , mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler ::markers::VideoSinkRenderMarker{}, 123)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("baseprofiler::AddMarker( \"video sink render\", mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::VideoSinkRenderMarker{}, 123)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4100); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"video sink render\", mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::VideoSinkRenderMarker{}, 123)" ")"); do { *((volatile int*)__null) = 4100; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4099 | "video sink render", mozilla::baseprofiler::category::OTHER, {},do { static_assert( mozilla::detail::AssertionConditionType< decltype(baseprofiler::AddMarker( "video sink render", mozilla ::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers ::VideoSinkRenderMarker{}, 123))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(baseprofiler::AddMarker( "video sink render" , mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler ::markers::VideoSinkRenderMarker{}, 123)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("baseprofiler::AddMarker( \"video sink render\", mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::VideoSinkRenderMarker{}, 123)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4100); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"video sink render\", mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::VideoSinkRenderMarker{}, 123)" ")"); do { *((volatile int*)__null) = 4100; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4100 | mozilla::baseprofiler::markers::VideoSinkRenderMarker{}, 123))do { static_assert( mozilla::detail::AssertionConditionType< decltype(baseprofiler::AddMarker( "video sink render", mozilla ::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers ::VideoSinkRenderMarker{}, 123))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(baseprofiler::AddMarker( "video sink render" , mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler ::markers::VideoSinkRenderMarker{}, 123)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("baseprofiler::AddMarker( \"video sink render\", mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::VideoSinkRenderMarker{}, 123)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4100); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "baseprofiler::AddMarker( \"video sink render\", mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::VideoSinkRenderMarker{}, 123)" ")"); do { *((volatile int*)__null) = 4100; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
4101 | ||||
4102 | printf("Sleep 1s...\n"); | |||
4103 | { | |||
4104 | AUTO_BASE_PROFILER_THREAD_SLEEP::mozilla::baseprofiler::AutoProfilerThreadSleep raiiObject4104; | |||
4105 | SleepMilli(1000); | |||
4106 | } | |||
4107 | ||||
4108 | printf("baseprofiler_pause()...\n"); | |||
4109 | baseprofiler::profiler_pause(); | |||
4110 | ||||
4111 | MOZ_RELEASE_ASSERT(!baseprofiler::profiler_thread_is_being_profiled())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!baseprofiler::profiler_thread_is_being_profiled())> ::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(!baseprofiler::profiler_thread_is_being_profiled())) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!baseprofiler::profiler_thread_is_being_profiled()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4111); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!baseprofiler::profiler_thread_is_being_profiled()" ")"); do { *((volatile int*)__null) = 4111; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
4112 | ||||
4113 | Maybe<baseprofiler::ProfilerBufferInfo> info = | |||
4114 | baseprofiler::profiler_get_buffer_info(); | |||
4115 | MOZ_RELEASE_ASSERT(info.isSome())do { static_assert( mozilla::detail::AssertionConditionType< decltype(info.isSome())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(info.isSome()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("info.isSome()", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4115); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "info.isSome()" ")"); do { *((volatile int*)__null) = 4115; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
4116 | printf("Profiler buffer range: %llu .. %llu (%llu bytes)\n", | |||
4117 | static_cast<unsigned long long>(info->mRangeStart), | |||
4118 | static_cast<unsigned long long>(info->mRangeEnd), | |||
4119 | // sizeof(ProfileBufferEntry) == 9 | |||
4120 | (static_cast<unsigned long long>(info->mRangeEnd) - | |||
4121 | static_cast<unsigned long long>(info->mRangeStart)) * | |||
4122 | 9); | |||
4123 | printf("Stats: min(us) .. mean(us) .. max(us) [count]\n"); | |||
4124 | printf("- Intervals: %7.1f .. %7.1f .. %7.1f [%u]\n", | |||
4125 | info->mIntervalsUs.min, | |||
4126 | info->mIntervalsUs.sum / info->mIntervalsUs.n, | |||
4127 | info->mIntervalsUs.max, info->mIntervalsUs.n); | |||
4128 | printf("- Overheads: %7.1f .. %7.1f .. %7.1f [%u]\n", | |||
4129 | info->mOverheadsUs.min, | |||
4130 | info->mOverheadsUs.sum / info->mOverheadsUs.n, | |||
4131 | info->mOverheadsUs.max, info->mOverheadsUs.n); | |||
4132 | printf(" - Locking: %7.1f .. %7.1f .. %7.1f [%u]\n", | |||
4133 | info->mLockingsUs.min, info->mLockingsUs.sum / info->mLockingsUs.n, | |||
4134 | info->mLockingsUs.max, info->mLockingsUs.n); | |||
4135 | printf(" - Clearning: %7.1f .. %7.1f .. %7.1f [%u]\n", | |||
4136 | info->mCleaningsUs.min, | |||
4137 | info->mCleaningsUs.sum / info->mCleaningsUs.n, | |||
4138 | info->mCleaningsUs.max, info->mCleaningsUs.n); | |||
4139 | printf(" - Counters: %7.1f .. %7.1f .. %7.1f [%u]\n", | |||
4140 | info->mCountersUs.min, info->mCountersUs.sum / info->mCountersUs.n, | |||
4141 | info->mCountersUs.max, info->mCountersUs.n); | |||
4142 | printf(" - Threads: %7.1f .. %7.1f .. %7.1f [%u]\n", | |||
4143 | info->mThreadsUs.min, info->mThreadsUs.sum / info->mThreadsUs.n, | |||
4144 | info->mThreadsUs.max, info->mThreadsUs.n); | |||
4145 | ||||
4146 | printf("baseprofiler_get_profile()...\n"); | |||
4147 | UniquePtr<char[]> profile = baseprofiler::profiler_get_profile(); | |||
4148 | ||||
4149 | // Use a string view over the profile contents, for easier testing. | |||
4150 | std::string_view profileSV = profile.get(); | |||
4151 | ||||
4152 | constexpr const auto svnpos = std::string_view::npos; | |||
4153 | // TODO: Properly parse profile and check fields. | |||
4154 | // Check for some expected marker schema JSON output. | |||
4155 | MOZ_RELEASE_ASSERT(profileSV.find("\"markerSchema\":[") != svnpos)do { static_assert( mozilla::detail::AssertionConditionType< decltype(profileSV.find("\"markerSchema\":[") != svnpos)>:: isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(profileSV.find("\"markerSchema\":[") != svnpos))), 0 ))) { do { } while (false); MOZ_ReportAssertionFailure("profileSV.find(\"\\\"markerSchema\\\":[\") != svnpos" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4155); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "profileSV.find(\"\\\"markerSchema\\\":[\") != svnpos" ")"); do { *((volatile int*)__null) = 4155; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
4156 | MOZ_RELEASE_ASSERT(profileSV.find("\"name\":\"Text\",") != svnpos)do { static_assert( mozilla::detail::AssertionConditionType< decltype(profileSV.find("\"name\":\"Text\",") != svnpos)>:: isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(profileSV.find("\"name\":\"Text\",") != svnpos))), 0 ))) { do { } while (false); MOZ_ReportAssertionFailure("profileSV.find(\"\\\"name\\\":\\\"Text\\\",\") != svnpos" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4156); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "profileSV.find(\"\\\"name\\\":\\\"Text\\\",\") != svnpos" ")"); do { *((volatile int*)__null) = 4156; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
4157 | MOZ_RELEASE_ASSERT(profileSV.find("\"name\":\"tracing\",") != svnpos)do { static_assert( mozilla::detail::AssertionConditionType< decltype(profileSV.find("\"name\":\"tracing\",") != svnpos)> ::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(profileSV.find("\"name\":\"tracing\",") != svnpos))) , 0))) { do { } while (false); MOZ_ReportAssertionFailure("profileSV.find(\"\\\"name\\\":\\\"tracing\\\",\") != svnpos" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4157); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "profileSV.find(\"\\\"name\\\":\\\"tracing\\\",\") != svnpos" ")"); do { *((volatile int*)__null) = 4157; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
4158 | MOZ_RELEASE_ASSERT(profileSV.find("\"name\":\"MediaSample\",") != svnpos)do { static_assert( mozilla::detail::AssertionConditionType< decltype(profileSV.find("\"name\":\"MediaSample\",") != svnpos )>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(profileSV.find("\"name\":\"MediaSample\",") != svnpos ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "profileSV.find(\"\\\"name\\\":\\\"MediaSample\\\",\") != svnpos" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4158); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "profileSV.find(\"\\\"name\\\":\\\"MediaSample\\\",\") != svnpos" ")"); do { *((volatile int*)__null) = 4158; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
4159 | MOZ_RELEASE_ASSERT(profileSV.find("\"display\":[") != svnpos)do { static_assert( mozilla::detail::AssertionConditionType< decltype(profileSV.find("\"display\":[") != svnpos)>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(profileSV.find("\"display\":[") != svnpos))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("profileSV.find(\"\\\"display\\\":[\") != svnpos" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4159); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "profileSV.find(\"\\\"display\\\":[\") != svnpos" ")"); do { *((volatile int*)__null) = 4159; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
4160 | MOZ_RELEASE_ASSERT(profileSV.find("\"marker-chart\"") != svnpos)do { static_assert( mozilla::detail::AssertionConditionType< decltype(profileSV.find("\"marker-chart\"") != svnpos)>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(profileSV.find("\"marker-chart\"") != svnpos))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("profileSV.find(\"\\\"marker-chart\\\"\") != svnpos" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4160); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "profileSV.find(\"\\\"marker-chart\\\"\") != svnpos" ")"); do { *((volatile int*)__null) = 4160; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
4161 | MOZ_RELEASE_ASSERT(profileSV.find("\"marker-table\"") != svnpos)do { static_assert( mozilla::detail::AssertionConditionType< decltype(profileSV.find("\"marker-table\"") != svnpos)>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(profileSV.find("\"marker-table\"") != svnpos))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("profileSV.find(\"\\\"marker-table\\\"\") != svnpos" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4161); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "profileSV.find(\"\\\"marker-table\\\"\") != svnpos" ")"); do { *((volatile int*)__null) = 4161; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
4162 | MOZ_RELEASE_ASSERT(profileSV.find("\"format\":\"string\"") != svnpos)do { static_assert( mozilla::detail::AssertionConditionType< decltype(profileSV.find("\"format\":\"string\"") != svnpos)> ::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(profileSV.find("\"format\":\"string\"") != svnpos))) , 0))) { do { } while (false); MOZ_ReportAssertionFailure("profileSV.find(\"\\\"format\\\":\\\"string\\\"\") != svnpos" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4162); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "profileSV.find(\"\\\"format\\\":\\\"string\\\"\") != svnpos" ")"); do { *((volatile int*)__null) = 4162; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
4163 | // TODO: Add more checks for what's expected in the profile. Some of them | |||
4164 | // are done in gtest's. | |||
4165 | ||||
4166 | printf("baseprofiler_save_profile_to_file()...\n"); | |||
4167 | baseprofiler::baseprofiler_save_profile_to_file( | |||
4168 | "TestProfiler_profile.json"); | |||
4169 | ||||
4170 | printf("profiler_stop()...\n"); | |||
4171 | baseprofiler::profiler_stop(); | |||
4172 | ||||
4173 | MOZ_RELEASE_ASSERT(!baseprofiler::profiler_is_active())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!baseprofiler::profiler_is_active())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!baseprofiler::profiler_is_active ()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("!baseprofiler::profiler_is_active()", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4173); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!baseprofiler::profiler_is_active()" ")"); do { *((volatile int*)__null) = 4173; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
4174 | MOZ_RELEASE_ASSERT(!baseprofiler::profiler_thread_is_being_profiled())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!baseprofiler::profiler_thread_is_being_profiled())> ::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(!baseprofiler::profiler_thread_is_being_profiled())) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!baseprofiler::profiler_thread_is_being_profiled()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4174); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!baseprofiler::profiler_thread_is_being_profiled()" ")"); do { *((volatile int*)__null) = 4174; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
4175 | MOZ_RELEASE_ASSERT(!baseprofiler::profiler_thread_is_sleeping())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!baseprofiler::profiler_thread_is_sleeping())>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(!baseprofiler::profiler_thread_is_sleeping()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!baseprofiler::profiler_thread_is_sleeping()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4175); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!baseprofiler::profiler_thread_is_sleeping()" ")"); do { *((volatile int*)__null) = 4175; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
4176 | ||||
4177 | printf("profiler_shutdown()...\n"); | |||
4178 | } | |||
4179 | ||||
4180 | printf("TestProfiler done\n"); | |||
4181 | } | |||
4182 | ||||
4183 | // Minimal string escaping, similar to how C++ stringliterals should be entered, | |||
4184 | // to help update comparison strings in tests below. | |||
4185 | void printEscaped(std::string_view aString) { | |||
4186 | for (const char c : aString) { | |||
4187 | switch (c) { | |||
4188 | case '\n': | |||
4189 | fprintf(stderrstderr, "\\n\n"); | |||
4190 | break; | |||
4191 | case '"': | |||
4192 | fprintf(stderrstderr, "\\\""); | |||
4193 | break; | |||
4194 | case '\\': | |||
4195 | fprintf(stderrstderr, "\\\\"); | |||
4196 | break; | |||
4197 | default: | |||
4198 | if (c >= ' ' && c <= '~') { | |||
4199 | fprintf(stderrstderr, "%c", c); | |||
4200 | } else { | |||
4201 | fprintf(stderrstderr, "\\x%02x", unsigned(c)); | |||
4202 | } | |||
4203 | break; | |||
4204 | } | |||
4205 | } | |||
4206 | } | |||
4207 | ||||
4208 | // Run aF(SpliceableChunkedJSONWriter&, UniqueJSONStrings&) from inside a JSON | |||
4209 | // array, then output the string table, and compare the full output to | |||
4210 | // aExpected. | |||
4211 | template <typename F> | |||
4212 | static void VerifyUniqueStringContents( | |||
4213 | F&& aF, std::string_view aExpectedData, | |||
4214 | std::string_view aExpectedUniqueStrings, | |||
4215 | mozilla::baseprofiler::UniqueJSONStrings* aUniqueStringsOrNull = nullptr) { | |||
4216 | mozilla::baseprofiler::SpliceableChunkedJSONWriter writer{ | |||
4217 | FailureLatchInfallibleSource::Singleton()}; | |||
4218 | ||||
4219 | MOZ_RELEASE_ASSERT(!writer.ChunkedWriteFunc().Fallible())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!writer.ChunkedWriteFunc().Fallible())>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(! !(!writer.ChunkedWriteFunc().Fallible()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!writer.ChunkedWriteFunc().Fallible()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4219); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!writer.ChunkedWriteFunc().Fallible()" ")"); do { *((volatile int*)__null) = 4219; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
4220 | MOZ_RELEASE_ASSERT(!writer.ChunkedWriteFunc().Failed())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!writer.ChunkedWriteFunc().Failed())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!writer.ChunkedWriteFunc().Failed ()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("!writer.ChunkedWriteFunc().Failed()", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4220); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!writer.ChunkedWriteFunc().Failed()" ")"); do { *((volatile int*)__null) = 4220; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
4221 | MOZ_RELEASE_ASSERT(!writer.ChunkedWriteFunc().GetFailure())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!writer.ChunkedWriteFunc().GetFailure())>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(!writer.ChunkedWriteFunc().GetFailure()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!writer.ChunkedWriteFunc().GetFailure()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4221); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!writer.ChunkedWriteFunc().GetFailure()" ")"); do { *((volatile int*)__null) = 4221; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
4222 | MOZ_RELEASE_ASSERT(&writer.ChunkedWriteFunc().SourceFailureLatch() ==do { static_assert( mozilla::detail::AssertionConditionType< decltype(&writer.ChunkedWriteFunc().SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton())> ::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(&writer.ChunkedWriteFunc().SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()))), 0 ))) { do { } while (false); MOZ_ReportAssertionFailure("&writer.ChunkedWriteFunc().SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4223); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&writer.ChunkedWriteFunc().SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()" ")"); do { *((volatile int*)__null) = 4223; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4223 | &mozilla::FailureLatchInfallibleSource::Singleton())do { static_assert( mozilla::detail::AssertionConditionType< decltype(&writer.ChunkedWriteFunc().SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton())> ::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(&writer.ChunkedWriteFunc().SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()))), 0 ))) { do { } while (false); MOZ_ReportAssertionFailure("&writer.ChunkedWriteFunc().SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4223); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&writer.ChunkedWriteFunc().SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()" ")"); do { *((volatile int*)__null) = 4223; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
4224 | MOZ_RELEASE_ASSERT(do { static_assert( mozilla::detail::AssertionConditionType< decltype(&std::as_const(writer.ChunkedWriteFunc()).SourceFailureLatch () == &mozilla::FailureLatchInfallibleSource::Singleton() )>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(&std::as_const(writer.ChunkedWriteFunc()).SourceFailureLatch () == &mozilla::FailureLatchInfallibleSource::Singleton() ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "&std::as_const(writer.ChunkedWriteFunc()).SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4226); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&std::as_const(writer.ChunkedWriteFunc()).SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()" ")"); do { *((volatile int*)__null) = 4226; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4225 | &std::as_const(writer.ChunkedWriteFunc()).SourceFailureLatch() ==do { static_assert( mozilla::detail::AssertionConditionType< decltype(&std::as_const(writer.ChunkedWriteFunc()).SourceFailureLatch () == &mozilla::FailureLatchInfallibleSource::Singleton() )>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(&std::as_const(writer.ChunkedWriteFunc()).SourceFailureLatch () == &mozilla::FailureLatchInfallibleSource::Singleton() ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "&std::as_const(writer.ChunkedWriteFunc()).SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4226); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&std::as_const(writer.ChunkedWriteFunc()).SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()" ")"); do { *((volatile int*)__null) = 4226; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4226 | &mozilla::FailureLatchInfallibleSource::Singleton())do { static_assert( mozilla::detail::AssertionConditionType< decltype(&std::as_const(writer.ChunkedWriteFunc()).SourceFailureLatch () == &mozilla::FailureLatchInfallibleSource::Singleton() )>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(&std::as_const(writer.ChunkedWriteFunc()).SourceFailureLatch () == &mozilla::FailureLatchInfallibleSource::Singleton() ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "&std::as_const(writer.ChunkedWriteFunc()).SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4226); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&std::as_const(writer.ChunkedWriteFunc()).SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()" ")"); do { *((volatile int*)__null) = 4226; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
4227 | ||||
4228 | MOZ_RELEASE_ASSERT(!writer.Fallible())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!writer.Fallible())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!writer.Fallible()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!writer.Fallible()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4228); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!writer.Fallible()" ")"); do { *((volatile int*)__null) = 4228; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
4229 | MOZ_RELEASE_ASSERT(!writer.Failed())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!writer.Failed())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!writer.Failed()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!writer.Failed()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4229); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!writer.Failed()" ")"); do { *((volatile int*)__null) = 4229; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
4230 | MOZ_RELEASE_ASSERT(!writer.GetFailure())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!writer.GetFailure())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!writer.GetFailure()))), 0)) ) { do { } while (false); MOZ_ReportAssertionFailure("!writer.GetFailure()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4230); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!writer.GetFailure()" ")"); do { *((volatile int*)__null) = 4230; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
4231 | MOZ_RELEASE_ASSERT(&writer.SourceFailureLatch() ==do { static_assert( mozilla::detail::AssertionConditionType< decltype(&writer.SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource ::Singleton())>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(!!(&writer.SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()))), 0 ))) { do { } while (false); MOZ_ReportAssertionFailure("&writer.SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4232); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&writer.SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()" ")"); do { *((volatile int*)__null) = 4232; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4232 | &mozilla::FailureLatchInfallibleSource::Singleton())do { static_assert( mozilla::detail::AssertionConditionType< decltype(&writer.SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource ::Singleton())>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(!!(&writer.SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()))), 0 ))) { do { } while (false); MOZ_ReportAssertionFailure("&writer.SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4232); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&writer.SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()" ")"); do { *((volatile int*)__null) = 4232; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
4233 | MOZ_RELEASE_ASSERT(&std::as_const(writer).SourceFailureLatch() ==do { static_assert( mozilla::detail::AssertionConditionType< decltype(&std::as_const(writer).SourceFailureLatch() == & mozilla::FailureLatchInfallibleSource::Singleton())>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(&std::as_const(writer).SourceFailureLatch() == &mozilla ::FailureLatchInfallibleSource::Singleton()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("&std::as_const(writer).SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4234); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&std::as_const(writer).SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()" ")"); do { *((volatile int*)__null) = 4234; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4234 | &mozilla::FailureLatchInfallibleSource::Singleton())do { static_assert( mozilla::detail::AssertionConditionType< decltype(&std::as_const(writer).SourceFailureLatch() == & mozilla::FailureLatchInfallibleSource::Singleton())>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(&std::as_const(writer).SourceFailureLatch() == &mozilla ::FailureLatchInfallibleSource::Singleton()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("&std::as_const(writer).SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4234); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&std::as_const(writer).SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()" ")"); do { *((volatile int*)__null) = 4234; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
4235 | ||||
4236 | // By default use a local UniqueJSONStrings, otherwise use the one provided. | |||
4237 | mozilla::baseprofiler::UniqueJSONStrings localUniqueStrings{ | |||
4238 | FailureLatchInfallibleSource::Singleton()}; | |||
4239 | MOZ_RELEASE_ASSERT(!localUniqueStrings.Fallible())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!localUniqueStrings.Fallible())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!localUniqueStrings.Fallible ()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("!localUniqueStrings.Fallible()", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4239); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!localUniqueStrings.Fallible()" ")"); do { *((volatile int*)__null) = 4239; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
4240 | MOZ_RELEASE_ASSERT(!localUniqueStrings.Failed())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!localUniqueStrings.Failed())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!localUniqueStrings.Failed() ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "!localUniqueStrings.Failed()", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4240); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!localUniqueStrings.Failed()" ")"); do { *((volatile int*)__null) = 4240; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
4241 | MOZ_RELEASE_ASSERT(!localUniqueStrings.GetFailure())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!localUniqueStrings.GetFailure())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!localUniqueStrings.GetFailure ()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("!localUniqueStrings.GetFailure()", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4241); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!localUniqueStrings.GetFailure()" ")"); do { *((volatile int*)__null) = 4241; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
4242 | MOZ_RELEASE_ASSERT(&localUniqueStrings.SourceFailureLatch() ==do { static_assert( mozilla::detail::AssertionConditionType< decltype(&localUniqueStrings.SourceFailureLatch() == & mozilla::FailureLatchInfallibleSource::Singleton())>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(&localUniqueStrings.SourceFailureLatch() == &mozilla ::FailureLatchInfallibleSource::Singleton()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("&localUniqueStrings.SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4243); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&localUniqueStrings.SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()" ")"); do { *((volatile int*)__null) = 4243; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4243 | &mozilla::FailureLatchInfallibleSource::Singleton())do { static_assert( mozilla::detail::AssertionConditionType< decltype(&localUniqueStrings.SourceFailureLatch() == & mozilla::FailureLatchInfallibleSource::Singleton())>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(&localUniqueStrings.SourceFailureLatch() == &mozilla ::FailureLatchInfallibleSource::Singleton()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("&localUniqueStrings.SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4243); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&localUniqueStrings.SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()" ")"); do { *((volatile int*)__null) = 4243; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
4244 | MOZ_RELEASE_ASSERT(&std::as_const(localUniqueStrings).SourceFailureLatch() ==do { static_assert( mozilla::detail::AssertionConditionType< decltype(&std::as_const(localUniqueStrings).SourceFailureLatch () == &mozilla::FailureLatchInfallibleSource::Singleton() )>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(&std::as_const(localUniqueStrings).SourceFailureLatch () == &mozilla::FailureLatchInfallibleSource::Singleton() ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "&std::as_const(localUniqueStrings).SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4245); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&std::as_const(localUniqueStrings).SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()" ")"); do { *((volatile int*)__null) = 4245; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4245 | &mozilla::FailureLatchInfallibleSource::Singleton())do { static_assert( mozilla::detail::AssertionConditionType< decltype(&std::as_const(localUniqueStrings).SourceFailureLatch () == &mozilla::FailureLatchInfallibleSource::Singleton() )>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(&std::as_const(localUniqueStrings).SourceFailureLatch () == &mozilla::FailureLatchInfallibleSource::Singleton() ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "&std::as_const(localUniqueStrings).SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4245); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "&std::as_const(localUniqueStrings).SourceFailureLatch() == &mozilla::FailureLatchInfallibleSource::Singleton()" ")"); do { *((volatile int*)__null) = 4245; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
4246 | ||||
4247 | mozilla::baseprofiler::UniqueJSONStrings& uniqueStrings = | |||
4248 | aUniqueStringsOrNull ? *aUniqueStringsOrNull : localUniqueStrings; | |||
4249 | MOZ_RELEASE_ASSERT(!uniqueStrings.Failed())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!uniqueStrings.Failed())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!uniqueStrings.Failed()))), 0 ))) { do { } while (false); MOZ_ReportAssertionFailure("!uniqueStrings.Failed()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4249); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!uniqueStrings.Failed()" ")"); do { *((volatile int*)__null) = 4249; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
4250 | MOZ_RELEASE_ASSERT(!uniqueStrings.GetFailure())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!uniqueStrings.GetFailure())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!uniqueStrings.GetFailure()) )), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!uniqueStrings.GetFailure()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4250); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!uniqueStrings.GetFailure()" ")"); do { *((volatile int*)__null) = 4250; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
4251 | ||||
4252 | writer.Start(); | |||
4253 | { | |||
4254 | writer.StartArrayProperty("data"); | |||
4255 | { std::forward<F>(aF)(writer, uniqueStrings); } | |||
4256 | writer.EndArray(); | |||
4257 | ||||
4258 | writer.StartArrayProperty("stringTable"); | |||
4259 | { uniqueStrings.SpliceStringTableElements(writer); } | |||
4260 | writer.EndArray(); | |||
4261 | } | |||
4262 | writer.End(); | |||
4263 | ||||
4264 | MOZ_RELEASE_ASSERT(!uniqueStrings.Failed())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!uniqueStrings.Failed())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!uniqueStrings.Failed()))), 0 ))) { do { } while (false); MOZ_ReportAssertionFailure("!uniqueStrings.Failed()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4264); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!uniqueStrings.Failed()" ")"); do { *((volatile int*)__null) = 4264; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
4265 | MOZ_RELEASE_ASSERT(!uniqueStrings.GetFailure())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!uniqueStrings.GetFailure())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!uniqueStrings.GetFailure()) )), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!uniqueStrings.GetFailure()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4265); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!uniqueStrings.GetFailure()" ")"); do { *((volatile int*)__null) = 4265; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
4266 | ||||
4267 | MOZ_RELEASE_ASSERT(!writer.ChunkedWriteFunc().Failed())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!writer.ChunkedWriteFunc().Failed())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!writer.ChunkedWriteFunc().Failed ()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("!writer.ChunkedWriteFunc().Failed()", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4267); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!writer.ChunkedWriteFunc().Failed()" ")"); do { *((volatile int*)__null) = 4267; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
4268 | MOZ_RELEASE_ASSERT(!writer.ChunkedWriteFunc().GetFailure())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!writer.ChunkedWriteFunc().GetFailure())>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(!writer.ChunkedWriteFunc().GetFailure()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!writer.ChunkedWriteFunc().GetFailure()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4268); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!writer.ChunkedWriteFunc().GetFailure()" ")"); do { *((volatile int*)__null) = 4268; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
4269 | ||||
4270 | MOZ_RELEASE_ASSERT(!writer.Failed())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!writer.Failed())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!writer.Failed()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!writer.Failed()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4270); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!writer.Failed()" ")"); do { *((volatile int*)__null) = 4270; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
4271 | MOZ_RELEASE_ASSERT(!writer.GetFailure())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!writer.GetFailure())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!writer.GetFailure()))), 0)) ) { do { } while (false); MOZ_ReportAssertionFailure("!writer.GetFailure()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4271); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!writer.GetFailure()" ")"); do { *((volatile int*)__null) = 4271; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
4272 | ||||
4273 | UniquePtr<char[]> jsonString = writer.ChunkedWriteFunc().CopyData(); | |||
4274 | MOZ_RELEASE_ASSERT(jsonString)do { static_assert( mozilla::detail::AssertionConditionType< decltype(jsonString)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(jsonString))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("jsonString", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4274); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "jsonString" ")"); do { *((volatile int*)__null) = 4274; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
4275 | std::string_view jsonStringView(jsonString.get()); | |||
4276 | const size_t length = writer.ChunkedWriteFunc().Length(); | |||
4277 | MOZ_RELEASE_ASSERT(length == jsonStringView.length())do { static_assert( mozilla::detail::AssertionConditionType< decltype(length == jsonStringView.length())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(length == jsonStringView.length ()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("length == jsonStringView.length()", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4277); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "length == jsonStringView.length()" ")"); do { *((volatile int*)__null) = 4277; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
4278 | std::string expected = "{\"data\":["; | |||
4279 | expected += aExpectedData; | |||
4280 | expected += "],\"stringTable\":["; | |||
4281 | expected += aExpectedUniqueStrings; | |||
4282 | expected += "]}"; | |||
4283 | if (jsonStringView != expected) { | |||
4284 | fprintf(stderrstderr, | |||
4285 | "Expected:\n" | |||
4286 | "------\n"); | |||
4287 | printEscaped(expected); | |||
4288 | fprintf(stderrstderr, | |||
4289 | "\n" | |||
4290 | "------\n" | |||
4291 | "Actual:\n" | |||
4292 | "------\n"); | |||
4293 | printEscaped(jsonStringView); | |||
4294 | fprintf(stderrstderr, | |||
4295 | "\n" | |||
4296 | "------\n"); | |||
4297 | } | |||
4298 | MOZ_RELEASE_ASSERT(jsonStringView == expected)do { static_assert( mozilla::detail::AssertionConditionType< decltype(jsonStringView == expected)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(jsonStringView == expected)) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("jsonStringView == expected" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4298); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "jsonStringView == expected" ")"); do { *((volatile int*)__null) = 4298; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
4299 | } | |||
4300 | ||||
4301 | void TestUniqueJSONStrings() { | |||
4302 | printf("TestUniqueJSONStrings...\n"); | |||
4303 | ||||
4304 | using SCJW = mozilla::baseprofiler::SpliceableChunkedJSONWriter; | |||
4305 | using UJS = mozilla::baseprofiler::UniqueJSONStrings; | |||
4306 | ||||
4307 | // Empty everything. | |||
4308 | VerifyUniqueStringContents([](SCJW& aWriter, UJS& aUniqueStrings) {}, "", ""); | |||
4309 | ||||
4310 | // Empty unique strings. | |||
4311 | VerifyUniqueStringContents( | |||
4312 | [](SCJW& aWriter, UJS& aUniqueStrings) { | |||
4313 | aWriter.StringElement("string"); | |||
4314 | }, | |||
4315 | R"("string")", ""); | |||
4316 | ||||
4317 | // One unique string. | |||
4318 | VerifyUniqueStringContents( | |||
4319 | [](SCJW& aWriter, UJS& aUniqueStrings) { | |||
4320 | aUniqueStrings.WriteElement(aWriter, "string"); | |||
4321 | }, | |||
4322 | "0", R"("string")"); | |||
4323 | ||||
4324 | // One unique string twice. | |||
4325 | VerifyUniqueStringContents( | |||
4326 | [](SCJW& aWriter, UJS& aUniqueStrings) { | |||
4327 | aUniqueStrings.WriteElement(aWriter, "string"); | |||
4328 | aUniqueStrings.WriteElement(aWriter, "string"); | |||
4329 | }, | |||
4330 | "0,0", R"("string")"); | |||
4331 | ||||
4332 | // Two single unique strings. | |||
4333 | VerifyUniqueStringContents( | |||
4334 | [](SCJW& aWriter, UJS& aUniqueStrings) { | |||
4335 | aUniqueStrings.WriteElement(aWriter, "string0"); | |||
4336 | aUniqueStrings.WriteElement(aWriter, "string1"); | |||
4337 | }, | |||
4338 | "0,1", R"("string0","string1")"); | |||
4339 | ||||
4340 | // Two unique strings with repetition. | |||
4341 | VerifyUniqueStringContents( | |||
4342 | [](SCJW& aWriter, UJS& aUniqueStrings) { | |||
4343 | aUniqueStrings.WriteElement(aWriter, "string0"); | |||
4344 | aUniqueStrings.WriteElement(aWriter, "string1"); | |||
4345 | aUniqueStrings.WriteElement(aWriter, "string0"); | |||
4346 | }, | |||
4347 | "0,1,0", R"("string0","string1")"); | |||
4348 | ||||
4349 | // Mix some object properties, for coverage. | |||
4350 | VerifyUniqueStringContents( | |||
4351 | [](SCJW& aWriter, UJS& aUniqueStrings) { | |||
4352 | aUniqueStrings.WriteElement(aWriter, "string0"); | |||
4353 | aWriter.StartObjectElement(); | |||
4354 | { | |||
4355 | aUniqueStrings.WriteProperty(aWriter, "p0", "prop"); | |||
4356 | aUniqueStrings.WriteProperty(aWriter, "p1", "string0"); | |||
4357 | aUniqueStrings.WriteProperty(aWriter, "p2", "prop"); | |||
4358 | } | |||
4359 | aWriter.EndObject(); | |||
4360 | aUniqueStrings.WriteElement(aWriter, "string1"); | |||
4361 | aUniqueStrings.WriteElement(aWriter, "string0"); | |||
4362 | aUniqueStrings.WriteElement(aWriter, "prop"); | |||
4363 | }, | |||
4364 | R"(0,{"p0":1,"p1":0,"p2":1},2,0,1)", R"("string0","prop","string1")"); | |||
4365 | ||||
4366 | // Unique string table with pre-existing data. | |||
4367 | { | |||
4368 | UJS ujs{FailureLatchInfallibleSource::Singleton()}; | |||
4369 | { | |||
4370 | SCJW writer{FailureLatchInfallibleSource::Singleton()}; | |||
4371 | ujs.WriteElement(writer, "external0"); | |||
4372 | ujs.WriteElement(writer, "external1"); | |||
4373 | ujs.WriteElement(writer, "external0"); | |||
4374 | } | |||
4375 | VerifyUniqueStringContents( | |||
4376 | [](SCJW& aWriter, UJS& aUniqueStrings) { | |||
4377 | aUniqueStrings.WriteElement(aWriter, "string0"); | |||
4378 | aUniqueStrings.WriteElement(aWriter, "string1"); | |||
4379 | aUniqueStrings.WriteElement(aWriter, "string0"); | |||
4380 | }, | |||
4381 | "2,3,2", R"("external0","external1","string0","string1")", &ujs); | |||
4382 | } | |||
4383 | ||||
4384 | // Unique string table with pre-existing data from another table. | |||
4385 | { | |||
4386 | UJS ujs{FailureLatchInfallibleSource::Singleton()}; | |||
4387 | { | |||
4388 | SCJW writer{FailureLatchInfallibleSource::Singleton()}; | |||
4389 | ujs.WriteElement(writer, "external0"); | |||
4390 | ujs.WriteElement(writer, "external1"); | |||
4391 | ujs.WriteElement(writer, "external0"); | |||
4392 | } | |||
4393 | UJS ujsCopy(FailureLatchInfallibleSource::Singleton(), ujs, | |||
4394 | mozilla::ProgressLogger{}); | |||
4395 | VerifyUniqueStringContents( | |||
4396 | [](SCJW& aWriter, UJS& aUniqueStrings) { | |||
4397 | aUniqueStrings.WriteElement(aWriter, "string0"); | |||
4398 | aUniqueStrings.WriteElement(aWriter, "string1"); | |||
4399 | aUniqueStrings.WriteElement(aWriter, "string0"); | |||
4400 | }, | |||
4401 | "2,3,2", R"("external0","external1","string0","string1")", &ujs); | |||
4402 | } | |||
4403 | ||||
4404 | // Unique string table through SpliceableJSONWriter. | |||
4405 | VerifyUniqueStringContents( | |||
4406 | [](SCJW& aWriter, UJS& aUniqueStrings) { | |||
4407 | aWriter.SetUniqueStrings(aUniqueStrings); | |||
4408 | aWriter.UniqueStringElement("string0"); | |||
4409 | aWriter.StartObjectElement(); | |||
4410 | { | |||
4411 | aWriter.UniqueStringProperty("p0", "prop"); | |||
4412 | aWriter.UniqueStringProperty("p1", "string0"); | |||
4413 | aWriter.UniqueStringProperty("p2", "prop"); | |||
4414 | } | |||
4415 | aWriter.EndObject(); | |||
4416 | aWriter.UniqueStringElement("string1"); | |||
4417 | aWriter.UniqueStringElement("string0"); | |||
4418 | aWriter.UniqueStringElement("prop"); | |||
4419 | aWriter.ResetUniqueStrings(); | |||
4420 | }, | |||
4421 | R"(0,{"p0":1,"p1":0,"p2":1},2,0,1)", R"("string0","prop","string1")"); | |||
4422 | ||||
4423 | printf("TestUniqueJSONStrings done\n"); | |||
4424 | } | |||
4425 | ||||
4426 | void StreamMarkers(const mozilla::ProfileChunkedBuffer& aBuffer, | |||
4427 | mozilla::baseprofiler::SpliceableJSONWriter& aWriter) { | |||
4428 | aWriter.StartArrayProperty("data"); | |||
4429 | { | |||
4430 | aBuffer.ReadEach([&](mozilla::ProfileBufferEntryReader& aEntryReader) { | |||
4431 | mozilla::ProfileBufferEntryKind entryKind = | |||
4432 | aEntryReader.ReadObject<mozilla::ProfileBufferEntryKind>(); | |||
4433 | MOZ_RELEASE_ASSERT(entryKind == mozilla::ProfileBufferEntryKind::Marker)do { static_assert( mozilla::detail::AssertionConditionType< decltype(entryKind == mozilla::ProfileBufferEntryKind::Marker )>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(entryKind == mozilla::ProfileBufferEntryKind::Marker ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "entryKind == mozilla::ProfileBufferEntryKind::Marker", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4433); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "entryKind == mozilla::ProfileBufferEntryKind::Marker" ")"); do { *((volatile int*)__null) = 4433; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
4434 | ||||
4435 | mozilla::base_profiler_markers_detail::DeserializeAfterKindAndStream( | |||
4436 | aEntryReader, | |||
4437 | [&](const mozilla::baseprofiler::BaseProfilerThreadId&) { | |||
4438 | return &aWriter; | |||
4439 | }, | |||
4440 | [&](mozilla::ProfileChunkedBuffer&) { | |||
4441 | aWriter.StringElement("Real backtrace would be here"); | |||
4442 | }, | |||
4443 | [&](mozilla::base_profiler_markers_detail::Streaming:: | |||
4444 | DeserializerTag) {}); | |||
4445 | }); | |||
4446 | } | |||
4447 | aWriter.EndArray(); | |||
4448 | } | |||
4449 | ||||
4450 | void PrintMarkers(const mozilla::ProfileChunkedBuffer& aBuffer) { | |||
4451 | mozilla::baseprofiler::SpliceableJSONWriter writer( | |||
4452 | mozilla::MakeUnique<mozilla::baseprofiler::OStreamJSONWriteFunc>( | |||
4453 | std::cout), | |||
4454 | FailureLatchInfallibleSource::Singleton()); | |||
4455 | mozilla::baseprofiler::UniqueJSONStrings uniqueStrings{ | |||
4456 | FailureLatchInfallibleSource::Singleton()}; | |||
4457 | writer.SetUniqueStrings(uniqueStrings); | |||
4458 | writer.Start(); | |||
4459 | { | |||
4460 | StreamMarkers(aBuffer, writer); | |||
4461 | ||||
4462 | writer.StartArrayProperty("stringTable"); | |||
4463 | { uniqueStrings.SpliceStringTableElements(writer); } | |||
4464 | writer.EndArray(); | |||
4465 | } | |||
4466 | writer.End(); | |||
4467 | writer.ResetUniqueStrings(); | |||
4468 | } | |||
4469 | ||||
4470 | static void SubTestMarkerCategory( | |||
4471 | const mozilla::MarkerCategory& aMarkerCategory, | |||
4472 | const mozilla::baseprofiler::ProfilingCategoryPair& aProfilingCategoryPair, | |||
4473 | const mozilla::baseprofiler::ProfilingCategory& aProfilingCategory) { | |||
4474 | MOZ_RELEASE_ASSERT(aMarkerCategory.CategoryPair() == aProfilingCategoryPair,do { static_assert( mozilla::detail::AssertionConditionType< decltype(aMarkerCategory.CategoryPair() == aProfilingCategoryPair )>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(aMarkerCategory.CategoryPair() == aProfilingCategoryPair ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "aMarkerCategory.CategoryPair() == aProfilingCategoryPair" " (" "Unexpected MarkerCategory::CategoryPair()" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4475); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "aMarkerCategory.CategoryPair() == aProfilingCategoryPair" ") (" "Unexpected MarkerCategory::CategoryPair()" ")"); do { *((volatile int*)__null) = 4475; __attribute__((nomerge)) :: abort(); } while (false); } } while (false) | |||
4475 | "Unexpected MarkerCategory::CategoryPair()")do { static_assert( mozilla::detail::AssertionConditionType< decltype(aMarkerCategory.CategoryPair() == aProfilingCategoryPair )>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(aMarkerCategory.CategoryPair() == aProfilingCategoryPair ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "aMarkerCategory.CategoryPair() == aProfilingCategoryPair" " (" "Unexpected MarkerCategory::CategoryPair()" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4475); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "aMarkerCategory.CategoryPair() == aProfilingCategoryPair" ") (" "Unexpected MarkerCategory::CategoryPair()" ")"); do { *((volatile int*)__null) = 4475; __attribute__((nomerge)) :: abort(); } while (false); } } while (false); | |||
4476 | ||||
4477 | MOZ_RELEASE_ASSERT(do { static_assert( mozilla::detail::AssertionConditionType< decltype(mozilla::MarkerCategory(aProfilingCategoryPair).CategoryPair () == aProfilingCategoryPair)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(mozilla::MarkerCategory(aProfilingCategoryPair ).CategoryPair() == aProfilingCategoryPair))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("mozilla::MarkerCategory(aProfilingCategoryPair).CategoryPair() == aProfilingCategoryPair" " (" "MarkerCategory(<name>).CategoryPair() should return <name>" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4480); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::MarkerCategory(aProfilingCategoryPair).CategoryPair() == aProfilingCategoryPair" ") (" "MarkerCategory(<name>).CategoryPair() should return <name>" ")"); do { *((volatile int*)__null) = 4480; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4478 | mozilla::MarkerCategory(aProfilingCategoryPair).CategoryPair() ==do { static_assert( mozilla::detail::AssertionConditionType< decltype(mozilla::MarkerCategory(aProfilingCategoryPair).CategoryPair () == aProfilingCategoryPair)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(mozilla::MarkerCategory(aProfilingCategoryPair ).CategoryPair() == aProfilingCategoryPair))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("mozilla::MarkerCategory(aProfilingCategoryPair).CategoryPair() == aProfilingCategoryPair" " (" "MarkerCategory(<name>).CategoryPair() should return <name>" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4480); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::MarkerCategory(aProfilingCategoryPair).CategoryPair() == aProfilingCategoryPair" ") (" "MarkerCategory(<name>).CategoryPair() should return <name>" ")"); do { *((volatile int*)__null) = 4480; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4479 | aProfilingCategoryPair,do { static_assert( mozilla::detail::AssertionConditionType< decltype(mozilla::MarkerCategory(aProfilingCategoryPair).CategoryPair () == aProfilingCategoryPair)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(mozilla::MarkerCategory(aProfilingCategoryPair ).CategoryPair() == aProfilingCategoryPair))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("mozilla::MarkerCategory(aProfilingCategoryPair).CategoryPair() == aProfilingCategoryPair" " (" "MarkerCategory(<name>).CategoryPair() should return <name>" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4480); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::MarkerCategory(aProfilingCategoryPair).CategoryPair() == aProfilingCategoryPair" ") (" "MarkerCategory(<name>).CategoryPair() should return <name>" ")"); do { *((volatile int*)__null) = 4480; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4480 | "MarkerCategory(<name>).CategoryPair() should return <name>")do { static_assert( mozilla::detail::AssertionConditionType< decltype(mozilla::MarkerCategory(aProfilingCategoryPair).CategoryPair () == aProfilingCategoryPair)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(mozilla::MarkerCategory(aProfilingCategoryPair ).CategoryPair() == aProfilingCategoryPair))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("mozilla::MarkerCategory(aProfilingCategoryPair).CategoryPair() == aProfilingCategoryPair" " (" "MarkerCategory(<name>).CategoryPair() should return <name>" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4480); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::MarkerCategory(aProfilingCategoryPair).CategoryPair() == aProfilingCategoryPair" ") (" "MarkerCategory(<name>).CategoryPair() should return <name>" ")"); do { *((volatile int*)__null) = 4480; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
4481 | ||||
4482 | MOZ_RELEASE_ASSERT(aMarkerCategory.GetCategory() == aProfilingCategory,do { static_assert( mozilla::detail::AssertionConditionType< decltype(aMarkerCategory.GetCategory() == aProfilingCategory) >::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(aMarkerCategory.GetCategory() == aProfilingCategory) )), 0))) { do { } while (false); MOZ_ReportAssertionFailure("aMarkerCategory.GetCategory() == aProfilingCategory" " (" "Unexpected MarkerCategory::GetCategory()" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4483); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "aMarkerCategory.GetCategory() == aProfilingCategory" ") (" "Unexpected MarkerCategory::GetCategory()" ")"); do { * ((volatile int*)__null) = 4483; __attribute__((nomerge)) ::abort (); } while (false); } } while (false) | |||
4483 | "Unexpected MarkerCategory::GetCategory()")do { static_assert( mozilla::detail::AssertionConditionType< decltype(aMarkerCategory.GetCategory() == aProfilingCategory) >::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(aMarkerCategory.GetCategory() == aProfilingCategory) )), 0))) { do { } while (false); MOZ_ReportAssertionFailure("aMarkerCategory.GetCategory() == aProfilingCategory" " (" "Unexpected MarkerCategory::GetCategory()" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4483); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "aMarkerCategory.GetCategory() == aProfilingCategory" ") (" "Unexpected MarkerCategory::GetCategory()" ")"); do { * ((volatile int*)__null) = 4483; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); | |||
4484 | ||||
4485 | mozilla::ProfileBufferChunkManagerSingle chunkManager(512); | |||
4486 | mozilla::ProfileChunkedBuffer buffer( | |||
4487 | mozilla::ProfileChunkedBuffer::ThreadSafety::WithoutMutex, chunkManager); | |||
4488 | mozilla::ProfileBufferBlockIndex i = buffer.PutObject(aMarkerCategory); | |||
4489 | MOZ_RELEASE_ASSERT(i != mozilla::ProfileBufferBlockIndex{},do { static_assert( mozilla::detail::AssertionConditionType< decltype(i != mozilla::ProfileBufferBlockIndex{})>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(i != mozilla::ProfileBufferBlockIndex{}))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("i != mozilla::ProfileBufferBlockIndex{}" " (" "Failed serialization" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4490); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "i != mozilla::ProfileBufferBlockIndex{}" ") (" "Failed serialization" ")"); do { *((volatile int*)__null ) = 4490; __attribute__((nomerge)) ::abort(); } while (false) ; } } while (false) | |||
4490 | "Failed serialization")do { static_assert( mozilla::detail::AssertionConditionType< decltype(i != mozilla::ProfileBufferBlockIndex{})>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(i != mozilla::ProfileBufferBlockIndex{}))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("i != mozilla::ProfileBufferBlockIndex{}" " (" "Failed serialization" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4490); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "i != mozilla::ProfileBufferBlockIndex{}" ") (" "Failed serialization" ")"); do { *((volatile int*)__null ) = 4490; __attribute__((nomerge)) ::abort(); } while (false) ; } } while (false); | |||
4491 | buffer.ReadEach([&](mozilla::ProfileBufferEntryReader& aER, | |||
4492 | mozilla::ProfileBufferBlockIndex aIndex) { | |||
4493 | MOZ_RELEASE_ASSERT(aIndex == i, "Unexpected deserialization index")do { static_assert( mozilla::detail::AssertionConditionType< decltype(aIndex == i)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(aIndex == i))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("aIndex == i" " (" "Unexpected deserialization index" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4493); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "aIndex == i" ") (" "Unexpected deserialization index" ")"); do { *((volatile int*)__null) = 4493; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | |||
4494 | const auto readCategory = aER.ReadObject<mozilla::MarkerCategory>(); | |||
4495 | MOZ_RELEASE_ASSERT(aER.RemainingBytes() == 0,do { static_assert( mozilla::detail::AssertionConditionType< decltype(aER.RemainingBytes() == 0)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(aER.RemainingBytes() == 0))) , 0))) { do { } while (false); MOZ_ReportAssertionFailure("aER.RemainingBytes() == 0" " (" "Unexpected extra serialized bytes" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4496); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "aER.RemainingBytes() == 0" ") (" "Unexpected extra serialized bytes" ")"); do { *((volatile int*)__null) = 4496; __attribute__((nomerge)) ::abort(); } while (false); } } while (false) | |||
4496 | "Unexpected extra serialized bytes")do { static_assert( mozilla::detail::AssertionConditionType< decltype(aER.RemainingBytes() == 0)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(aER.RemainingBytes() == 0))) , 0))) { do { } while (false); MOZ_ReportAssertionFailure("aER.RemainingBytes() == 0" " (" "Unexpected extra serialized bytes" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4496); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "aER.RemainingBytes() == 0" ") (" "Unexpected extra serialized bytes" ")"); do { *((volatile int*)__null) = 4496; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | |||
4497 | MOZ_RELEASE_ASSERT(readCategory.CategoryPair() == aProfilingCategoryPair,do { static_assert( mozilla::detail::AssertionConditionType< decltype(readCategory.CategoryPair() == aProfilingCategoryPair )>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(readCategory.CategoryPair() == aProfilingCategoryPair ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "readCategory.CategoryPair() == aProfilingCategoryPair" " (" "Incorrect deserialization value" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4498); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "readCategory.CategoryPair() == aProfilingCategoryPair" ") (" "Incorrect deserialization value" ")"); do { *((volatile int*)__null) = 4498; __attribute__((nomerge)) ::abort(); } while (false); } } while (false) | |||
4498 | "Incorrect deserialization value")do { static_assert( mozilla::detail::AssertionConditionType< decltype(readCategory.CategoryPair() == aProfilingCategoryPair )>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(readCategory.CategoryPair() == aProfilingCategoryPair ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "readCategory.CategoryPair() == aProfilingCategoryPair" " (" "Incorrect deserialization value" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4498); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "readCategory.CategoryPair() == aProfilingCategoryPair" ") (" "Incorrect deserialization value" ")"); do { *((volatile int*)__null) = 4498; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); | |||
4499 | }); | |||
4500 | } | |||
4501 | ||||
4502 | void TestMarkerCategory() { | |||
4503 | printf("TestMarkerCategory...\n"); | |||
4504 | ||||
4505 | mozilla::ProfileBufferChunkManagerSingle chunkManager(512); | |||
4506 | mozilla::ProfileChunkedBuffer buffer( | |||
4507 | mozilla::ProfileChunkedBuffer::ThreadSafety::WithoutMutex, chunkManager); | |||
4508 | ||||
4509 | # define CATEGORY_ENUM_BEGIN_CATEGORY(name, labelAsString, color) | |||
4510 | # define CATEGORY_ENUM_SUBCATEGORY(supercategory, name, labelAsString) \ | |||
4511 | static_assert( \ | |||
4512 | std::is_same_v<decltype(mozilla::baseprofiler::category::name), \ | |||
4513 | const mozilla::MarkerCategory>, \ | |||
4514 | "baseprofiler::category::<name> should be a const MarkerCategory"); \ | |||
4515 | \ | |||
4516 | SubTestMarkerCategory( \ | |||
4517 | mozilla::baseprofiler::category::name, \ | |||
4518 | mozilla::baseprofiler::ProfilingCategoryPair::name, \ | |||
4519 | mozilla::baseprofiler::ProfilingCategory::supercategory); | |||
4520 | # define CATEGORY_ENUM_END_CATEGORY | |||
4521 | MOZ_PROFILING_CATEGORY_LIST(CATEGORY_ENUM_BEGIN_CATEGORY,CATEGORY_ENUM_BEGIN_CATEGORY(IDLE, "Idle", "transparent") CATEGORY_ENUM_SUBCATEGORY (IDLE, IDLE, "Other") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY (OTHER, "Other", "grey") CATEGORY_ENUM_SUBCATEGORY(OTHER, OTHER , "Other") CATEGORY_ENUM_SUBCATEGORY(OTHER, OTHER_PreferenceRead , "Preference Read") CATEGORY_ENUM_SUBCATEGORY(OTHER, OTHER_Profiling , "Profiling") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY (TEST, "Test", "darkgray") CATEGORY_ENUM_SUBCATEGORY(TEST, TEST , "Test") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY (LAYOUT, "Layout", "purple") CATEGORY_ENUM_SUBCATEGORY(LAYOUT , LAYOUT, "Other") CATEGORY_ENUM_SUBCATEGORY(LAYOUT, LAYOUT_FrameConstruction , "Frame construction") CATEGORY_ENUM_SUBCATEGORY(LAYOUT, LAYOUT_Reflow , "Reflow") CATEGORY_ENUM_SUBCATEGORY(LAYOUT, LAYOUT_CSSParsing , "CSS parsing") CATEGORY_ENUM_SUBCATEGORY(LAYOUT, LAYOUT_SelectorQuery , "Selector query") CATEGORY_ENUM_SUBCATEGORY(LAYOUT, LAYOUT_StyleComputation , "Style computation") CATEGORY_ENUM_SUBCATEGORY(LAYOUT, LAYOUT_Destroy , "Layout cleanup") CATEGORY_ENUM_SUBCATEGORY(LAYOUT, LAYOUT_Printing , "Printing") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY (JS, "JavaScript", "yellow") CATEGORY_ENUM_SUBCATEGORY(JS, JS , "Other") CATEGORY_ENUM_SUBCATEGORY(JS, JS_Parsing, "Parsing" ) CATEGORY_ENUM_SUBCATEGORY(JS, JS_BaselineCompilation, "JIT Compile (baseline)" ) CATEGORY_ENUM_SUBCATEGORY(JS, JS_IonCompilation, "JIT Compile (ion)" ) CATEGORY_ENUM_SUBCATEGORY(JS, JS_Interpreter, "Interpreter" ) CATEGORY_ENUM_SUBCATEGORY(JS, JS_BaselineInterpret, "JIT (baseline-interpreter)" ) CATEGORY_ENUM_SUBCATEGORY(JS, JS_Baseline, "JIT (baseline)" ) CATEGORY_ENUM_SUBCATEGORY(JS, JS_IonMonkey, "JIT (ion)") CATEGORY_ENUM_SUBCATEGORY (JS, JS_Builtin, "Builtin API") CATEGORY_ENUM_SUBCATEGORY(JS, JS_WasmIon, "Wasm (ion)") CATEGORY_ENUM_SUBCATEGORY(JS, JS_WasmBaseline , "Wasm (baseline)") CATEGORY_ENUM_SUBCATEGORY(JS, JS_WasmOther , "Wasm (other)") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY (GCCC, "GC / CC", "orange") CATEGORY_ENUM_SUBCATEGORY(GCCC, GCCC , "Other") CATEGORY_ENUM_SUBCATEGORY(GCCC, GCCC_MinorGC, "Minor GC" ) CATEGORY_ENUM_SUBCATEGORY(GCCC, GCCC_MajorGC, "Major GC (Other)" ) CATEGORY_ENUM_SUBCATEGORY(GCCC, GCCC_MajorGC_Mark, "Major GC (Mark)" ) CATEGORY_ENUM_SUBCATEGORY(GCCC, GCCC_MajorGC_Sweep, "Major GC (Sweep)" ) CATEGORY_ENUM_SUBCATEGORY(GCCC, GCCC_MajorGC_Compact, "Major GC (Compact)" ) CATEGORY_ENUM_SUBCATEGORY(GCCC, GCCC_UnmarkGray, "Unmark Gray" ) CATEGORY_ENUM_SUBCATEGORY(GCCC, GCCC_Barrier, "Barrier") CATEGORY_ENUM_SUBCATEGORY (GCCC, GCCC_FreeSnowWhite, "CC (Free Snow White)") CATEGORY_ENUM_SUBCATEGORY (GCCC, GCCC_BuildGraph, "CC (Build Graph)") CATEGORY_ENUM_SUBCATEGORY (GCCC, GCCC_ScanRoots, "CC (Scan Roots)") CATEGORY_ENUM_SUBCATEGORY (GCCC, GCCC_CollectWhite, "CC (Collect White)") CATEGORY_ENUM_SUBCATEGORY (GCCC, GCCC_Finalize, "CC (Finalize)") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY(NETWORK, "Network", "lightblue" ) CATEGORY_ENUM_SUBCATEGORY(NETWORK, NETWORK, "Other") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY(GRAPHICS, "Graphics", "green") CATEGORY_ENUM_SUBCATEGORY (GRAPHICS, GRAPHICS, "Other") CATEGORY_ENUM_SUBCATEGORY(GRAPHICS , GRAPHICS_DisplayListBuilding, "DisplayList building") CATEGORY_ENUM_SUBCATEGORY (GRAPHICS, GRAPHICS_DisplayListMerging, "DisplayList merging" ) CATEGORY_ENUM_SUBCATEGORY(GRAPHICS, GRAPHICS_LayerBuilding, "Layer building") CATEGORY_ENUM_SUBCATEGORY(GRAPHICS, GRAPHICS_TileAllocation , "Tile allocation") CATEGORY_ENUM_SUBCATEGORY(GRAPHICS, GRAPHICS_WRDisplayList , "WebRender display list") CATEGORY_ENUM_SUBCATEGORY(GRAPHICS , GRAPHICS_Rasterization, "Rasterization") CATEGORY_ENUM_SUBCATEGORY (GRAPHICS, GRAPHICS_FlushingAsyncPaints, "Flushing async paints" ) CATEGORY_ENUM_SUBCATEGORY(GRAPHICS, GRAPHICS_ImageDecoding, "Image decoding") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY (DOM, "DOM", "blue") CATEGORY_ENUM_SUBCATEGORY(DOM, DOM, "Other" ) CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY(JAVA_ANDROID , "Android", "yellow") CATEGORY_ENUM_SUBCATEGORY(JAVA_ANDROID , JAVA_ANDROID, "Other") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY (JAVA_ANDROIDX, "AndroidX", "orange") CATEGORY_ENUM_SUBCATEGORY (JAVA_ANDROIDX, JAVA_ANDROIDX, "Other") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY(JAVA_LANGUAGE, "Java", "blue") CATEGORY_ENUM_SUBCATEGORY (JAVA_LANGUAGE, JAVA_LANGUAGE, "Other") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY(JAVA_MOZILLA, "Mozilla", "green" ) CATEGORY_ENUM_SUBCATEGORY(JAVA_MOZILLA, JAVA_MOZILLA, "Other" ) CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY(JAVA_KOTLIN , "Kotlin", "purple") CATEGORY_ENUM_SUBCATEGORY(JAVA_KOTLIN, JAVA_KOTLIN , "Other") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY (JAVA_BLOCKED, "Blocked", "lightblue") CATEGORY_ENUM_SUBCATEGORY (JAVA_BLOCKED, JAVA_BLOCKED, "Other") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY(IPC, "IPC", "lightgreen") CATEGORY_ENUM_SUBCATEGORY (IPC, IPC, "Other") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY (MEDIA, "Media", "orange") CATEGORY_ENUM_SUBCATEGORY(MEDIA, MEDIA , "Other") CATEGORY_ENUM_SUBCATEGORY(MEDIA, MEDIA_CUBEB, "Cubeb" ) CATEGORY_ENUM_SUBCATEGORY(MEDIA, MEDIA_PLAYBACK, "Playback" ) CATEGORY_ENUM_SUBCATEGORY(MEDIA, MEDIA_RT, "Real-time rendering" ) CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY(A11Y , "Accessibility", "brown") CATEGORY_ENUM_SUBCATEGORY(A11Y, A11Y , "Other") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY (PROFILER, "Profiler", "lightred") CATEGORY_ENUM_SUBCATEGORY( PROFILER, PROFILER, "Other") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY (TIMER, "Timer", "grey") CATEGORY_ENUM_SUBCATEGORY(TIMER, TIMER , "Other") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY (REMOTE_PROTOCOL, "Remote-Protocol", "grey") CATEGORY_ENUM_SUBCATEGORY (REMOTE_PROTOCOL, REMOTE_PROTOCOL, "Other") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY(SANDBOX, "Sandbox", "grey") CATEGORY_ENUM_SUBCATEGORY (SANDBOX, SANDBOX, "Other") CATEGORY_ENUM_END_CATEGORY | |||
4522 | CATEGORY_ENUM_SUBCATEGORY,CATEGORY_ENUM_BEGIN_CATEGORY(IDLE, "Idle", "transparent") CATEGORY_ENUM_SUBCATEGORY (IDLE, IDLE, "Other") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY (OTHER, "Other", "grey") CATEGORY_ENUM_SUBCATEGORY(OTHER, OTHER , "Other") CATEGORY_ENUM_SUBCATEGORY(OTHER, OTHER_PreferenceRead , "Preference Read") CATEGORY_ENUM_SUBCATEGORY(OTHER, OTHER_Profiling , "Profiling") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY (TEST, "Test", "darkgray") CATEGORY_ENUM_SUBCATEGORY(TEST, TEST , "Test") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY (LAYOUT, "Layout", "purple") CATEGORY_ENUM_SUBCATEGORY(LAYOUT , LAYOUT, "Other") CATEGORY_ENUM_SUBCATEGORY(LAYOUT, LAYOUT_FrameConstruction , "Frame construction") CATEGORY_ENUM_SUBCATEGORY(LAYOUT, LAYOUT_Reflow , "Reflow") CATEGORY_ENUM_SUBCATEGORY(LAYOUT, LAYOUT_CSSParsing , "CSS parsing") CATEGORY_ENUM_SUBCATEGORY(LAYOUT, LAYOUT_SelectorQuery , "Selector query") CATEGORY_ENUM_SUBCATEGORY(LAYOUT, LAYOUT_StyleComputation , "Style computation") CATEGORY_ENUM_SUBCATEGORY(LAYOUT, LAYOUT_Destroy , "Layout cleanup") CATEGORY_ENUM_SUBCATEGORY(LAYOUT, LAYOUT_Printing , "Printing") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY (JS, "JavaScript", "yellow") CATEGORY_ENUM_SUBCATEGORY(JS, JS , "Other") CATEGORY_ENUM_SUBCATEGORY(JS, JS_Parsing, "Parsing" ) CATEGORY_ENUM_SUBCATEGORY(JS, JS_BaselineCompilation, "JIT Compile (baseline)" ) CATEGORY_ENUM_SUBCATEGORY(JS, JS_IonCompilation, "JIT Compile (ion)" ) CATEGORY_ENUM_SUBCATEGORY(JS, JS_Interpreter, "Interpreter" ) CATEGORY_ENUM_SUBCATEGORY(JS, JS_BaselineInterpret, "JIT (baseline-interpreter)" ) CATEGORY_ENUM_SUBCATEGORY(JS, JS_Baseline, "JIT (baseline)" ) CATEGORY_ENUM_SUBCATEGORY(JS, JS_IonMonkey, "JIT (ion)") CATEGORY_ENUM_SUBCATEGORY (JS, JS_Builtin, "Builtin API") CATEGORY_ENUM_SUBCATEGORY(JS, JS_WasmIon, "Wasm (ion)") CATEGORY_ENUM_SUBCATEGORY(JS, JS_WasmBaseline , "Wasm (baseline)") CATEGORY_ENUM_SUBCATEGORY(JS, JS_WasmOther , "Wasm (other)") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY (GCCC, "GC / CC", "orange") CATEGORY_ENUM_SUBCATEGORY(GCCC, GCCC , "Other") CATEGORY_ENUM_SUBCATEGORY(GCCC, GCCC_MinorGC, "Minor GC" ) CATEGORY_ENUM_SUBCATEGORY(GCCC, GCCC_MajorGC, "Major GC (Other)" ) CATEGORY_ENUM_SUBCATEGORY(GCCC, GCCC_MajorGC_Mark, "Major GC (Mark)" ) CATEGORY_ENUM_SUBCATEGORY(GCCC, GCCC_MajorGC_Sweep, "Major GC (Sweep)" ) CATEGORY_ENUM_SUBCATEGORY(GCCC, GCCC_MajorGC_Compact, "Major GC (Compact)" ) CATEGORY_ENUM_SUBCATEGORY(GCCC, GCCC_UnmarkGray, "Unmark Gray" ) CATEGORY_ENUM_SUBCATEGORY(GCCC, GCCC_Barrier, "Barrier") CATEGORY_ENUM_SUBCATEGORY (GCCC, GCCC_FreeSnowWhite, "CC (Free Snow White)") CATEGORY_ENUM_SUBCATEGORY (GCCC, GCCC_BuildGraph, "CC (Build Graph)") CATEGORY_ENUM_SUBCATEGORY (GCCC, GCCC_ScanRoots, "CC (Scan Roots)") CATEGORY_ENUM_SUBCATEGORY (GCCC, GCCC_CollectWhite, "CC (Collect White)") CATEGORY_ENUM_SUBCATEGORY (GCCC, GCCC_Finalize, "CC (Finalize)") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY(NETWORK, "Network", "lightblue" ) CATEGORY_ENUM_SUBCATEGORY(NETWORK, NETWORK, "Other") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY(GRAPHICS, "Graphics", "green") CATEGORY_ENUM_SUBCATEGORY (GRAPHICS, GRAPHICS, "Other") CATEGORY_ENUM_SUBCATEGORY(GRAPHICS , GRAPHICS_DisplayListBuilding, "DisplayList building") CATEGORY_ENUM_SUBCATEGORY (GRAPHICS, GRAPHICS_DisplayListMerging, "DisplayList merging" ) CATEGORY_ENUM_SUBCATEGORY(GRAPHICS, GRAPHICS_LayerBuilding, "Layer building") CATEGORY_ENUM_SUBCATEGORY(GRAPHICS, GRAPHICS_TileAllocation , "Tile allocation") CATEGORY_ENUM_SUBCATEGORY(GRAPHICS, GRAPHICS_WRDisplayList , "WebRender display list") CATEGORY_ENUM_SUBCATEGORY(GRAPHICS , GRAPHICS_Rasterization, "Rasterization") CATEGORY_ENUM_SUBCATEGORY (GRAPHICS, GRAPHICS_FlushingAsyncPaints, "Flushing async paints" ) CATEGORY_ENUM_SUBCATEGORY(GRAPHICS, GRAPHICS_ImageDecoding, "Image decoding") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY (DOM, "DOM", "blue") CATEGORY_ENUM_SUBCATEGORY(DOM, DOM, "Other" ) CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY(JAVA_ANDROID , "Android", "yellow") CATEGORY_ENUM_SUBCATEGORY(JAVA_ANDROID , JAVA_ANDROID, "Other") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY (JAVA_ANDROIDX, "AndroidX", "orange") CATEGORY_ENUM_SUBCATEGORY (JAVA_ANDROIDX, JAVA_ANDROIDX, "Other") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY(JAVA_LANGUAGE, "Java", "blue") CATEGORY_ENUM_SUBCATEGORY (JAVA_LANGUAGE, JAVA_LANGUAGE, "Other") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY(JAVA_MOZILLA, "Mozilla", "green" ) CATEGORY_ENUM_SUBCATEGORY(JAVA_MOZILLA, JAVA_MOZILLA, "Other" ) CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY(JAVA_KOTLIN , "Kotlin", "purple") CATEGORY_ENUM_SUBCATEGORY(JAVA_KOTLIN, JAVA_KOTLIN , "Other") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY (JAVA_BLOCKED, "Blocked", "lightblue") CATEGORY_ENUM_SUBCATEGORY (JAVA_BLOCKED, JAVA_BLOCKED, "Other") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY(IPC, "IPC", "lightgreen") CATEGORY_ENUM_SUBCATEGORY (IPC, IPC, "Other") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY (MEDIA, "Media", "orange") CATEGORY_ENUM_SUBCATEGORY(MEDIA, MEDIA , "Other") CATEGORY_ENUM_SUBCATEGORY(MEDIA, MEDIA_CUBEB, "Cubeb" ) CATEGORY_ENUM_SUBCATEGORY(MEDIA, MEDIA_PLAYBACK, "Playback" ) CATEGORY_ENUM_SUBCATEGORY(MEDIA, MEDIA_RT, "Real-time rendering" ) CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY(A11Y , "Accessibility", "brown") CATEGORY_ENUM_SUBCATEGORY(A11Y, A11Y , "Other") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY (PROFILER, "Profiler", "lightred") CATEGORY_ENUM_SUBCATEGORY( PROFILER, PROFILER, "Other") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY (TIMER, "Timer", "grey") CATEGORY_ENUM_SUBCATEGORY(TIMER, TIMER , "Other") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY (REMOTE_PROTOCOL, "Remote-Protocol", "grey") CATEGORY_ENUM_SUBCATEGORY (REMOTE_PROTOCOL, REMOTE_PROTOCOL, "Other") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY(SANDBOX, "Sandbox", "grey") CATEGORY_ENUM_SUBCATEGORY (SANDBOX, SANDBOX, "Other") CATEGORY_ENUM_END_CATEGORY | |||
4523 | CATEGORY_ENUM_END_CATEGORY)CATEGORY_ENUM_BEGIN_CATEGORY(IDLE, "Idle", "transparent") CATEGORY_ENUM_SUBCATEGORY (IDLE, IDLE, "Other") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY (OTHER, "Other", "grey") CATEGORY_ENUM_SUBCATEGORY(OTHER, OTHER , "Other") CATEGORY_ENUM_SUBCATEGORY(OTHER, OTHER_PreferenceRead , "Preference Read") CATEGORY_ENUM_SUBCATEGORY(OTHER, OTHER_Profiling , "Profiling") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY (TEST, "Test", "darkgray") CATEGORY_ENUM_SUBCATEGORY(TEST, TEST , "Test") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY (LAYOUT, "Layout", "purple") CATEGORY_ENUM_SUBCATEGORY(LAYOUT , LAYOUT, "Other") CATEGORY_ENUM_SUBCATEGORY(LAYOUT, LAYOUT_FrameConstruction , "Frame construction") CATEGORY_ENUM_SUBCATEGORY(LAYOUT, LAYOUT_Reflow , "Reflow") CATEGORY_ENUM_SUBCATEGORY(LAYOUT, LAYOUT_CSSParsing , "CSS parsing") CATEGORY_ENUM_SUBCATEGORY(LAYOUT, LAYOUT_SelectorQuery , "Selector query") CATEGORY_ENUM_SUBCATEGORY(LAYOUT, LAYOUT_StyleComputation , "Style computation") CATEGORY_ENUM_SUBCATEGORY(LAYOUT, LAYOUT_Destroy , "Layout cleanup") CATEGORY_ENUM_SUBCATEGORY(LAYOUT, LAYOUT_Printing , "Printing") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY (JS, "JavaScript", "yellow") CATEGORY_ENUM_SUBCATEGORY(JS, JS , "Other") CATEGORY_ENUM_SUBCATEGORY(JS, JS_Parsing, "Parsing" ) CATEGORY_ENUM_SUBCATEGORY(JS, JS_BaselineCompilation, "JIT Compile (baseline)" ) CATEGORY_ENUM_SUBCATEGORY(JS, JS_IonCompilation, "JIT Compile (ion)" ) CATEGORY_ENUM_SUBCATEGORY(JS, JS_Interpreter, "Interpreter" ) CATEGORY_ENUM_SUBCATEGORY(JS, JS_BaselineInterpret, "JIT (baseline-interpreter)" ) CATEGORY_ENUM_SUBCATEGORY(JS, JS_Baseline, "JIT (baseline)" ) CATEGORY_ENUM_SUBCATEGORY(JS, JS_IonMonkey, "JIT (ion)") CATEGORY_ENUM_SUBCATEGORY (JS, JS_Builtin, "Builtin API") CATEGORY_ENUM_SUBCATEGORY(JS, JS_WasmIon, "Wasm (ion)") CATEGORY_ENUM_SUBCATEGORY(JS, JS_WasmBaseline , "Wasm (baseline)") CATEGORY_ENUM_SUBCATEGORY(JS, JS_WasmOther , "Wasm (other)") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY (GCCC, "GC / CC", "orange") CATEGORY_ENUM_SUBCATEGORY(GCCC, GCCC , "Other") CATEGORY_ENUM_SUBCATEGORY(GCCC, GCCC_MinorGC, "Minor GC" ) CATEGORY_ENUM_SUBCATEGORY(GCCC, GCCC_MajorGC, "Major GC (Other)" ) CATEGORY_ENUM_SUBCATEGORY(GCCC, GCCC_MajorGC_Mark, "Major GC (Mark)" ) CATEGORY_ENUM_SUBCATEGORY(GCCC, GCCC_MajorGC_Sweep, "Major GC (Sweep)" ) CATEGORY_ENUM_SUBCATEGORY(GCCC, GCCC_MajorGC_Compact, "Major GC (Compact)" ) CATEGORY_ENUM_SUBCATEGORY(GCCC, GCCC_UnmarkGray, "Unmark Gray" ) CATEGORY_ENUM_SUBCATEGORY(GCCC, GCCC_Barrier, "Barrier") CATEGORY_ENUM_SUBCATEGORY (GCCC, GCCC_FreeSnowWhite, "CC (Free Snow White)") CATEGORY_ENUM_SUBCATEGORY (GCCC, GCCC_BuildGraph, "CC (Build Graph)") CATEGORY_ENUM_SUBCATEGORY (GCCC, GCCC_ScanRoots, "CC (Scan Roots)") CATEGORY_ENUM_SUBCATEGORY (GCCC, GCCC_CollectWhite, "CC (Collect White)") CATEGORY_ENUM_SUBCATEGORY (GCCC, GCCC_Finalize, "CC (Finalize)") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY(NETWORK, "Network", "lightblue" ) CATEGORY_ENUM_SUBCATEGORY(NETWORK, NETWORK, "Other") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY(GRAPHICS, "Graphics", "green") CATEGORY_ENUM_SUBCATEGORY (GRAPHICS, GRAPHICS, "Other") CATEGORY_ENUM_SUBCATEGORY(GRAPHICS , GRAPHICS_DisplayListBuilding, "DisplayList building") CATEGORY_ENUM_SUBCATEGORY (GRAPHICS, GRAPHICS_DisplayListMerging, "DisplayList merging" ) CATEGORY_ENUM_SUBCATEGORY(GRAPHICS, GRAPHICS_LayerBuilding, "Layer building") CATEGORY_ENUM_SUBCATEGORY(GRAPHICS, GRAPHICS_TileAllocation , "Tile allocation") CATEGORY_ENUM_SUBCATEGORY(GRAPHICS, GRAPHICS_WRDisplayList , "WebRender display list") CATEGORY_ENUM_SUBCATEGORY(GRAPHICS , GRAPHICS_Rasterization, "Rasterization") CATEGORY_ENUM_SUBCATEGORY (GRAPHICS, GRAPHICS_FlushingAsyncPaints, "Flushing async paints" ) CATEGORY_ENUM_SUBCATEGORY(GRAPHICS, GRAPHICS_ImageDecoding, "Image decoding") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY (DOM, "DOM", "blue") CATEGORY_ENUM_SUBCATEGORY(DOM, DOM, "Other" ) CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY(JAVA_ANDROID , "Android", "yellow") CATEGORY_ENUM_SUBCATEGORY(JAVA_ANDROID , JAVA_ANDROID, "Other") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY (JAVA_ANDROIDX, "AndroidX", "orange") CATEGORY_ENUM_SUBCATEGORY (JAVA_ANDROIDX, JAVA_ANDROIDX, "Other") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY(JAVA_LANGUAGE, "Java", "blue") CATEGORY_ENUM_SUBCATEGORY (JAVA_LANGUAGE, JAVA_LANGUAGE, "Other") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY(JAVA_MOZILLA, "Mozilla", "green" ) CATEGORY_ENUM_SUBCATEGORY(JAVA_MOZILLA, JAVA_MOZILLA, "Other" ) CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY(JAVA_KOTLIN , "Kotlin", "purple") CATEGORY_ENUM_SUBCATEGORY(JAVA_KOTLIN, JAVA_KOTLIN , "Other") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY (JAVA_BLOCKED, "Blocked", "lightblue") CATEGORY_ENUM_SUBCATEGORY (JAVA_BLOCKED, JAVA_BLOCKED, "Other") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY(IPC, "IPC", "lightgreen") CATEGORY_ENUM_SUBCATEGORY (IPC, IPC, "Other") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY (MEDIA, "Media", "orange") CATEGORY_ENUM_SUBCATEGORY(MEDIA, MEDIA , "Other") CATEGORY_ENUM_SUBCATEGORY(MEDIA, MEDIA_CUBEB, "Cubeb" ) CATEGORY_ENUM_SUBCATEGORY(MEDIA, MEDIA_PLAYBACK, "Playback" ) CATEGORY_ENUM_SUBCATEGORY(MEDIA, MEDIA_RT, "Real-time rendering" ) CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY(A11Y , "Accessibility", "brown") CATEGORY_ENUM_SUBCATEGORY(A11Y, A11Y , "Other") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY (PROFILER, "Profiler", "lightred") CATEGORY_ENUM_SUBCATEGORY( PROFILER, PROFILER, "Other") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY (TIMER, "Timer", "grey") CATEGORY_ENUM_SUBCATEGORY(TIMER, TIMER , "Other") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY (REMOTE_PROTOCOL, "Remote-Protocol", "grey") CATEGORY_ENUM_SUBCATEGORY (REMOTE_PROTOCOL, REMOTE_PROTOCOL, "Other") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY(SANDBOX, "Sandbox", "grey") CATEGORY_ENUM_SUBCATEGORY (SANDBOX, SANDBOX, "Other") CATEGORY_ENUM_END_CATEGORY | |||
4524 | # undef CATEGORY_ENUM_BEGIN_CATEGORY | |||
4525 | # undef CATEGORY_ENUM_SUBCATEGORY | |||
4526 | # undef CATEGORY_ENUM_END_CATEGORY | |||
4527 | ||||
4528 | printf("TestMarkerCategory done\n"); | |||
4529 | } | |||
4530 | ||||
4531 | void TestMarkerThreadId() { | |||
4532 | printf("TestMarkerThreadId...\n"); | |||
4533 | ||||
4534 | MOZ_RELEASE_ASSERT(MarkerThreadId{}.IsUnspecified())do { static_assert( mozilla::detail::AssertionConditionType< decltype(MarkerThreadId{}.IsUnspecified())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(MarkerThreadId{}.IsUnspecified ()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("MarkerThreadId{}.IsUnspecified()", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4534); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "MarkerThreadId{}.IsUnspecified()" ")"); do { *((volatile int*)__null) = 4534; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
4535 | MOZ_RELEASE_ASSERT(!MarkerThreadId::MainThread().IsUnspecified())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!MarkerThreadId::MainThread().IsUnspecified())>:: isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(!MarkerThreadId::MainThread().IsUnspecified()))), 0) )) { do { } while (false); MOZ_ReportAssertionFailure("!MarkerThreadId::MainThread().IsUnspecified()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4535); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!MarkerThreadId::MainThread().IsUnspecified()" ")"); do { *((volatile int*)__null) = 4535; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
4536 | MOZ_RELEASE_ASSERT(!MarkerThreadId::CurrentThread().IsUnspecified())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!MarkerThreadId::CurrentThread().IsUnspecified())> ::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(!MarkerThreadId::CurrentThread().IsUnspecified()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!MarkerThreadId::CurrentThread().IsUnspecified()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4536); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!MarkerThreadId::CurrentThread().IsUnspecified()" ")"); do { *((volatile int*)__null) = 4536; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
4537 | ||||
4538 | MOZ_RELEASE_ASSERT(!MarkerThreadId{do { static_assert( mozilla::detail::AssertionConditionType< decltype(!MarkerThreadId{ mozilla::baseprofiler::BaseProfilerThreadId ::FromNumber(42)} .IsUnspecified())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!MarkerThreadId{ mozilla::baseprofiler ::BaseProfilerThreadId::FromNumber(42)} .IsUnspecified()))), 0 ))) { do { } while (false); MOZ_ReportAssertionFailure("!MarkerThreadId{ mozilla::baseprofiler::BaseProfilerThreadId::FromNumber(42)} .IsUnspecified()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4540); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!MarkerThreadId{ mozilla::baseprofiler::BaseProfilerThreadId::FromNumber(42)} .IsUnspecified()" ")"); do { *((volatile int*)__null) = 4540; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4539 | mozilla::baseprofiler::BaseProfilerThreadId::FromNumber(42)}do { static_assert( mozilla::detail::AssertionConditionType< decltype(!MarkerThreadId{ mozilla::baseprofiler::BaseProfilerThreadId ::FromNumber(42)} .IsUnspecified())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!MarkerThreadId{ mozilla::baseprofiler ::BaseProfilerThreadId::FromNumber(42)} .IsUnspecified()))), 0 ))) { do { } while (false); MOZ_ReportAssertionFailure("!MarkerThreadId{ mozilla::baseprofiler::BaseProfilerThreadId::FromNumber(42)} .IsUnspecified()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4540); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!MarkerThreadId{ mozilla::baseprofiler::BaseProfilerThreadId::FromNumber(42)} .IsUnspecified()" ")"); do { *((volatile int*)__null) = 4540; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4540 | .IsUnspecified())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!MarkerThreadId{ mozilla::baseprofiler::BaseProfilerThreadId ::FromNumber(42)} .IsUnspecified())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!MarkerThreadId{ mozilla::baseprofiler ::BaseProfilerThreadId::FromNumber(42)} .IsUnspecified()))), 0 ))) { do { } while (false); MOZ_ReportAssertionFailure("!MarkerThreadId{ mozilla::baseprofiler::BaseProfilerThreadId::FromNumber(42)} .IsUnspecified()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4540); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!MarkerThreadId{ mozilla::baseprofiler::BaseProfilerThreadId::FromNumber(42)} .IsUnspecified()" ")"); do { *((volatile int*)__null) = 4540; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
4541 | MOZ_RELEASE_ASSERT(do { static_assert( mozilla::detail::AssertionConditionType< decltype(MarkerThreadId{ mozilla::baseprofiler::BaseProfilerThreadId ::FromNumber(42)} .ThreadId() .ToNumber() == 42)>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(MarkerThreadId{ mozilla::baseprofiler::BaseProfilerThreadId ::FromNumber(42)} .ThreadId() .ToNumber() == 42))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("MarkerThreadId{ mozilla::baseprofiler::BaseProfilerThreadId::FromNumber(42)} .ThreadId() .ToNumber() == 42" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4545); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "MarkerThreadId{ mozilla::baseprofiler::BaseProfilerThreadId::FromNumber(42)} .ThreadId() .ToNumber() == 42" ")"); do { *((volatile int*)__null) = 4545; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4542 | MarkerThreadId{do { static_assert( mozilla::detail::AssertionConditionType< decltype(MarkerThreadId{ mozilla::baseprofiler::BaseProfilerThreadId ::FromNumber(42)} .ThreadId() .ToNumber() == 42)>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(MarkerThreadId{ mozilla::baseprofiler::BaseProfilerThreadId ::FromNumber(42)} .ThreadId() .ToNumber() == 42))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("MarkerThreadId{ mozilla::baseprofiler::BaseProfilerThreadId::FromNumber(42)} .ThreadId() .ToNumber() == 42" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4545); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "MarkerThreadId{ mozilla::baseprofiler::BaseProfilerThreadId::FromNumber(42)} .ThreadId() .ToNumber() == 42" ")"); do { *((volatile int*)__null) = 4545; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4543 | mozilla::baseprofiler::BaseProfilerThreadId::FromNumber(42)}do { static_assert( mozilla::detail::AssertionConditionType< decltype(MarkerThreadId{ mozilla::baseprofiler::BaseProfilerThreadId ::FromNumber(42)} .ThreadId() .ToNumber() == 42)>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(MarkerThreadId{ mozilla::baseprofiler::BaseProfilerThreadId ::FromNumber(42)} .ThreadId() .ToNumber() == 42))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("MarkerThreadId{ mozilla::baseprofiler::BaseProfilerThreadId::FromNumber(42)} .ThreadId() .ToNumber() == 42" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4545); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "MarkerThreadId{ mozilla::baseprofiler::BaseProfilerThreadId::FromNumber(42)} .ThreadId() .ToNumber() == 42" ")"); do { *((volatile int*)__null) = 4545; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4544 | .ThreadId()do { static_assert( mozilla::detail::AssertionConditionType< decltype(MarkerThreadId{ mozilla::baseprofiler::BaseProfilerThreadId ::FromNumber(42)} .ThreadId() .ToNumber() == 42)>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(MarkerThreadId{ mozilla::baseprofiler::BaseProfilerThreadId ::FromNumber(42)} .ThreadId() .ToNumber() == 42))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("MarkerThreadId{ mozilla::baseprofiler::BaseProfilerThreadId::FromNumber(42)} .ThreadId() .ToNumber() == 42" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4545); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "MarkerThreadId{ mozilla::baseprofiler::BaseProfilerThreadId::FromNumber(42)} .ThreadId() .ToNumber() == 42" ")"); do { *((volatile int*)__null) = 4545; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4545 | .ToNumber() == 42)do { static_assert( mozilla::detail::AssertionConditionType< decltype(MarkerThreadId{ mozilla::baseprofiler::BaseProfilerThreadId ::FromNumber(42)} .ThreadId() .ToNumber() == 42)>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(MarkerThreadId{ mozilla::baseprofiler::BaseProfilerThreadId ::FromNumber(42)} .ThreadId() .ToNumber() == 42))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("MarkerThreadId{ mozilla::baseprofiler::BaseProfilerThreadId::FromNumber(42)} .ThreadId() .ToNumber() == 42" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4545); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "MarkerThreadId{ mozilla::baseprofiler::BaseProfilerThreadId::FromNumber(42)} .ThreadId() .ToNumber() == 42" ")"); do { *((volatile int*)__null) = 4545; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
4546 | ||||
4547 | // We'll assume that this test runs in the main thread (which should be true | |||
4548 | // when called from the `main` function). | |||
4549 | MOZ_RELEASE_ASSERT(MarkerThreadId::MainThread().ThreadId() ==do { static_assert( mozilla::detail::AssertionConditionType< decltype(MarkerThreadId::MainThread().ThreadId() == mozilla:: baseprofiler::profiler_main_thread_id())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(MarkerThreadId::MainThread() .ThreadId() == mozilla::baseprofiler::profiler_main_thread_id ()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("MarkerThreadId::MainThread().ThreadId() == mozilla::baseprofiler::profiler_main_thread_id()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4550); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "MarkerThreadId::MainThread().ThreadId() == mozilla::baseprofiler::profiler_main_thread_id()" ")"); do { *((volatile int*)__null) = 4550; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4550 | mozilla::baseprofiler::profiler_main_thread_id())do { static_assert( mozilla::detail::AssertionConditionType< decltype(MarkerThreadId::MainThread().ThreadId() == mozilla:: baseprofiler::profiler_main_thread_id())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(MarkerThreadId::MainThread() .ThreadId() == mozilla::baseprofiler::profiler_main_thread_id ()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("MarkerThreadId::MainThread().ThreadId() == mozilla::baseprofiler::profiler_main_thread_id()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4550); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "MarkerThreadId::MainThread().ThreadId() == mozilla::baseprofiler::profiler_main_thread_id()" ")"); do { *((volatile int*)__null) = 4550; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
4551 | ||||
4552 | MOZ_RELEASE_ASSERT(MarkerThreadId::CurrentThread().ThreadId() ==do { static_assert( mozilla::detail::AssertionConditionType< decltype(MarkerThreadId::CurrentThread().ThreadId() == mozilla ::baseprofiler::profiler_current_thread_id())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(MarkerThreadId::CurrentThread ().ThreadId() == mozilla::baseprofiler::profiler_current_thread_id ()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("MarkerThreadId::CurrentThread().ThreadId() == mozilla::baseprofiler::profiler_current_thread_id()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4553); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "MarkerThreadId::CurrentThread().ThreadId() == mozilla::baseprofiler::profiler_current_thread_id()" ")"); do { *((volatile int*)__null) = 4553; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4553 | mozilla::baseprofiler::profiler_current_thread_id())do { static_assert( mozilla::detail::AssertionConditionType< decltype(MarkerThreadId::CurrentThread().ThreadId() == mozilla ::baseprofiler::profiler_current_thread_id())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(MarkerThreadId::CurrentThread ().ThreadId() == mozilla::baseprofiler::profiler_current_thread_id ()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("MarkerThreadId::CurrentThread().ThreadId() == mozilla::baseprofiler::profiler_current_thread_id()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4553); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "MarkerThreadId::CurrentThread().ThreadId() == mozilla::baseprofiler::profiler_current_thread_id()" ")"); do { *((volatile int*)__null) = 4553; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
4554 | ||||
4555 | MOZ_RELEASE_ASSERT(MarkerThreadId::CurrentThread().ThreadId() ==do { static_assert( mozilla::detail::AssertionConditionType< decltype(MarkerThreadId::CurrentThread().ThreadId() == mozilla ::baseprofiler::profiler_main_thread_id())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(MarkerThreadId::CurrentThread ().ThreadId() == mozilla::baseprofiler::profiler_main_thread_id ()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("MarkerThreadId::CurrentThread().ThreadId() == mozilla::baseprofiler::profiler_main_thread_id()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4556); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "MarkerThreadId::CurrentThread().ThreadId() == mozilla::baseprofiler::profiler_main_thread_id()" ")"); do { *((volatile int*)__null) = 4556; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4556 | mozilla::baseprofiler::profiler_main_thread_id())do { static_assert( mozilla::detail::AssertionConditionType< decltype(MarkerThreadId::CurrentThread().ThreadId() == mozilla ::baseprofiler::profiler_main_thread_id())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(MarkerThreadId::CurrentThread ().ThreadId() == mozilla::baseprofiler::profiler_main_thread_id ()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("MarkerThreadId::CurrentThread().ThreadId() == mozilla::baseprofiler::profiler_main_thread_id()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4556); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "MarkerThreadId::CurrentThread().ThreadId() == mozilla::baseprofiler::profiler_main_thread_id()" ")"); do { *((volatile int*)__null) = 4556; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
4557 | ||||
4558 | std::thread testThread([]() { | |||
4559 | MOZ_RELEASE_ASSERT(!MarkerThreadId::MainThread().IsUnspecified())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!MarkerThreadId::MainThread().IsUnspecified())>:: isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(!MarkerThreadId::MainThread().IsUnspecified()))), 0) )) { do { } while (false); MOZ_ReportAssertionFailure("!MarkerThreadId::MainThread().IsUnspecified()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4559); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!MarkerThreadId::MainThread().IsUnspecified()" ")"); do { *((volatile int*)__null) = 4559; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
4560 | MOZ_RELEASE_ASSERT(!MarkerThreadId::CurrentThread().IsUnspecified())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!MarkerThreadId::CurrentThread().IsUnspecified())> ::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(!MarkerThreadId::CurrentThread().IsUnspecified()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!MarkerThreadId::CurrentThread().IsUnspecified()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4560); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!MarkerThreadId::CurrentThread().IsUnspecified()" ")"); do { *((volatile int*)__null) = 4560; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
4561 | ||||
4562 | MOZ_RELEASE_ASSERT(MarkerThreadId::MainThread().ThreadId() ==do { static_assert( mozilla::detail::AssertionConditionType< decltype(MarkerThreadId::MainThread().ThreadId() == mozilla:: baseprofiler::profiler_main_thread_id())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(MarkerThreadId::MainThread() .ThreadId() == mozilla::baseprofiler::profiler_main_thread_id ()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("MarkerThreadId::MainThread().ThreadId() == mozilla::baseprofiler::profiler_main_thread_id()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4563); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "MarkerThreadId::MainThread().ThreadId() == mozilla::baseprofiler::profiler_main_thread_id()" ")"); do { *((volatile int*)__null) = 4563; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4563 | mozilla::baseprofiler::profiler_main_thread_id())do { static_assert( mozilla::detail::AssertionConditionType< decltype(MarkerThreadId::MainThread().ThreadId() == mozilla:: baseprofiler::profiler_main_thread_id())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(MarkerThreadId::MainThread() .ThreadId() == mozilla::baseprofiler::profiler_main_thread_id ()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("MarkerThreadId::MainThread().ThreadId() == mozilla::baseprofiler::profiler_main_thread_id()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4563); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "MarkerThreadId::MainThread().ThreadId() == mozilla::baseprofiler::profiler_main_thread_id()" ")"); do { *((volatile int*)__null) = 4563; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
4564 | ||||
4565 | MOZ_RELEASE_ASSERT(MarkerThreadId::CurrentThread().ThreadId() ==do { static_assert( mozilla::detail::AssertionConditionType< decltype(MarkerThreadId::CurrentThread().ThreadId() == mozilla ::baseprofiler::profiler_current_thread_id())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(MarkerThreadId::CurrentThread ().ThreadId() == mozilla::baseprofiler::profiler_current_thread_id ()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("MarkerThreadId::CurrentThread().ThreadId() == mozilla::baseprofiler::profiler_current_thread_id()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4566); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "MarkerThreadId::CurrentThread().ThreadId() == mozilla::baseprofiler::profiler_current_thread_id()" ")"); do { *((volatile int*)__null) = 4566; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4566 | mozilla::baseprofiler::profiler_current_thread_id())do { static_assert( mozilla::detail::AssertionConditionType< decltype(MarkerThreadId::CurrentThread().ThreadId() == mozilla ::baseprofiler::profiler_current_thread_id())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(MarkerThreadId::CurrentThread ().ThreadId() == mozilla::baseprofiler::profiler_current_thread_id ()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("MarkerThreadId::CurrentThread().ThreadId() == mozilla::baseprofiler::profiler_current_thread_id()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4566); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "MarkerThreadId::CurrentThread().ThreadId() == mozilla::baseprofiler::profiler_current_thread_id()" ")"); do { *((volatile int*)__null) = 4566; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
4567 | ||||
4568 | MOZ_RELEASE_ASSERT(MarkerThreadId::CurrentThread().ThreadId() !=do { static_assert( mozilla::detail::AssertionConditionType< decltype(MarkerThreadId::CurrentThread().ThreadId() != mozilla ::baseprofiler::profiler_main_thread_id())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(MarkerThreadId::CurrentThread ().ThreadId() != mozilla::baseprofiler::profiler_main_thread_id ()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("MarkerThreadId::CurrentThread().ThreadId() != mozilla::baseprofiler::profiler_main_thread_id()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4569); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "MarkerThreadId::CurrentThread().ThreadId() != mozilla::baseprofiler::profiler_main_thread_id()" ")"); do { *((volatile int*)__null) = 4569; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4569 | mozilla::baseprofiler::profiler_main_thread_id())do { static_assert( mozilla::detail::AssertionConditionType< decltype(MarkerThreadId::CurrentThread().ThreadId() != mozilla ::baseprofiler::profiler_main_thread_id())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(MarkerThreadId::CurrentThread ().ThreadId() != mozilla::baseprofiler::profiler_main_thread_id ()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("MarkerThreadId::CurrentThread().ThreadId() != mozilla::baseprofiler::profiler_main_thread_id()" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4569); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "MarkerThreadId::CurrentThread().ThreadId() != mozilla::baseprofiler::profiler_main_thread_id()" ")"); do { *((volatile int*)__null) = 4569; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
4570 | }); | |||
4571 | testThread.join(); | |||
4572 | ||||
4573 | printf("TestMarkerThreadId done\n"); | |||
4574 | } | |||
4575 | ||||
4576 | void TestMarkerNoPayload() { | |||
4577 | printf("TestMarkerNoPayload...\n"); | |||
4578 | ||||
4579 | mozilla::ProfileBufferChunkManagerSingle chunkManager(512); | |||
4580 | mozilla::ProfileChunkedBuffer buffer( | |||
4581 | mozilla::ProfileChunkedBuffer::ThreadSafety::WithoutMutex, chunkManager); | |||
4582 | ||||
4583 | mozilla::ProfileBufferBlockIndex i0 = | |||
4584 | mozilla::baseprofiler::AddMarkerToBuffer( | |||
4585 | buffer, "literal", mozilla::baseprofiler::category::OTHER_Profiling); | |||
4586 | MOZ_RELEASE_ASSERT(i0)do { static_assert( mozilla::detail::AssertionConditionType< decltype(i0)>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(!!(i0))), 0))) { do { } while (false ); MOZ_ReportAssertionFailure("i0", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4586); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "i0" ")"); do { *((volatile int*)__null) = 4586; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
4587 | ||||
4588 | const std::string dynamic = "dynamic"; | |||
4589 | mozilla::ProfileBufferBlockIndex i1 = | |||
4590 | mozilla::baseprofiler::AddMarkerToBuffer( | |||
4591 | buffer, dynamic, | |||
4592 | mozilla::baseprofiler::category::GRAPHICS_FlushingAsyncPaints, {}); | |||
4593 | MOZ_RELEASE_ASSERT(i1)do { static_assert( mozilla::detail::AssertionConditionType< decltype(i1)>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(!!(i1))), 0))) { do { } while (false ); MOZ_ReportAssertionFailure("i1", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4593); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "i1" ")"); do { *((volatile int*)__null) = 4593; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
4594 | MOZ_RELEASE_ASSERT(i1 > i0)do { static_assert( mozilla::detail::AssertionConditionType< decltype(i1 > i0)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(i1 > i0))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("i1 > i0", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4594); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "i1 > i0" ")"); do { *((volatile int*)__null) = 4594; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
4595 | ||||
4596 | mozilla::ProfileBufferBlockIndex i2 = | |||
4597 | mozilla::baseprofiler::AddMarkerToBuffer( | |||
4598 | buffer, std::string_view("string_view"), | |||
4599 | mozilla::baseprofiler::category::GRAPHICS_FlushingAsyncPaints, {}); | |||
4600 | MOZ_RELEASE_ASSERT(i2)do { static_assert( mozilla::detail::AssertionConditionType< decltype(i2)>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(!!(i2))), 0))) { do { } while (false ); MOZ_ReportAssertionFailure("i2", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4600); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "i2" ")"); do { *((volatile int*)__null) = 4600; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
4601 | MOZ_RELEASE_ASSERT(i2 > i1)do { static_assert( mozilla::detail::AssertionConditionType< decltype(i2 > i1)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(i2 > i1))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("i2 > i1", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4601); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "i2 > i1" ")"); do { *((volatile int*)__null) = 4601; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
4602 | ||||
4603 | # ifdef DEBUG1 | |||
4604 | buffer.Dump(); | |||
4605 | # endif | |||
4606 | ||||
4607 | PrintMarkers(buffer); | |||
4608 | ||||
4609 | printf("TestMarkerNoPayload done\n"); | |||
4610 | } | |||
4611 | ||||
4612 | void TestUserMarker() { | |||
4613 | printf("TestUserMarker...\n"); | |||
4614 | ||||
4615 | // User-defined marker type with text. | |||
4616 | // It's fine to define it right in the function where it's used. | |||
4617 | struct MarkerTypeTestMinimal { | |||
4618 | static constexpr Span<const char> MarkerTypeName() { | |||
4619 | return MakeStringSpan("test-minimal"); | |||
4620 | } | |||
4621 | static void StreamJSONMarkerData( | |||
4622 | mozilla::baseprofiler::SpliceableJSONWriter& aWriter, | |||
4623 | const std::string& aText) { | |||
4624 | aWriter.StringProperty("text", aText); | |||
4625 | } | |||
4626 | static mozilla::MarkerSchema MarkerTypeDisplay() { | |||
4627 | using MS = mozilla::MarkerSchema; | |||
4628 | MS schema{MS::Location::MarkerChart, MS::Location::MarkerTable}; | |||
4629 | schema.SetTooltipLabel("tooltip for test-minimal"); | |||
4630 | schema.AddKeyLabelFormatSearchable("text", "Text", MS::Format::String, | |||
4631 | MS::Searchable::Searchable); | |||
4632 | return schema; | |||
4633 | } | |||
4634 | }; | |||
4635 | ||||
4636 | mozilla::ProfileBufferChunkManagerSingle chunkManager(1024); | |||
4637 | mozilla::ProfileChunkedBuffer buffer( | |||
4638 | mozilla::ProfileChunkedBuffer::ThreadSafety::WithoutMutex, chunkManager); | |||
4639 | ||||
4640 | MOZ_RELEASE_ASSERT(mozilla::baseprofiler::AddMarkerToBuffer(do { static_assert( mozilla::detail::AssertionConditionType< decltype(mozilla::baseprofiler::AddMarkerToBuffer( buffer, "test2" , mozilla::baseprofiler::category::OTHER_Profiling, {}, MarkerTypeTestMinimal {}, std::string("payload text")))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(mozilla::baseprofiler::AddMarkerToBuffer ( buffer, "test2", mozilla::baseprofiler::category::OTHER_Profiling , {}, MarkerTypeTestMinimal{}, std::string("payload text")))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, {}, MarkerTypeTestMinimal{}, std::string(\"payload text\"))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4642); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, {}, MarkerTypeTestMinimal{}, std::string(\"payload text\"))" ")"); do { *((volatile int*)__null) = 4642; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4641 | buffer, "test2", mozilla::baseprofiler::category::OTHER_Profiling, {},do { static_assert( mozilla::detail::AssertionConditionType< decltype(mozilla::baseprofiler::AddMarkerToBuffer( buffer, "test2" , mozilla::baseprofiler::category::OTHER_Profiling, {}, MarkerTypeTestMinimal {}, std::string("payload text")))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(mozilla::baseprofiler::AddMarkerToBuffer ( buffer, "test2", mozilla::baseprofiler::category::OTHER_Profiling , {}, MarkerTypeTestMinimal{}, std::string("payload text")))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, {}, MarkerTypeTestMinimal{}, std::string(\"payload text\"))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4642); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, {}, MarkerTypeTestMinimal{}, std::string(\"payload text\"))" ")"); do { *((volatile int*)__null) = 4642; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4642 | MarkerTypeTestMinimal{}, std::string("payload text")))do { static_assert( mozilla::detail::AssertionConditionType< decltype(mozilla::baseprofiler::AddMarkerToBuffer( buffer, "test2" , mozilla::baseprofiler::category::OTHER_Profiling, {}, MarkerTypeTestMinimal {}, std::string("payload text")))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(mozilla::baseprofiler::AddMarkerToBuffer ( buffer, "test2", mozilla::baseprofiler::category::OTHER_Profiling , {}, MarkerTypeTestMinimal{}, std::string("payload text")))) ), 0))) { do { } while (false); MOZ_ReportAssertionFailure("mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, {}, MarkerTypeTestMinimal{}, std::string(\"payload text\"))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4642); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, {}, MarkerTypeTestMinimal{}, std::string(\"payload text\"))" ")"); do { *((volatile int*)__null) = 4642; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
4643 | ||||
4644 | MOZ_RELEASE_ASSERT(mozilla::baseprofiler::AddMarkerToBuffer(do { static_assert( mozilla::detail::AssertionConditionType< decltype(mozilla::baseprofiler::AddMarkerToBuffer( buffer, "test2" , mozilla::baseprofiler::category::OTHER_Profiling, mozilla:: MarkerThreadId( mozilla::baseprofiler::BaseProfilerThreadId:: FromNumber(123)), MarkerTypeTestMinimal{}, std::string("ThreadId(123)" )))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(mozilla::baseprofiler::AddMarkerToBuffer( buffer, "test2" , mozilla::baseprofiler::category::OTHER_Profiling, mozilla:: MarkerThreadId( mozilla::baseprofiler::BaseProfilerThreadId:: FromNumber(123)), MarkerTypeTestMinimal{}, std::string("ThreadId(123)" ))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerThreadId( mozilla::baseprofiler::BaseProfilerThreadId::FromNumber(123)), MarkerTypeTestMinimal{}, std::string(\"ThreadId(123)\"))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4648); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerThreadId( mozilla::baseprofiler::BaseProfilerThreadId::FromNumber(123)), MarkerTypeTestMinimal{}, std::string(\"ThreadId(123)\"))" ")"); do { *((volatile int*)__null) = 4648; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4645 | buffer, "test2", mozilla::baseprofiler::category::OTHER_Profiling,do { static_assert( mozilla::detail::AssertionConditionType< decltype(mozilla::baseprofiler::AddMarkerToBuffer( buffer, "test2" , mozilla::baseprofiler::category::OTHER_Profiling, mozilla:: MarkerThreadId( mozilla::baseprofiler::BaseProfilerThreadId:: FromNumber(123)), MarkerTypeTestMinimal{}, std::string("ThreadId(123)" )))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(mozilla::baseprofiler::AddMarkerToBuffer( buffer, "test2" , mozilla::baseprofiler::category::OTHER_Profiling, mozilla:: MarkerThreadId( mozilla::baseprofiler::BaseProfilerThreadId:: FromNumber(123)), MarkerTypeTestMinimal{}, std::string("ThreadId(123)" ))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerThreadId( mozilla::baseprofiler::BaseProfilerThreadId::FromNumber(123)), MarkerTypeTestMinimal{}, std::string(\"ThreadId(123)\"))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4648); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerThreadId( mozilla::baseprofiler::BaseProfilerThreadId::FromNumber(123)), MarkerTypeTestMinimal{}, std::string(\"ThreadId(123)\"))" ")"); do { *((volatile int*)__null) = 4648; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4646 | mozilla::MarkerThreadId(do { static_assert( mozilla::detail::AssertionConditionType< decltype(mozilla::baseprofiler::AddMarkerToBuffer( buffer, "test2" , mozilla::baseprofiler::category::OTHER_Profiling, mozilla:: MarkerThreadId( mozilla::baseprofiler::BaseProfilerThreadId:: FromNumber(123)), MarkerTypeTestMinimal{}, std::string("ThreadId(123)" )))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(mozilla::baseprofiler::AddMarkerToBuffer( buffer, "test2" , mozilla::baseprofiler::category::OTHER_Profiling, mozilla:: MarkerThreadId( mozilla::baseprofiler::BaseProfilerThreadId:: FromNumber(123)), MarkerTypeTestMinimal{}, std::string("ThreadId(123)" ))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerThreadId( mozilla::baseprofiler::BaseProfilerThreadId::FromNumber(123)), MarkerTypeTestMinimal{}, std::string(\"ThreadId(123)\"))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4648); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerThreadId( mozilla::baseprofiler::BaseProfilerThreadId::FromNumber(123)), MarkerTypeTestMinimal{}, std::string(\"ThreadId(123)\"))" ")"); do { *((volatile int*)__null) = 4648; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4647 | mozilla::baseprofiler::BaseProfilerThreadId::FromNumber(123)),do { static_assert( mozilla::detail::AssertionConditionType< decltype(mozilla::baseprofiler::AddMarkerToBuffer( buffer, "test2" , mozilla::baseprofiler::category::OTHER_Profiling, mozilla:: MarkerThreadId( mozilla::baseprofiler::BaseProfilerThreadId:: FromNumber(123)), MarkerTypeTestMinimal{}, std::string("ThreadId(123)" )))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(mozilla::baseprofiler::AddMarkerToBuffer( buffer, "test2" , mozilla::baseprofiler::category::OTHER_Profiling, mozilla:: MarkerThreadId( mozilla::baseprofiler::BaseProfilerThreadId:: FromNumber(123)), MarkerTypeTestMinimal{}, std::string("ThreadId(123)" ))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerThreadId( mozilla::baseprofiler::BaseProfilerThreadId::FromNumber(123)), MarkerTypeTestMinimal{}, std::string(\"ThreadId(123)\"))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4648); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerThreadId( mozilla::baseprofiler::BaseProfilerThreadId::FromNumber(123)), MarkerTypeTestMinimal{}, std::string(\"ThreadId(123)\"))" ")"); do { *((volatile int*)__null) = 4648; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4648 | MarkerTypeTestMinimal{}, std::string("ThreadId(123)")))do { static_assert( mozilla::detail::AssertionConditionType< decltype(mozilla::baseprofiler::AddMarkerToBuffer( buffer, "test2" , mozilla::baseprofiler::category::OTHER_Profiling, mozilla:: MarkerThreadId( mozilla::baseprofiler::BaseProfilerThreadId:: FromNumber(123)), MarkerTypeTestMinimal{}, std::string("ThreadId(123)" )))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(mozilla::baseprofiler::AddMarkerToBuffer( buffer, "test2" , mozilla::baseprofiler::category::OTHER_Profiling, mozilla:: MarkerThreadId( mozilla::baseprofiler::BaseProfilerThreadId:: FromNumber(123)), MarkerTypeTestMinimal{}, std::string("ThreadId(123)" ))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerThreadId( mozilla::baseprofiler::BaseProfilerThreadId::FromNumber(123)), MarkerTypeTestMinimal{}, std::string(\"ThreadId(123)\"))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4648); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerThreadId( mozilla::baseprofiler::BaseProfilerThreadId::FromNumber(123)), MarkerTypeTestMinimal{}, std::string(\"ThreadId(123)\"))" ")"); do { *((volatile int*)__null) = 4648; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
4649 | ||||
4650 | auto start = mozilla::TimeStamp::Now(); | |||
4651 | ||||
4652 | MOZ_RELEASE_ASSERT(mozilla::baseprofiler::AddMarkerToBuffer(do { static_assert( mozilla::detail::AssertionConditionType< decltype(mozilla::baseprofiler::AddMarkerToBuffer( buffer, "test2" , mozilla::baseprofiler::category::OTHER_Profiling, mozilla:: MarkerTiming::InstantAt(start), MarkerTypeTestMinimal{}, std:: string("InstantAt(start)")))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(mozilla::baseprofiler::AddMarkerToBuffer ( buffer, "test2", mozilla::baseprofiler::category::OTHER_Profiling , mozilla::MarkerTiming::InstantAt(start), MarkerTypeTestMinimal {}, std::string("InstantAt(start)"))))), 0))) { do { } while ( false); MOZ_ReportAssertionFailure("mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerTiming::InstantAt(start), MarkerTypeTestMinimal{}, std::string(\"InstantAt(start)\"))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4655); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerTiming::InstantAt(start), MarkerTypeTestMinimal{}, std::string(\"InstantAt(start)\"))" ")"); do { *((volatile int*)__null) = 4655; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4653 | buffer, "test2", mozilla::baseprofiler::category::OTHER_Profiling,do { static_assert( mozilla::detail::AssertionConditionType< decltype(mozilla::baseprofiler::AddMarkerToBuffer( buffer, "test2" , mozilla::baseprofiler::category::OTHER_Profiling, mozilla:: MarkerTiming::InstantAt(start), MarkerTypeTestMinimal{}, std:: string("InstantAt(start)")))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(mozilla::baseprofiler::AddMarkerToBuffer ( buffer, "test2", mozilla::baseprofiler::category::OTHER_Profiling , mozilla::MarkerTiming::InstantAt(start), MarkerTypeTestMinimal {}, std::string("InstantAt(start)"))))), 0))) { do { } while ( false); MOZ_ReportAssertionFailure("mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerTiming::InstantAt(start), MarkerTypeTestMinimal{}, std::string(\"InstantAt(start)\"))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4655); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerTiming::InstantAt(start), MarkerTypeTestMinimal{}, std::string(\"InstantAt(start)\"))" ")"); do { *((volatile int*)__null) = 4655; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4654 | mozilla::MarkerTiming::InstantAt(start), MarkerTypeTestMinimal{},do { static_assert( mozilla::detail::AssertionConditionType< decltype(mozilla::baseprofiler::AddMarkerToBuffer( buffer, "test2" , mozilla::baseprofiler::category::OTHER_Profiling, mozilla:: MarkerTiming::InstantAt(start), MarkerTypeTestMinimal{}, std:: string("InstantAt(start)")))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(mozilla::baseprofiler::AddMarkerToBuffer ( buffer, "test2", mozilla::baseprofiler::category::OTHER_Profiling , mozilla::MarkerTiming::InstantAt(start), MarkerTypeTestMinimal {}, std::string("InstantAt(start)"))))), 0))) { do { } while ( false); MOZ_ReportAssertionFailure("mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerTiming::InstantAt(start), MarkerTypeTestMinimal{}, std::string(\"InstantAt(start)\"))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4655); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerTiming::InstantAt(start), MarkerTypeTestMinimal{}, std::string(\"InstantAt(start)\"))" ")"); do { *((volatile int*)__null) = 4655; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4655 | std::string("InstantAt(start)")))do { static_assert( mozilla::detail::AssertionConditionType< decltype(mozilla::baseprofiler::AddMarkerToBuffer( buffer, "test2" , mozilla::baseprofiler::category::OTHER_Profiling, mozilla:: MarkerTiming::InstantAt(start), MarkerTypeTestMinimal{}, std:: string("InstantAt(start)")))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(mozilla::baseprofiler::AddMarkerToBuffer ( buffer, "test2", mozilla::baseprofiler::category::OTHER_Profiling , mozilla::MarkerTiming::InstantAt(start), MarkerTypeTestMinimal {}, std::string("InstantAt(start)"))))), 0))) { do { } while ( false); MOZ_ReportAssertionFailure("mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerTiming::InstantAt(start), MarkerTypeTestMinimal{}, std::string(\"InstantAt(start)\"))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4655); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerTiming::InstantAt(start), MarkerTypeTestMinimal{}, std::string(\"InstantAt(start)\"))" ")"); do { *((volatile int*)__null) = 4655; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
4656 | ||||
4657 | auto then = mozilla::TimeStamp::Now(); | |||
4658 | ||||
4659 | MOZ_RELEASE_ASSERT(mozilla::baseprofiler::AddMarkerToBuffer(do { static_assert( mozilla::detail::AssertionConditionType< decltype(mozilla::baseprofiler::AddMarkerToBuffer( buffer, "test2" , mozilla::baseprofiler::category::OTHER_Profiling, mozilla:: MarkerTiming::IntervalStart(start), MarkerTypeTestMinimal{}, std ::string("IntervalStart(start)")))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(mozilla::baseprofiler::AddMarkerToBuffer ( buffer, "test2", mozilla::baseprofiler::category::OTHER_Profiling , mozilla::MarkerTiming::IntervalStart(start), MarkerTypeTestMinimal {}, std::string("IntervalStart(start)"))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerTiming::IntervalStart(start), MarkerTypeTestMinimal{}, std::string(\"IntervalStart(start)\"))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4662); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerTiming::IntervalStart(start), MarkerTypeTestMinimal{}, std::string(\"IntervalStart(start)\"))" ")"); do { *((volatile int*)__null) = 4662; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4660 | buffer, "test2", mozilla::baseprofiler::category::OTHER_Profiling,do { static_assert( mozilla::detail::AssertionConditionType< decltype(mozilla::baseprofiler::AddMarkerToBuffer( buffer, "test2" , mozilla::baseprofiler::category::OTHER_Profiling, mozilla:: MarkerTiming::IntervalStart(start), MarkerTypeTestMinimal{}, std ::string("IntervalStart(start)")))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(mozilla::baseprofiler::AddMarkerToBuffer ( buffer, "test2", mozilla::baseprofiler::category::OTHER_Profiling , mozilla::MarkerTiming::IntervalStart(start), MarkerTypeTestMinimal {}, std::string("IntervalStart(start)"))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerTiming::IntervalStart(start), MarkerTypeTestMinimal{}, std::string(\"IntervalStart(start)\"))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4662); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerTiming::IntervalStart(start), MarkerTypeTestMinimal{}, std::string(\"IntervalStart(start)\"))" ")"); do { *((volatile int*)__null) = 4662; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4661 | mozilla::MarkerTiming::IntervalStart(start), MarkerTypeTestMinimal{},do { static_assert( mozilla::detail::AssertionConditionType< decltype(mozilla::baseprofiler::AddMarkerToBuffer( buffer, "test2" , mozilla::baseprofiler::category::OTHER_Profiling, mozilla:: MarkerTiming::IntervalStart(start), MarkerTypeTestMinimal{}, std ::string("IntervalStart(start)")))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(mozilla::baseprofiler::AddMarkerToBuffer ( buffer, "test2", mozilla::baseprofiler::category::OTHER_Profiling , mozilla::MarkerTiming::IntervalStart(start), MarkerTypeTestMinimal {}, std::string("IntervalStart(start)"))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerTiming::IntervalStart(start), MarkerTypeTestMinimal{}, std::string(\"IntervalStart(start)\"))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4662); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerTiming::IntervalStart(start), MarkerTypeTestMinimal{}, std::string(\"IntervalStart(start)\"))" ")"); do { *((volatile int*)__null) = 4662; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4662 | std::string("IntervalStart(start)")))do { static_assert( mozilla::detail::AssertionConditionType< decltype(mozilla::baseprofiler::AddMarkerToBuffer( buffer, "test2" , mozilla::baseprofiler::category::OTHER_Profiling, mozilla:: MarkerTiming::IntervalStart(start), MarkerTypeTestMinimal{}, std ::string("IntervalStart(start)")))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(mozilla::baseprofiler::AddMarkerToBuffer ( buffer, "test2", mozilla::baseprofiler::category::OTHER_Profiling , mozilla::MarkerTiming::IntervalStart(start), MarkerTypeTestMinimal {}, std::string("IntervalStart(start)"))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerTiming::IntervalStart(start), MarkerTypeTestMinimal{}, std::string(\"IntervalStart(start)\"))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4662); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerTiming::IntervalStart(start), MarkerTypeTestMinimal{}, std::string(\"IntervalStart(start)\"))" ")"); do { *((volatile int*)__null) = 4662; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
4663 | ||||
4664 | MOZ_RELEASE_ASSERT(mozilla::baseprofiler::AddMarkerToBuffer(do { static_assert( mozilla::detail::AssertionConditionType< decltype(mozilla::baseprofiler::AddMarkerToBuffer( buffer, "test2" , mozilla::baseprofiler::category::OTHER_Profiling, mozilla:: MarkerTiming::IntervalEnd(then), MarkerTypeTestMinimal{}, std ::string("IntervalEnd(then)")))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(mozilla::baseprofiler::AddMarkerToBuffer ( buffer, "test2", mozilla::baseprofiler::category::OTHER_Profiling , mozilla::MarkerTiming::IntervalEnd(then), MarkerTypeTestMinimal {}, std::string("IntervalEnd(then)"))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerTiming::IntervalEnd(then), MarkerTypeTestMinimal{}, std::string(\"IntervalEnd(then)\"))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4667); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerTiming::IntervalEnd(then), MarkerTypeTestMinimal{}, std::string(\"IntervalEnd(then)\"))" ")"); do { *((volatile int*)__null) = 4667; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4665 | buffer, "test2", mozilla::baseprofiler::category::OTHER_Profiling,do { static_assert( mozilla::detail::AssertionConditionType< decltype(mozilla::baseprofiler::AddMarkerToBuffer( buffer, "test2" , mozilla::baseprofiler::category::OTHER_Profiling, mozilla:: MarkerTiming::IntervalEnd(then), MarkerTypeTestMinimal{}, std ::string("IntervalEnd(then)")))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(mozilla::baseprofiler::AddMarkerToBuffer ( buffer, "test2", mozilla::baseprofiler::category::OTHER_Profiling , mozilla::MarkerTiming::IntervalEnd(then), MarkerTypeTestMinimal {}, std::string("IntervalEnd(then)"))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerTiming::IntervalEnd(then), MarkerTypeTestMinimal{}, std::string(\"IntervalEnd(then)\"))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4667); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerTiming::IntervalEnd(then), MarkerTypeTestMinimal{}, std::string(\"IntervalEnd(then)\"))" ")"); do { *((volatile int*)__null) = 4667; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4666 | mozilla::MarkerTiming::IntervalEnd(then), MarkerTypeTestMinimal{},do { static_assert( mozilla::detail::AssertionConditionType< decltype(mozilla::baseprofiler::AddMarkerToBuffer( buffer, "test2" , mozilla::baseprofiler::category::OTHER_Profiling, mozilla:: MarkerTiming::IntervalEnd(then), MarkerTypeTestMinimal{}, std ::string("IntervalEnd(then)")))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(mozilla::baseprofiler::AddMarkerToBuffer ( buffer, "test2", mozilla::baseprofiler::category::OTHER_Profiling , mozilla::MarkerTiming::IntervalEnd(then), MarkerTypeTestMinimal {}, std::string("IntervalEnd(then)"))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerTiming::IntervalEnd(then), MarkerTypeTestMinimal{}, std::string(\"IntervalEnd(then)\"))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4667); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerTiming::IntervalEnd(then), MarkerTypeTestMinimal{}, std::string(\"IntervalEnd(then)\"))" ")"); do { *((volatile int*)__null) = 4667; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4667 | std::string("IntervalEnd(then)")))do { static_assert( mozilla::detail::AssertionConditionType< decltype(mozilla::baseprofiler::AddMarkerToBuffer( buffer, "test2" , mozilla::baseprofiler::category::OTHER_Profiling, mozilla:: MarkerTiming::IntervalEnd(then), MarkerTypeTestMinimal{}, std ::string("IntervalEnd(then)")))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(mozilla::baseprofiler::AddMarkerToBuffer ( buffer, "test2", mozilla::baseprofiler::category::OTHER_Profiling , mozilla::MarkerTiming::IntervalEnd(then), MarkerTypeTestMinimal {}, std::string("IntervalEnd(then)"))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerTiming::IntervalEnd(then), MarkerTypeTestMinimal{}, std::string(\"IntervalEnd(then)\"))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4667); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerTiming::IntervalEnd(then), MarkerTypeTestMinimal{}, std::string(\"IntervalEnd(then)\"))" ")"); do { *((volatile int*)__null) = 4667; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
4668 | ||||
4669 | MOZ_RELEASE_ASSERT(mozilla::baseprofiler::AddMarkerToBuffer(do { static_assert( mozilla::detail::AssertionConditionType< decltype(mozilla::baseprofiler::AddMarkerToBuffer( buffer, "test2" , mozilla::baseprofiler::category::OTHER_Profiling, mozilla:: MarkerTiming::Interval(start, then), MarkerTypeTestMinimal{}, std::string("Interval(start, then)")))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(mozilla::baseprofiler::AddMarkerToBuffer ( buffer, "test2", mozilla::baseprofiler::category::OTHER_Profiling , mozilla::MarkerTiming::Interval(start, then), MarkerTypeTestMinimal {}, std::string("Interval(start, then)"))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerTiming::Interval(start, then), MarkerTypeTestMinimal{}, std::string(\"Interval(start, then)\"))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4672); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerTiming::Interval(start, then), MarkerTypeTestMinimal{}, std::string(\"Interval(start, then)\"))" ")"); do { *((volatile int*)__null) = 4672; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4670 | buffer, "test2", mozilla::baseprofiler::category::OTHER_Profiling,do { static_assert( mozilla::detail::AssertionConditionType< decltype(mozilla::baseprofiler::AddMarkerToBuffer( buffer, "test2" , mozilla::baseprofiler::category::OTHER_Profiling, mozilla:: MarkerTiming::Interval(start, then), MarkerTypeTestMinimal{}, std::string("Interval(start, then)")))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(mozilla::baseprofiler::AddMarkerToBuffer ( buffer, "test2", mozilla::baseprofiler::category::OTHER_Profiling , mozilla::MarkerTiming::Interval(start, then), MarkerTypeTestMinimal {}, std::string("Interval(start, then)"))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerTiming::Interval(start, then), MarkerTypeTestMinimal{}, std::string(\"Interval(start, then)\"))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4672); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerTiming::Interval(start, then), MarkerTypeTestMinimal{}, std::string(\"Interval(start, then)\"))" ")"); do { *((volatile int*)__null) = 4672; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4671 | mozilla::MarkerTiming::Interval(start, then), MarkerTypeTestMinimal{},do { static_assert( mozilla::detail::AssertionConditionType< decltype(mozilla::baseprofiler::AddMarkerToBuffer( buffer, "test2" , mozilla::baseprofiler::category::OTHER_Profiling, mozilla:: MarkerTiming::Interval(start, then), MarkerTypeTestMinimal{}, std::string("Interval(start, then)")))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(mozilla::baseprofiler::AddMarkerToBuffer ( buffer, "test2", mozilla::baseprofiler::category::OTHER_Profiling , mozilla::MarkerTiming::Interval(start, then), MarkerTypeTestMinimal {}, std::string("Interval(start, then)"))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerTiming::Interval(start, then), MarkerTypeTestMinimal{}, std::string(\"Interval(start, then)\"))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4672); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerTiming::Interval(start, then), MarkerTypeTestMinimal{}, std::string(\"Interval(start, then)\"))" ")"); do { *((volatile int*)__null) = 4672; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4672 | std::string("Interval(start, then)")))do { static_assert( mozilla::detail::AssertionConditionType< decltype(mozilla::baseprofiler::AddMarkerToBuffer( buffer, "test2" , mozilla::baseprofiler::category::OTHER_Profiling, mozilla:: MarkerTiming::Interval(start, then), MarkerTypeTestMinimal{}, std::string("Interval(start, then)")))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(mozilla::baseprofiler::AddMarkerToBuffer ( buffer, "test2", mozilla::baseprofiler::category::OTHER_Profiling , mozilla::MarkerTiming::Interval(start, then), MarkerTypeTestMinimal {}, std::string("Interval(start, then)"))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerTiming::Interval(start, then), MarkerTypeTestMinimal{}, std::string(\"Interval(start, then)\"))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4672); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerTiming::Interval(start, then), MarkerTypeTestMinimal{}, std::string(\"Interval(start, then)\"))" ")"); do { *((volatile int*)__null) = 4672; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
4673 | ||||
4674 | MOZ_RELEASE_ASSERT(mozilla::baseprofiler::AddMarkerToBuffer(do { static_assert( mozilla::detail::AssertionConditionType< decltype(mozilla::baseprofiler::AddMarkerToBuffer( buffer, "test2" , mozilla::baseprofiler::category::OTHER_Profiling, mozilla:: MarkerTiming::IntervalUntilNowFrom(start), MarkerTypeTestMinimal {}, std::string("IntervalUntilNowFrom(start)")))>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(mozilla::baseprofiler::AddMarkerToBuffer( buffer, "test2", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerTiming ::IntervalUntilNowFrom(start), MarkerTypeTestMinimal{}, std:: string("IntervalUntilNowFrom(start)"))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerTiming::IntervalUntilNowFrom(start), MarkerTypeTestMinimal{}, std::string(\"IntervalUntilNowFrom(start)\"))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4677); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerTiming::IntervalUntilNowFrom(start), MarkerTypeTestMinimal{}, std::string(\"IntervalUntilNowFrom(start)\"))" ")"); do { *((volatile int*)__null) = 4677; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4675 | buffer, "test2", mozilla::baseprofiler::category::OTHER_Profiling,do { static_assert( mozilla::detail::AssertionConditionType< decltype(mozilla::baseprofiler::AddMarkerToBuffer( buffer, "test2" , mozilla::baseprofiler::category::OTHER_Profiling, mozilla:: MarkerTiming::IntervalUntilNowFrom(start), MarkerTypeTestMinimal {}, std::string("IntervalUntilNowFrom(start)")))>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(mozilla::baseprofiler::AddMarkerToBuffer( buffer, "test2", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerTiming ::IntervalUntilNowFrom(start), MarkerTypeTestMinimal{}, std:: string("IntervalUntilNowFrom(start)"))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerTiming::IntervalUntilNowFrom(start), MarkerTypeTestMinimal{}, std::string(\"IntervalUntilNowFrom(start)\"))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4677); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerTiming::IntervalUntilNowFrom(start), MarkerTypeTestMinimal{}, std::string(\"IntervalUntilNowFrom(start)\"))" ")"); do { *((volatile int*)__null) = 4677; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4676 | mozilla::MarkerTiming::IntervalUntilNowFrom(start),do { static_assert( mozilla::detail::AssertionConditionType< decltype(mozilla::baseprofiler::AddMarkerToBuffer( buffer, "test2" , mozilla::baseprofiler::category::OTHER_Profiling, mozilla:: MarkerTiming::IntervalUntilNowFrom(start), MarkerTypeTestMinimal {}, std::string("IntervalUntilNowFrom(start)")))>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(mozilla::baseprofiler::AddMarkerToBuffer( buffer, "test2", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerTiming ::IntervalUntilNowFrom(start), MarkerTypeTestMinimal{}, std:: string("IntervalUntilNowFrom(start)"))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerTiming::IntervalUntilNowFrom(start), MarkerTypeTestMinimal{}, std::string(\"IntervalUntilNowFrom(start)\"))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4677); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerTiming::IntervalUntilNowFrom(start), MarkerTypeTestMinimal{}, std::string(\"IntervalUntilNowFrom(start)\"))" ")"); do { *((volatile int*)__null) = 4677; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4677 | MarkerTypeTestMinimal{}, std::string("IntervalUntilNowFrom(start)")))do { static_assert( mozilla::detail::AssertionConditionType< decltype(mozilla::baseprofiler::AddMarkerToBuffer( buffer, "test2" , mozilla::baseprofiler::category::OTHER_Profiling, mozilla:: MarkerTiming::IntervalUntilNowFrom(start), MarkerTypeTestMinimal {}, std::string("IntervalUntilNowFrom(start)")))>::isValid , "invalid assertion condition"); if ((__builtin_expect(!!(!( !!(mozilla::baseprofiler::AddMarkerToBuffer( buffer, "test2", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerTiming ::IntervalUntilNowFrom(start), MarkerTypeTestMinimal{}, std:: string("IntervalUntilNowFrom(start)"))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerTiming::IntervalUntilNowFrom(start), MarkerTypeTestMinimal{}, std::string(\"IntervalUntilNowFrom(start)\"))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4677); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerTiming::IntervalUntilNowFrom(start), MarkerTypeTestMinimal{}, std::string(\"IntervalUntilNowFrom(start)\"))" ")"); do { *((volatile int*)__null) = 4677; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
4678 | ||||
4679 | MOZ_RELEASE_ASSERT(mozilla::baseprofiler::AddMarkerToBuffer(do { static_assert( mozilla::detail::AssertionConditionType< decltype(mozilla::baseprofiler::AddMarkerToBuffer( buffer, "test2" , mozilla::baseprofiler::category::OTHER_Profiling, mozilla:: MarkerStack::NoStack(), MarkerTypeTestMinimal{}, std::string( "NoStack")))>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(!!(mozilla::baseprofiler::AddMarkerToBuffer ( buffer, "test2", mozilla::baseprofiler::category::OTHER_Profiling , mozilla::MarkerStack::NoStack(), MarkerTypeTestMinimal{}, std ::string("NoStack"))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerStack::NoStack(), MarkerTypeTestMinimal{}, std::string(\"NoStack\"))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4682); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerStack::NoStack(), MarkerTypeTestMinimal{}, std::string(\"NoStack\"))" ")"); do { *((volatile int*)__null) = 4682; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4680 | buffer, "test2", mozilla::baseprofiler::category::OTHER_Profiling,do { static_assert( mozilla::detail::AssertionConditionType< decltype(mozilla::baseprofiler::AddMarkerToBuffer( buffer, "test2" , mozilla::baseprofiler::category::OTHER_Profiling, mozilla:: MarkerStack::NoStack(), MarkerTypeTestMinimal{}, std::string( "NoStack")))>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(!!(mozilla::baseprofiler::AddMarkerToBuffer ( buffer, "test2", mozilla::baseprofiler::category::OTHER_Profiling , mozilla::MarkerStack::NoStack(), MarkerTypeTestMinimal{}, std ::string("NoStack"))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerStack::NoStack(), MarkerTypeTestMinimal{}, std::string(\"NoStack\"))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4682); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerStack::NoStack(), MarkerTypeTestMinimal{}, std::string(\"NoStack\"))" ")"); do { *((volatile int*)__null) = 4682; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4681 | mozilla::MarkerStack::NoStack(), MarkerTypeTestMinimal{},do { static_assert( mozilla::detail::AssertionConditionType< decltype(mozilla::baseprofiler::AddMarkerToBuffer( buffer, "test2" , mozilla::baseprofiler::category::OTHER_Profiling, mozilla:: MarkerStack::NoStack(), MarkerTypeTestMinimal{}, std::string( "NoStack")))>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(!!(mozilla::baseprofiler::AddMarkerToBuffer ( buffer, "test2", mozilla::baseprofiler::category::OTHER_Profiling , mozilla::MarkerStack::NoStack(), MarkerTypeTestMinimal{}, std ::string("NoStack"))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerStack::NoStack(), MarkerTypeTestMinimal{}, std::string(\"NoStack\"))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4682); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerStack::NoStack(), MarkerTypeTestMinimal{}, std::string(\"NoStack\"))" ")"); do { *((volatile int*)__null) = 4682; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4682 | std::string("NoStack")))do { static_assert( mozilla::detail::AssertionConditionType< decltype(mozilla::baseprofiler::AddMarkerToBuffer( buffer, "test2" , mozilla::baseprofiler::category::OTHER_Profiling, mozilla:: MarkerStack::NoStack(), MarkerTypeTestMinimal{}, std::string( "NoStack")))>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(!!(mozilla::baseprofiler::AddMarkerToBuffer ( buffer, "test2", mozilla::baseprofiler::category::OTHER_Profiling , mozilla::MarkerStack::NoStack(), MarkerTypeTestMinimal{}, std ::string("NoStack"))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerStack::NoStack(), MarkerTypeTestMinimal{}, std::string(\"NoStack\"))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4682); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerStack::NoStack(), MarkerTypeTestMinimal{}, std::string(\"NoStack\"))" ")"); do { *((volatile int*)__null) = 4682; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
4683 | // Note: We cannot test stack-capture here, because the profiler is not | |||
4684 | // initialized. | |||
4685 | ||||
4686 | MOZ_RELEASE_ASSERT(mozilla::baseprofiler::AddMarkerToBuffer(do { static_assert( mozilla::detail::AssertionConditionType< decltype(mozilla::baseprofiler::AddMarkerToBuffer( buffer, "test2" , mozilla::baseprofiler::category::OTHER_Profiling, mozilla:: MarkerInnerWindowId(123), MarkerTypeTestMinimal{}, std::string ("InnerWindowId(123)")))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(mozilla::baseprofiler::AddMarkerToBuffer ( buffer, "test2", mozilla::baseprofiler::category::OTHER_Profiling , mozilla::MarkerInnerWindowId(123), MarkerTypeTestMinimal{}, std::string("InnerWindowId(123)"))))), 0))) { do { } while ( false); MOZ_ReportAssertionFailure("mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerInnerWindowId(123), MarkerTypeTestMinimal{}, std::string(\"InnerWindowId(123)\"))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4689); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerInnerWindowId(123), MarkerTypeTestMinimal{}, std::string(\"InnerWindowId(123)\"))" ")"); do { *((volatile int*)__null) = 4689; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4687 | buffer, "test2", mozilla::baseprofiler::category::OTHER_Profiling,do { static_assert( mozilla::detail::AssertionConditionType< decltype(mozilla::baseprofiler::AddMarkerToBuffer( buffer, "test2" , mozilla::baseprofiler::category::OTHER_Profiling, mozilla:: MarkerInnerWindowId(123), MarkerTypeTestMinimal{}, std::string ("InnerWindowId(123)")))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(mozilla::baseprofiler::AddMarkerToBuffer ( buffer, "test2", mozilla::baseprofiler::category::OTHER_Profiling , mozilla::MarkerInnerWindowId(123), MarkerTypeTestMinimal{}, std::string("InnerWindowId(123)"))))), 0))) { do { } while ( false); MOZ_ReportAssertionFailure("mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerInnerWindowId(123), MarkerTypeTestMinimal{}, std::string(\"InnerWindowId(123)\"))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4689); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerInnerWindowId(123), MarkerTypeTestMinimal{}, std::string(\"InnerWindowId(123)\"))" ")"); do { *((volatile int*)__null) = 4689; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4688 | mozilla::MarkerInnerWindowId(123), MarkerTypeTestMinimal{},do { static_assert( mozilla::detail::AssertionConditionType< decltype(mozilla::baseprofiler::AddMarkerToBuffer( buffer, "test2" , mozilla::baseprofiler::category::OTHER_Profiling, mozilla:: MarkerInnerWindowId(123), MarkerTypeTestMinimal{}, std::string ("InnerWindowId(123)")))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(mozilla::baseprofiler::AddMarkerToBuffer ( buffer, "test2", mozilla::baseprofiler::category::OTHER_Profiling , mozilla::MarkerInnerWindowId(123), MarkerTypeTestMinimal{}, std::string("InnerWindowId(123)"))))), 0))) { do { } while ( false); MOZ_ReportAssertionFailure("mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerInnerWindowId(123), MarkerTypeTestMinimal{}, std::string(\"InnerWindowId(123)\"))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4689); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerInnerWindowId(123), MarkerTypeTestMinimal{}, std::string(\"InnerWindowId(123)\"))" ")"); do { *((volatile int*)__null) = 4689; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4689 | std::string("InnerWindowId(123)")))do { static_assert( mozilla::detail::AssertionConditionType< decltype(mozilla::baseprofiler::AddMarkerToBuffer( buffer, "test2" , mozilla::baseprofiler::category::OTHER_Profiling, mozilla:: MarkerInnerWindowId(123), MarkerTypeTestMinimal{}, std::string ("InnerWindowId(123)")))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(mozilla::baseprofiler::AddMarkerToBuffer ( buffer, "test2", mozilla::baseprofiler::category::OTHER_Profiling , mozilla::MarkerInnerWindowId(123), MarkerTypeTestMinimal{}, std::string("InnerWindowId(123)"))))), 0))) { do { } while ( false); MOZ_ReportAssertionFailure("mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerInnerWindowId(123), MarkerTypeTestMinimal{}, std::string(\"InnerWindowId(123)\"))" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4689); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::AddMarkerToBuffer( buffer, \"test2\", mozilla::baseprofiler::category::OTHER_Profiling, mozilla::MarkerInnerWindowId(123), MarkerTypeTestMinimal{}, std::string(\"InnerWindowId(123)\"))" ")"); do { *((volatile int*)__null) = 4689; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
4690 | ||||
4691 | # ifdef DEBUG1 | |||
4692 | buffer.Dump(); | |||
4693 | # endif | |||
4694 | ||||
4695 | PrintMarkers(buffer); | |||
4696 | ||||
4697 | printf("TestUserMarker done\n"); | |||
4698 | } | |||
4699 | ||||
4700 | void TestPredefinedMarkers() { | |||
4701 | printf("TestPredefinedMarkers...\n"); | |||
4702 | ||||
4703 | mozilla::ProfileBufferChunkManagerSingle chunkManager(1024); | |||
4704 | mozilla::ProfileChunkedBuffer buffer( | |||
4705 | mozilla::ProfileChunkedBuffer::ThreadSafety::WithoutMutex, chunkManager); | |||
4706 | ||||
4707 | MOZ_RELEASE_ASSERT(mozilla::baseprofiler::AddMarkerToBuffer(do { static_assert( mozilla::detail::AssertionConditionType< decltype(mozilla::baseprofiler::AddMarkerToBuffer( buffer, std ::string_view("tracing"), mozilla::baseprofiler::category::OTHER , {}, mozilla::baseprofiler::markers::Tracing{}, "category")) >::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(mozilla::baseprofiler::AddMarkerToBuffer( buffer, std ::string_view("tracing"), mozilla::baseprofiler::category::OTHER , {}, mozilla::baseprofiler::markers::Tracing{}, "category")) )), 0))) { do { } while (false); MOZ_ReportAssertionFailure("mozilla::baseprofiler::AddMarkerToBuffer( buffer, std::string_view(\"tracing\"), mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::Tracing{}, \"category\")" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4710); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::AddMarkerToBuffer( buffer, std::string_view(\"tracing\"), mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::Tracing{}, \"category\")" ")"); do { *((volatile int*)__null) = 4710; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4708 | buffer, std::string_view("tracing"),do { static_assert( mozilla::detail::AssertionConditionType< decltype(mozilla::baseprofiler::AddMarkerToBuffer( buffer, std ::string_view("tracing"), mozilla::baseprofiler::category::OTHER , {}, mozilla::baseprofiler::markers::Tracing{}, "category")) >::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(mozilla::baseprofiler::AddMarkerToBuffer( buffer, std ::string_view("tracing"), mozilla::baseprofiler::category::OTHER , {}, mozilla::baseprofiler::markers::Tracing{}, "category")) )), 0))) { do { } while (false); MOZ_ReportAssertionFailure("mozilla::baseprofiler::AddMarkerToBuffer( buffer, std::string_view(\"tracing\"), mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::Tracing{}, \"category\")" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4710); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::AddMarkerToBuffer( buffer, std::string_view(\"tracing\"), mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::Tracing{}, \"category\")" ")"); do { *((volatile int*)__null) = 4710; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4709 | mozilla::baseprofiler::category::OTHER, {},do { static_assert( mozilla::detail::AssertionConditionType< decltype(mozilla::baseprofiler::AddMarkerToBuffer( buffer, std ::string_view("tracing"), mozilla::baseprofiler::category::OTHER , {}, mozilla::baseprofiler::markers::Tracing{}, "category")) >::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(mozilla::baseprofiler::AddMarkerToBuffer( buffer, std ::string_view("tracing"), mozilla::baseprofiler::category::OTHER , {}, mozilla::baseprofiler::markers::Tracing{}, "category")) )), 0))) { do { } while (false); MOZ_ReportAssertionFailure("mozilla::baseprofiler::AddMarkerToBuffer( buffer, std::string_view(\"tracing\"), mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::Tracing{}, \"category\")" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4710); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::AddMarkerToBuffer( buffer, std::string_view(\"tracing\"), mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::Tracing{}, \"category\")" ")"); do { *((volatile int*)__null) = 4710; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4710 | mozilla::baseprofiler::markers::Tracing{}, "category"))do { static_assert( mozilla::detail::AssertionConditionType< decltype(mozilla::baseprofiler::AddMarkerToBuffer( buffer, std ::string_view("tracing"), mozilla::baseprofiler::category::OTHER , {}, mozilla::baseprofiler::markers::Tracing{}, "category")) >::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(mozilla::baseprofiler::AddMarkerToBuffer( buffer, std ::string_view("tracing"), mozilla::baseprofiler::category::OTHER , {}, mozilla::baseprofiler::markers::Tracing{}, "category")) )), 0))) { do { } while (false); MOZ_ReportAssertionFailure("mozilla::baseprofiler::AddMarkerToBuffer( buffer, std::string_view(\"tracing\"), mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::Tracing{}, \"category\")" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4710); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::AddMarkerToBuffer( buffer, std::string_view(\"tracing\"), mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::Tracing{}, \"category\")" ")"); do { *((volatile int*)__null) = 4710; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
4711 | ||||
4712 | MOZ_RELEASE_ASSERT(mozilla::baseprofiler::AddMarkerToBuffer(do { static_assert( mozilla::detail::AssertionConditionType< decltype(mozilla::baseprofiler::AddMarkerToBuffer( buffer, std ::string_view("text"), mozilla::baseprofiler::category::OTHER , {}, mozilla::baseprofiler::markers::TextMarker{}, "text text" ))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(mozilla::baseprofiler::AddMarkerToBuffer( buffer, std ::string_view("text"), mozilla::baseprofiler::category::OTHER , {}, mozilla::baseprofiler::markers::TextMarker{}, "text text" )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("mozilla::baseprofiler::AddMarkerToBuffer( buffer, std::string_view(\"text\"), mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::TextMarker{}, \"text text\")" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4714); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::AddMarkerToBuffer( buffer, std::string_view(\"text\"), mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::TextMarker{}, \"text text\")" ")"); do { *((volatile int*)__null) = 4714; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4713 | buffer, std::string_view("text"), mozilla::baseprofiler::category::OTHER,do { static_assert( mozilla::detail::AssertionConditionType< decltype(mozilla::baseprofiler::AddMarkerToBuffer( buffer, std ::string_view("text"), mozilla::baseprofiler::category::OTHER , {}, mozilla::baseprofiler::markers::TextMarker{}, "text text" ))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(mozilla::baseprofiler::AddMarkerToBuffer( buffer, std ::string_view("text"), mozilla::baseprofiler::category::OTHER , {}, mozilla::baseprofiler::markers::TextMarker{}, "text text" )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("mozilla::baseprofiler::AddMarkerToBuffer( buffer, std::string_view(\"text\"), mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::TextMarker{}, \"text text\")" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4714); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::AddMarkerToBuffer( buffer, std::string_view(\"text\"), mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::TextMarker{}, \"text text\")" ")"); do { *((volatile int*)__null) = 4714; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4714 | {}, mozilla::baseprofiler::markers::TextMarker{}, "text text"))do { static_assert( mozilla::detail::AssertionConditionType< decltype(mozilla::baseprofiler::AddMarkerToBuffer( buffer, std ::string_view("text"), mozilla::baseprofiler::category::OTHER , {}, mozilla::baseprofiler::markers::TextMarker{}, "text text" ))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(mozilla::baseprofiler::AddMarkerToBuffer( buffer, std ::string_view("text"), mozilla::baseprofiler::category::OTHER , {}, mozilla::baseprofiler::markers::TextMarker{}, "text text" )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("mozilla::baseprofiler::AddMarkerToBuffer( buffer, std::string_view(\"text\"), mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::TextMarker{}, \"text text\")" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4714); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::AddMarkerToBuffer( buffer, std::string_view(\"text\"), mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::TextMarker{}, \"text text\")" ")"); do { *((volatile int*)__null) = 4714; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
4715 | ||||
4716 | MOZ_RELEASE_ASSERT(mozilla::baseprofiler::AddMarkerToBuffer(do { static_assert( mozilla::detail::AssertionConditionType< decltype(mozilla::baseprofiler::AddMarkerToBuffer( buffer, std ::string_view("media"), mozilla::baseprofiler::category::OTHER , {}, mozilla::baseprofiler::markers::MediaSampleMarker{}, 123 , 456, 789))>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(!!(mozilla::baseprofiler::AddMarkerToBuffer ( buffer, std::string_view("media"), mozilla::baseprofiler::category ::OTHER, {}, mozilla::baseprofiler::markers::MediaSampleMarker {}, 123, 456, 789)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("mozilla::baseprofiler::AddMarkerToBuffer( buffer, std::string_view(\"media\"), mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::MediaSampleMarker{}, 123, 456, 789)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4718); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::AddMarkerToBuffer( buffer, std::string_view(\"media\"), mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::MediaSampleMarker{}, 123, 456, 789)" ")"); do { *((volatile int*)__null) = 4718; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4717 | buffer, std::string_view("media"), mozilla::baseprofiler::category::OTHER,do { static_assert( mozilla::detail::AssertionConditionType< decltype(mozilla::baseprofiler::AddMarkerToBuffer( buffer, std ::string_view("media"), mozilla::baseprofiler::category::OTHER , {}, mozilla::baseprofiler::markers::MediaSampleMarker{}, 123 , 456, 789))>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(!!(mozilla::baseprofiler::AddMarkerToBuffer ( buffer, std::string_view("media"), mozilla::baseprofiler::category ::OTHER, {}, mozilla::baseprofiler::markers::MediaSampleMarker {}, 123, 456, 789)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("mozilla::baseprofiler::AddMarkerToBuffer( buffer, std::string_view(\"media\"), mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::MediaSampleMarker{}, 123, 456, 789)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4718); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::AddMarkerToBuffer( buffer, std::string_view(\"media\"), mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::MediaSampleMarker{}, 123, 456, 789)" ")"); do { *((volatile int*)__null) = 4718; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4718 | {}, mozilla::baseprofiler::markers::MediaSampleMarker{}, 123, 456, 789))do { static_assert( mozilla::detail::AssertionConditionType< decltype(mozilla::baseprofiler::AddMarkerToBuffer( buffer, std ::string_view("media"), mozilla::baseprofiler::category::OTHER , {}, mozilla::baseprofiler::markers::MediaSampleMarker{}, 123 , 456, 789))>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(!!(mozilla::baseprofiler::AddMarkerToBuffer ( buffer, std::string_view("media"), mozilla::baseprofiler::category ::OTHER, {}, mozilla::baseprofiler::markers::MediaSampleMarker {}, 123, 456, 789)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("mozilla::baseprofiler::AddMarkerToBuffer( buffer, std::string_view(\"media\"), mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::MediaSampleMarker{}, 123, 456, 789)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4718); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::AddMarkerToBuffer( buffer, std::string_view(\"media\"), mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::MediaSampleMarker{}, 123, 456, 789)" ")"); do { *((volatile int*)__null) = 4718; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
4719 | ||||
4720 | MOZ_RELEASE_ASSERT(mozilla::baseprofiler::AddMarkerToBuffer(do { static_assert( mozilla::detail::AssertionConditionType< decltype(mozilla::baseprofiler::AddMarkerToBuffer( buffer, std ::string_view("media"), mozilla::baseprofiler::category::OTHER , {}, mozilla::baseprofiler::markers::VideoFallingBehindMarker {}, 123, 456))>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(!!(mozilla::baseprofiler::AddMarkerToBuffer ( buffer, std::string_view("media"), mozilla::baseprofiler::category ::OTHER, {}, mozilla::baseprofiler::markers::VideoFallingBehindMarker {}, 123, 456)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("mozilla::baseprofiler::AddMarkerToBuffer( buffer, std::string_view(\"media\"), mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::VideoFallingBehindMarker{}, 123, 456)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4723); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::AddMarkerToBuffer( buffer, std::string_view(\"media\"), mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::VideoFallingBehindMarker{}, 123, 456)" ")"); do { *((volatile int*)__null) = 4723; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4721 | buffer, std::string_view("media"), mozilla::baseprofiler::category::OTHER,do { static_assert( mozilla::detail::AssertionConditionType< decltype(mozilla::baseprofiler::AddMarkerToBuffer( buffer, std ::string_view("media"), mozilla::baseprofiler::category::OTHER , {}, mozilla::baseprofiler::markers::VideoFallingBehindMarker {}, 123, 456))>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(!!(mozilla::baseprofiler::AddMarkerToBuffer ( buffer, std::string_view("media"), mozilla::baseprofiler::category ::OTHER, {}, mozilla::baseprofiler::markers::VideoFallingBehindMarker {}, 123, 456)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("mozilla::baseprofiler::AddMarkerToBuffer( buffer, std::string_view(\"media\"), mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::VideoFallingBehindMarker{}, 123, 456)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4723); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::AddMarkerToBuffer( buffer, std::string_view(\"media\"), mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::VideoFallingBehindMarker{}, 123, 456)" ")"); do { *((volatile int*)__null) = 4723; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4722 | {}, mozilla::baseprofiler::markers::VideoFallingBehindMarker{}, 123,do { static_assert( mozilla::detail::AssertionConditionType< decltype(mozilla::baseprofiler::AddMarkerToBuffer( buffer, std ::string_view("media"), mozilla::baseprofiler::category::OTHER , {}, mozilla::baseprofiler::markers::VideoFallingBehindMarker {}, 123, 456))>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(!!(mozilla::baseprofiler::AddMarkerToBuffer ( buffer, std::string_view("media"), mozilla::baseprofiler::category ::OTHER, {}, mozilla::baseprofiler::markers::VideoFallingBehindMarker {}, 123, 456)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("mozilla::baseprofiler::AddMarkerToBuffer( buffer, std::string_view(\"media\"), mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::VideoFallingBehindMarker{}, 123, 456)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4723); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::AddMarkerToBuffer( buffer, std::string_view(\"media\"), mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::VideoFallingBehindMarker{}, 123, 456)" ")"); do { *((volatile int*)__null) = 4723; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4723 | 456))do { static_assert( mozilla::detail::AssertionConditionType< decltype(mozilla::baseprofiler::AddMarkerToBuffer( buffer, std ::string_view("media"), mozilla::baseprofiler::category::OTHER , {}, mozilla::baseprofiler::markers::VideoFallingBehindMarker {}, 123, 456))>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(!!(mozilla::baseprofiler::AddMarkerToBuffer ( buffer, std::string_view("media"), mozilla::baseprofiler::category ::OTHER, {}, mozilla::baseprofiler::markers::VideoFallingBehindMarker {}, 123, 456)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("mozilla::baseprofiler::AddMarkerToBuffer( buffer, std::string_view(\"media\"), mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::VideoFallingBehindMarker{}, 123, 456)" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4723); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mozilla::baseprofiler::AddMarkerToBuffer( buffer, std::string_view(\"media\"), mozilla::baseprofiler::category::OTHER, {}, mozilla::baseprofiler::markers::VideoFallingBehindMarker{}, 123, 456)" ")"); do { *((volatile int*)__null) = 4723; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
4724 | ||||
4725 | # ifdef DEBUG1 | |||
4726 | buffer.Dump(); | |||
4727 | # endif | |||
4728 | ||||
4729 | PrintMarkers(buffer); | |||
4730 | ||||
4731 | printf("TestPredefinedMarkers done\n"); | |||
4732 | } | |||
4733 | ||||
4734 | void TestProfilerMarkers() { | |||
4735 | printf( | |||
4736 | "TestProfilerMarkers -- pid: %" PRIu64"l" "u" ", tid: %" PRIu64"l" "u" "\n", | |||
4737 | uint64_t(mozilla::baseprofiler::profiler_current_process_id().ToNumber()), | |||
4738 | uint64_t(mozilla::baseprofiler::profiler_current_thread_id().ToNumber())); | |||
4739 | // ::SleepMilli(10000); | |||
4740 | ||||
4741 | TestUniqueJSONStrings(); | |||
4742 | TestMarkerCategory(); | |||
4743 | TestMarkerThreadId(); | |||
4744 | TestMarkerNoPayload(); | |||
4745 | TestUserMarker(); | |||
4746 | TestPredefinedMarkers(); | |||
4747 | ||||
4748 | printf("TestProfilerMarkers done\n"); | |||
4749 | } | |||
4750 | ||||
4751 | #else // MOZ_GECKO_PROFILER | |||
4752 | ||||
4753 | // Testing that macros are still #defined (but do nothing) when | |||
4754 | // MOZ_GECKO_PROFILER is disabled. | |||
4755 | void TestProfiler() { | |||
4756 | // These don't need to make sense, we just want to know that they're defined | |||
4757 | // and don't do anything. | |||
4758 | ||||
4759 | # ifndef AUTO_BASE_PROFILER_INIT::mozilla::baseprofiler::AutoProfilerInit raiiObject4759 | |||
4760 | # error AUTO_BASE_PROFILER_INIT::mozilla::baseprofiler::AutoProfilerInit raiiObject4760 not #defined | |||
4761 | # endif // AUTO_BASE_PROFILER_INIT | |||
4762 | AUTO_BASE_PROFILER_INIT::mozilla::baseprofiler::AutoProfilerInit raiiObject4762; | |||
4763 | ||||
4764 | # ifndef AUTO_BASE_PROFILER_MARKER_TEXT | |||
4765 | # error AUTO_BASE_PROFILER_MARKER_TEXT not #defined | |||
4766 | # endif // AUTO_BASE_PROFILER_MARKER_TEXT | |||
4767 | ||||
4768 | # ifndef AUTO_BASE_PROFILER_LABEL | |||
4769 | # error AUTO_BASE_PROFILER_LABEL not #defined | |||
4770 | # endif // AUTO_BASE_PROFILER_LABEL | |||
4771 | ||||
4772 | # ifndef AUTO_BASE_PROFILER_THREAD_SLEEP::mozilla::baseprofiler::AutoProfilerThreadSleep raiiObject4772 | |||
4773 | # error AUTO_BASE_PROFILER_THREAD_SLEEP::mozilla::baseprofiler::AutoProfilerThreadSleep raiiObject4773 not #defined | |||
4774 | # endif // AUTO_BASE_PROFILER_THREAD_SLEEP | |||
4775 | AUTO_BASE_PROFILER_THREAD_SLEEP::mozilla::baseprofiler::AutoProfilerThreadSleep raiiObject4775; | |||
4776 | ||||
4777 | # ifndef BASE_PROFILER_MARKER_UNTYPED | |||
4778 | # error BASE_PROFILER_MARKER_UNTYPED not #defined | |||
4779 | # endif // BASE_PROFILER_MARKER_UNTYPED | |||
4780 | ||||
4781 | # ifndef BASE_PROFILER_MARKER | |||
4782 | # error BASE_PROFILER_MARKER not #defined | |||
4783 | # endif // BASE_PROFILER_MARKER | |||
4784 | ||||
4785 | # ifndef BASE_PROFILER_MARKER_TEXT | |||
4786 | # error BASE_PROFILER_MARKER_TEXT not #defined | |||
4787 | # endif // BASE_PROFILER_MARKER_TEXT | |||
4788 | ||||
4789 | MOZ_RELEASE_ASSERT(!mozilla::baseprofiler::profiler_get_backtrace(),do { static_assert( mozilla::detail::AssertionConditionType< decltype(!mozilla::baseprofiler::profiler_get_backtrace())> ::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(!mozilla::baseprofiler::profiler_get_backtrace()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!mozilla::baseprofiler::profiler_get_backtrace()" " (" "profiler_get_backtrace should return nullptr" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4790); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!mozilla::baseprofiler::profiler_get_backtrace()" ") (" "profiler_get_backtrace should return nullptr" ")"); do { *((volatile int*)__null) = 4790; __attribute__((nomerge)) :: abort(); } while (false); } } while (false) | |||
4790 | "profiler_get_backtrace should return nullptr")do { static_assert( mozilla::detail::AssertionConditionType< decltype(!mozilla::baseprofiler::profiler_get_backtrace())> ::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(!mozilla::baseprofiler::profiler_get_backtrace()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!mozilla::baseprofiler::profiler_get_backtrace()" " (" "profiler_get_backtrace should return nullptr" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4790); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!mozilla::baseprofiler::profiler_get_backtrace()" ") (" "profiler_get_backtrace should return nullptr" ")"); do { *((volatile int*)__null) = 4790; __attribute__((nomerge)) :: abort(); } while (false); } } while (false); | |||
4791 | mozilla::ProfileChunkedBuffer buffer( | |||
4792 | mozilla::ProfileChunkedBuffer::ThreadSafety::WithoutMutex); | |||
4793 | MOZ_RELEASE_ASSERT(!mozilla::baseprofiler::profiler_capture_backtrace_into(do { static_assert( mozilla::detail::AssertionConditionType< decltype(!mozilla::baseprofiler::profiler_capture_backtrace_into ( buffer, mozilla::StackCaptureOptions::Full))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!mozilla::baseprofiler::profiler_capture_backtrace_into ( buffer, mozilla::StackCaptureOptions::Full)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!mozilla::baseprofiler::profiler_capture_backtrace_into( buffer, mozilla::StackCaptureOptions::Full)" " (" "profiler_capture_backtrace_into should return false" ")" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4795); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!mozilla::baseprofiler::profiler_capture_backtrace_into( buffer, mozilla::StackCaptureOptions::Full)" ") (" "profiler_capture_backtrace_into should return false" ")" ); do { *((volatile int*)__null) = 4795; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4794 | buffer, mozilla::StackCaptureOptions::Full),do { static_assert( mozilla::detail::AssertionConditionType< decltype(!mozilla::baseprofiler::profiler_capture_backtrace_into ( buffer, mozilla::StackCaptureOptions::Full))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!mozilla::baseprofiler::profiler_capture_backtrace_into ( buffer, mozilla::StackCaptureOptions::Full)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!mozilla::baseprofiler::profiler_capture_backtrace_into( buffer, mozilla::StackCaptureOptions::Full)" " (" "profiler_capture_backtrace_into should return false" ")" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4795); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!mozilla::baseprofiler::profiler_capture_backtrace_into( buffer, mozilla::StackCaptureOptions::Full)" ") (" "profiler_capture_backtrace_into should return false" ")" ); do { *((volatile int*)__null) = 4795; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4795 | "profiler_capture_backtrace_into should return false")do { static_assert( mozilla::detail::AssertionConditionType< decltype(!mozilla::baseprofiler::profiler_capture_backtrace_into ( buffer, mozilla::StackCaptureOptions::Full))>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!mozilla::baseprofiler::profiler_capture_backtrace_into ( buffer, mozilla::StackCaptureOptions::Full)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!mozilla::baseprofiler::profiler_capture_backtrace_into( buffer, mozilla::StackCaptureOptions::Full)" " (" "profiler_capture_backtrace_into should return false" ")" , "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4795); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!mozilla::baseprofiler::profiler_capture_backtrace_into( buffer, mozilla::StackCaptureOptions::Full)" ") (" "profiler_capture_backtrace_into should return false" ")" ); do { *((volatile int*)__null) = 4795; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
4796 | MOZ_RELEASE_ASSERT(!mozilla::baseprofiler::profiler_capture_backtrace(),do { static_assert( mozilla::detail::AssertionConditionType< decltype(!mozilla::baseprofiler::profiler_capture_backtrace() )>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(!mozilla::baseprofiler::profiler_capture_backtrace() ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "!mozilla::baseprofiler::profiler_capture_backtrace()" " (" "profiler_capture_backtrace should return nullptr" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4797); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!mozilla::baseprofiler::profiler_capture_backtrace()" ") (" "profiler_capture_backtrace should return nullptr" ")" ); do { *((volatile int*)__null) = 4797; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) | |||
4797 | "profiler_capture_backtrace should return nullptr")do { static_assert( mozilla::detail::AssertionConditionType< decltype(!mozilla::baseprofiler::profiler_capture_backtrace() )>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(!mozilla::baseprofiler::profiler_capture_backtrace() ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "!mozilla::baseprofiler::profiler_capture_backtrace()" " (" "profiler_capture_backtrace should return nullptr" ")", "/var/lib/jenkins/workspace/firefox-scan-build/mozglue/tests/TestBaseProfiler.cpp" , 4797); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "!mozilla::baseprofiler::profiler_capture_backtrace()" ") (" "profiler_capture_backtrace should return nullptr" ")" ); do { *((volatile int*)__null) = 4797; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
4798 | } | |||
4799 | ||||
4800 | // Testing that macros are still #defined (but do nothing) when | |||
4801 | // MOZ_GECKO_PROFILER is disabled. | |||
4802 | void TestProfilerMarkers() { | |||
4803 | // These don't need to make sense, we just want to know that they're defined | |||
4804 | // and don't do anything. | |||
4805 | } | |||
4806 | ||||
4807 | #endif // MOZ_GECKO_PROFILER else | |||
4808 | ||||
4809 | #if defined(XP_WIN) | |||
4810 | int wmain() | |||
4811 | #else | |||
4812 | int main() | |||
4813 | #endif // defined(XP_WIN) | |||
4814 | { | |||
4815 | #ifdef MOZ_GECKO_PROFILER1 | |||
4816 | printf("BaseTestProfiler -- pid: %" PRIu64"l" "u" ", tid: %" PRIu64"l" "u" "\n", | |||
4817 | uint64_t(baseprofiler::profiler_current_process_id().ToNumber()), | |||
4818 | uint64_t(baseprofiler::profiler_current_thread_id().ToNumber())); | |||
4819 | // ::SleepMilli(10000); | |||
4820 | #endif // MOZ_GECKO_PROFILER | |||
4821 | ||||
4822 | TestFailureLatch(); | |||
4823 | TestProfilerUtils(); | |||
4824 | TestBaseAndProfilerDetail(); | |||
4825 | TestSharedMutex(); | |||
4826 | TestProportionValue(); | |||
4827 | TestProgressLogger(); | |||
4828 | // Note that there are two `TestProfiler{,Markers}` functions above, depending | |||
4829 | // on whether MOZ_GECKO_PROFILER is #defined. | |||
4830 | { | |||
4831 | printf("profiler_init()...\n"); | |||
4832 | AUTO_BASE_PROFILER_INIT::mozilla::baseprofiler::AutoProfilerInit raiiObject4832; | |||
4833 | ||||
4834 | TestProfiler(); | |||
4835 | TestProfilerMarkers(); | |||
4836 | } | |||
4837 | ||||
4838 | return 0; | |||
4839 | } |
1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
2 | /* vim: set ts=8 sts=2 et sw=2 tw=80: */ |
3 | /* This Source Code Form is subject to the terms of the Mozilla Public |
4 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
5 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
6 | |
7 | // This header contains basic definitions required to create marker types, and |
8 | // to add markers to the profiler buffers. |
9 | // |
10 | // In most cases, #include "mozilla/BaseProfilerMarkers.h" instead, or |
11 | // #include "mozilla/BaseProfilerMarkerTypes.h" for common marker types. |
12 | |
13 | #ifndef BaseProfilerMarkersPrerequisites_h |
14 | #define BaseProfilerMarkersPrerequisites_h |
15 | |
16 | namespace mozilla { |
17 | |
18 | enum class StackCaptureOptions { |
19 | NoStack, // No stack captured. |
20 | Full, // Capture a full stack, including label frames, JS frames and |
21 | // native frames. |
22 | NonNative, // Capture a stack without native frames for reduced overhead. |
23 | }; |
24 | |
25 | } |
26 | |
27 | #include "BaseProfileJSONWriter.h" |
28 | #include "BaseProfilingCategory.h" |
29 | #include "mozilla/Maybe.h" |
30 | #include "mozilla/ProfileChunkedBuffer.h" |
31 | #include "mozilla/BaseProfilerState.h" |
32 | #include "mozilla/TimeStamp.h" |
33 | #include "mozilla/UniquePtr.h" |
34 | #include "mozilla/Variant.h" |
35 | |
36 | #include <initializer_list> |
37 | #include <string_view> |
38 | #include <string> |
39 | #include <type_traits> |
40 | #include <utility> |
41 | #include <vector> |
42 | |
43 | namespace mozilla { |
44 | |
45 | // Return a NotNull<const CHAR*> pointing at the literal empty string `""`. |
46 | template <typename CHAR> |
47 | constexpr const CHAR* LiteralEmptyStringPointer() { |
48 | static_assert(std::is_same_v<CHAR, char> || std::is_same_v<CHAR, char16_t>, |
49 | "Only char and char16_t are supported in Firefox"); |
50 | if constexpr (std::is_same_v<CHAR, char>) { |
51 | return ""; |
52 | } |
53 | if constexpr (std::is_same_v<CHAR, char16_t>) { |
54 | return u""; |
55 | } |
56 | } |
57 | |
58 | // Return a string_view<CHAR> pointing at the literal empty string. |
59 | template <typename CHAR> |
60 | constexpr std::basic_string_view<CHAR> LiteralEmptyStringView() { |
61 | static_assert(std::is_same_v<CHAR, char> || std::is_same_v<CHAR, char16_t>, |
62 | "Only char and char16_t are supported in Firefox"); |
63 | // Use `operator""sv()` from <string_view>. |
64 | using namespace std::literals::string_view_literals; |
65 | if constexpr (std::is_same_v<CHAR, char>) { |
66 | return ""sv; |
67 | } |
68 | if constexpr (std::is_same_v<CHAR, char16_t>) { |
69 | return u""sv; |
70 | } |
71 | } |
72 | |
73 | // General string view, optimized for short on-stack life before serialization, |
74 | // and between deserialization and JSON-streaming. |
75 | template <typename CHAR> |
76 | class MOZ_STACK_CLASS ProfilerStringView { |
77 | public: |
78 | // Default constructor points at "" (literal empty string). |
79 | constexpr ProfilerStringView() = default; |
80 | |
81 | // Don't allow copy. |
82 | ProfilerStringView(const ProfilerStringView&) = delete; |
83 | ProfilerStringView& operator=(const ProfilerStringView&) = delete; |
84 | |
85 | // Allow move. For consistency the moved-from string is always reset to "". |
86 | constexpr ProfilerStringView(ProfilerStringView&& aOther) |
87 | : mStringView(std::move(aOther.mStringView)), |
88 | mOwnership(aOther.mOwnership) { |
89 | if (mOwnership == Ownership::OwnedThroughStringView) { |
90 | // We now own the buffer, make the other point at the literal "". |
91 | aOther.mStringView = LiteralEmptyStringView<CHAR>(); |
92 | aOther.mOwnership = Ownership::Literal; |
93 | } |
94 | } |
95 | constexpr ProfilerStringView& operator=(ProfilerStringView&& aOther) { |
96 | mStringView = std::move(aOther.mStringView); |
97 | mOwnership = aOther.mOwnership; |
98 | if (mOwnership == Ownership::OwnedThroughStringView) { |
99 | // We now own the buffer, make the other point at the literal "". |
100 | aOther.mStringView = LiteralEmptyStringView<CHAR>(); |
101 | aOther.mOwnership = Ownership::Literal; |
102 | } |
103 | return *this; |
104 | } |
105 | |
106 | ~ProfilerStringView() { |
107 | if (MOZ_UNLIKELY(mOwnership == Ownership::OwnedThroughStringView)(__builtin_expect(!!(mOwnership == Ownership::OwnedThroughStringView ), 0))) { |
108 | // We own the buffer pointed at by mStringView, destroy it. |
109 | // This is only used between deserialization and streaming. |
110 | delete mStringView.data(); |
111 | } |
112 | } |
113 | |
114 | // Implicit construction from nullptr, points at "" (literal empty string). |
115 | constexpr MOZ_IMPLICIT ProfilerStringView(decltype(nullptr)) {} |
116 | |
117 | // Implicit constructor from a literal string. |
118 | template <size_t Np1> |
119 | constexpr MOZ_IMPLICIT ProfilerStringView(const CHAR (&aLiteralString)[Np1]) |
120 | : ProfilerStringView(aLiteralString, Np1 - 1, Ownership::Literal) {} |
121 | |
122 | // Constructor from a non-literal string. |
123 | constexpr ProfilerStringView(const CHAR* aString, size_t aLength) |
124 | : ProfilerStringView(aString, aLength, Ownership::Reference) {} |
125 | |
126 | // Implicit constructor from a string_view. |
127 | constexpr MOZ_IMPLICIT ProfilerStringView( |
128 | const std::basic_string_view<CHAR>& aStringView) |
129 | : ProfilerStringView(aStringView.data(), aStringView.length(), |
130 | Ownership::Reference) {} |
131 | |
132 | // Implicit constructor from an expiring string_view. We assume that the |
133 | // pointed-at string will outlive this ProfilerStringView. |
134 | constexpr MOZ_IMPLICIT ProfilerStringView( |
135 | std::basic_string_view<CHAR>&& aStringView) |
136 | : ProfilerStringView(aStringView.data(), aStringView.length(), |
137 | Ownership::Reference) {} |
138 | |
139 | // Implicit constructor from std::string. |
140 | constexpr MOZ_IMPLICIT ProfilerStringView( |
141 | const std::basic_string<CHAR>& aString) |
142 | : ProfilerStringView(aString.data(), aString.length(), |
143 | Ownership::Reference) {} |
144 | |
145 | // Construction from a raw pointer to a null-terminated string. |
146 | // This is a named class-static function to make it more obvious where work is |
147 | // being done (to determine the string length), and encourage users to instead |
148 | // provide a length, if already known. |
149 | // TODO: Find callers and convert them to constructor instead if possible. |
150 | static constexpr ProfilerStringView WrapNullTerminatedString( |
151 | const CHAR* aString) { |
152 | return ProfilerStringView( |
153 | aString, aString ? std::char_traits<CHAR>::length(aString) : 0, |
154 | Ownership::Reference); |
155 | } |
156 | |
157 | // Implicit constructor for an object with member functions `Data()` |
158 | // `Length()`, and `IsLiteral()`, common in xpcom strings. |
159 | template < |
160 | typename String, |
161 | typename DataReturnType = decltype(std::declval<const String>().Data()), |
162 | typename LengthReturnType = |
163 | decltype(std::declval<const String>().Length()), |
164 | typename IsLiteralReturnType = |
165 | decltype(std::declval<const String>().IsLiteral()), |
166 | typename = |
167 | std::enable_if_t<std::is_convertible_v<DataReturnType, const CHAR*> && |
168 | std::is_integral_v<LengthReturnType> && |
169 | std::is_same_v<IsLiteralReturnType, bool>>> |
170 | constexpr MOZ_IMPLICIT ProfilerStringView(const String& aString) |
171 | : ProfilerStringView( |
172 | static_cast<const CHAR*>(aString.Data()), aString.Length(), |
173 | aString.IsLiteral() ? Ownership::Literal : Ownership::Reference) {} |
174 | |
175 | [[nodiscard]] constexpr const std::basic_string_view<CHAR>& StringView() |
176 | const { |
177 | return mStringView; |
178 | } |
179 | |
180 | [[nodiscard]] constexpr size_t Length() const { return mStringView.length(); } |
181 | |
182 | [[nodiscard]] constexpr bool IsLiteral() const { |
183 | return mOwnership == Ownership::Literal; |
184 | } |
185 | [[nodiscard]] constexpr bool IsReference() const { |
186 | return mOwnership == Ownership::Reference; |
187 | } |
188 | // No `IsOwned...()` because it's a secret, only used internally! |
189 | |
190 | [[nodiscard]] Span<const CHAR> AsSpan() const { |
191 | return Span<const CHAR>(mStringView.data(), mStringView.length()); |
192 | } |
193 | [[nodiscard]] operator Span<const CHAR>() const { return AsSpan(); } |
194 | |
195 | private: |
196 | enum class Ownership { Literal, Reference, OwnedThroughStringView }; |
197 | |
198 | // Allow deserializer to store anything here. |
199 | friend ProfileBufferEntryReader::Deserializer<ProfilerStringView>; |
200 | |
201 | constexpr ProfilerStringView(const CHAR* aString, size_t aLength, |
202 | Ownership aOwnership) |
203 | : mStringView(aString ? std::basic_string_view<CHAR>(aString, aLength) |
204 | : LiteralEmptyStringView<CHAR>()), |
205 | mOwnership(aString ? aOwnership : Ownership::Literal) {} |
206 | |
207 | // String view to an outside string (literal or reference). |
208 | // We may actually own the pointed-at buffer, but it is only used internally |
209 | // between deserialization and JSON streaming. |
210 | std::basic_string_view<CHAR> mStringView = LiteralEmptyStringView<CHAR>(); |
211 | |
212 | Ownership mOwnership = Ownership::Literal; |
213 | }; |
214 | |
215 | using ProfilerString8View = ProfilerStringView<char>; |
216 | using ProfilerString16View = ProfilerStringView<char16_t>; |
217 | |
218 | // This compulsory marker parameter contains the required category information. |
219 | class MarkerCategory { |
220 | public: |
221 | // Constructor from category pair (includes both super- and sub-categories). |
222 | constexpr explicit MarkerCategory( |
223 | baseprofiler::ProfilingCategoryPair aCategoryPair) |
224 | : mCategoryPair(aCategoryPair) {} |
225 | |
226 | // Returns the stored category pair. |
227 | constexpr baseprofiler::ProfilingCategoryPair CategoryPair() const { |
228 | return mCategoryPair; |
229 | } |
230 | |
231 | // Returns the super-category from the stored category pair. |
232 | baseprofiler::ProfilingCategory GetCategory() const { |
233 | return GetProfilingCategoryPairInfo(mCategoryPair).mCategory; |
234 | } |
235 | |
236 | private: |
237 | baseprofiler::ProfilingCategoryPair mCategoryPair = |
238 | baseprofiler::ProfilingCategoryPair::OTHER; |
239 | }; |
240 | |
241 | namespace baseprofiler::category { |
242 | |
243 | // Each category pair name constructs a MarkerCategory. |
244 | // E.g.: mozilla::baseprofiler::category::OTHER_Profiling |
245 | // Profiler macros will take the category name alone without namespace. |
246 | // E.g.: `PROFILER_MARKER_UNTYPED("name", OTHER_Profiling)` |
247 | #define CATEGORY_ENUM_BEGIN_CATEGORY(name, labelAsString, color) |
248 | #define CATEGORY_ENUM_SUBCATEGORY(supercategory, name, labelAsString) \ |
249 | static constexpr MarkerCategory name{ProfilingCategoryPair::name}; |
250 | #define CATEGORY_ENUM_END_CATEGORY |
251 | MOZ_PROFILING_CATEGORY_LIST(CATEGORY_ENUM_BEGIN_CATEGORY,CATEGORY_ENUM_BEGIN_CATEGORY(IDLE, "Idle", "transparent") CATEGORY_ENUM_SUBCATEGORY (IDLE, IDLE, "Other") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY (OTHER, "Other", "grey") CATEGORY_ENUM_SUBCATEGORY(OTHER, OTHER , "Other") CATEGORY_ENUM_SUBCATEGORY(OTHER, OTHER_PreferenceRead , "Preference Read") CATEGORY_ENUM_SUBCATEGORY(OTHER, OTHER_Profiling , "Profiling") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY (TEST, "Test", "darkgray") CATEGORY_ENUM_SUBCATEGORY(TEST, TEST , "Test") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY (LAYOUT, "Layout", "purple") CATEGORY_ENUM_SUBCATEGORY(LAYOUT , LAYOUT, "Other") CATEGORY_ENUM_SUBCATEGORY(LAYOUT, LAYOUT_FrameConstruction , "Frame construction") CATEGORY_ENUM_SUBCATEGORY(LAYOUT, LAYOUT_Reflow , "Reflow") CATEGORY_ENUM_SUBCATEGORY(LAYOUT, LAYOUT_CSSParsing , "CSS parsing") CATEGORY_ENUM_SUBCATEGORY(LAYOUT, LAYOUT_SelectorQuery , "Selector query") CATEGORY_ENUM_SUBCATEGORY(LAYOUT, LAYOUT_StyleComputation , "Style computation") CATEGORY_ENUM_SUBCATEGORY(LAYOUT, LAYOUT_Destroy , "Layout cleanup") CATEGORY_ENUM_SUBCATEGORY(LAYOUT, LAYOUT_Printing , "Printing") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY (JS, "JavaScript", "yellow") CATEGORY_ENUM_SUBCATEGORY(JS, JS , "Other") CATEGORY_ENUM_SUBCATEGORY(JS, JS_Parsing, "Parsing" ) CATEGORY_ENUM_SUBCATEGORY(JS, JS_BaselineCompilation, "JIT Compile (baseline)" ) CATEGORY_ENUM_SUBCATEGORY(JS, JS_IonCompilation, "JIT Compile (ion)" ) CATEGORY_ENUM_SUBCATEGORY(JS, JS_Interpreter, "Interpreter" ) CATEGORY_ENUM_SUBCATEGORY(JS, JS_BaselineInterpret, "JIT (baseline-interpreter)" ) CATEGORY_ENUM_SUBCATEGORY(JS, JS_Baseline, "JIT (baseline)" ) CATEGORY_ENUM_SUBCATEGORY(JS, JS_IonMonkey, "JIT (ion)") CATEGORY_ENUM_SUBCATEGORY (JS, JS_Builtin, "Builtin API") CATEGORY_ENUM_SUBCATEGORY(JS, JS_WasmIon, "Wasm (ion)") CATEGORY_ENUM_SUBCATEGORY(JS, JS_WasmBaseline , "Wasm (baseline)") CATEGORY_ENUM_SUBCATEGORY(JS, JS_WasmOther , "Wasm (other)") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY (GCCC, "GC / CC", "orange") CATEGORY_ENUM_SUBCATEGORY(GCCC, GCCC , "Other") CATEGORY_ENUM_SUBCATEGORY(GCCC, GCCC_MinorGC, "Minor GC" ) CATEGORY_ENUM_SUBCATEGORY(GCCC, GCCC_MajorGC, "Major GC (Other)" ) CATEGORY_ENUM_SUBCATEGORY(GCCC, GCCC_MajorGC_Mark, "Major GC (Mark)" ) CATEGORY_ENUM_SUBCATEGORY(GCCC, GCCC_MajorGC_Sweep, "Major GC (Sweep)" ) CATEGORY_ENUM_SUBCATEGORY(GCCC, GCCC_MajorGC_Compact, "Major GC (Compact)" ) CATEGORY_ENUM_SUBCATEGORY(GCCC, GCCC_UnmarkGray, "Unmark Gray" ) CATEGORY_ENUM_SUBCATEGORY(GCCC, GCCC_Barrier, "Barrier") CATEGORY_ENUM_SUBCATEGORY (GCCC, GCCC_FreeSnowWhite, "CC (Free Snow White)") CATEGORY_ENUM_SUBCATEGORY (GCCC, GCCC_BuildGraph, "CC (Build Graph)") CATEGORY_ENUM_SUBCATEGORY (GCCC, GCCC_ScanRoots, "CC (Scan Roots)") CATEGORY_ENUM_SUBCATEGORY (GCCC, GCCC_CollectWhite, "CC (Collect White)") CATEGORY_ENUM_SUBCATEGORY (GCCC, GCCC_Finalize, "CC (Finalize)") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY(NETWORK, "Network", "lightblue" ) CATEGORY_ENUM_SUBCATEGORY(NETWORK, NETWORK, "Other") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY(GRAPHICS, "Graphics", "green") CATEGORY_ENUM_SUBCATEGORY (GRAPHICS, GRAPHICS, "Other") CATEGORY_ENUM_SUBCATEGORY(GRAPHICS , GRAPHICS_DisplayListBuilding, "DisplayList building") CATEGORY_ENUM_SUBCATEGORY (GRAPHICS, GRAPHICS_DisplayListMerging, "DisplayList merging" ) CATEGORY_ENUM_SUBCATEGORY(GRAPHICS, GRAPHICS_LayerBuilding, "Layer building") CATEGORY_ENUM_SUBCATEGORY(GRAPHICS, GRAPHICS_TileAllocation , "Tile allocation") CATEGORY_ENUM_SUBCATEGORY(GRAPHICS, GRAPHICS_WRDisplayList , "WebRender display list") CATEGORY_ENUM_SUBCATEGORY(GRAPHICS , GRAPHICS_Rasterization, "Rasterization") CATEGORY_ENUM_SUBCATEGORY (GRAPHICS, GRAPHICS_FlushingAsyncPaints, "Flushing async paints" ) CATEGORY_ENUM_SUBCATEGORY(GRAPHICS, GRAPHICS_ImageDecoding, "Image decoding") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY (DOM, "DOM", "blue") CATEGORY_ENUM_SUBCATEGORY(DOM, DOM, "Other" ) CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY(JAVA_ANDROID , "Android", "yellow") CATEGORY_ENUM_SUBCATEGORY(JAVA_ANDROID , JAVA_ANDROID, "Other") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY (JAVA_ANDROIDX, "AndroidX", "orange") CATEGORY_ENUM_SUBCATEGORY (JAVA_ANDROIDX, JAVA_ANDROIDX, "Other") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY(JAVA_LANGUAGE, "Java", "blue") CATEGORY_ENUM_SUBCATEGORY (JAVA_LANGUAGE, JAVA_LANGUAGE, "Other") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY(JAVA_MOZILLA, "Mozilla", "green" ) CATEGORY_ENUM_SUBCATEGORY(JAVA_MOZILLA, JAVA_MOZILLA, "Other" ) CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY(JAVA_KOTLIN , "Kotlin", "purple") CATEGORY_ENUM_SUBCATEGORY(JAVA_KOTLIN, JAVA_KOTLIN , "Other") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY (JAVA_BLOCKED, "Blocked", "lightblue") CATEGORY_ENUM_SUBCATEGORY (JAVA_BLOCKED, JAVA_BLOCKED, "Other") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY(IPC, "IPC", "lightgreen") CATEGORY_ENUM_SUBCATEGORY (IPC, IPC, "Other") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY (MEDIA, "Media", "orange") CATEGORY_ENUM_SUBCATEGORY(MEDIA, MEDIA , "Other") CATEGORY_ENUM_SUBCATEGORY(MEDIA, MEDIA_CUBEB, "Cubeb" ) CATEGORY_ENUM_SUBCATEGORY(MEDIA, MEDIA_PLAYBACK, "Playback" ) CATEGORY_ENUM_SUBCATEGORY(MEDIA, MEDIA_RT, "Real-time rendering" ) CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY(A11Y , "Accessibility", "brown") CATEGORY_ENUM_SUBCATEGORY(A11Y, A11Y , "Other") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY (PROFILER, "Profiler", "lightred") CATEGORY_ENUM_SUBCATEGORY( PROFILER, PROFILER, "Other") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY (TIMER, "Timer", "grey") CATEGORY_ENUM_SUBCATEGORY(TIMER, TIMER , "Other") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY (REMOTE_PROTOCOL, "Remote-Protocol", "grey") CATEGORY_ENUM_SUBCATEGORY (REMOTE_PROTOCOL, REMOTE_PROTOCOL, "Other") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY(SANDBOX, "Sandbox", "grey") CATEGORY_ENUM_SUBCATEGORY (SANDBOX, SANDBOX, "Other") CATEGORY_ENUM_END_CATEGORY |
252 | CATEGORY_ENUM_SUBCATEGORY,CATEGORY_ENUM_BEGIN_CATEGORY(IDLE, "Idle", "transparent") CATEGORY_ENUM_SUBCATEGORY (IDLE, IDLE, "Other") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY (OTHER, "Other", "grey") CATEGORY_ENUM_SUBCATEGORY(OTHER, OTHER , "Other") CATEGORY_ENUM_SUBCATEGORY(OTHER, OTHER_PreferenceRead , "Preference Read") CATEGORY_ENUM_SUBCATEGORY(OTHER, OTHER_Profiling , "Profiling") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY (TEST, "Test", "darkgray") CATEGORY_ENUM_SUBCATEGORY(TEST, TEST , "Test") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY (LAYOUT, "Layout", "purple") CATEGORY_ENUM_SUBCATEGORY(LAYOUT , LAYOUT, "Other") CATEGORY_ENUM_SUBCATEGORY(LAYOUT, LAYOUT_FrameConstruction , "Frame construction") CATEGORY_ENUM_SUBCATEGORY(LAYOUT, LAYOUT_Reflow , "Reflow") CATEGORY_ENUM_SUBCATEGORY(LAYOUT, LAYOUT_CSSParsing , "CSS parsing") CATEGORY_ENUM_SUBCATEGORY(LAYOUT, LAYOUT_SelectorQuery , "Selector query") CATEGORY_ENUM_SUBCATEGORY(LAYOUT, LAYOUT_StyleComputation , "Style computation") CATEGORY_ENUM_SUBCATEGORY(LAYOUT, LAYOUT_Destroy , "Layout cleanup") CATEGORY_ENUM_SUBCATEGORY(LAYOUT, LAYOUT_Printing , "Printing") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY (JS, "JavaScript", "yellow") CATEGORY_ENUM_SUBCATEGORY(JS, JS , "Other") CATEGORY_ENUM_SUBCATEGORY(JS, JS_Parsing, "Parsing" ) CATEGORY_ENUM_SUBCATEGORY(JS, JS_BaselineCompilation, "JIT Compile (baseline)" ) CATEGORY_ENUM_SUBCATEGORY(JS, JS_IonCompilation, "JIT Compile (ion)" ) CATEGORY_ENUM_SUBCATEGORY(JS, JS_Interpreter, "Interpreter" ) CATEGORY_ENUM_SUBCATEGORY(JS, JS_BaselineInterpret, "JIT (baseline-interpreter)" ) CATEGORY_ENUM_SUBCATEGORY(JS, JS_Baseline, "JIT (baseline)" ) CATEGORY_ENUM_SUBCATEGORY(JS, JS_IonMonkey, "JIT (ion)") CATEGORY_ENUM_SUBCATEGORY (JS, JS_Builtin, "Builtin API") CATEGORY_ENUM_SUBCATEGORY(JS, JS_WasmIon, "Wasm (ion)") CATEGORY_ENUM_SUBCATEGORY(JS, JS_WasmBaseline , "Wasm (baseline)") CATEGORY_ENUM_SUBCATEGORY(JS, JS_WasmOther , "Wasm (other)") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY (GCCC, "GC / CC", "orange") CATEGORY_ENUM_SUBCATEGORY(GCCC, GCCC , "Other") CATEGORY_ENUM_SUBCATEGORY(GCCC, GCCC_MinorGC, "Minor GC" ) CATEGORY_ENUM_SUBCATEGORY(GCCC, GCCC_MajorGC, "Major GC (Other)" ) CATEGORY_ENUM_SUBCATEGORY(GCCC, GCCC_MajorGC_Mark, "Major GC (Mark)" ) CATEGORY_ENUM_SUBCATEGORY(GCCC, GCCC_MajorGC_Sweep, "Major GC (Sweep)" ) CATEGORY_ENUM_SUBCATEGORY(GCCC, GCCC_MajorGC_Compact, "Major GC (Compact)" ) CATEGORY_ENUM_SUBCATEGORY(GCCC, GCCC_UnmarkGray, "Unmark Gray" ) CATEGORY_ENUM_SUBCATEGORY(GCCC, GCCC_Barrier, "Barrier") CATEGORY_ENUM_SUBCATEGORY (GCCC, GCCC_FreeSnowWhite, "CC (Free Snow White)") CATEGORY_ENUM_SUBCATEGORY (GCCC, GCCC_BuildGraph, "CC (Build Graph)") CATEGORY_ENUM_SUBCATEGORY (GCCC, GCCC_ScanRoots, "CC (Scan Roots)") CATEGORY_ENUM_SUBCATEGORY (GCCC, GCCC_CollectWhite, "CC (Collect White)") CATEGORY_ENUM_SUBCATEGORY (GCCC, GCCC_Finalize, "CC (Finalize)") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY(NETWORK, "Network", "lightblue" ) CATEGORY_ENUM_SUBCATEGORY(NETWORK, NETWORK, "Other") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY(GRAPHICS, "Graphics", "green") CATEGORY_ENUM_SUBCATEGORY (GRAPHICS, GRAPHICS, "Other") CATEGORY_ENUM_SUBCATEGORY(GRAPHICS , GRAPHICS_DisplayListBuilding, "DisplayList building") CATEGORY_ENUM_SUBCATEGORY (GRAPHICS, GRAPHICS_DisplayListMerging, "DisplayList merging" ) CATEGORY_ENUM_SUBCATEGORY(GRAPHICS, GRAPHICS_LayerBuilding, "Layer building") CATEGORY_ENUM_SUBCATEGORY(GRAPHICS, GRAPHICS_TileAllocation , "Tile allocation") CATEGORY_ENUM_SUBCATEGORY(GRAPHICS, GRAPHICS_WRDisplayList , "WebRender display list") CATEGORY_ENUM_SUBCATEGORY(GRAPHICS , GRAPHICS_Rasterization, "Rasterization") CATEGORY_ENUM_SUBCATEGORY (GRAPHICS, GRAPHICS_FlushingAsyncPaints, "Flushing async paints" ) CATEGORY_ENUM_SUBCATEGORY(GRAPHICS, GRAPHICS_ImageDecoding, "Image decoding") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY (DOM, "DOM", "blue") CATEGORY_ENUM_SUBCATEGORY(DOM, DOM, "Other" ) CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY(JAVA_ANDROID , "Android", "yellow") CATEGORY_ENUM_SUBCATEGORY(JAVA_ANDROID , JAVA_ANDROID, "Other") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY (JAVA_ANDROIDX, "AndroidX", "orange") CATEGORY_ENUM_SUBCATEGORY (JAVA_ANDROIDX, JAVA_ANDROIDX, "Other") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY(JAVA_LANGUAGE, "Java", "blue") CATEGORY_ENUM_SUBCATEGORY (JAVA_LANGUAGE, JAVA_LANGUAGE, "Other") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY(JAVA_MOZILLA, "Mozilla", "green" ) CATEGORY_ENUM_SUBCATEGORY(JAVA_MOZILLA, JAVA_MOZILLA, "Other" ) CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY(JAVA_KOTLIN , "Kotlin", "purple") CATEGORY_ENUM_SUBCATEGORY(JAVA_KOTLIN, JAVA_KOTLIN , "Other") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY (JAVA_BLOCKED, "Blocked", "lightblue") CATEGORY_ENUM_SUBCATEGORY (JAVA_BLOCKED, JAVA_BLOCKED, "Other") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY(IPC, "IPC", "lightgreen") CATEGORY_ENUM_SUBCATEGORY (IPC, IPC, "Other") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY (MEDIA, "Media", "orange") CATEGORY_ENUM_SUBCATEGORY(MEDIA, MEDIA , "Other") CATEGORY_ENUM_SUBCATEGORY(MEDIA, MEDIA_CUBEB, "Cubeb" ) CATEGORY_ENUM_SUBCATEGORY(MEDIA, MEDIA_PLAYBACK, "Playback" ) CATEGORY_ENUM_SUBCATEGORY(MEDIA, MEDIA_RT, "Real-time rendering" ) CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY(A11Y , "Accessibility", "brown") CATEGORY_ENUM_SUBCATEGORY(A11Y, A11Y , "Other") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY (PROFILER, "Profiler", "lightred") CATEGORY_ENUM_SUBCATEGORY( PROFILER, PROFILER, "Other") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY (TIMER, "Timer", "grey") CATEGORY_ENUM_SUBCATEGORY(TIMER, TIMER , "Other") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY (REMOTE_PROTOCOL, "Remote-Protocol", "grey") CATEGORY_ENUM_SUBCATEGORY (REMOTE_PROTOCOL, REMOTE_PROTOCOL, "Other") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY(SANDBOX, "Sandbox", "grey") CATEGORY_ENUM_SUBCATEGORY (SANDBOX, SANDBOX, "Other") CATEGORY_ENUM_END_CATEGORY |
253 | CATEGORY_ENUM_END_CATEGORY)CATEGORY_ENUM_BEGIN_CATEGORY(IDLE, "Idle", "transparent") CATEGORY_ENUM_SUBCATEGORY (IDLE, IDLE, "Other") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY (OTHER, "Other", "grey") CATEGORY_ENUM_SUBCATEGORY(OTHER, OTHER , "Other") CATEGORY_ENUM_SUBCATEGORY(OTHER, OTHER_PreferenceRead , "Preference Read") CATEGORY_ENUM_SUBCATEGORY(OTHER, OTHER_Profiling , "Profiling") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY (TEST, "Test", "darkgray") CATEGORY_ENUM_SUBCATEGORY(TEST, TEST , "Test") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY (LAYOUT, "Layout", "purple") CATEGORY_ENUM_SUBCATEGORY(LAYOUT , LAYOUT, "Other") CATEGORY_ENUM_SUBCATEGORY(LAYOUT, LAYOUT_FrameConstruction , "Frame construction") CATEGORY_ENUM_SUBCATEGORY(LAYOUT, LAYOUT_Reflow , "Reflow") CATEGORY_ENUM_SUBCATEGORY(LAYOUT, LAYOUT_CSSParsing , "CSS parsing") CATEGORY_ENUM_SUBCATEGORY(LAYOUT, LAYOUT_SelectorQuery , "Selector query") CATEGORY_ENUM_SUBCATEGORY(LAYOUT, LAYOUT_StyleComputation , "Style computation") CATEGORY_ENUM_SUBCATEGORY(LAYOUT, LAYOUT_Destroy , "Layout cleanup") CATEGORY_ENUM_SUBCATEGORY(LAYOUT, LAYOUT_Printing , "Printing") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY (JS, "JavaScript", "yellow") CATEGORY_ENUM_SUBCATEGORY(JS, JS , "Other") CATEGORY_ENUM_SUBCATEGORY(JS, JS_Parsing, "Parsing" ) CATEGORY_ENUM_SUBCATEGORY(JS, JS_BaselineCompilation, "JIT Compile (baseline)" ) CATEGORY_ENUM_SUBCATEGORY(JS, JS_IonCompilation, "JIT Compile (ion)" ) CATEGORY_ENUM_SUBCATEGORY(JS, JS_Interpreter, "Interpreter" ) CATEGORY_ENUM_SUBCATEGORY(JS, JS_BaselineInterpret, "JIT (baseline-interpreter)" ) CATEGORY_ENUM_SUBCATEGORY(JS, JS_Baseline, "JIT (baseline)" ) CATEGORY_ENUM_SUBCATEGORY(JS, JS_IonMonkey, "JIT (ion)") CATEGORY_ENUM_SUBCATEGORY (JS, JS_Builtin, "Builtin API") CATEGORY_ENUM_SUBCATEGORY(JS, JS_WasmIon, "Wasm (ion)") CATEGORY_ENUM_SUBCATEGORY(JS, JS_WasmBaseline , "Wasm (baseline)") CATEGORY_ENUM_SUBCATEGORY(JS, JS_WasmOther , "Wasm (other)") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY (GCCC, "GC / CC", "orange") CATEGORY_ENUM_SUBCATEGORY(GCCC, GCCC , "Other") CATEGORY_ENUM_SUBCATEGORY(GCCC, GCCC_MinorGC, "Minor GC" ) CATEGORY_ENUM_SUBCATEGORY(GCCC, GCCC_MajorGC, "Major GC (Other)" ) CATEGORY_ENUM_SUBCATEGORY(GCCC, GCCC_MajorGC_Mark, "Major GC (Mark)" ) CATEGORY_ENUM_SUBCATEGORY(GCCC, GCCC_MajorGC_Sweep, "Major GC (Sweep)" ) CATEGORY_ENUM_SUBCATEGORY(GCCC, GCCC_MajorGC_Compact, "Major GC (Compact)" ) CATEGORY_ENUM_SUBCATEGORY(GCCC, GCCC_UnmarkGray, "Unmark Gray" ) CATEGORY_ENUM_SUBCATEGORY(GCCC, GCCC_Barrier, "Barrier") CATEGORY_ENUM_SUBCATEGORY (GCCC, GCCC_FreeSnowWhite, "CC (Free Snow White)") CATEGORY_ENUM_SUBCATEGORY (GCCC, GCCC_BuildGraph, "CC (Build Graph)") CATEGORY_ENUM_SUBCATEGORY (GCCC, GCCC_ScanRoots, "CC (Scan Roots)") CATEGORY_ENUM_SUBCATEGORY (GCCC, GCCC_CollectWhite, "CC (Collect White)") CATEGORY_ENUM_SUBCATEGORY (GCCC, GCCC_Finalize, "CC (Finalize)") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY(NETWORK, "Network", "lightblue" ) CATEGORY_ENUM_SUBCATEGORY(NETWORK, NETWORK, "Other") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY(GRAPHICS, "Graphics", "green") CATEGORY_ENUM_SUBCATEGORY (GRAPHICS, GRAPHICS, "Other") CATEGORY_ENUM_SUBCATEGORY(GRAPHICS , GRAPHICS_DisplayListBuilding, "DisplayList building") CATEGORY_ENUM_SUBCATEGORY (GRAPHICS, GRAPHICS_DisplayListMerging, "DisplayList merging" ) CATEGORY_ENUM_SUBCATEGORY(GRAPHICS, GRAPHICS_LayerBuilding, "Layer building") CATEGORY_ENUM_SUBCATEGORY(GRAPHICS, GRAPHICS_TileAllocation , "Tile allocation") CATEGORY_ENUM_SUBCATEGORY(GRAPHICS, GRAPHICS_WRDisplayList , "WebRender display list") CATEGORY_ENUM_SUBCATEGORY(GRAPHICS , GRAPHICS_Rasterization, "Rasterization") CATEGORY_ENUM_SUBCATEGORY (GRAPHICS, GRAPHICS_FlushingAsyncPaints, "Flushing async paints" ) CATEGORY_ENUM_SUBCATEGORY(GRAPHICS, GRAPHICS_ImageDecoding, "Image decoding") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY (DOM, "DOM", "blue") CATEGORY_ENUM_SUBCATEGORY(DOM, DOM, "Other" ) CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY(JAVA_ANDROID , "Android", "yellow") CATEGORY_ENUM_SUBCATEGORY(JAVA_ANDROID , JAVA_ANDROID, "Other") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY (JAVA_ANDROIDX, "AndroidX", "orange") CATEGORY_ENUM_SUBCATEGORY (JAVA_ANDROIDX, JAVA_ANDROIDX, "Other") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY(JAVA_LANGUAGE, "Java", "blue") CATEGORY_ENUM_SUBCATEGORY (JAVA_LANGUAGE, JAVA_LANGUAGE, "Other") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY(JAVA_MOZILLA, "Mozilla", "green" ) CATEGORY_ENUM_SUBCATEGORY(JAVA_MOZILLA, JAVA_MOZILLA, "Other" ) CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY(JAVA_KOTLIN , "Kotlin", "purple") CATEGORY_ENUM_SUBCATEGORY(JAVA_KOTLIN, JAVA_KOTLIN , "Other") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY (JAVA_BLOCKED, "Blocked", "lightblue") CATEGORY_ENUM_SUBCATEGORY (JAVA_BLOCKED, JAVA_BLOCKED, "Other") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY(IPC, "IPC", "lightgreen") CATEGORY_ENUM_SUBCATEGORY (IPC, IPC, "Other") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY (MEDIA, "Media", "orange") CATEGORY_ENUM_SUBCATEGORY(MEDIA, MEDIA , "Other") CATEGORY_ENUM_SUBCATEGORY(MEDIA, MEDIA_CUBEB, "Cubeb" ) CATEGORY_ENUM_SUBCATEGORY(MEDIA, MEDIA_PLAYBACK, "Playback" ) CATEGORY_ENUM_SUBCATEGORY(MEDIA, MEDIA_RT, "Real-time rendering" ) CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY(A11Y , "Accessibility", "brown") CATEGORY_ENUM_SUBCATEGORY(A11Y, A11Y , "Other") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY (PROFILER, "Profiler", "lightred") CATEGORY_ENUM_SUBCATEGORY( PROFILER, PROFILER, "Other") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY (TIMER, "Timer", "grey") CATEGORY_ENUM_SUBCATEGORY(TIMER, TIMER , "Other") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY (REMOTE_PROTOCOL, "Remote-Protocol", "grey") CATEGORY_ENUM_SUBCATEGORY (REMOTE_PROTOCOL, REMOTE_PROTOCOL, "Other") CATEGORY_ENUM_END_CATEGORY CATEGORY_ENUM_BEGIN_CATEGORY(SANDBOX, "Sandbox", "grey") CATEGORY_ENUM_SUBCATEGORY (SANDBOX, SANDBOX, "Other") CATEGORY_ENUM_END_CATEGORY |
254 | #undef CATEGORY_ENUM_BEGIN_CATEGORY |
255 | #undef CATEGORY_ENUM_SUBCATEGORY |
256 | #undef CATEGORY_ENUM_END_CATEGORY |
257 | |
258 | // Import `MarkerCategory` into this namespace. This will allow using this type |
259 | // dynamically in macros that prepend `::mozilla::baseprofiler::category::` to |
260 | // the given category, e.g.: |
261 | // `PROFILER_MARKER_UNTYPED("name", MarkerCategory(...))` |
262 | using MarkerCategory = ::mozilla::MarkerCategory; |
263 | |
264 | } // namespace baseprofiler::category |
265 | |
266 | // The classes below are all embedded in a `MarkerOptions` object. |
267 | class MarkerOptions; |
268 | |
269 | // This marker option captures a given thread id. |
270 | // If left unspecified (by default construction) during the add-marker call, the |
271 | // current thread id will be used then. |
272 | class MarkerThreadId { |
273 | public: |
274 | // Default constructor, keeps the thread id unspecified. |
275 | constexpr MarkerThreadId() = default; |
276 | |
277 | // Constructor from a given thread id. |
278 | constexpr explicit MarkerThreadId( |
279 | baseprofiler::BaseProfilerThreadId aThreadId) |
280 | : mThreadId(aThreadId) {} |
281 | |
282 | // Use the current thread's id. |
283 | static MarkerThreadId CurrentThread() { |
284 | return MarkerThreadId(baseprofiler::profiler_current_thread_id()); |
285 | } |
286 | |
287 | // Use the main thread's id. This can be useful to record a marker from a |
288 | // possibly-unregistered thread, and display it in the main thread track. |
289 | static MarkerThreadId MainThread() { |
290 | return MarkerThreadId(baseprofiler::profiler_main_thread_id()); |
291 | } |
292 | |
293 | [[nodiscard]] constexpr baseprofiler::BaseProfilerThreadId ThreadId() const { |
294 | return mThreadId; |
295 | } |
296 | |
297 | [[nodiscard]] constexpr bool IsUnspecified() const { |
298 | return !mThreadId.IsSpecified(); |
299 | } |
300 | |
301 | private: |
302 | baseprofiler::BaseProfilerThreadId mThreadId; |
303 | }; |
304 | |
305 | // This marker option contains marker timing information. |
306 | // This class encapsulates the logic for correctly storing a marker based on its |
307 | // Use the static methods to create the MarkerTiming. This is a transient object |
308 | // that is being used to enforce the constraints of the combinations of the |
309 | // data. |
310 | class MarkerTiming { |
311 | public: |
312 | // The following static methods are used to create the MarkerTiming based on |
313 | // the type that it is. |
314 | |
315 | static MarkerTiming InstantAt(const TimeStamp& aTime) { |
316 | MOZ_ASSERT(!aTime.IsNull(), "Time is null for an instant marker.")do { static_assert( mozilla::detail::AssertionConditionType< decltype(!aTime.IsNull())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!aTime.IsNull()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!aTime.IsNull()" " (" "Time is null for an instant marker." ")", "/var/lib/jenkins/workspace/firefox-scan-build/obj-x86_64-pc-linux-gnu/dist/include/mozilla/BaseProfilerMarkersPrerequisites.h" , 316); AnnotateMozCrashReason("MOZ_ASSERT" "(" "!aTime.IsNull()" ") (" "Time is null for an instant marker." ")"); do { *((volatile int*)__null) = 316; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); |
317 | return MarkerTiming{aTime, TimeStamp{}, MarkerTiming::Phase::Instant}; |
318 | } |
319 | |
320 | static MarkerTiming InstantNow() { return InstantAt(TimeStamp::Now()); } |
321 | |
322 | static MarkerTiming Interval(const TimeStamp& aStartTime, |
323 | const TimeStamp& aEndTime) { |
324 | MOZ_ASSERT(!aStartTime.IsNull(),do { static_assert( mozilla::detail::AssertionConditionType< decltype(!aStartTime.IsNull())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!aStartTime.IsNull()))), 0)) ) { do { } while (false); MOZ_ReportAssertionFailure("!aStartTime.IsNull()" " (" "Start time is null for an interval marker." ")", "/var/lib/jenkins/workspace/firefox-scan-build/obj-x86_64-pc-linux-gnu/dist/include/mozilla/BaseProfilerMarkersPrerequisites.h" , 325); AnnotateMozCrashReason("MOZ_ASSERT" "(" "!aStartTime.IsNull()" ") (" "Start time is null for an interval marker." ")"); do { *((volatile int*)__null) = 325; __attribute__((nomerge)) ::abort (); } while (false); } } while (false) |
325 | "Start time is null for an interval marker.")do { static_assert( mozilla::detail::AssertionConditionType< decltype(!aStartTime.IsNull())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!aStartTime.IsNull()))), 0)) ) { do { } while (false); MOZ_ReportAssertionFailure("!aStartTime.IsNull()" " (" "Start time is null for an interval marker." ")", "/var/lib/jenkins/workspace/firefox-scan-build/obj-x86_64-pc-linux-gnu/dist/include/mozilla/BaseProfilerMarkersPrerequisites.h" , 325); AnnotateMozCrashReason("MOZ_ASSERT" "(" "!aStartTime.IsNull()" ") (" "Start time is null for an interval marker." ")"); do { *((volatile int*)__null) = 325; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); |
326 | MOZ_ASSERT(!aEndTime.IsNull(), "End time is null for an interval marker.")do { static_assert( mozilla::detail::AssertionConditionType< decltype(!aEndTime.IsNull())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!aEndTime.IsNull()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!aEndTime.IsNull()" " (" "End time is null for an interval marker." ")", "/var/lib/jenkins/workspace/firefox-scan-build/obj-x86_64-pc-linux-gnu/dist/include/mozilla/BaseProfilerMarkersPrerequisites.h" , 326); AnnotateMozCrashReason("MOZ_ASSERT" "(" "!aEndTime.IsNull()" ") (" "End time is null for an interval marker." ")"); do { * ((volatile int*)__null) = 326; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); |
327 | return MarkerTiming{aStartTime, aEndTime, MarkerTiming::Phase::Interval}; |
328 | } |
329 | |
330 | static MarkerTiming IntervalUntilNowFrom(const TimeStamp& aStartTime) { |
331 | return Interval(aStartTime, TimeStamp::Now()); |
332 | } |
333 | |
334 | static MarkerTiming IntervalStart(const TimeStamp& aTime = TimeStamp::Now()) { |
335 | MOZ_ASSERT(!aTime.IsNull(), "Time is null for an interval start marker.")do { static_assert( mozilla::detail::AssertionConditionType< decltype(!aTime.IsNull())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!aTime.IsNull()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!aTime.IsNull()" " (" "Time is null for an interval start marker." ")", "/var/lib/jenkins/workspace/firefox-scan-build/obj-x86_64-pc-linux-gnu/dist/include/mozilla/BaseProfilerMarkersPrerequisites.h" , 335); AnnotateMozCrashReason("MOZ_ASSERT" "(" "!aTime.IsNull()" ") (" "Time is null for an interval start marker." ")"); do { *((volatile int*)__null) = 335; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); |
336 | return MarkerTiming{aTime, TimeStamp{}, MarkerTiming::Phase::IntervalStart}; |
337 | } |
338 | |
339 | static MarkerTiming IntervalEnd(const TimeStamp& aTime = TimeStamp::Now()) { |
340 | MOZ_ASSERT(!aTime.IsNull(), "Time is null for an interval end marker.")do { static_assert( mozilla::detail::AssertionConditionType< decltype(!aTime.IsNull())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!aTime.IsNull()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!aTime.IsNull()" " (" "Time is null for an interval end marker." ")", "/var/lib/jenkins/workspace/firefox-scan-build/obj-x86_64-pc-linux-gnu/dist/include/mozilla/BaseProfilerMarkersPrerequisites.h" , 340); AnnotateMozCrashReason("MOZ_ASSERT" "(" "!aTime.IsNull()" ") (" "Time is null for an interval end marker." ")"); do { * ((volatile int*)__null) = 340; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); |
341 | return MarkerTiming{TimeStamp{}, aTime, MarkerTiming::Phase::IntervalEnd}; |
342 | } |
343 | |
344 | // Set the interval end in this timing. |
345 | // If there was already a start time, this makes it a full interval. |
346 | void SetIntervalEnd(const TimeStamp& aTime = TimeStamp::Now()) { |
347 | MOZ_ASSERT(!aTime.IsNull(), "Time is null for an interval end marker.")do { static_assert( mozilla::detail::AssertionConditionType< decltype(!aTime.IsNull())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!aTime.IsNull()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!aTime.IsNull()" " (" "Time is null for an interval end marker." ")", "/var/lib/jenkins/workspace/firefox-scan-build/obj-x86_64-pc-linux-gnu/dist/include/mozilla/BaseProfilerMarkersPrerequisites.h" , 347); AnnotateMozCrashReason("MOZ_ASSERT" "(" "!aTime.IsNull()" ") (" "Time is null for an interval end marker." ")"); do { * ((volatile int*)__null) = 347; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); |
348 | mEndTime = aTime; |
349 | mPhase = mStartTime.IsNull() ? Phase::IntervalEnd : Phase::Interval; |
350 | } |
351 | |
352 | [[nodiscard]] const TimeStamp& StartTime() const { return mStartTime; } |
353 | [[nodiscard]] const TimeStamp& EndTime() const { return mEndTime; } |
354 | |
355 | // The phase differentiates Instant markers from Interval markers. |
356 | // Interval markers can either carry both timestamps on a single marker, |
357 | // or they can be split into individual Start and End markers, which are |
358 | // associated with each other via the marker name. |
359 | // |
360 | // The numeric representation of this enum value is also exposed in the |
361 | // ETW trace event's Phase field. |
362 | enum class Phase : uint8_t { |
363 | Instant = 0, |
364 | Interval = 1, |
365 | IntervalStart = 2, |
366 | IntervalEnd = 3, |
367 | }; |
368 | |
369 | [[nodiscard]] Phase MarkerPhase() const { |
370 | MOZ_ASSERT(!IsUnspecified())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!IsUnspecified())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!IsUnspecified()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!IsUnspecified()" , "/var/lib/jenkins/workspace/firefox-scan-build/obj-x86_64-pc-linux-gnu/dist/include/mozilla/BaseProfilerMarkersPrerequisites.h" , 370); AnnotateMozCrashReason("MOZ_ASSERT" "(" "!IsUnspecified()" ")"); do { *((volatile int*)__null) = 370; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); |
371 | return mPhase; |
372 | } |
373 | |
374 | // The following getter methods are used to put the value into the buffer for |
375 | // storage. |
376 | [[nodiscard]] double GetStartTime() const { |
377 | MOZ_ASSERT(!IsUnspecified())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!IsUnspecified())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!IsUnspecified()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!IsUnspecified()" , "/var/lib/jenkins/workspace/firefox-scan-build/obj-x86_64-pc-linux-gnu/dist/include/mozilla/BaseProfilerMarkersPrerequisites.h" , 377); AnnotateMozCrashReason("MOZ_ASSERT" "(" "!IsUnspecified()" ")"); do { *((volatile int*)__null) = 377; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); |
378 | // If mStartTime is null (e.g., for IntervalEnd), this will output 0.0 as |
379 | // expected. |
380 | return MarkerTiming::timeStampToDouble(mStartTime); |
381 | } |
382 | |
383 | [[nodiscard]] double GetEndTime() const { |
384 | MOZ_ASSERT(!IsUnspecified())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!IsUnspecified())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!IsUnspecified()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!IsUnspecified()" , "/var/lib/jenkins/workspace/firefox-scan-build/obj-x86_64-pc-linux-gnu/dist/include/mozilla/BaseProfilerMarkersPrerequisites.h" , 384); AnnotateMozCrashReason("MOZ_ASSERT" "(" "!IsUnspecified()" ")"); do { *((volatile int*)__null) = 384; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); |
385 | // If mEndTime is null (e.g., for Instant or IntervalStart), this will |
386 | // output 0.0 as expected. |
387 | return MarkerTiming::timeStampToDouble(mEndTime); |
388 | } |
389 | |
390 | [[nodiscard]] uint8_t GetPhase() const { |
391 | MOZ_ASSERT(!IsUnspecified())do { static_assert( mozilla::detail::AssertionConditionType< decltype(!IsUnspecified())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!IsUnspecified()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!IsUnspecified()" , "/var/lib/jenkins/workspace/firefox-scan-build/obj-x86_64-pc-linux-gnu/dist/include/mozilla/BaseProfilerMarkersPrerequisites.h" , 391); AnnotateMozCrashReason("MOZ_ASSERT" "(" "!IsUnspecified()" ")"); do { *((volatile int*)__null) = 391; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); |
392 | return static_cast<uint8_t>(mPhase); |
393 | } |
394 | |
395 | // This is a constructor for Rust FFI bindings. It must not be used outside of |
396 | // this! Please see the other static constructors above. |
397 | static void UnsafeConstruct(MarkerTiming* aMarkerTiming, |
398 | const TimeStamp& aStartTime, |
399 | const TimeStamp& aEndTime, Phase aPhase) { |
400 | new (aMarkerTiming) MarkerTiming{aStartTime, aEndTime, aPhase}; |
401 | } |
402 | |
403 | private: |
404 | friend ProfileBufferEntryWriter::Serializer<MarkerTiming>; |
405 | friend ProfileBufferEntryReader::Deserializer<MarkerTiming>; |
406 | friend MarkerOptions; |
407 | |
408 | // Default timing leaves it internally "unspecified", serialization getters |
409 | // and add-marker functions will default to `InstantNow()`. |
410 | constexpr MarkerTiming() = default; |
411 | |
412 | // This should only be used by internal profiler code. |
413 | [[nodiscard]] bool IsUnspecified() const { |
414 | return mStartTime.IsNull() && mEndTime.IsNull(); |
415 | } |
416 | |
417 | // Full constructor, used by static factory functions. |
418 | constexpr MarkerTiming(const TimeStamp& aStartTime, const TimeStamp& aEndTime, |
419 | Phase aPhase) |
420 | : mStartTime(aStartTime), mEndTime(aEndTime), mPhase(aPhase) {} |
421 | |
422 | static double timeStampToDouble(const TimeStamp& time) { |
423 | if (time.IsNull()) { |
424 | // The Phase lets us know not to use this value. |
425 | return 0; |
426 | } |
427 | return (time - TimeStamp::ProcessCreation()).ToMilliseconds(); |
428 | } |
429 | |
430 | TimeStamp mStartTime; |
431 | TimeStamp mEndTime; |
432 | Phase mPhase = Phase::Instant; |
433 | }; |
434 | |
435 | // This marker option allows three cases: |
436 | // - By default, no stacks are captured. |
437 | // - The caller can request a stack capture, and the add-marker code will take |
438 | // care of it in the most efficient way. |
439 | // - The caller can still provide an existing backtrace, for cases where a |
440 | // marker reports something that happened elsewhere. |
441 | class MarkerStack { |
442 | public: |
443 | // Default constructor, no capture. |
444 | constexpr MarkerStack() = default; |
445 | |
446 | // Disallow copy. |
447 | MarkerStack(const MarkerStack&) = delete; |
448 | MarkerStack& operator=(const MarkerStack&) = delete; |
449 | |
450 | // Allow move. |
451 | MarkerStack(MarkerStack&& aOther) |
452 | : mCaptureOptions(aOther.mCaptureOptions), |
453 | mOptionalChunkedBufferStorage( |
454 | std::move(aOther.mOptionalChunkedBufferStorage)), |
455 | mChunkedBuffer(aOther.mChunkedBuffer) { |
456 | AssertInvariants(); |
457 | aOther.Clear(); |
458 | } |
459 | MarkerStack& operator=(MarkerStack&& aOther) { |
460 | mCaptureOptions = aOther.mCaptureOptions; |
461 | mOptionalChunkedBufferStorage = |
462 | std::move(aOther.mOptionalChunkedBufferStorage); |
463 | mChunkedBuffer = aOther.mChunkedBuffer; |
464 | AssertInvariants(); |
465 | aOther.Clear(); |
466 | return *this; |
467 | } |
468 | |
469 | // Take ownership of a backtrace. If null or empty, equivalent to NoStack(). |
470 | explicit MarkerStack(UniquePtr<ProfileChunkedBuffer>&& aExternalChunkedBuffer) |
471 | : mOptionalChunkedBufferStorage( |
472 | (!aExternalChunkedBuffer || aExternalChunkedBuffer->IsEmpty()) |
473 | ? nullptr |
474 | : std::move(aExternalChunkedBuffer)), |
475 | mChunkedBuffer(mOptionalChunkedBufferStorage.get()) { |
476 | AssertInvariants(); |
477 | } |
478 | |
479 | // Use an existing backtrace stored elsewhere, which the user must guarantee |
480 | // is alive during the add-marker call. If empty, equivalent to NoStack(). |
481 | explicit MarkerStack(ProfileChunkedBuffer& aExternalChunkedBuffer) |
482 | : mChunkedBuffer(aExternalChunkedBuffer.IsEmpty() |
483 | ? nullptr |
484 | : &aExternalChunkedBuffer) { |
485 | AssertInvariants(); |
486 | } |
487 | |
488 | // Don't capture a stack in this marker. |
489 | static MarkerStack NoStack() { |
490 | return MarkerStack(StackCaptureOptions::NoStack); |
491 | } |
492 | |
493 | // Capture a stack when adding this marker. |
494 | static MarkerStack Capture( |
495 | StackCaptureOptions aCaptureOptions = StackCaptureOptions::Full) { |
496 | // Actual capture will be handled inside profiler_add_marker. |
497 | return MarkerStack(aCaptureOptions); |
498 | } |
499 | |
500 | // Optionally capture a stack, useful for avoiding long-winded ternaries. |
501 | static MarkerStack MaybeCapture(bool aDoCapture) { |
502 | return aDoCapture ? Capture() : NoStack(); |
503 | } |
504 | |
505 | // Use an existing backtrace stored elsewhere, which the user must guarantee |
506 | // is alive during the add-marker call. If empty, equivalent to NoStack(). |
507 | static MarkerStack UseBacktrace( |
508 | ProfileChunkedBuffer& aExternalChunkedBuffer) { |
509 | return MarkerStack(aExternalChunkedBuffer); |
510 | } |
511 | |
512 | // Take ownership of a backtrace previously captured with |
513 | // `profiler_capture_backtrace()`. If null, equivalent to NoStack(). |
514 | static MarkerStack TakeBacktrace( |
515 | UniquePtr<ProfileChunkedBuffer>&& aExternalChunkedBuffer) { |
516 | return MarkerStack(std::move(aExternalChunkedBuffer)); |
517 | } |
518 | |
519 | // Construct with the given capture options. |
520 | static MarkerStack WithCaptureOptions(StackCaptureOptions aCaptureOptions) { |
521 | return MarkerStack(aCaptureOptions); |
522 | } |
523 | |
524 | [[nodiscard]] StackCaptureOptions CaptureOptions() const { |
525 | return mCaptureOptions; |
526 | } |
527 | |
528 | ProfileChunkedBuffer* GetChunkedBuffer() const { return mChunkedBuffer; } |
529 | |
530 | // Use backtrace after a request. If null, equivalent to NoStack(). |
531 | void UseRequestedBacktrace(ProfileChunkedBuffer* aExternalChunkedBuffer) { |
532 | MOZ_RELEASE_ASSERT(mCaptureOptions != StackCaptureOptions::NoStack)do { static_assert( mozilla::detail::AssertionConditionType< decltype(mCaptureOptions != StackCaptureOptions::NoStack)> ::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(mCaptureOptions != StackCaptureOptions::NoStack))), 0 ))) { do { } while (false); MOZ_ReportAssertionFailure("mCaptureOptions != StackCaptureOptions::NoStack" , "/var/lib/jenkins/workspace/firefox-scan-build/obj-x86_64-pc-linux-gnu/dist/include/mozilla/BaseProfilerMarkersPrerequisites.h" , 532); AnnotateMozCrashReason("MOZ_RELEASE_ASSERT" "(" "mCaptureOptions != StackCaptureOptions::NoStack" ")"); do { *((volatile int*)__null) = 532; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); |
533 | mCaptureOptions = StackCaptureOptions::NoStack; |
534 | if (aExternalChunkedBuffer && !aExternalChunkedBuffer->IsEmpty()) { |
535 | // We only need to use the provided buffer if it is not empty. |
536 | mChunkedBuffer = aExternalChunkedBuffer; |
537 | } |
538 | AssertInvariants(); |
539 | } |
540 | |
541 | void Clear() { |
542 | mCaptureOptions = StackCaptureOptions::NoStack; |
543 | mOptionalChunkedBufferStorage.reset(); |
544 | mChunkedBuffer = nullptr; |
545 | AssertInvariants(); |
546 | } |
547 | |
548 | private: |
549 | explicit MarkerStack(StackCaptureOptions aCaptureOptions) |
550 | : mCaptureOptions(aCaptureOptions) { |
551 | AssertInvariants(); |
552 | } |
553 | |
554 | // This should be called after every constructor and non-const function. |
555 | void AssertInvariants() const { |
556 | #ifdef DEBUG1 |
557 | if (mCaptureOptions != StackCaptureOptions::NoStack) { |
558 | MOZ_ASSERT(!mOptionalChunkedBufferStorage,do { static_assert( mozilla::detail::AssertionConditionType< decltype(!mOptionalChunkedBufferStorage)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!mOptionalChunkedBufferStorage ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "!mOptionalChunkedBufferStorage" " (" "We should not hold a buffer when capture is requested" ")", "/var/lib/jenkins/workspace/firefox-scan-build/obj-x86_64-pc-linux-gnu/dist/include/mozilla/BaseProfilerMarkersPrerequisites.h" , 559); AnnotateMozCrashReason("MOZ_ASSERT" "(" "!mOptionalChunkedBufferStorage" ") (" "We should not hold a buffer when capture is requested" ")"); do { *((volatile int*)__null) = 559; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) |
559 | "We should not hold a buffer when capture is requested")do { static_assert( mozilla::detail::AssertionConditionType< decltype(!mOptionalChunkedBufferStorage)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!mOptionalChunkedBufferStorage ))), 0))) { do { } while (false); MOZ_ReportAssertionFailure( "!mOptionalChunkedBufferStorage" " (" "We should not hold a buffer when capture is requested" ")", "/var/lib/jenkins/workspace/firefox-scan-build/obj-x86_64-pc-linux-gnu/dist/include/mozilla/BaseProfilerMarkersPrerequisites.h" , 559); AnnotateMozCrashReason("MOZ_ASSERT" "(" "!mOptionalChunkedBufferStorage" ") (" "We should not hold a buffer when capture is requested" ")"); do { *((volatile int*)__null) = 559; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); |
560 | MOZ_ASSERT(!mChunkedBuffer,do { static_assert( mozilla::detail::AssertionConditionType< decltype(!mChunkedBuffer)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!mChunkedBuffer))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!mChunkedBuffer" " (" "We should not point at a buffer when capture is requested" ")", "/var/lib/jenkins/workspace/firefox-scan-build/obj-x86_64-pc-linux-gnu/dist/include/mozilla/BaseProfilerMarkersPrerequisites.h" , 561); AnnotateMozCrashReason("MOZ_ASSERT" "(" "!mChunkedBuffer" ") (" "We should not point at a buffer when capture is requested" ")"); do { *((volatile int*)__null) = 561; __attribute__((nomerge )) ::abort(); } while (false); } } while (false) |
561 | "We should not point at a buffer when capture is requested")do { static_assert( mozilla::detail::AssertionConditionType< decltype(!mChunkedBuffer)>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!mChunkedBuffer))), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!mChunkedBuffer" " (" "We should not point at a buffer when capture is requested" ")", "/var/lib/jenkins/workspace/firefox-scan-build/obj-x86_64-pc-linux-gnu/dist/include/mozilla/BaseProfilerMarkersPrerequisites.h" , 561); AnnotateMozCrashReason("MOZ_ASSERT" "(" "!mChunkedBuffer" ") (" "We should not point at a buffer when capture is requested" ")"); do { *((volatile int*)__null) = 561; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); |
562 | } else { |
563 | if (mOptionalChunkedBufferStorage) { |
564 | MOZ_ASSERT(mChunkedBuffer == mOptionalChunkedBufferStorage.get(),do { static_assert( mozilla::detail::AssertionConditionType< decltype(mChunkedBuffer == mOptionalChunkedBufferStorage.get( ))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(mChunkedBuffer == mOptionalChunkedBufferStorage.get( )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("mChunkedBuffer == mOptionalChunkedBufferStorage.get()" " (" "Non-null mOptionalChunkedBufferStorage must be pointed-at " "by mChunkedBuffer" ")", "/var/lib/jenkins/workspace/firefox-scan-build/obj-x86_64-pc-linux-gnu/dist/include/mozilla/BaseProfilerMarkersPrerequisites.h" , 566); AnnotateMozCrashReason("MOZ_ASSERT" "(" "mChunkedBuffer == mOptionalChunkedBufferStorage.get()" ") (" "Non-null mOptionalChunkedBufferStorage must be pointed-at " "by mChunkedBuffer" ")"); do { *((volatile int*)__null) = 566 ; __attribute__((nomerge)) ::abort(); } while (false); } } while (false) |
565 | "Non-null mOptionalChunkedBufferStorage must be pointed-at "do { static_assert( mozilla::detail::AssertionConditionType< decltype(mChunkedBuffer == mOptionalChunkedBufferStorage.get( ))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(mChunkedBuffer == mOptionalChunkedBufferStorage.get( )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("mChunkedBuffer == mOptionalChunkedBufferStorage.get()" " (" "Non-null mOptionalChunkedBufferStorage must be pointed-at " "by mChunkedBuffer" ")", "/var/lib/jenkins/workspace/firefox-scan-build/obj-x86_64-pc-linux-gnu/dist/include/mozilla/BaseProfilerMarkersPrerequisites.h" , 566); AnnotateMozCrashReason("MOZ_ASSERT" "(" "mChunkedBuffer == mOptionalChunkedBufferStorage.get()" ") (" "Non-null mOptionalChunkedBufferStorage must be pointed-at " "by mChunkedBuffer" ")"); do { *((volatile int*)__null) = 566 ; __attribute__((nomerge)) ::abort(); } while (false); } } while (false) |
566 | "by mChunkedBuffer")do { static_assert( mozilla::detail::AssertionConditionType< decltype(mChunkedBuffer == mOptionalChunkedBufferStorage.get( ))>::isValid, "invalid assertion condition"); if ((__builtin_expect (!!(!(!!(mChunkedBuffer == mOptionalChunkedBufferStorage.get( )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("mChunkedBuffer == mOptionalChunkedBufferStorage.get()" " (" "Non-null mOptionalChunkedBufferStorage must be pointed-at " "by mChunkedBuffer" ")", "/var/lib/jenkins/workspace/firefox-scan-build/obj-x86_64-pc-linux-gnu/dist/include/mozilla/BaseProfilerMarkersPrerequisites.h" , 566); AnnotateMozCrashReason("MOZ_ASSERT" "(" "mChunkedBuffer == mOptionalChunkedBufferStorage.get()" ") (" "Non-null mOptionalChunkedBufferStorage must be pointed-at " "by mChunkedBuffer" ")"); do { *((volatile int*)__null) = 566 ; __attribute__((nomerge)) ::abort(); } while (false); } } while (false); |
567 | } |
568 | if (mChunkedBuffer) { |
569 | MOZ_ASSERT(!mChunkedBuffer->IsEmpty(),do { static_assert( mozilla::detail::AssertionConditionType< decltype(!mChunkedBuffer->IsEmpty())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!mChunkedBuffer->IsEmpty( )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("!mChunkedBuffer->IsEmpty()" " (" "Non-null mChunkedBuffer must not be empty" ")", "/var/lib/jenkins/workspace/firefox-scan-build/obj-x86_64-pc-linux-gnu/dist/include/mozilla/BaseProfilerMarkersPrerequisites.h" , 570); AnnotateMozCrashReason("MOZ_ASSERT" "(" "!mChunkedBuffer->IsEmpty()" ") (" "Non-null mChunkedBuffer must not be empty" ")"); do { *((volatile int*)__null) = 570; __attribute__((nomerge)) ::abort (); } while (false); } } while (false) |
570 | "Non-null mChunkedBuffer must not be empty")do { static_assert( mozilla::detail::AssertionConditionType< decltype(!mChunkedBuffer->IsEmpty())>::isValid, "invalid assertion condition" ); if ((__builtin_expect(!!(!(!!(!mChunkedBuffer->IsEmpty( )))), 0))) { do { } while (false); MOZ_ReportAssertionFailure ("!mChunkedBuffer->IsEmpty()" " (" "Non-null mChunkedBuffer must not be empty" ")", "/var/lib/jenkins/workspace/firefox-scan-build/obj-x86_64-pc-linux-gnu/dist/include/mozilla/BaseProfilerMarkersPrerequisites.h" , 570); AnnotateMozCrashReason("MOZ_ASSERT" "(" "!mChunkedBuffer->IsEmpty()" ") (" "Non-null mChunkedBuffer must not be empty" ")"); do { *((volatile int*)__null) = 570; __attribute__((nomerge)) ::abort (); } while (false); } } while (false); |
571 | } |
572 | } |
573 | #endif // DEBUG |
574 | } |
575 | |
576 | StackCaptureOptions mCaptureOptions = StackCaptureOptions::NoStack; |
577 | |
578 | // Optional storage for the backtrace, in case it was captured before the |
579 | // add-marker call. |
580 | UniquePtr<ProfileChunkedBuffer> mOptionalChunkedBufferStorage; |
581 | |
582 | // If not null, this points to the backtrace. It may point to a backtrace |
583 | // temporarily stored on the stack, or to mOptionalChunkedBufferStorage. |
584 | ProfileChunkedBuffer* mChunkedBuffer = nullptr; |
585 | }; |
586 | |
587 | // This marker option captures a given inner window id. |
588 | class MarkerInnerWindowId { |
589 | public: |
590 | // Default constructor, it leaves the id unspecified. |
591 | constexpr MarkerInnerWindowId() = default; |
592 | |
593 | // Constructor with a specified inner window id. |
594 | constexpr explicit MarkerInnerWindowId(uint64_t i) : mInnerWindowId(i) {} |
595 | |
596 | // Constructor with either specified inner window id or Nothing. |
597 | constexpr explicit MarkerInnerWindowId(const Maybe<uint64_t>& i) |
598 | : mInnerWindowId(i.valueOr(scNoId)) {} |
599 | |
600 | // Explicit option with unspecified id. |
601 | constexpr static MarkerInnerWindowId NoId() { return MarkerInnerWindowId{}; } |
602 | |
603 | [[nodiscard]] bool IsUnspecified() const { return mInnerWindowId == scNoId; } |
604 | |
605 | [[nodiscard]] constexpr uint64_t Id() const { return mInnerWindowId; } |
606 | |
607 | private: |
608 | static constexpr uint64_t scNoId = 0; |
609 | uint64_t mInnerWindowId = scNoId; |
610 | }; |
611 | |
612 | // This class combines each of the possible marker options above. |
613 | class MarkerOptions { |
614 | public: |
615 | // Constructor from individual options (including none). |
616 | // Implicit to allow `{}` and one option type as-is. |
617 | // Options that are not provided here are defaulted. In particular, timing |
618 | // defaults to `MarkerTiming::InstantNow()` when the marker is recorded. |
619 | template <typename... Options> |
620 | MOZ_IMPLICIT MarkerOptions(Options&&... aOptions) { |
621 | (Set(std::forward<Options>(aOptions)), ...); |
622 | } |
623 | |
624 | // Disallow copy. |
625 | MarkerOptions(const MarkerOptions&) = delete; |
626 | MarkerOptions& operator=(const MarkerOptions&) = delete; |
627 | |
628 | // Allow move. |
629 | MarkerOptions(MarkerOptions&&) = default; |
630 | MarkerOptions& operator=(MarkerOptions&&) = default; |
631 | |
632 | // The embedded `MarkerTiming` hasn't been specified yet. |
633 | [[nodiscard]] bool IsTimingUnspecified() const { |
634 | return mTiming.IsUnspecified(); |
635 | } |
636 | |
637 | // Each option may be added in a chain by e.g.: |
638 | // `options.Set(MarkerThreadId(123)).Set(MarkerTiming::IntervalEnd())`. |
639 | // When passed to an add-marker function, it must be an rvalue, either created |
640 | // on the spot, or `std::move`d from storage, e.g.: |
641 | // `PROFILER_MARKER_UNTYPED("...", std::move(options).Set(...))`; |
642 | // |
643 | // Options can be read by their name (without "Marker"), e.g.: `o.ThreadId()`. |
644 | // Add "Ref" for a non-const reference, e.g.: `o.ThreadIdRef() = ...;` |
645 | #define FUNCTIONS_ON_MEMBER(NAME) \ |
646 | MarkerOptions& Set(Marker##NAME&& a##NAME)& { \ |
647 | m##NAME = std::move(a##NAME); \ |
648 | return *this; \ |
649 | } \ |
650 | \ |
651 | MarkerOptions&& Set(Marker##NAME&& a##NAME)&& { \ |
652 | m##NAME = std::move(a##NAME); \ |
653 | return std::move(*this); \ |
654 | } \ |
655 | \ |
656 | const Marker##NAME& NAME() const { return m##NAME; } \ |
657 | \ |
658 | Marker##NAME& NAME##Ref() { return m##NAME; } |
659 | |
660 | FUNCTIONS_ON_MEMBER(ThreadId); |
661 | FUNCTIONS_ON_MEMBER(Timing); |
662 | FUNCTIONS_ON_MEMBER(Stack); |
663 | FUNCTIONS_ON_MEMBER(InnerWindowId); |
664 | #undef FUNCTIONS_ON_MEMBER |
665 | |
666 | private: |
667 | friend ProfileBufferEntryReader::Deserializer<MarkerOptions>; |
668 | |
669 | MarkerThreadId mThreadId; |
670 | MarkerTiming mTiming; |
671 | MarkerStack mStack; |
672 | MarkerInnerWindowId mInnerWindowId; |
673 | }; |
674 | |
675 | } // namespace mozilla |
676 | |
677 | namespace mozilla::baseprofiler::markers { |
678 | |
679 | // Default marker payload types, with no extra information, not even a marker |
680 | // type and payload. This is intended for label-only markers. |
681 | struct NoPayload final {}; |
682 | |
683 | } // namespace mozilla::baseprofiler::markers |
684 | |
685 | namespace mozilla { |
686 | |
687 | class JSONWriter; |
688 | |
689 | // This class collects all the information necessary to stream the JSON schema |
690 | // that informs the front-end how to display a type of markers. |
691 | // It will be created and populated in `MarkerTypeDisplay()` functions in each |
692 | // marker type definition, see Add/Set functions. |
693 | class MarkerSchema { |
694 | public: |
695 | // This is used to describe a C++ type that is expected to be specified to |
696 | // the marker and used in PayloadField. This type is the expected input type |
697 | // to the marker data. |
698 | enum class InputType { |
699 | Uint64, |
700 | Uint32, |
701 | Uint8, |
702 | Boolean, |
703 | CString, |
704 | String, |
705 | TimeStamp, |
706 | TimeDuration |
707 | }; |
708 | |
709 | enum class Location : unsigned { |
710 | MarkerChart, |
711 | MarkerTable, |
712 | // This adds markers to the main marker timeline in the header. |
713 | TimelineOverview, |
714 | // In the timeline, this is a section that breaks out markers that are |
715 | // related to memory. When memory counters are enabled, this is its own |
716 | // track, otherwise it is displayed with the main thread. |
717 | TimelineMemory, |
718 | // This adds markers to the IPC timeline area in the header. |
719 | TimelineIPC, |
720 | // This adds markers to the FileIO timeline area in the header. |
721 | TimelineFileIO, |
722 | // TODO - This is not supported yet. |
723 | StackChart |
724 | }; |
725 | |
726 | // Used as constructor parameter, to explicitly specify that the location (and |
727 | // other display options) are handled as a special case in the front-end. |
728 | // In this case, *no* schema will be output for this type. |
729 | struct SpecialFrontendLocation {}; |
730 | |
731 | enum class Format { |
732 | // ---------------------------------------------------- |
733 | // String types. |
734 | |
735 | // Show the URL, and handle PII sanitization |
736 | Url, |
737 | // Show the file path, and handle PII sanitization. |
738 | FilePath, |
739 | // Show arbitrary string and handle PII sanitization |
740 | SanitizedString, |
741 | // Important, do not put URL or file path information here, as it will not |
742 | // be sanitized. Please be careful with including other types of PII here as |
743 | // well. |
744 | // e.g. "Label: Some String" |
745 | String, |
746 | |
747 | // Show a string from a UniqueStringArray given an index in the profile. |
748 | // e.g. 1, given string table ["hello", "world"] will show "world" |
749 | UniqueString, |
750 | |
751 | // ---------------------------------------------------- |
752 | // Numeric types |
753 | |
754 | // For time data that represents a duration of time. |
755 | // e.g. "Label: 5s, 5ms, 5μs" |
756 | Duration, |
757 | // Data that happened at a specific time, relative to the start of the |
758 | // profile. e.g. "Label: 15.5s, 20.5ms, 30.5μs" |
759 | Time, |
760 | // The following are alternatives to display a time only in a specific unit |
761 | // of time. |
762 | Seconds, // "Label: 5s" |
763 | Milliseconds, // "Label: 5ms" |
764 | Microseconds, // "Label: 5μs" |
765 | Nanoseconds, // "Label: 5ns" |
766 | // e.g. "Label: 5.55mb, 5 bytes, 312.5kb" |
767 | Bytes, |
768 | // This should be a value between 0 and 1. |
769 | // "Label: 50%" |
770 | Percentage, |
771 | // The integer should be used for generic representations of numbers. |
772 | // Do not use it for time information. |
773 | // "Label: 52, 5,323, 1,234,567" |
774 | Integer, |
775 | // The decimal should be used for generic representations of numbers. |
776 | // Do not use it for time information. |
777 | // "Label: 52.23, 0.0054, 123,456.78" |
778 | Decimal |
779 | }; |
780 | |
781 | // This represents groups of markers which MarkerTypes can expose to indicate |
782 | // what group they belong to (multiple groups are allowed combined in bitwise |
783 | // or). This is currently only used for ETW filtering. In the long run this |
784 | // should be generalized to gecko markers. |
785 | enum class ETWMarkerGroup : uint64_t { |
786 | Generic = 1, |
787 | UserMarkers = 1 << 1, |
788 | Memory = 1 << 2, |
789 | Scheduling = 1 << 3, |
790 | Text = 1 << 4, |
791 | Tracing = 1 << 5 |
792 | }; |
793 | |
794 | // Flags which describe additional information for a PayloadField. |
795 | enum class PayloadFlags : uint32_t { None = 0, Searchable = 1 }; |
796 | |
797 | // This is one field of payload to be used for additional marker data. |
798 | struct PayloadField { |
799 | // Key identifying the marker. |
800 | const char* Key; |
801 | // Input type, this represents the data type specified. |
802 | InputType InputTy; |
803 | // Label, additional description. |
804 | const char* Label = nullptr; |
805 | // Format as written to the JSON. |
806 | Format Fmt = Format::String; |
807 | // Optional PayloadFlags. |
808 | PayloadFlags Flags = PayloadFlags::None; |
809 | }; |
810 | |
811 | enum class Searchable { NotSearchable, Searchable }; |
812 | enum class GraphType { Line, Bar, FilledLine }; |
813 | enum class GraphColor { |
814 | Blue, |
815 | Green, |
816 | Grey, |
817 | Ink, |
818 | Magenta, |
819 | Orange, |
820 | Purple, |
821 | Red, |
822 | Teal, |
823 | Yellow |
824 | }; |
825 | |
826 | // Marker schema, with a non-empty list of locations where markers should be |
827 | // shown. |
828 | // Tech note: Even though `aLocations` are templated arguments, they are |
829 | // assigned to an `enum class` object, so they can only be of that enum type. |
830 | template <typename... Locations> |
831 | explicit MarkerSchema(Location aLocation, Locations... aLocations) |
832 | : mLocations{aLocation, aLocations...} {} |
833 | |
834 | // Alternative constructor for MarkerSchema. |
835 | explicit MarkerSchema(const mozilla::MarkerSchema::Location* aLocations, |
836 | size_t aLength) |
837 | : mLocations(aLocations, aLocations + aLength) {} |
838 | |
839 | // Marker schema for types that have special frontend handling. |
840 | // Nothing else should be set in this case. |
841 | // Implicit to allow quick return from MarkerTypeDisplay functions. |
842 | MOZ_IMPLICIT MarkerSchema(SpecialFrontendLocation) {} |
843 | |
844 | // Caller must specify location(s) or SpecialFrontendLocation above. |
845 | MarkerSchema() = delete; |
846 | |
847 | // Optional labels in the marker chart, the chart tooltip, and the marker |
848 | // table. If not provided, the marker "name" will be used. The given string |
849 | // can contain element keys in braces to include data elements streamed by |
850 | // `StreamJSONMarkerData()`. E.g.: "This is {text}" |
851 | |
852 | #define LABEL_SETTER(name) \ |
853 | MarkerSchema& Set##name(std::string a##name) { \ |
854 | m##name = std::move(a##name); \ |
855 | return *this; \ |
856 | } |
857 | |
858 | LABEL_SETTER(ChartLabel) |
859 | LABEL_SETTER(TooltipLabel) |
860 | LABEL_SETTER(TableLabel) |
861 | |
862 | #undef LABEL_SETTER |
863 | |
864 | MarkerSchema& SetAllLabels(std::string aText) { |
865 | // Here we set the same text in each label. |
866 | // TODO: Move to a single "label" field once the front-end allows it. |
867 | SetChartLabel(aText); |
868 | SetTooltipLabel(aText); |
869 | SetTableLabel(std::move(aText)); |
870 | return *this; |
871 | } |
872 | |
873 | // Each data element that is streamed by `StreamJSONMarkerData()` can be |
874 | // displayed as indicated by using one of the `Add...` function below. |
875 | // Each `Add...` will add a line in the full marker description. Parameters: |
876 | // - `aKey`: Element property name as streamed by `StreamJSONMarkerData()`. |
877 | // - `aLabel`: Optional prefix. Defaults to the key name. |
878 | // - `aFormat`: How to format the data element value, see `Format` above. |
879 | // - `aSearchable`: Optional, indicates if the value is used in searches, |
880 | // defaults to false. |
881 | |
882 | MarkerSchema& AddKeyFormat(std::string aKey, Format aFormat) { |
883 | mData.emplace_back(mozilla::VariantType<DynamicData>{}, |
884 | DynamicData{std::move(aKey), mozilla::Nothing{}, aFormat, |
885 | mozilla::Nothing{}}); |
886 | return *this; |
887 | } |
888 | |
889 | MarkerSchema& AddKeyLabelFormat(std::string aKey, std::string aLabel, |
890 | Format aFormat) { |
891 | mData.emplace_back( |
892 | mozilla::VariantType<DynamicData>{}, |
893 | DynamicData{std::move(aKey), mozilla::Some(std::move(aLabel)), aFormat, |
894 | mozilla::Nothing{}}); |
895 | return *this; |
896 | } |
897 | |
898 | MarkerSchema& AddKeyFormatSearchable(std::string aKey, Format aFormat, |
899 | Searchable aSearchable) { |
900 | mData.emplace_back(mozilla::VariantType<DynamicData>{}, |
901 | DynamicData{std::move(aKey), mozilla::Nothing{}, aFormat, |
902 | mozilla::Some(aSearchable)}); |
903 | return *this; |
904 | } |
905 | |
906 | MarkerSchema& AddKeyLabelFormatSearchable(std::string aKey, |
907 | std::string aLabel, Format aFormat, |
908 | Searchable aSearchable) { |
909 | mData.emplace_back( |
910 | mozilla::VariantType<DynamicData>{}, |
911 | DynamicData{std::move(aKey), mozilla::Some(std::move(aLabel)), aFormat, |
912 | mozilla::Some(aSearchable)}); |
913 | return *this; |
914 | } |
915 | |
916 | // The display may also include static rows. |
917 | |
918 | MarkerSchema& AddStaticLabelValue(std::string aLabel, std::string aValue) { |
919 | mData.emplace_back(mozilla::VariantType<StaticData>{}, |
920 | StaticData{std::move(aLabel), std::move(aValue)}); |
921 | return *this; |
922 | } |
923 | |
924 | // Markers can be shown as timeline tracks. |
925 | |
926 | MarkerSchema& AddChart(std::string aKey, GraphType aType) { |
927 | mGraphs.emplace_back(GraphData{std::move(aKey), aType, mozilla::Nothing{}}); |
928 | return *this; |
929 | } |
930 | |
931 | MarkerSchema& AddChartColor(std::string aKey, GraphType aType, |
932 | GraphColor aColor) { |
933 | mGraphs.emplace_back( |
934 | GraphData{std::move(aKey), aType, mozilla::Some(aColor)}); |
935 | return *this; |
936 | } |
937 | |
938 | // Internal streaming function. |
939 | MFBT_API__attribute__((weak)) __attribute__((visibility("default"))) void Stream(JSONWriter& aWriter, const Span<const char>& aName) &&; |
940 | |
941 | private: |
942 | MFBT_API__attribute__((weak)) __attribute__((visibility("default"))) static Span<const char> LocationToStringSpan(Location aLocation); |
943 | MFBT_API__attribute__((weak)) __attribute__((visibility("default"))) static Span<const char> FormatToStringSpan(Format aFormat); |
944 | MFBT_API__attribute__((weak)) __attribute__((visibility("default"))) static Span<const char> GraphTypeToStringSpan(GraphType aType); |
945 | MFBT_API__attribute__((weak)) __attribute__((visibility("default"))) static Span<const char> GraphColorToStringSpan(GraphColor aColor); |
946 | |
947 | // List of marker display locations. Empty for SpecialFrontendLocation. |
948 | std::vector<Location> mLocations; |
949 | // Labels for different places. |
950 | std::string mChartLabel; |
951 | std::string mTooltipLabel; |
952 | std::string mTableLabel; |
953 | // Main display, made of zero or more rows of key+label+format or label+value. |
954 | private: |
955 | struct DynamicData { |
956 | std::string mKey; |
957 | mozilla::Maybe<std::string> mLabel; |
958 | Format mFormat; |
959 | mozilla::Maybe<Searchable> mSearchable; |
960 | }; |
961 | struct StaticData { |
962 | std::string mLabel; |
963 | std::string mValue; |
964 | }; |
965 | using DataRow = mozilla::Variant<DynamicData, StaticData>; |
966 | using DataRowVector = std::vector<DataRow>; |
967 | |
968 | DataRowVector mData; |
969 | |
970 | struct GraphData { |
971 | std::string mKey; |
972 | GraphType mType; |
973 | mozilla::Maybe<GraphColor> mColor; |
974 | }; |
975 | std::vector<GraphData> mGraphs; |
976 | }; |
977 | |
978 | namespace detail { |
979 | // GCC doesn't allow this to live inside the class. |
980 | template <typename PayloadType> |
981 | static void StreamPayload(baseprofiler::SpliceableJSONWriter& aWriter, |
982 | const Span<const char> aKey, |
983 | const PayloadType& aPayload) { |
984 | aWriter.StringProperty(aKey, aPayload); |
985 | } |
986 | |
987 | template <typename PayloadType> |
988 | inline void StreamPayload(baseprofiler::SpliceableJSONWriter& aWriter, |
989 | const Span<const char> aKey, |
990 | const Maybe<PayloadType>& aPayload) { |
991 | if (aPayload.isSome()) { |
992 | StreamPayload(aWriter, aKey, *aPayload); |
993 | } else { |
994 | aWriter.NullProperty(aKey); |
995 | } |
996 | } |
997 | |
998 | template <> |
999 | inline void StreamPayload<bool>(baseprofiler::SpliceableJSONWriter& aWriter, |
1000 | const Span<const char> aKey, |
1001 | const bool& aPayload) { |
1002 | aWriter.BoolProperty(aKey, aPayload); |
1003 | } |
1004 | |
1005 | template <> |
1006 | inline void StreamPayload<ProfilerString8View>( |
1007 | baseprofiler::SpliceableJSONWriter& aWriter, const Span<const char> aKey, |
1008 | const ProfilerString8View& aPayload) { |
1009 | aWriter.StringProperty(aKey, aPayload); |
1010 | } |
1011 | } // namespace detail |
1012 | |
1013 | // This helper class is used by MarkerTypes that want to support the general |
1014 | // MarkerType object schema. When using this the markers will also transmit |
1015 | // their payload to the ETW tracer as well as requiring less inline code. |
1016 | // This is a curiously recurring template, the template argument is the child |
1017 | // class itself. |
1018 | template <typename T> |
1019 | struct BaseMarkerType { |
1020 | static constexpr const char* AllLabels = nullptr; |
1021 | static constexpr const char* ChartLabel = nullptr; |
1022 | static constexpr const char* TableLabel = nullptr; |
1023 | static constexpr const char* TooltipLabel = nullptr; |
1024 | |
1025 | // This indicates whether this marker type wants the names passed to the |
1026 | // individual marker calls stores along with the marker. |
1027 | static constexpr bool StoreName = false; |
1028 | |
1029 | static constexpr MarkerSchema::ETWMarkerGroup Group = |
1030 | MarkerSchema::ETWMarkerGroup::Generic; |
1031 | |
1032 | static MarkerSchema MarkerTypeDisplay() { |
1033 | using MS = MarkerSchema; |
1034 | MS schema{T::Locations, std::size(T::Locations)}; |
1035 | if (T::AllLabels) { |
1036 | schema.SetAllLabels(T::AllLabels); |
1037 | } |
1038 | if (T::ChartLabel) { |
1039 | schema.SetChartLabel(T::ChartLabel); |
1040 | } |
1041 | if (T::TableLabel) { |
1042 | schema.SetTableLabel(T::TableLabel); |
1043 | } |
1044 | if (T::TooltipLabel) { |
1045 | schema.SetTooltipLabel(T::TooltipLabel); |
1046 | } |
1047 | for (const MS::PayloadField field : T::PayloadFields) { |
1048 | if (field.Label) { |
1049 | if (uint32_t(field.Flags) & uint32_t(MS::PayloadFlags::Searchable)) { |
1050 | schema.AddKeyLabelFormatSearchable(field.Key, field.Label, field.Fmt, |
1051 | MS::Searchable::Searchable); |
1052 | } else { |
1053 | schema.AddKeyLabelFormat(field.Key, field.Label, field.Fmt); |
1054 | } |
1055 | } else { |
1056 | if (uint32_t(field.Flags) & uint32_t(MS::PayloadFlags::Searchable)) { |
1057 | schema.AddKeyFormatSearchable(field.Key, field.Fmt, |
1058 | MS::Searchable::Searchable); |
1059 | } else { |
1060 | schema.AddKeyFormat(field.Key, field.Fmt); |
1061 | } |
1062 | } |
1063 | } |
1064 | if (T::Description) { |
1065 | schema.AddStaticLabelValue("Description", T::Description); |
1066 | } |
1067 | return schema; |
1068 | } |
1069 | |
1070 | static constexpr Span<const char> MarkerTypeName() { |
1071 | return MakeStringSpan(T::Name); |
1072 | } |
1073 | |
1074 | // This is called by the child class since the child class version of this |
1075 | // function is used to infer the argument types by the profile buffer and |
1076 | // allows the child to do any special data conversion it needs to do. |
1077 | // Optionally the child can opt not to use this at all and write the data |
1078 | // out itself. |
1079 | template <typename... PayloadArguments> |
1080 | static void StreamJSONMarkerDataImpl( |
1081 | baseprofiler::SpliceableJSONWriter& aWriter, |
1082 | const PayloadArguments&... aPayloadArguments) { |
1083 | size_t i = 0; |
1084 | (detail::StreamPayload(aWriter, MakeStringSpan(T::PayloadFields[i++].Key), |
1085 | aPayloadArguments), |
1086 | ...); |
1087 | } |
1088 | }; |
1089 | } // namespace mozilla |
1090 | |
1091 | #endif // BaseProfilerMarkersPrerequisites_h |
1 | /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ | |||
2 | /* vim: set ts=8 sts=2 et sw=2 tw=80: */ | |||
3 | /* This Source Code Form is subject to the terms of the Mozilla Public | |||
4 | * License, v. 2.0. If a copy of the MPL was not distributed with this | |||
5 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | |||
6 | ||||
7 | /* Smart pointer managing sole ownership of a resource. */ | |||
8 | ||||
9 | #ifndef mozilla_UniquePtr_h | |||
10 | #define mozilla_UniquePtr_h | |||
11 | ||||
12 | #include <memory> | |||
13 | #include <type_traits> | |||
14 | #include <utility> | |||
15 | ||||
16 | #include "mozilla/Assertions.h" | |||
17 | #include "mozilla/Attributes.h" | |||
18 | #include "mozilla/CompactPair.h" | |||
19 | #include "mozilla/Compiler.h" | |||
20 | ||||
21 | namespace mozilla { | |||
22 | ||||
23 | template <typename T> | |||
24 | class DefaultDelete; | |||
25 | template <typename T, class D = DefaultDelete<T>> | |||
26 | class UniquePtr; | |||
27 | ||||
28 | } // namespace mozilla | |||
29 | ||||
30 | namespace mozilla { | |||
31 | ||||
32 | namespace detail { | |||
33 | ||||
34 | struct HasPointerTypeHelper { | |||
35 | template <class U> | |||
36 | static double Test(...); | |||
37 | template <class U> | |||
38 | static char Test(typename U::pointer* = 0); | |||
39 | }; | |||
40 | ||||
41 | template <class T> | |||
42 | class HasPointerType | |||
43 | : public std::integral_constant<bool, sizeof(HasPointerTypeHelper::Test<T>( | |||
44 | 0)) == 1> {}; | |||
45 | ||||
46 | template <class T, class D, bool = HasPointerType<D>::value> | |||
47 | struct PointerTypeImpl { | |||
48 | typedef typename D::pointer Type; | |||
49 | }; | |||
50 | ||||
51 | template <class T, class D> | |||
52 | struct PointerTypeImpl<T, D, false> { | |||
53 | typedef T* Type; | |||
54 | }; | |||
55 | ||||
56 | template <class T, class D> | |||
57 | struct PointerType { | |||
58 | typedef typename PointerTypeImpl<T, std::remove_reference_t<D>>::Type Type; | |||
59 | }; | |||
60 | ||||
61 | } // namespace detail | |||
62 | ||||
63 | /** | |||
64 | * UniquePtr is a smart pointer that wholly owns a resource. Ownership may be | |||
65 | * transferred out of a UniquePtr through explicit action, but otherwise the | |||
66 | * resource is destroyed when the UniquePtr is destroyed. | |||
67 | * | |||
68 | * UniquePtr is similar to C++98's std::auto_ptr, but it improves upon auto_ptr | |||
69 | * in one crucial way: it's impossible to copy a UniquePtr. Copying an auto_ptr | |||
70 | * obviously *can't* copy ownership of its singly-owned resource. So what | |||
71 | * happens if you try to copy one? Bizarrely, ownership is implicitly | |||
72 | * *transferred*, preserving single ownership but breaking code that assumes a | |||
73 | * copy of an object is identical to the original. (This is why auto_ptr is | |||
74 | * prohibited in STL containers.) | |||
75 | * | |||
76 | * UniquePtr solves this problem by being *movable* rather than copyable. | |||
77 | * Instead of passing a |UniquePtr u| directly to the constructor or assignment | |||
78 | * operator, you pass |Move(u)|. In doing so you indicate that you're *moving* | |||
79 | * ownership out of |u|, into the target of the construction/assignment. After | |||
80 | * the transfer completes, |u| contains |nullptr| and may be safely destroyed. | |||
81 | * This preserves single ownership but also allows UniquePtr to be moved by | |||
82 | * algorithms that have been made move-safe. (Note: if |u| is instead a | |||
83 | * temporary expression, don't use |Move()|: just pass the expression, because | |||
84 | * it's already move-ready. For more information see Move.h.) | |||
85 | * | |||
86 | * UniquePtr is also better than std::auto_ptr in that the deletion operation is | |||
87 | * customizable. An optional second template parameter specifies a class that | |||
88 | * (through its operator()(T*)) implements the desired deletion policy. If no | |||
89 | * policy is specified, mozilla::DefaultDelete<T> is used -- which will either | |||
90 | * |delete| or |delete[]| the resource, depending whether the resource is an | |||
91 | * array. Custom deletion policies ideally should be empty classes (no member | |||
92 | * fields, no member fields in base classes, no virtual methods/inheritance), | |||
93 | * because then UniquePtr can be just as efficient as a raw pointer. | |||
94 | * | |||
95 | * Use of UniquePtr proceeds like so: | |||
96 | * | |||
97 | * UniquePtr<int> g1; // initializes to nullptr | |||
98 | * g1.reset(new int); // switch resources using reset() | |||
99 | * g1 = nullptr; // clears g1, deletes the int | |||
100 | * | |||
101 | * UniquePtr<int> g2(new int); // owns that int | |||
102 | * int* p = g2.release(); // g2 leaks its int -- still requires deletion | |||
103 | * delete p; // now freed | |||
104 | * | |||
105 | * struct S { int x; S(int x) : x(x) {} }; | |||
106 | * UniquePtr<S> g3, g4(new S(5)); | |||
107 | * g3 = std::move(g4); // g3 owns the S, g4 cleared | |||
108 | * S* p = g3.get(); // g3 still owns |p| | |||
109 | * assert(g3->x == 5); // operator-> works (if .get() != nullptr) | |||
110 | * assert((*g3).x == 5); // also operator* (again, if not cleared) | |||
111 | * std::swap(g3, g4); // g4 now owns the S, g3 cleared | |||
112 | * g3.swap(g4); // g3 now owns the S, g4 cleared | |||
113 | * UniquePtr<S> g5(std::move(g3)); // g5 owns the S, g3 cleared | |||
114 | * g5.reset(); // deletes the S, g5 cleared | |||
115 | * | |||
116 | * struct FreePolicy { void operator()(void* p) { free(p); } }; | |||
117 | * UniquePtr<int, FreePolicy> g6(static_cast<int*>(malloc(sizeof(int)))); | |||
118 | * int* ptr = g6.get(); | |||
119 | * g6 = nullptr; // calls free(ptr) | |||
120 | * | |||
121 | * Now, carefully note a few things you *can't* do: | |||
122 | * | |||
123 | * UniquePtr<int> b1; | |||
124 | * b1 = new int; // BAD: can only assign another UniquePtr | |||
125 | * int* ptr = b1; // BAD: no auto-conversion to pointer, use get() | |||
126 | * | |||
127 | * UniquePtr<int> b2(b1); // BAD: can't copy a UniquePtr | |||
128 | * UniquePtr<int> b3 = b1; // BAD: can't copy-assign a UniquePtr | |||
129 | * | |||
130 | * (Note that changing a UniquePtr to store a direct |new| expression is | |||
131 | * permitted, but usually you should use MakeUnique, defined at the end of this | |||
132 | * header.) | |||
133 | * | |||
134 | * A few miscellaneous notes: | |||
135 | * | |||
136 | * UniquePtr, when not instantiated for an array type, can be move-constructed | |||
137 | * and move-assigned, not only from itself but from "derived" UniquePtr<U, E> | |||
138 | * instantiations where U converts to T and E converts to D. If you want to use | |||
139 | * this, you're going to have to specify a deletion policy for both UniquePtr | |||
140 | * instantations, and T pretty much has to have a virtual destructor. In other | |||
141 | * words, this doesn't work: | |||
142 | * | |||
143 | * struct Base { virtual ~Base() {} }; | |||
144 | * struct Derived : Base {}; | |||
145 | * | |||
146 | * UniquePtr<Base> b1; | |||
147 | * // BAD: DefaultDelete<Base> and DefaultDelete<Derived> don't interconvert | |||
148 | * UniquePtr<Derived> d1(std::move(b)); | |||
149 | * | |||
150 | * UniquePtr<Base> b2; | |||
151 | * UniquePtr<Derived, DefaultDelete<Base>> d2(std::move(b2)); // okay | |||
152 | * | |||
153 | * UniquePtr is specialized for array types. Specializing with an array type | |||
154 | * creates a smart-pointer version of that array -- not a pointer to such an | |||
155 | * array. | |||
156 | * | |||
157 | * UniquePtr<int[]> arr(new int[5]); | |||
158 | * arr[0] = 4; | |||
159 | * | |||
160 | * What else is different? Deletion of course uses |delete[]|. An operator[] | |||
161 | * is provided. Functionality that doesn't make sense for arrays is removed. | |||
162 | * The constructors and mutating methods only accept array pointers (not T*, U* | |||
163 | * that converts to T*, or UniquePtr<U[]> or UniquePtr<U>) or |nullptr|. | |||
164 | * | |||
165 | * It's perfectly okay for a function to return a UniquePtr. This transfers | |||
166 | * the UniquePtr's sole ownership of the data, to the fresh UniquePtr created | |||
167 | * in the calling function, that will then solely own that data. Such functions | |||
168 | * can return a local variable UniquePtr, |nullptr|, |UniquePtr(ptr)| where | |||
169 | * |ptr| is a |T*|, or a UniquePtr |Move()|'d from elsewhere. | |||
170 | * | |||
171 | * UniquePtr will commonly be a member of a class, with lifetime equivalent to | |||
172 | * that of that class. If you want to expose the related resource, you could | |||
173 | * expose a raw pointer via |get()|, but ownership of a raw pointer is | |||
174 | * inherently unclear. So it's better to expose a |const UniquePtr&| instead. | |||
175 | * This prohibits mutation but still allows use of |get()| when needed (but | |||
176 | * operator-> is preferred). Of course, you can only use this smart pointer as | |||
177 | * long as the enclosing class instance remains live -- no different than if you | |||
178 | * exposed the |get()| raw pointer. | |||
179 | * | |||
180 | * To pass a UniquePtr-managed resource as a pointer, use a |const UniquePtr&| | |||
181 | * argument. To specify an inout parameter (where the method may or may not | |||
182 | * take ownership of the resource, or reset it), or to specify an out parameter | |||
183 | * (where simply returning a |UniquePtr| isn't possible), use a |UniquePtr&| | |||
184 | * argument. To unconditionally transfer ownership of a UniquePtr | |||
185 | * into a method, use a |UniquePtr| argument. To conditionally transfer | |||
186 | * ownership of a resource into a method, should the method want it, use a | |||
187 | * |UniquePtr&&| argument. | |||
188 | */ | |||
189 | template <typename T, class D> | |||
190 | class UniquePtr { | |||
191 | public: | |||
192 | typedef T ElementType; | |||
193 | typedef D DeleterType; | |||
194 | typedef typename detail::PointerType<T, DeleterType>::Type Pointer; | |||
195 | ||||
196 | private: | |||
197 | mozilla::CompactPair<Pointer, DeleterType> mTuple; | |||
198 | ||||
199 | Pointer& ptr() { return mTuple.first(); } | |||
200 | const Pointer& ptr() const { return mTuple.first(); } | |||
201 | ||||
202 | DeleterType& del() { return mTuple.second(); } | |||
203 | const DeleterType& del() const { return mTuple.second(); } | |||
204 | ||||
205 | public: | |||
206 | /** | |||
207 | * Construct a UniquePtr containing |nullptr|. | |||
208 | */ | |||
209 | constexpr UniquePtr() : mTuple(static_cast<Pointer>(nullptr), DeleterType()) { | |||
210 | static_assert(!std::is_pointer_v<D>, "must provide a deleter instance"); | |||
211 | static_assert(!std::is_reference_v<D>, "must provide a deleter instance"); | |||
212 | } | |||
213 | ||||
214 | /** | |||
215 | * Construct a UniquePtr containing |aPtr|. | |||
216 | */ | |||
217 | explicit UniquePtr(Pointer aPtr) : mTuple(aPtr, DeleterType()) { | |||
218 | static_assert(!std::is_pointer_v<D>, "must provide a deleter instance"); | |||
219 | static_assert(!std::is_reference_v<D>, "must provide a deleter instance"); | |||
220 | } | |||
221 | ||||
222 | UniquePtr(Pointer aPtr, | |||
223 | std::conditional_t<std::is_reference_v<D>, D, const D&> aD1) | |||
224 | : mTuple(aPtr, aD1) {} | |||
225 | ||||
226 | UniquePtr(Pointer aPtr, std::remove_reference_t<D>&& aD2) | |||
227 | : mTuple(aPtr, std::move(aD2)) { | |||
228 | static_assert(!std::is_reference_v<D>, | |||
229 | "rvalue deleter can't be stored by reference"); | |||
230 | } | |||
231 | ||||
232 | UniquePtr(UniquePtr&& aOther) | |||
233 | : mTuple(aOther.release(), | |||
234 | std::forward<DeleterType>(aOther.get_deleter())) {} | |||
235 | ||||
236 | MOZ_IMPLICIT constexpr UniquePtr(decltype(nullptr)) : UniquePtr() {} | |||
237 | ||||
238 | template <typename U, class E> | |||
239 | MOZ_IMPLICIT UniquePtr( | |||
240 | UniquePtr<U, E>&& aOther, | |||
241 | std::enable_if_t< | |||
242 | std::is_convertible_v<typename UniquePtr<U, E>::Pointer, Pointer> && | |||
243 | !std::is_array_v<U> && | |||
244 | (std::is_reference_v<D> ? std::is_same_v<D, E> | |||
245 | : std::is_convertible_v<E, D>), | |||
246 | int> | |||
247 | aDummy = 0) | |||
248 | : mTuple(aOther.release(), std::forward<E>(aOther.get_deleter())) {} | |||
249 | ||||
250 | ~UniquePtr() { reset(nullptr); } | |||
251 | ||||
252 | UniquePtr& operator=(UniquePtr&& aOther) { | |||
253 | reset(aOther.release()); | |||
254 | get_deleter() = std::forward<DeleterType>(aOther.get_deleter()); | |||
255 | return *this; | |||
256 | } | |||
257 | ||||
258 | template <typename U, typename E> | |||
259 | UniquePtr& operator=(UniquePtr<U, E>&& aOther) { | |||
260 | static_assert( | |||
261 | std::is_convertible_v<typename UniquePtr<U, E>::Pointer, Pointer>, | |||
262 | "incompatible UniquePtr pointees"); | |||
263 | static_assert(!std::is_array_v<U>, | |||
264 | "can't assign from UniquePtr holding an array"); | |||
265 | ||||
266 | reset(aOther.release()); | |||
267 | get_deleter() = std::forward<E>(aOther.get_deleter()); | |||
268 | return *this; | |||
269 | } | |||
270 | ||||
271 | UniquePtr& operator=(decltype(nullptr)) { | |||
272 | reset(nullptr); | |||
273 | return *this; | |||
274 | } | |||
275 | ||||
276 | std::add_lvalue_reference_t<T> operator*() const { | |||
277 | MOZ_ASSERT(get(), "dereferencing a UniquePtr containing nullptr with *")do { static_assert( mozilla::detail::AssertionConditionType< decltype(get())>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(!!(get()))), 0))) { do { } while ( false); MOZ_ReportAssertionFailure("get()" " (" "dereferencing a UniquePtr containing nullptr with *" ")", "/var/lib/jenkins/workspace/firefox-scan-build/obj-x86_64-pc-linux-gnu/dist/include/mozilla/UniquePtr.h" , 277); AnnotateMozCrashReason("MOZ_ASSERT" "(" "get()" ") (" "dereferencing a UniquePtr containing nullptr with *" ")"); do { *((volatile int*)__null) = 277; __attribute__((nomerge)) :: abort(); } while (false); } } while (false); | |||
278 | return *get(); | |||
279 | } | |||
280 | Pointer operator->() const { | |||
281 | MOZ_ASSERT(get(), "dereferencing a UniquePtr containing nullptr with ->")do { static_assert( mozilla::detail::AssertionConditionType< decltype(get())>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(!!(get()))), 0))) { do { } while ( false); MOZ_ReportAssertionFailure("get()" " (" "dereferencing a UniquePtr containing nullptr with ->" ")", "/var/lib/jenkins/workspace/firefox-scan-build/obj-x86_64-pc-linux-gnu/dist/include/mozilla/UniquePtr.h" , 281); AnnotateMozCrashReason("MOZ_ASSERT" "(" "get()" ") (" "dereferencing a UniquePtr containing nullptr with ->" ")" ); do { *((volatile int*)__null) = 281; __attribute__((nomerge )) ::abort(); } while (false); } } while (false); | |||
282 | return get(); | |||
283 | } | |||
284 | ||||
285 | explicit operator bool() const { return get() != nullptr; } | |||
286 | ||||
287 | Pointer get() const { return ptr(); } | |||
| ||||
288 | ||||
289 | DeleterType& get_deleter() { return del(); } | |||
290 | const DeleterType& get_deleter() const { return del(); } | |||
291 | ||||
292 | [[nodiscard]] Pointer release() { | |||
293 | Pointer p = ptr(); | |||
294 | ptr() = nullptr; | |||
295 | return p; | |||
296 | } | |||
297 | ||||
298 | void reset(Pointer aPtr = Pointer()) { | |||
299 | Pointer old = ptr(); | |||
300 | ptr() = aPtr; | |||
301 | if (old != nullptr) { | |||
302 | get_deleter()(old); | |||
303 | } | |||
304 | } | |||
305 | ||||
306 | void swap(UniquePtr& aOther) { mTuple.swap(aOther.mTuple); } | |||
307 | ||||
308 | UniquePtr(const UniquePtr& aOther) = delete; // construct using std::move()! | |||
309 | void operator=(const UniquePtr& aOther) = | |||
310 | delete; // assign using std::move()! | |||
311 | }; | |||
312 | ||||
313 | // In case you didn't read the comment by the main definition (you should!): the | |||
314 | // UniquePtr<T[]> specialization exists to manage array pointers. It deletes | |||
315 | // such pointers using delete[], it will reject construction and modification | |||
316 | // attempts using U* or U[]. Otherwise it works like the normal UniquePtr. | |||
317 | template <typename T, class D> | |||
318 | class UniquePtr<T[], D> { | |||
319 | public: | |||
320 | typedef T* Pointer; | |||
321 | typedef T ElementType; | |||
322 | typedef D DeleterType; | |||
323 | ||||
324 | private: | |||
325 | mozilla::CompactPair<Pointer, DeleterType> mTuple; | |||
326 | ||||
327 | public: | |||
328 | /** | |||
329 | * Construct a UniquePtr containing nullptr. | |||
330 | */ | |||
331 | constexpr UniquePtr() : mTuple(static_cast<Pointer>(nullptr), DeleterType()) { | |||
332 | static_assert(!std::is_pointer_v<D>, "must provide a deleter instance"); | |||
333 | static_assert(!std::is_reference_v<D>, "must provide a deleter instance"); | |||
334 | } | |||
335 | ||||
336 | /** | |||
337 | * Construct a UniquePtr containing |aPtr|. | |||
338 | */ | |||
339 | explicit UniquePtr(Pointer aPtr) : mTuple(aPtr, DeleterType()) { | |||
340 | static_assert(!std::is_pointer_v<D>, "must provide a deleter instance"); | |||
341 | static_assert(!std::is_reference_v<D>, "must provide a deleter instance"); | |||
342 | } | |||
343 | ||||
344 | // delete[] knows how to handle *only* an array of a single class type. For | |||
345 | // delete[] to work correctly, it must know the size of each element, the | |||
346 | // fields and base classes of each element requiring destruction, and so on. | |||
347 | // So forbid all overloads which would end up invoking delete[] on a pointer | |||
348 | // of the wrong type. | |||
349 | template <typename U> | |||
350 | UniquePtr(U&& aU, | |||
351 | std::enable_if_t< | |||
352 | std::is_pointer_v<U> && std::is_convertible_v<U, Pointer>, int> | |||
353 | aDummy = 0) = delete; | |||
354 | ||||
355 | UniquePtr(Pointer aPtr, | |||
356 | std::conditional_t<std::is_reference_v<D>, D, const D&> aD1) | |||
357 | : mTuple(aPtr, aD1) {} | |||
358 | ||||
359 | UniquePtr(Pointer aPtr, std::remove_reference_t<D>&& aD2) | |||
360 | : mTuple(aPtr, std::move(aD2)) { | |||
361 | static_assert(!std::is_reference_v<D>, | |||
362 | "rvalue deleter can't be stored by reference"); | |||
363 | } | |||
364 | ||||
365 | // Forbidden for the same reasons as stated above. | |||
366 | template <typename U, typename V> | |||
367 | UniquePtr(U&& aU, V&& aV, | |||
368 | std::enable_if_t< | |||
369 | std::is_pointer_v<U> && std::is_convertible_v<U, Pointer>, int> | |||
370 | aDummy = 0) = delete; | |||
371 | ||||
372 | UniquePtr(UniquePtr&& aOther) | |||
373 | : mTuple(aOther.release(), | |||
374 | std::forward<DeleterType>(aOther.get_deleter())) {} | |||
375 | ||||
376 | MOZ_IMPLICIT | |||
377 | UniquePtr(decltype(nullptr)) : mTuple(nullptr, DeleterType()) { | |||
378 | static_assert(!std::is_pointer_v<D>, "must provide a deleter instance"); | |||
379 | static_assert(!std::is_reference_v<D>, "must provide a deleter instance"); | |||
380 | } | |||
381 | ||||
382 | ~UniquePtr() { reset(nullptr); } | |||
383 | ||||
384 | UniquePtr& operator=(UniquePtr&& aOther) { | |||
385 | reset(aOther.release()); | |||
386 | get_deleter() = std::forward<DeleterType>(aOther.get_deleter()); | |||
387 | return *this; | |||
388 | } | |||
389 | ||||
390 | UniquePtr& operator=(decltype(nullptr)) { | |||
391 | reset(); | |||
392 | return *this; | |||
393 | } | |||
394 | ||||
395 | explicit operator bool() const { return get() != nullptr; } | |||
396 | ||||
397 | T& operator[](decltype(sizeof(int)) aIndex) const { return get()[aIndex]; } | |||
398 | Pointer get() const { return mTuple.first(); } | |||
399 | ||||
400 | DeleterType& get_deleter() { return mTuple.second(); } | |||
401 | const DeleterType& get_deleter() const { return mTuple.second(); } | |||
402 | ||||
403 | [[nodiscard]] Pointer release() { | |||
404 | Pointer p = mTuple.first(); | |||
405 | mTuple.first() = nullptr; | |||
406 | return p; | |||
407 | } | |||
408 | ||||
409 | void reset(Pointer aPtr = Pointer()) { | |||
410 | Pointer old = mTuple.first(); | |||
411 | mTuple.first() = aPtr; | |||
412 | if (old != nullptr) { | |||
413 | mTuple.second()(old); | |||
414 | } | |||
415 | } | |||
416 | ||||
417 | void reset(decltype(nullptr)) { | |||
418 | Pointer old = mTuple.first(); | |||
419 | mTuple.first() = nullptr; | |||
420 | if (old != nullptr) { | |||
421 | mTuple.second()(old); | |||
422 | } | |||
423 | } | |||
424 | ||||
425 | template <typename U> | |||
426 | void reset(U) = delete; | |||
427 | ||||
428 | void swap(UniquePtr& aOther) { mTuple.swap(aOther.mTuple); } | |||
429 | ||||
430 | UniquePtr(const UniquePtr& aOther) = delete; // construct using std::move()! | |||
431 | void operator=(const UniquePtr& aOther) = | |||
432 | delete; // assign using std::move()! | |||
433 | }; | |||
434 | ||||
435 | /** | |||
436 | * A default deletion policy using plain old operator delete. | |||
437 | * | |||
438 | * Note that this type can be specialized, but authors should beware of the risk | |||
439 | * that the specialization may at some point cease to match (either because it | |||
440 | * gets moved to a different compilation unit or the signature changes). If the | |||
441 | * non-specialized (|delete|-based) version compiles for that type but does the | |||
442 | * wrong thing, bad things could happen. | |||
443 | * | |||
444 | * This is a non-issue for types which are always incomplete (i.e. opaque handle | |||
445 | * types), since |delete|-ing such a type will always trigger a compilation | |||
446 | * error. | |||
447 | */ | |||
448 | template <typename T> | |||
449 | class DefaultDelete { | |||
450 | public: | |||
451 | constexpr DefaultDelete() = default; | |||
452 | ||||
453 | template <typename U> | |||
454 | MOZ_IMPLICIT DefaultDelete( | |||
455 | const DefaultDelete<U>& aOther, | |||
456 | std::enable_if_t<std::is_convertible_v<U*, T*>, int> aDummy = 0) {} | |||
457 | ||||
458 | void operator()(T* aPtr) const { | |||
459 | static_assert(sizeof(T) > 0, "T must be complete"); | |||
460 | delete aPtr; | |||
461 | } | |||
462 | }; | |||
463 | ||||
464 | /** A default deletion policy using operator delete[]. */ | |||
465 | template <typename T> | |||
466 | class DefaultDelete<T[]> { | |||
467 | public: | |||
468 | constexpr DefaultDelete() = default; | |||
469 | ||||
470 | void operator()(T* aPtr) const { | |||
471 | static_assert(sizeof(T) > 0, "T must be complete"); | |||
472 | delete[] aPtr; | |||
473 | } | |||
474 | ||||
475 | template <typename U> | |||
476 | void operator()(U* aPtr) const = delete; | |||
477 | }; | |||
478 | ||||
479 | template <typename T, class D, typename U, class E> | |||
480 | bool operator==(const UniquePtr<T, D>& aX, const UniquePtr<U, E>& aY) { | |||
481 | return aX.get() == aY.get(); | |||
482 | } | |||
483 | ||||
484 | template <typename T, class D, typename U, class E> | |||
485 | bool operator!=(const UniquePtr<T, D>& aX, const UniquePtr<U, E>& aY) { | |||
486 | return aX.get() != aY.get(); | |||
487 | } | |||
488 | ||||
489 | template <typename T, class D> | |||
490 | bool operator==(const UniquePtr<T, D>& aX, const T* aY) { | |||
491 | return aX.get() == aY; | |||
492 | } | |||
493 | ||||
494 | template <typename T, class D> | |||
495 | bool operator==(const T* aY, const UniquePtr<T, D>& aX) { | |||
496 | return aY == aX.get(); | |||
497 | } | |||
498 | ||||
499 | template <typename T, class D> | |||
500 | bool operator!=(const UniquePtr<T, D>& aX, const T* aY) { | |||
501 | return aX.get() != aY; | |||
502 | } | |||
503 | ||||
504 | template <typename T, class D> | |||
505 | bool operator!=(const T* aY, const UniquePtr<T, D>& aX) { | |||
506 | return aY != aX.get(); | |||
507 | } | |||
508 | ||||
509 | template <typename T, class D> | |||
510 | bool operator==(const UniquePtr<T, D>& aX, decltype(nullptr)) { | |||
511 | return !aX; | |||
512 | } | |||
513 | ||||
514 | template <typename T, class D> | |||
515 | bool operator==(decltype(nullptr), const UniquePtr<T, D>& aX) { | |||
516 | return !aX; | |||
517 | } | |||
518 | ||||
519 | template <typename T, class D> | |||
520 | bool operator!=(const UniquePtr<T, D>& aX, decltype(nullptr)) { | |||
521 | return bool(aX); | |||
522 | } | |||
523 | ||||
524 | template <typename T, class D> | |||
525 | bool operator!=(decltype(nullptr), const UniquePtr<T, D>& aX) { | |||
526 | return bool(aX); | |||
527 | } | |||
528 | ||||
529 | // No operator<, operator>, operator<=, operator>= for now because simplicity. | |||
530 | ||||
531 | namespace detail { | |||
532 | ||||
533 | template <typename T> | |||
534 | struct UniqueSelector { | |||
535 | typedef UniquePtr<T> SingleObject; | |||
536 | }; | |||
537 | ||||
538 | template <typename T> | |||
539 | struct UniqueSelector<T[]> { | |||
540 | typedef UniquePtr<T[]> UnknownBound; | |||
541 | }; | |||
542 | ||||
543 | template <typename T, decltype(sizeof(int)) N> | |||
544 | struct UniqueSelector<T[N]> { | |||
545 | typedef UniquePtr<T[N]> KnownBound; | |||
546 | }; | |||
547 | ||||
548 | } // namespace detail | |||
549 | ||||
550 | /** | |||
551 | * MakeUnique is a helper function for allocating new'd objects and arrays, | |||
552 | * returning a UniquePtr containing the resulting pointer. The semantics of | |||
553 | * MakeUnique<Type>(...) are as follows. | |||
554 | * | |||
555 | * If Type is an array T[n]: | |||
556 | * Disallowed, deleted, no overload for you! | |||
557 | * If Type is an array T[]: | |||
558 | * MakeUnique<T[]>(size_t) is the only valid overload. The pointer returned | |||
559 | * is as if by |new T[n]()|, which value-initializes each element. (If T | |||
560 | * isn't a class type, this will zero each element. If T is a class type, | |||
561 | * then roughly speaking, each element will be constructed using its default | |||
562 | * constructor. See C++11 [dcl.init]p7 for the full gory details.) | |||
563 | * If Type is non-array T: | |||
564 | * The arguments passed to MakeUnique<T>(...) are forwarded into a | |||
565 | * |new T(...)| call, initializing the T as would happen if executing | |||
566 | * |T(...)|. | |||
567 | * | |||
568 | * There are various benefits to using MakeUnique instead of |new| expressions. | |||
569 | * | |||
570 | * First, MakeUnique eliminates use of |new| from code entirely. If objects are | |||
571 | * only created through UniquePtr, then (assuming all explicit release() calls | |||
572 | * are safe, including transitively, and no type-safety casting funniness) | |||
573 | * correctly maintained ownership of the UniquePtr guarantees no leaks are | |||
574 | * possible. (This pays off best if a class is only ever created through a | |||
575 | * factory method on the class, using a private constructor.) | |||
576 | * | |||
577 | * Second, initializing a UniquePtr using a |new| expression requires repeating | |||
578 | * the name of the new'd type, whereas MakeUnique in concert with the |auto| | |||
579 | * keyword names it only once: | |||
580 | * | |||
581 | * UniquePtr<char> ptr1(new char()); // repetitive | |||
582 | * auto ptr2 = MakeUnique<char>(); // shorter | |||
583 | * | |||
584 | * Of course this assumes the reader understands the operation MakeUnique | |||
585 | * performs. In the long run this is probably a reasonable assumption. In the | |||
586 | * short run you'll have to use your judgment about what readers can be expected | |||
587 | * to know, or to quickly look up. | |||
588 | * | |||
589 | * Third, a call to MakeUnique can be assigned directly to a UniquePtr. In | |||
590 | * contrast you can't assign a pointer into a UniquePtr without using the | |||
591 | * cumbersome reset(). | |||
592 | * | |||
593 | * UniquePtr<char> p; | |||
594 | * p = new char; // ERROR | |||
595 | * p.reset(new char); // works, but fugly | |||
596 | * p = MakeUnique<char>(); // preferred | |||
597 | * | |||
598 | * (And third, although not relevant to Mozilla: MakeUnique is exception-safe. | |||
599 | * An exception thrown after |new T| succeeds will leak that memory, unless the | |||
600 | * pointer is assigned to an object that will manage its ownership. UniquePtr | |||
601 | * ably serves this function.) | |||
602 | */ | |||
603 | ||||
604 | template <typename T, typename... Args> | |||
605 | typename detail::UniqueSelector<T>::SingleObject MakeUnique(Args&&... aArgs) { | |||
606 | return UniquePtr<T>(new T(std::forward<Args>(aArgs)...)); | |||
607 | } | |||
608 | ||||
609 | template <typename T> | |||
610 | typename detail::UniqueSelector<T>::UnknownBound MakeUnique( | |||
611 | decltype(sizeof(int)) aN) { | |||
612 | using ArrayType = std::remove_extent_t<T>; | |||
613 | return UniquePtr<T>(new ArrayType[aN]()); | |||
614 | } | |||
615 | ||||
616 | template <typename T, typename... Args> | |||
617 | typename detail::UniqueSelector<T>::KnownBound MakeUnique(Args&&... aArgs) = | |||
618 | delete; | |||
619 | ||||
620 | /** | |||
621 | * WrapUnique is a helper function to transfer ownership from a raw pointer | |||
622 | * into a UniquePtr<T>. It can only be used with a single non-array type. | |||
623 | * | |||
624 | * It is generally used this way: | |||
625 | * | |||
626 | * auto p = WrapUnique(new char); | |||
627 | * | |||
628 | * It can be used when MakeUnique is not usable, for example, when the | |||
629 | * constructor you are using is private, or you want to use aggregate | |||
630 | * initialization. | |||
631 | */ | |||
632 | ||||
633 | template <typename T> | |||
634 | typename detail::UniqueSelector<T>::SingleObject WrapUnique(T* aPtr) { | |||
635 | return UniquePtr<T>(aPtr); | |||
636 | } | |||
637 | ||||
638 | } // namespace mozilla | |||
639 | ||||
640 | namespace std { | |||
641 | ||||
642 | template <typename T, class D> | |||
643 | void swap(mozilla::UniquePtr<T, D>& aX, mozilla::UniquePtr<T, D>& aY) { | |||
644 | aX.swap(aY); | |||
645 | } | |||
646 | ||||
647 | } // namespace std | |||
648 | ||||
649 | /** | |||
650 | TempPtrToSetter(UniquePtr<T>*) -> T**-ish | |||
651 | TempPtrToSetter(std::unique_ptr<T>*) -> T**-ish | |||
652 | ||||
653 | Make a temporary class to support assigning to UniquePtr/unique_ptr via passing | |||
654 | a pointer to the callee. | |||
655 | ||||
656 | Often, APIs will be shaped like this trivial example: | |||
657 | ``` | |||
658 | nsresult Foo::NewChildBar(Bar** out) { | |||
659 | if (!IsOk()) return NS_ERROR_FAILURE; | |||
660 | *out = new Bar(this); | |||
661 | return NS_OK; | |||
662 | } | |||
663 | ``` | |||
664 | ||||
665 | In order to make this work with unique ptrs, it's often either risky or | |||
666 | overwrought: | |||
667 | ``` | |||
668 | Bar* bar = nullptr; | |||
669 | const auto cleanup = MakeScopeExit([&]() { | |||
670 | if (bar) { | |||
671 | delete bar; | |||
672 | } | |||
673 | }); | |||
674 | if (FAILED(foo->NewChildBar(&bar)) { | |||
675 | // handle it | |||
676 | } | |||
677 | ``` | |||
678 | ||||
679 | ``` | |||
680 | UniquePtr<Bar> bar; | |||
681 | { | |||
682 | Bar* raw = nullptr; | |||
683 | const auto res = foo->NewChildBar(&bar); | |||
684 | bar.reset(raw); | |||
685 | if (FAILED(res) { | |||
686 | // handle it | |||
687 | } | |||
688 | } | |||
689 | ``` | |||
690 | TempPtrToSettable is a shorthand for the latter approach, allowing something | |||
691 | cleaner but also safe: | |||
692 | ||||
693 | ``` | |||
694 | UniquePtr<Bar> bar; | |||
695 | if (FAILED(foo->NewChildBar(TempPtrToSetter(&bar))) { | |||
696 | // handle it | |||
697 | } | |||
698 | ``` | |||
699 | */ | |||
700 | ||||
701 | namespace mozilla { | |||
702 | namespace detail { | |||
703 | ||||
704 | template <class T, class UniquePtrT> | |||
705 | class MOZ_TEMPORARY_CLASS TempPtrToSetterT final { | |||
706 | private: | |||
707 | UniquePtrT* const mDest; | |||
708 | T* mNewVal; | |||
709 | ||||
710 | public: | |||
711 | explicit TempPtrToSetterT(UniquePtrT* dest) | |||
712 | : mDest(dest), mNewVal(mDest->get()) {} | |||
713 | ||||
714 | operator T**() { return &mNewVal; } | |||
715 | ||||
716 | ~TempPtrToSetterT() { | |||
717 | if (mDest->get() != mNewVal) { | |||
718 | mDest->reset(mNewVal); | |||
719 | } | |||
720 | } | |||
721 | }; | |||
722 | ||||
723 | } // namespace detail | |||
724 | ||||
725 | template <class T, class Deleter> | |||
726 | auto TempPtrToSetter(UniquePtr<T, Deleter>* const p) { | |||
727 | return detail::TempPtrToSetterT<T, UniquePtr<T, Deleter>>{p}; | |||
728 | } | |||
729 | ||||
730 | template <class T, class Deleter> | |||
731 | auto TempPtrToSetter(std::unique_ptr<T, Deleter>* const p) { | |||
732 | return detail::TempPtrToSetterT<T, std::unique_ptr<T, Deleter>>{p}; | |||
733 | } | |||
734 | ||||
735 | } // namespace mozilla | |||
736 | ||||
737 | #endif /* mozilla_UniquePtr_h */ |
1 | /* This Source Code Form is subject to the terms of the Mozilla Public |
2 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
3 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
4 | |
5 | #ifndef mozilla_cxxalloc_h |
6 | #define mozilla_cxxalloc_h |
7 | |
8 | /* |
9 | * We implement the default operators new/delete as part of |
10 | * libmozalloc, replacing their definitions in libstdc++. The |
11 | * operator new* definitions in libmozalloc will never return a NULL |
12 | * pointer. |
13 | * |
14 | * Each operator new immediately below returns a pointer to memory |
15 | * that can be delete'd by any of |
16 | * |
17 | * (1) the matching infallible operator delete immediately below |
18 | * (2) the matching system |operator delete(void*, std::nothrow)| |
19 | * (3) the matching system |operator delete(void*) noexcept(false)| |
20 | * |
21 | * NB: these are declared |noexcept(false)|, though they will never |
22 | * throw that exception. This declaration is consistent with the rule |
23 | * that |::operator new() noexcept(false)| will never return NULL. |
24 | * |
25 | * NB: mozilla::fallible can be used instead of std::nothrow. |
26 | */ |
27 | |
28 | #ifndef MOZALLOC_EXPORT_NEW__attribute__((always_inline)) inline |
29 | # define MOZALLOC_EXPORT_NEW__attribute__((always_inline)) inline MFBT_API__attribute__((weak)) __attribute__((visibility("default"))) |
30 | #endif |
31 | |
32 | MOZALLOC_EXPORT_NEW__attribute__((always_inline)) inline void* operator new(size_t size) noexcept(false) { |
33 | return moz_xmalloc(size); |
34 | } |
35 | |
36 | MOZALLOC_EXPORT_NEW__attribute__((always_inline)) inline void* operator new(size_t size, |
37 | const std::nothrow_t&) noexcept(true) { |
38 | return malloc_implmalloc(size); |
39 | } |
40 | |
41 | MOZALLOC_EXPORT_NEW__attribute__((always_inline)) inline void* operator new[](size_t size) noexcept(false) { |
42 | return moz_xmalloc(size); |
43 | } |
44 | |
45 | MOZALLOC_EXPORT_NEW__attribute__((always_inline)) inline void* operator new[](size_t size, |
46 | const std::nothrow_t&) noexcept(true) { |
47 | return malloc_implmalloc(size); |
48 | } |
49 | |
50 | MOZALLOC_EXPORT_NEW__attribute__((always_inline)) inline void operator delete(void* ptr) noexcept(true) { |
51 | return free_implfree(ptr); |
52 | } |
53 | |
54 | MOZALLOC_EXPORT_NEW__attribute__((always_inline)) inline void operator delete(void* ptr, |
55 | const std::nothrow_t&) noexcept(true) { |
56 | return free_implfree(ptr); |
57 | } |
58 | |
59 | MOZALLOC_EXPORT_NEW__attribute__((always_inline)) inline void operator delete[](void* ptr) noexcept(true) { |
60 | return free_implfree(ptr); |
61 | } |
62 | |
63 | MOZALLOC_EXPORT_NEW__attribute__((always_inline)) inline void operator delete[]( |
64 | void* ptr, const std::nothrow_t&) noexcept(true) { |
65 | return free_implfree(ptr); |
66 | } |
67 | |
68 | #if defined(XP_WIN) |
69 | // We provide the global sized delete overloads unconditionally because the |
70 | // MSVC runtime headers do, despite compiling with /Zc:sizedDealloc- |
71 | MOZALLOC_EXPORT_NEW__attribute__((always_inline)) inline void operator delete(void* ptr, |
72 | size_t /*size*/) noexcept(true) { |
73 | return free_implfree(ptr); |
74 | } |
75 | |
76 | MOZALLOC_EXPORT_NEW__attribute__((always_inline)) inline void operator delete[](void* ptr, |
77 | size_t /*size*/) noexcept(true) { |
78 | return free_implfree(ptr); |
79 | } |
80 | #endif |
81 | |
82 | #endif /* mozilla_cxxalloc_h */ |