Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

290 lines
8.9 KiB
C++
Raw Normal View History

/*
* Copyright 2019 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#include "sdk/android/native_api/stacktrace/stacktrace.h"
#include <dlfcn.h>
Use std::make_unique instead of absl::make_unique. WebRTC is now using C++14 so there is no need to use the Abseil version of std::make_unique. This CL has been created with the following steps: git grep -l absl::make_unique | sort | uniq > /tmp/make_unique.txt git grep -l absl::WrapUnique | sort | uniq > /tmp/wrap_unique.txt git grep -l "#include <memory>" | sort | uniq > /tmp/memory.txt diff --new-line-format="" --unchanged-line-format="" \ /tmp/make_unique.txt /tmp/wrap_unique.txt | sort | \ uniq > /tmp/only_make_unique.txt diff --new-line-format="" --unchanged-line-format="" \ /tmp/only_make_unique.txt /tmp/memory.txt | \ xargs grep -l "absl/memory" > /tmp/add-memory.txt git grep -l "\babsl::make_unique\b" | \ xargs sed -i "s/\babsl::make_unique\b/std::make_unique/g" git checkout PRESUBMIT.py abseil-in-webrtc.md cat /tmp/add-memory.txt | \ xargs sed -i \ 's/#include "absl\/memory\/memory.h"/#include <memory>/g' git cl format # Manual fix order of the new inserted #include <memory> cat /tmp/only_make_unique | xargs grep -l "#include <memory>" | \ xargs sed -i '/#include "absl\/memory\/memory.h"/d' git ls-files | grep BUILD.gn | \ xargs sed -i '/\/\/third_party\/abseil-cpp\/absl\/memory/d' python tools_webrtc/gn_check_autofix.py \ -m tryserver.webrtc -b linux_rel # Repead the gn_check_autofix step for other platforms git ls-files | grep BUILD.gn | \ xargs sed -i 's/absl\/memory:memory/absl\/memory/g' git cl format Bug: webrtc:10945 Change-Id: I3fe28ea80f4dd3ba3cf28effd151d5e1f19aff89 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/153221 Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org> Reviewed-by: Alessio Bazzica <alessiob@webrtc.org> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org> Cr-Commit-Position: refs/heads/master@{#29209}
2019-09-17 17:06:18 +02:00
#include <atomic>
Use std::make_unique instead of absl::make_unique. WebRTC is now using C++14 so there is no need to use the Abseil version of std::make_unique. This CL has been created with the following steps: git grep -l absl::make_unique | sort | uniq > /tmp/make_unique.txt git grep -l absl::WrapUnique | sort | uniq > /tmp/wrap_unique.txt git grep -l "#include <memory>" | sort | uniq > /tmp/memory.txt diff --new-line-format="" --unchanged-line-format="" \ /tmp/make_unique.txt /tmp/wrap_unique.txt | sort | \ uniq > /tmp/only_make_unique.txt diff --new-line-format="" --unchanged-line-format="" \ /tmp/only_make_unique.txt /tmp/memory.txt | \ xargs grep -l "absl/memory" > /tmp/add-memory.txt git grep -l "\babsl::make_unique\b" | \ xargs sed -i "s/\babsl::make_unique\b/std::make_unique/g" git checkout PRESUBMIT.py abseil-in-webrtc.md cat /tmp/add-memory.txt | \ xargs sed -i \ 's/#include "absl\/memory\/memory.h"/#include <memory>/g' git cl format # Manual fix order of the new inserted #include <memory> cat /tmp/only_make_unique | xargs grep -l "#include <memory>" | \ xargs sed -i '/#include "absl\/memory\/memory.h"/d' git ls-files | grep BUILD.gn | \ xargs sed -i '/\/\/third_party\/abseil-cpp\/absl\/memory/d' python tools_webrtc/gn_check_autofix.py \ -m tryserver.webrtc -b linux_rel # Repead the gn_check_autofix step for other platforms git ls-files | grep BUILD.gn | \ xargs sed -i 's/absl\/memory:memory/absl\/memory/g' git cl format Bug: webrtc:10945 Change-Id: I3fe28ea80f4dd3ba3cf28effd151d5e1f19aff89 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/153221 Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org> Reviewed-by: Alessio Bazzica <alessiob@webrtc.org> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org> Cr-Commit-Position: refs/heads/master@{#29209}
2019-09-17 17:06:18 +02:00
#include <memory>
#include <vector>
#include "rtc_base/event.h"
#include "rtc_base/logging.h"
#include "rtc_base/platform_thread.h"
#include "rtc_base/string_utils.h"
#include "rtc_base/strings/string_builder.h"
#include "rtc_base/synchronization/mutex.h"
#include "rtc_base/system/inline.h"
#include "system_wrappers/include/sleep.h"
#include "test/gtest.h"
namespace webrtc {
namespace test {
namespace {
// A simple atomic spin event. Implemented with std::atomic_flag, since the C++
// standard guarantees that that type is implemented with actual atomic
// instructions (as opposed to e.g. with a mutex). Uses sequentially consistent
// memory order since this is a test, where simplicity trumps performance.
class SimpleSpinEvent {
public:
// Initialize the event to its blocked state.
SimpleSpinEvent() {
static_cast<void>(blocked_.test_and_set(std::memory_order_seq_cst));
}
// Busy-wait for the event to become unblocked, and block it behind us as we
// leave.
void Wait() {
bool was_blocked;
do {
// Check if the event was blocked, and set it to blocked.
was_blocked = blocked_.test_and_set(std::memory_order_seq_cst);
} while (was_blocked);
}
// Unblock the event.
void Set() { blocked_.clear(std::memory_order_seq_cst); }
private:
std::atomic_flag blocked_;
};
// Returns the execution address relative to the .so base address. This matches
// the addresses we get from GetStacktrace().
RTC_NO_INLINE uint32_t GetCurrentRelativeExecutionAddress() {
void* pc = __builtin_return_address(0);
Dl_info dl_info = {};
const bool success = dladdr(pc, &dl_info);
EXPECT_TRUE(success);
return static_cast<uint32_t>(reinterpret_cast<uintptr_t>(pc) -
reinterpret_cast<uintptr_t>(dl_info.dli_fbase));
}
// Returns true if any of the stack trace element is inside the specified
// region.
bool StackTraceContainsRange(const std::vector<StackTraceElement>& stack_trace,
uintptr_t pc_low,
uintptr_t pc_high) {
for (const StackTraceElement& stack_trace_element : stack_trace) {
if (pc_low <= stack_trace_element.relative_address &&
pc_high >= stack_trace_element.relative_address) {
return true;
}
}
return false;
}
class DeadlockInterface {
public:
virtual ~DeadlockInterface() {}
// This function should deadlock until Release() is called.
virtual void Deadlock() = 0;
// This function should release the thread stuck in Deadlock().
virtual void Release() = 0;
};
struct ThreadParams {
volatile int tid;
// Signaled when the deadlock region is entered.
SimpleSpinEvent deadlock_start_event;
DeadlockInterface* volatile deadlock_impl;
// Defines an address range within the deadlock will occur.
volatile uint32_t deadlock_region_start_address;
volatile uint32_t deadlock_region_end_address;
// Signaled when the deadlock is done.
rtc::Event deadlock_done_event;
};
class RtcEventDeadlock : public DeadlockInterface {
private:
void Deadlock() override { event.Wait(rtc::Event::kForever); }
void Release() override { event.Set(); }
rtc::Event event;
};
class RtcCriticalSectionDeadlock : public DeadlockInterface {
public:
RtcCriticalSectionDeadlock()
: mutex_lock_(std::make_unique<MutexLock>(&mutex_)) {}
private:
void Deadlock() override { MutexLock lock(&mutex_); }
void Release() override { mutex_lock_.reset(); }
Mutex mutex_;
std::unique_ptr<MutexLock> mutex_lock_;
};
class SpinDeadlock : public DeadlockInterface {
public:
SpinDeadlock() : is_deadlocked_(true) {}
private:
void Deadlock() override {
while (is_deadlocked_) {
}
}
void Release() override { is_deadlocked_ = false; }
std::atomic<bool> is_deadlocked_;
};
class SleepDeadlock : public DeadlockInterface {
private:
void Deadlock() override { sleep(1000000); }
void Release() override {
// The interrupt itself will break free from the sleep.
}
};
void TestStacktrace(std::unique_ptr<DeadlockInterface> deadlock_impl) {
// Set params that will be sent to other thread.
ThreadParams params;
params.deadlock_impl = deadlock_impl.get();
// Spawn thread.
Reland "Refactor the PlatformThread API." This reverts commit 793bac569fdf1be16cbf24d7871d20d00bbec81b. Reason for revert: rare compilation error fixed Original change's description: > Revert "Refactor the PlatformThread API." > > This reverts commit c89fdd716c4c8af608017c76f75bf27e4c3d602e. > > Reason for revert: Causes rare compilation error on win-libfuzzer-asan trybot. > See https://ci.chromium.org/p/chromium/builders/try/win-libfuzzer-asan-rel/713745? > > Original change's description: > > Refactor the PlatformThread API. > > > > PlatformThread's API is using old style function pointers, causes > > casting, is unintuitive and forces artificial call sequences, and > > is additionally possible to misuse in release mode. > > > > Fix this by an API face lift: > > 1. The class is turned into a handle, which can be empty. > > 2. The only way of getting a non-empty PlatformThread is by calling > > SpawnJoinable or SpawnDetached, clearly conveying the semantics to the > > code reader. > > 3. Handles can be Finalized, which works differently for joinable and > > detached threads: > > a) Handles for detached threads are simply closed where applicable. > > b) Joinable threads are joined before handles are closed. > > 4. The destructor finalizes handles. No explicit call is needed. > > > > Fixed: webrtc:12727 > > Change-Id: Id00a0464edf4fc9e552b6a1fbb5d2e1280e88811 > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/215075 > > Commit-Queue: Markus Handell <handellm@webrtc.org> > > Reviewed-by: Harald Alvestrand <hta@webrtc.org> > > Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org> > > Reviewed-by: Tommi <tommi@webrtc.org> > > Cr-Commit-Position: refs/heads/master@{#33923} > > # Not skipping CQ checks because original CL landed > 1 day ago. > > TBR=handellm@webrtc.org > > Bug: webrtc:12727 > Change-Id: Ic0146be8866f6dd3ad9c364fb8646650b8e07419 > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/217583 > Reviewed-by: Guido Urdaneta <guidou@webrtc.org> > Reviewed-by: Markus Handell <handellm@webrtc.org> > Commit-Queue: Guido Urdaneta <guidou@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#33936} # Not skipping CQ checks because this is a reland. Bug: webrtc:12727 Change-Id: Ifd6f44eac72fed84474277a1be03eb84d2f4376e Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/217881 Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org> Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org> Reviewed-by: Markus Handell <handellm@webrtc.org> Reviewed-by: Harald Alvestrand <hta@webrtc.org> Cr-Commit-Position: refs/heads/master@{#33950}
2021-05-07 15:02:36 +02:00
auto thread = rtc::PlatformThread::SpawnJoinable(
[&params] {
params.tid = gettid();
params.deadlock_region_start_address =
GetCurrentRelativeExecutionAddress();
params.deadlock_start_event.Set();
params.deadlock_impl->Deadlock();
params.deadlock_region_end_address =
GetCurrentRelativeExecutionAddress();
params.deadlock_done_event.Set();
},
"StacktraceTest");
// Wait until the thread has entered the deadlock region, and take a very
// brief nap to give it time to reach the actual deadlock.
params.deadlock_start_event.Wait();
SleepMs(1);
// Acquire the stack trace of the thread which should now be deadlocking.
std::vector<StackTraceElement> stack_trace = GetStackTrace(params.tid);
// Release the deadlock so that the thread can continue.
deadlock_impl->Release();
// Wait until the thread has left the deadlock.
params.deadlock_done_event.Wait(rtc::Event::kForever);
// Assert that the stack trace contains the deadlock region.
EXPECT_TRUE(StackTraceContainsRange(stack_trace,
params.deadlock_region_start_address,
params.deadlock_region_end_address))
<< "Deadlock region: ["
<< rtc::ToHex(params.deadlock_region_start_address) << ", "
<< rtc::ToHex(params.deadlock_region_end_address)
<< "] not contained in: " << StackTraceToString(stack_trace);
}
class LookoutLogSink final : public rtc::LogSink {
public:
explicit LookoutLogSink(std::string look_for)
: look_for_(std::move(look_for)) {}
void OnLogMessage(const std::string& message) override {
if (message.find(look_for_) != std::string::npos) {
when_found_.Set();
}
}
rtc::Event& WhenFound() { return when_found_; }
private:
const std::string look_for_;
rtc::Event when_found_;
};
} // namespace
TEST(Stacktrace, TestCurrentThread) {
const uint32_t start_addr = GetCurrentRelativeExecutionAddress();
const std::vector<StackTraceElement> stack_trace = GetStackTrace();
const uint32_t end_addr = GetCurrentRelativeExecutionAddress();
EXPECT_TRUE(StackTraceContainsRange(stack_trace, start_addr, end_addr))
<< "Caller region: [" << rtc::ToHex(start_addr) << ", "
<< rtc::ToHex(end_addr)
<< "] not contained in: " << StackTraceToString(stack_trace);
}
Roll chromium_revision 867b87eb29..b56d8868f3 (933713:941610) Change log: https://chromium.googlesource.com/chromium/src/+log/867b87eb29..b56d8868f3 Full diff: https://chromium.googlesource.com/chromium/src/+/867b87eb29..b56d8868f3 Changed dependencies * src/base: https://chromium.googlesource.com/chromium/src/base/+log/14c89123e6..b367343820 * src/build: https://chromium.googlesource.com/chromium/src/build/+log/a0368daa25..d134d68f00 * src/buildtools: https://chromium.googlesource.com/chromium/src/buildtools/+log/aa2fb0187c..b138e6ce86 * src/buildtools/linux64: git_revision:693f9fb87e4febdd4299db9f73d8d2c958e63148..git_revision:90294ccdcf9334ed25a76ac9b67689468e506342 * src/buildtools/mac: git_revision:693f9fb87e4febdd4299db9f73d8d2c958e63148..git_revision:90294ccdcf9334ed25a76ac9b67689468e506342 * src/buildtools/third_party/libc++abi/trunk: https://chromium.googlesource.com/external/github.com/llvm/llvm-project/libcxxabi.git/+log/4c834abe6f..707d75f53e * src/buildtools/third_party/libunwind/trunk: https://chromium.googlesource.com/external/github.com/llvm/llvm-project/libunwind.git/+log/10f4e4a5b5..51ffc5ed5c * src/buildtools/win: git_revision:693f9fb87e4febdd4299db9f73d8d2c958e63148..git_revision:90294ccdcf9334ed25a76ac9b67689468e506342 * src/ios: https://chromium.googlesource.com/chromium/src/ios/+log/eb1001b206..af72ede971 * src/testing: https://chromium.googlesource.com/chromium/src/testing/+log/650a2f9467..619bca0ef9 * src/third_party: https://chromium.googlesource.com/chromium/src/third_party/+log/bc52b47596..5f94f37f8c * src/third_party/android_build_tools/aapt2: oJ_fhfmT6sLorimH6Eo6hwWS2R2gU0c4ZUQfXvzae1UC..GlCdqxHxlg-8YkDGgj5cie-6COsEAZga9jyq-LAYxY4C * src/third_party/android_build_tools/bundletool: OZ4is33usuZy-deP3FpWCtbKXaIY0qBLsElWte7556YC..2ZcLVDxyRwp8FzpeYLtLT0TfSRweZxvwh1-Kx1jZ_FoC * src/third_party/android_deps/libs/com_google_android_material_material: version:2@1.5.0-alpha02.cr0..version:2@1.5.0-alpha05.cr0 * src/third_party/android_deps/libs/com_google_errorprone_error_prone_annotation: version:2@2.9.0.cr0..version:2@2.10.0.cr0 * src/third_party/android_deps/libs/com_google_errorprone_error_prone_annotations: version:2@2.9.0.cr0..version:2@2.10.0.cr0 * src/third_party/android_deps/libs/com_google_errorprone_error_prone_check_api: version:2@2.9.0.cr0..version:2@2.10.0.cr0 * src/third_party/android_deps/libs/com_google_errorprone_error_prone_core: version:2@2.9.0.cr0..version:2@2.10.0.cr0 * src/third_party/android_deps/libs/com_google_errorprone_error_prone_type_annotations: version:2@2.9.0.cr0..version:2@2.10.0.cr0 * src/third_party/androidx: Dewv4glpYqPtnvaOzHgVF6074yDsYzzDFiv0dO1ijwgC..nCX115noKlFOaRMhmFKd1v01hnVpUAaKg2SyLFZaYZgC * src/third_party/boringssl/src: https://boringssl.googlesource.com/boringssl.git/+log/45c8be91f3..69030a0cea * src/third_party/breakpad/breakpad: https://chromium.googlesource.com/breakpad/breakpad.git/+log/ff5892c5da..ee2ad61263 * src/third_party/catapult: https://chromium.googlesource.com/catapult.git/+log/2d036344bd..a7ad5b5c96 * src/third_party/depot_tools: https://chromium.googlesource.com/chromium/tools/depot_tools.git/+log/5cffc195c9..9fcfde2499 * src/third_party/freetype/src: https://chromium.googlesource.com/chromium/src/third_party/freetype2.git/+log/fde91ab8f1..d31bafcb9c * src/third_party/googletest/src: https://chromium.googlesource.com/external/github.com/google/googletest.git/+log/16f637fbf4..1b18723e87 * src/third_party/icu: https://chromium.googlesource.com/chromium/deps/icu.git/+log/eedbaf76e4..3e05d9daa9 * src/third_party/libvpx/source/libvpx: https://chromium.googlesource.com/webm/libvpx.git/+log/7aabd69682..e259e6951d * src/third_party/perfetto: https://android.googlesource.com/platform/external/perfetto.git/+log/844b8662e9..5ed467a290 * src/third_party/r8: EU82Aqeu2B1PZzAmebHXfyOgeL2UZifcIJ1LPyoThw0C..nqWomZTwNDoogX26WeCSoFGg6aQN1FrwzoU4hCS0duEC * src/third_party/turbine: 6QYCyqU5yXkAT7T-_K3sCPvfISI8ACXF_cW4OM5v9BgC..KbLQUR_KFiUEzVt1lMTORY96bz_PbMwC3GwIb1oGJmAC * src/tools: https://chromium.googlesource.com/chromium/src/tools/+log/f4333a2a39..a182115705 * src/tools/luci-go: git_revision:d1c03082ecda0148d8096f1fd8bf5491eafc7323..git_revision:0e76392e6557cc3ff8d95c3bc012540e0dbc128a * src/tools/luci-go: git_revision:d1c03082ecda0148d8096f1fd8bf5491eafc7323..git_revision:0e76392e6557cc3ff8d95c3bc012540e0dbc128a Added dependency * src/third_party/android_deps/libs/com_google_flatbuffers_flatbuffers_java DEPS diff: https://chromium.googlesource.com/chromium/src/+/867b87eb29..b56d8868f3/DEPS Clang version changed llvmorg-14-init-6722-g0fbd3aad:llvmorg-14-init-8564-g34b903d8 Details: https://chromium.googlesource.com/chromium/src/+/867b87eb29..b56d8868f3/tools/clang/scripts/update.py TBR=chromium-webrtc-autoroll@webrtc-ci.iam.gserviceaccount.com,marpan@webrtc.org, jianj@chromium.org, BUG=None No-Presubmit: True Change-Id: I721d681c6c0a687c782fa1f34ea6cea3fba6ce02 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/237761 Reviewed-by: Xavier Lepaul‎ <xalep@webrtc.org> Reviewed-by: Harald Alvestrand <hta@webrtc.org> Reviewed-by: Autoroller <chromium-webrtc-autoroll@webrtc-ci.iam.gserviceaccount.com> Reviewed-by: Artem Titov <titovartem@webrtc.org> Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org> Cr-Commit-Position: refs/heads/main@{#35347}
2021-11-15 15:41:28 +01:00
// TODO(bugs.webrtc.org/13383): Re-enable once stack unwinding with
// compiler-rt/libunwind works on Android arm64.
#ifdef WEBRTC_ARCH_ARM64
#define MAYBE_TestSpinLock DISABLED_TestSpinLock
#else
#define MAYBE_TestSpinLock TestSpinLock
#endif
TEST(Stacktrace, MAYBE_TestSpinLock) {
Use std::make_unique instead of absl::make_unique. WebRTC is now using C++14 so there is no need to use the Abseil version of std::make_unique. This CL has been created with the following steps: git grep -l absl::make_unique | sort | uniq > /tmp/make_unique.txt git grep -l absl::WrapUnique | sort | uniq > /tmp/wrap_unique.txt git grep -l "#include <memory>" | sort | uniq > /tmp/memory.txt diff --new-line-format="" --unchanged-line-format="" \ /tmp/make_unique.txt /tmp/wrap_unique.txt | sort | \ uniq > /tmp/only_make_unique.txt diff --new-line-format="" --unchanged-line-format="" \ /tmp/only_make_unique.txt /tmp/memory.txt | \ xargs grep -l "absl/memory" > /tmp/add-memory.txt git grep -l "\babsl::make_unique\b" | \ xargs sed -i "s/\babsl::make_unique\b/std::make_unique/g" git checkout PRESUBMIT.py abseil-in-webrtc.md cat /tmp/add-memory.txt | \ xargs sed -i \ 's/#include "absl\/memory\/memory.h"/#include <memory>/g' git cl format # Manual fix order of the new inserted #include <memory> cat /tmp/only_make_unique | xargs grep -l "#include <memory>" | \ xargs sed -i '/#include "absl\/memory\/memory.h"/d' git ls-files | grep BUILD.gn | \ xargs sed -i '/\/\/third_party\/abseil-cpp\/absl\/memory/d' python tools_webrtc/gn_check_autofix.py \ -m tryserver.webrtc -b linux_rel # Repead the gn_check_autofix step for other platforms git ls-files | grep BUILD.gn | \ xargs sed -i 's/absl\/memory:memory/absl\/memory/g' git cl format Bug: webrtc:10945 Change-Id: I3fe28ea80f4dd3ba3cf28effd151d5e1f19aff89 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/153221 Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org> Reviewed-by: Alessio Bazzica <alessiob@webrtc.org> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org> Cr-Commit-Position: refs/heads/master@{#29209}
2019-09-17 17:06:18 +02:00
TestStacktrace(std::make_unique<SpinDeadlock>());
}
Roll chromium_revision 867b87eb29..b56d8868f3 (933713:941610) Change log: https://chromium.googlesource.com/chromium/src/+log/867b87eb29..b56d8868f3 Full diff: https://chromium.googlesource.com/chromium/src/+/867b87eb29..b56d8868f3 Changed dependencies * src/base: https://chromium.googlesource.com/chromium/src/base/+log/14c89123e6..b367343820 * src/build: https://chromium.googlesource.com/chromium/src/build/+log/a0368daa25..d134d68f00 * src/buildtools: https://chromium.googlesource.com/chromium/src/buildtools/+log/aa2fb0187c..b138e6ce86 * src/buildtools/linux64: git_revision:693f9fb87e4febdd4299db9f73d8d2c958e63148..git_revision:90294ccdcf9334ed25a76ac9b67689468e506342 * src/buildtools/mac: git_revision:693f9fb87e4febdd4299db9f73d8d2c958e63148..git_revision:90294ccdcf9334ed25a76ac9b67689468e506342 * src/buildtools/third_party/libc++abi/trunk: https://chromium.googlesource.com/external/github.com/llvm/llvm-project/libcxxabi.git/+log/4c834abe6f..707d75f53e * src/buildtools/third_party/libunwind/trunk: https://chromium.googlesource.com/external/github.com/llvm/llvm-project/libunwind.git/+log/10f4e4a5b5..51ffc5ed5c * src/buildtools/win: git_revision:693f9fb87e4febdd4299db9f73d8d2c958e63148..git_revision:90294ccdcf9334ed25a76ac9b67689468e506342 * src/ios: https://chromium.googlesource.com/chromium/src/ios/+log/eb1001b206..af72ede971 * src/testing: https://chromium.googlesource.com/chromium/src/testing/+log/650a2f9467..619bca0ef9 * src/third_party: https://chromium.googlesource.com/chromium/src/third_party/+log/bc52b47596..5f94f37f8c * src/third_party/android_build_tools/aapt2: oJ_fhfmT6sLorimH6Eo6hwWS2R2gU0c4ZUQfXvzae1UC..GlCdqxHxlg-8YkDGgj5cie-6COsEAZga9jyq-LAYxY4C * src/third_party/android_build_tools/bundletool: OZ4is33usuZy-deP3FpWCtbKXaIY0qBLsElWte7556YC..2ZcLVDxyRwp8FzpeYLtLT0TfSRweZxvwh1-Kx1jZ_FoC * src/third_party/android_deps/libs/com_google_android_material_material: version:2@1.5.0-alpha02.cr0..version:2@1.5.0-alpha05.cr0 * src/third_party/android_deps/libs/com_google_errorprone_error_prone_annotation: version:2@2.9.0.cr0..version:2@2.10.0.cr0 * src/third_party/android_deps/libs/com_google_errorprone_error_prone_annotations: version:2@2.9.0.cr0..version:2@2.10.0.cr0 * src/third_party/android_deps/libs/com_google_errorprone_error_prone_check_api: version:2@2.9.0.cr0..version:2@2.10.0.cr0 * src/third_party/android_deps/libs/com_google_errorprone_error_prone_core: version:2@2.9.0.cr0..version:2@2.10.0.cr0 * src/third_party/android_deps/libs/com_google_errorprone_error_prone_type_annotations: version:2@2.9.0.cr0..version:2@2.10.0.cr0 * src/third_party/androidx: Dewv4glpYqPtnvaOzHgVF6074yDsYzzDFiv0dO1ijwgC..nCX115noKlFOaRMhmFKd1v01hnVpUAaKg2SyLFZaYZgC * src/third_party/boringssl/src: https://boringssl.googlesource.com/boringssl.git/+log/45c8be91f3..69030a0cea * src/third_party/breakpad/breakpad: https://chromium.googlesource.com/breakpad/breakpad.git/+log/ff5892c5da..ee2ad61263 * src/third_party/catapult: https://chromium.googlesource.com/catapult.git/+log/2d036344bd..a7ad5b5c96 * src/third_party/depot_tools: https://chromium.googlesource.com/chromium/tools/depot_tools.git/+log/5cffc195c9..9fcfde2499 * src/third_party/freetype/src: https://chromium.googlesource.com/chromium/src/third_party/freetype2.git/+log/fde91ab8f1..d31bafcb9c * src/third_party/googletest/src: https://chromium.googlesource.com/external/github.com/google/googletest.git/+log/16f637fbf4..1b18723e87 * src/third_party/icu: https://chromium.googlesource.com/chromium/deps/icu.git/+log/eedbaf76e4..3e05d9daa9 * src/third_party/libvpx/source/libvpx: https://chromium.googlesource.com/webm/libvpx.git/+log/7aabd69682..e259e6951d * src/third_party/perfetto: https://android.googlesource.com/platform/external/perfetto.git/+log/844b8662e9..5ed467a290 * src/third_party/r8: EU82Aqeu2B1PZzAmebHXfyOgeL2UZifcIJ1LPyoThw0C..nqWomZTwNDoogX26WeCSoFGg6aQN1FrwzoU4hCS0duEC * src/third_party/turbine: 6QYCyqU5yXkAT7T-_K3sCPvfISI8ACXF_cW4OM5v9BgC..KbLQUR_KFiUEzVt1lMTORY96bz_PbMwC3GwIb1oGJmAC * src/tools: https://chromium.googlesource.com/chromium/src/tools/+log/f4333a2a39..a182115705 * src/tools/luci-go: git_revision:d1c03082ecda0148d8096f1fd8bf5491eafc7323..git_revision:0e76392e6557cc3ff8d95c3bc012540e0dbc128a * src/tools/luci-go: git_revision:d1c03082ecda0148d8096f1fd8bf5491eafc7323..git_revision:0e76392e6557cc3ff8d95c3bc012540e0dbc128a Added dependency * src/third_party/android_deps/libs/com_google_flatbuffers_flatbuffers_java DEPS diff: https://chromium.googlesource.com/chromium/src/+/867b87eb29..b56d8868f3/DEPS Clang version changed llvmorg-14-init-6722-g0fbd3aad:llvmorg-14-init-8564-g34b903d8 Details: https://chromium.googlesource.com/chromium/src/+/867b87eb29..b56d8868f3/tools/clang/scripts/update.py TBR=chromium-webrtc-autoroll@webrtc-ci.iam.gserviceaccount.com,marpan@webrtc.org, jianj@chromium.org, BUG=None No-Presubmit: True Change-Id: I721d681c6c0a687c782fa1f34ea6cea3fba6ce02 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/237761 Reviewed-by: Xavier Lepaul‎ <xalep@webrtc.org> Reviewed-by: Harald Alvestrand <hta@webrtc.org> Reviewed-by: Autoroller <chromium-webrtc-autoroll@webrtc-ci.iam.gserviceaccount.com> Reviewed-by: Artem Titov <titovartem@webrtc.org> Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org> Cr-Commit-Position: refs/heads/main@{#35347}
2021-11-15 15:41:28 +01:00
// TODO(bugs.webrtc.org/13383): Re-enable once stack unwinding with
// compiler-rt/libunwind works on Android arm64.
#ifdef WEBRTC_ARCH_ARM64
#define MAYBE_TestSleep DISABLED_TestSleep
#else
#define MAYBE_TestSleep TestSleep
#endif
TEST(Stacktrace, MAYBE_TestSleep) {
Use std::make_unique instead of absl::make_unique. WebRTC is now using C++14 so there is no need to use the Abseil version of std::make_unique. This CL has been created with the following steps: git grep -l absl::make_unique | sort | uniq > /tmp/make_unique.txt git grep -l absl::WrapUnique | sort | uniq > /tmp/wrap_unique.txt git grep -l "#include <memory>" | sort | uniq > /tmp/memory.txt diff --new-line-format="" --unchanged-line-format="" \ /tmp/make_unique.txt /tmp/wrap_unique.txt | sort | \ uniq > /tmp/only_make_unique.txt diff --new-line-format="" --unchanged-line-format="" \ /tmp/only_make_unique.txt /tmp/memory.txt | \ xargs grep -l "absl/memory" > /tmp/add-memory.txt git grep -l "\babsl::make_unique\b" | \ xargs sed -i "s/\babsl::make_unique\b/std::make_unique/g" git checkout PRESUBMIT.py abseil-in-webrtc.md cat /tmp/add-memory.txt | \ xargs sed -i \ 's/#include "absl\/memory\/memory.h"/#include <memory>/g' git cl format # Manual fix order of the new inserted #include <memory> cat /tmp/only_make_unique | xargs grep -l "#include <memory>" | \ xargs sed -i '/#include "absl\/memory\/memory.h"/d' git ls-files | grep BUILD.gn | \ xargs sed -i '/\/\/third_party\/abseil-cpp\/absl\/memory/d' python tools_webrtc/gn_check_autofix.py \ -m tryserver.webrtc -b linux_rel # Repead the gn_check_autofix step for other platforms git ls-files | grep BUILD.gn | \ xargs sed -i 's/absl\/memory:memory/absl\/memory/g' git cl format Bug: webrtc:10945 Change-Id: I3fe28ea80f4dd3ba3cf28effd151d5e1f19aff89 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/153221 Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org> Reviewed-by: Alessio Bazzica <alessiob@webrtc.org> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org> Cr-Commit-Position: refs/heads/master@{#29209}
2019-09-17 17:06:18 +02:00
TestStacktrace(std::make_unique<SleepDeadlock>());
}
// Stack traces originating from kernel space does not include user space stack
// traces for ARM 32.
#ifdef WEBRTC_ARCH_ARM64
Roll chromium_revision 867b87eb29..b56d8868f3 (933713:941610) Change log: https://chromium.googlesource.com/chromium/src/+log/867b87eb29..b56d8868f3 Full diff: https://chromium.googlesource.com/chromium/src/+/867b87eb29..b56d8868f3 Changed dependencies * src/base: https://chromium.googlesource.com/chromium/src/base/+log/14c89123e6..b367343820 * src/build: https://chromium.googlesource.com/chromium/src/build/+log/a0368daa25..d134d68f00 * src/buildtools: https://chromium.googlesource.com/chromium/src/buildtools/+log/aa2fb0187c..b138e6ce86 * src/buildtools/linux64: git_revision:693f9fb87e4febdd4299db9f73d8d2c958e63148..git_revision:90294ccdcf9334ed25a76ac9b67689468e506342 * src/buildtools/mac: git_revision:693f9fb87e4febdd4299db9f73d8d2c958e63148..git_revision:90294ccdcf9334ed25a76ac9b67689468e506342 * src/buildtools/third_party/libc++abi/trunk: https://chromium.googlesource.com/external/github.com/llvm/llvm-project/libcxxabi.git/+log/4c834abe6f..707d75f53e * src/buildtools/third_party/libunwind/trunk: https://chromium.googlesource.com/external/github.com/llvm/llvm-project/libunwind.git/+log/10f4e4a5b5..51ffc5ed5c * src/buildtools/win: git_revision:693f9fb87e4febdd4299db9f73d8d2c958e63148..git_revision:90294ccdcf9334ed25a76ac9b67689468e506342 * src/ios: https://chromium.googlesource.com/chromium/src/ios/+log/eb1001b206..af72ede971 * src/testing: https://chromium.googlesource.com/chromium/src/testing/+log/650a2f9467..619bca0ef9 * src/third_party: https://chromium.googlesource.com/chromium/src/third_party/+log/bc52b47596..5f94f37f8c * src/third_party/android_build_tools/aapt2: oJ_fhfmT6sLorimH6Eo6hwWS2R2gU0c4ZUQfXvzae1UC..GlCdqxHxlg-8YkDGgj5cie-6COsEAZga9jyq-LAYxY4C * src/third_party/android_build_tools/bundletool: OZ4is33usuZy-deP3FpWCtbKXaIY0qBLsElWte7556YC..2ZcLVDxyRwp8FzpeYLtLT0TfSRweZxvwh1-Kx1jZ_FoC * src/third_party/android_deps/libs/com_google_android_material_material: version:2@1.5.0-alpha02.cr0..version:2@1.5.0-alpha05.cr0 * src/third_party/android_deps/libs/com_google_errorprone_error_prone_annotation: version:2@2.9.0.cr0..version:2@2.10.0.cr0 * src/third_party/android_deps/libs/com_google_errorprone_error_prone_annotations: version:2@2.9.0.cr0..version:2@2.10.0.cr0 * src/third_party/android_deps/libs/com_google_errorprone_error_prone_check_api: version:2@2.9.0.cr0..version:2@2.10.0.cr0 * src/third_party/android_deps/libs/com_google_errorprone_error_prone_core: version:2@2.9.0.cr0..version:2@2.10.0.cr0 * src/third_party/android_deps/libs/com_google_errorprone_error_prone_type_annotations: version:2@2.9.0.cr0..version:2@2.10.0.cr0 * src/third_party/androidx: Dewv4glpYqPtnvaOzHgVF6074yDsYzzDFiv0dO1ijwgC..nCX115noKlFOaRMhmFKd1v01hnVpUAaKg2SyLFZaYZgC * src/third_party/boringssl/src: https://boringssl.googlesource.com/boringssl.git/+log/45c8be91f3..69030a0cea * src/third_party/breakpad/breakpad: https://chromium.googlesource.com/breakpad/breakpad.git/+log/ff5892c5da..ee2ad61263 * src/third_party/catapult: https://chromium.googlesource.com/catapult.git/+log/2d036344bd..a7ad5b5c96 * src/third_party/depot_tools: https://chromium.googlesource.com/chromium/tools/depot_tools.git/+log/5cffc195c9..9fcfde2499 * src/third_party/freetype/src: https://chromium.googlesource.com/chromium/src/third_party/freetype2.git/+log/fde91ab8f1..d31bafcb9c * src/third_party/googletest/src: https://chromium.googlesource.com/external/github.com/google/googletest.git/+log/16f637fbf4..1b18723e87 * src/third_party/icu: https://chromium.googlesource.com/chromium/deps/icu.git/+log/eedbaf76e4..3e05d9daa9 * src/third_party/libvpx/source/libvpx: https://chromium.googlesource.com/webm/libvpx.git/+log/7aabd69682..e259e6951d * src/third_party/perfetto: https://android.googlesource.com/platform/external/perfetto.git/+log/844b8662e9..5ed467a290 * src/third_party/r8: EU82Aqeu2B1PZzAmebHXfyOgeL2UZifcIJ1LPyoThw0C..nqWomZTwNDoogX26WeCSoFGg6aQN1FrwzoU4hCS0duEC * src/third_party/turbine: 6QYCyqU5yXkAT7T-_K3sCPvfISI8ACXF_cW4OM5v9BgC..KbLQUR_KFiUEzVt1lMTORY96bz_PbMwC3GwIb1oGJmAC * src/tools: https://chromium.googlesource.com/chromium/src/tools/+log/f4333a2a39..a182115705 * src/tools/luci-go: git_revision:d1c03082ecda0148d8096f1fd8bf5491eafc7323..git_revision:0e76392e6557cc3ff8d95c3bc012540e0dbc128a * src/tools/luci-go: git_revision:d1c03082ecda0148d8096f1fd8bf5491eafc7323..git_revision:0e76392e6557cc3ff8d95c3bc012540e0dbc128a Added dependency * src/third_party/android_deps/libs/com_google_flatbuffers_flatbuffers_java DEPS diff: https://chromium.googlesource.com/chromium/src/+/867b87eb29..b56d8868f3/DEPS Clang version changed llvmorg-14-init-6722-g0fbd3aad:llvmorg-14-init-8564-g34b903d8 Details: https://chromium.googlesource.com/chromium/src/+/867b87eb29..b56d8868f3/tools/clang/scripts/update.py TBR=chromium-webrtc-autoroll@webrtc-ci.iam.gserviceaccount.com,marpan@webrtc.org, jianj@chromium.org, BUG=None No-Presubmit: True Change-Id: I721d681c6c0a687c782fa1f34ea6cea3fba6ce02 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/237761 Reviewed-by: Xavier Lepaul‎ <xalep@webrtc.org> Reviewed-by: Harald Alvestrand <hta@webrtc.org> Reviewed-by: Autoroller <chromium-webrtc-autoroll@webrtc-ci.iam.gserviceaccount.com> Reviewed-by: Artem Titov <titovartem@webrtc.org> Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org> Cr-Commit-Position: refs/heads/main@{#35347}
2021-11-15 15:41:28 +01:00
// TODO(bugs.webrtc.org/13383): Re-enable once stack unwinding with
// compiler-rt/libunwind works on Android arm64.
TEST(Stacktrace, DISABLED_TestRtcEvent) {
Use std::make_unique instead of absl::make_unique. WebRTC is now using C++14 so there is no need to use the Abseil version of std::make_unique. This CL has been created with the following steps: git grep -l absl::make_unique | sort | uniq > /tmp/make_unique.txt git grep -l absl::WrapUnique | sort | uniq > /tmp/wrap_unique.txt git grep -l "#include <memory>" | sort | uniq > /tmp/memory.txt diff --new-line-format="" --unchanged-line-format="" \ /tmp/make_unique.txt /tmp/wrap_unique.txt | sort | \ uniq > /tmp/only_make_unique.txt diff --new-line-format="" --unchanged-line-format="" \ /tmp/only_make_unique.txt /tmp/memory.txt | \ xargs grep -l "absl/memory" > /tmp/add-memory.txt git grep -l "\babsl::make_unique\b" | \ xargs sed -i "s/\babsl::make_unique\b/std::make_unique/g" git checkout PRESUBMIT.py abseil-in-webrtc.md cat /tmp/add-memory.txt | \ xargs sed -i \ 's/#include "absl\/memory\/memory.h"/#include <memory>/g' git cl format # Manual fix order of the new inserted #include <memory> cat /tmp/only_make_unique | xargs grep -l "#include <memory>" | \ xargs sed -i '/#include "absl\/memory\/memory.h"/d' git ls-files | grep BUILD.gn | \ xargs sed -i '/\/\/third_party\/abseil-cpp\/absl\/memory/d' python tools_webrtc/gn_check_autofix.py \ -m tryserver.webrtc -b linux_rel # Repead the gn_check_autofix step for other platforms git ls-files | grep BUILD.gn | \ xargs sed -i 's/absl\/memory:memory/absl\/memory/g' git cl format Bug: webrtc:10945 Change-Id: I3fe28ea80f4dd3ba3cf28effd151d5e1f19aff89 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/153221 Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org> Reviewed-by: Alessio Bazzica <alessiob@webrtc.org> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org> Cr-Commit-Position: refs/heads/master@{#29209}
2019-09-17 17:06:18 +02:00
TestStacktrace(std::make_unique<RtcEventDeadlock>());
}
Roll chromium_revision 867b87eb29..b56d8868f3 (933713:941610) Change log: https://chromium.googlesource.com/chromium/src/+log/867b87eb29..b56d8868f3 Full diff: https://chromium.googlesource.com/chromium/src/+/867b87eb29..b56d8868f3 Changed dependencies * src/base: https://chromium.googlesource.com/chromium/src/base/+log/14c89123e6..b367343820 * src/build: https://chromium.googlesource.com/chromium/src/build/+log/a0368daa25..d134d68f00 * src/buildtools: https://chromium.googlesource.com/chromium/src/buildtools/+log/aa2fb0187c..b138e6ce86 * src/buildtools/linux64: git_revision:693f9fb87e4febdd4299db9f73d8d2c958e63148..git_revision:90294ccdcf9334ed25a76ac9b67689468e506342 * src/buildtools/mac: git_revision:693f9fb87e4febdd4299db9f73d8d2c958e63148..git_revision:90294ccdcf9334ed25a76ac9b67689468e506342 * src/buildtools/third_party/libc++abi/trunk: https://chromium.googlesource.com/external/github.com/llvm/llvm-project/libcxxabi.git/+log/4c834abe6f..707d75f53e * src/buildtools/third_party/libunwind/trunk: https://chromium.googlesource.com/external/github.com/llvm/llvm-project/libunwind.git/+log/10f4e4a5b5..51ffc5ed5c * src/buildtools/win: git_revision:693f9fb87e4febdd4299db9f73d8d2c958e63148..git_revision:90294ccdcf9334ed25a76ac9b67689468e506342 * src/ios: https://chromium.googlesource.com/chromium/src/ios/+log/eb1001b206..af72ede971 * src/testing: https://chromium.googlesource.com/chromium/src/testing/+log/650a2f9467..619bca0ef9 * src/third_party: https://chromium.googlesource.com/chromium/src/third_party/+log/bc52b47596..5f94f37f8c * src/third_party/android_build_tools/aapt2: oJ_fhfmT6sLorimH6Eo6hwWS2R2gU0c4ZUQfXvzae1UC..GlCdqxHxlg-8YkDGgj5cie-6COsEAZga9jyq-LAYxY4C * src/third_party/android_build_tools/bundletool: OZ4is33usuZy-deP3FpWCtbKXaIY0qBLsElWte7556YC..2ZcLVDxyRwp8FzpeYLtLT0TfSRweZxvwh1-Kx1jZ_FoC * src/third_party/android_deps/libs/com_google_android_material_material: version:2@1.5.0-alpha02.cr0..version:2@1.5.0-alpha05.cr0 * src/third_party/android_deps/libs/com_google_errorprone_error_prone_annotation: version:2@2.9.0.cr0..version:2@2.10.0.cr0 * src/third_party/android_deps/libs/com_google_errorprone_error_prone_annotations: version:2@2.9.0.cr0..version:2@2.10.0.cr0 * src/third_party/android_deps/libs/com_google_errorprone_error_prone_check_api: version:2@2.9.0.cr0..version:2@2.10.0.cr0 * src/third_party/android_deps/libs/com_google_errorprone_error_prone_core: version:2@2.9.0.cr0..version:2@2.10.0.cr0 * src/third_party/android_deps/libs/com_google_errorprone_error_prone_type_annotations: version:2@2.9.0.cr0..version:2@2.10.0.cr0 * src/third_party/androidx: Dewv4glpYqPtnvaOzHgVF6074yDsYzzDFiv0dO1ijwgC..nCX115noKlFOaRMhmFKd1v01hnVpUAaKg2SyLFZaYZgC * src/third_party/boringssl/src: https://boringssl.googlesource.com/boringssl.git/+log/45c8be91f3..69030a0cea * src/third_party/breakpad/breakpad: https://chromium.googlesource.com/breakpad/breakpad.git/+log/ff5892c5da..ee2ad61263 * src/third_party/catapult: https://chromium.googlesource.com/catapult.git/+log/2d036344bd..a7ad5b5c96 * src/third_party/depot_tools: https://chromium.googlesource.com/chromium/tools/depot_tools.git/+log/5cffc195c9..9fcfde2499 * src/third_party/freetype/src: https://chromium.googlesource.com/chromium/src/third_party/freetype2.git/+log/fde91ab8f1..d31bafcb9c * src/third_party/googletest/src: https://chromium.googlesource.com/external/github.com/google/googletest.git/+log/16f637fbf4..1b18723e87 * src/third_party/icu: https://chromium.googlesource.com/chromium/deps/icu.git/+log/eedbaf76e4..3e05d9daa9 * src/third_party/libvpx/source/libvpx: https://chromium.googlesource.com/webm/libvpx.git/+log/7aabd69682..e259e6951d * src/third_party/perfetto: https://android.googlesource.com/platform/external/perfetto.git/+log/844b8662e9..5ed467a290 * src/third_party/r8: EU82Aqeu2B1PZzAmebHXfyOgeL2UZifcIJ1LPyoThw0C..nqWomZTwNDoogX26WeCSoFGg6aQN1FrwzoU4hCS0duEC * src/third_party/turbine: 6QYCyqU5yXkAT7T-_K3sCPvfISI8ACXF_cW4OM5v9BgC..KbLQUR_KFiUEzVt1lMTORY96bz_PbMwC3GwIb1oGJmAC * src/tools: https://chromium.googlesource.com/chromium/src/tools/+log/f4333a2a39..a182115705 * src/tools/luci-go: git_revision:d1c03082ecda0148d8096f1fd8bf5491eafc7323..git_revision:0e76392e6557cc3ff8d95c3bc012540e0dbc128a * src/tools/luci-go: git_revision:d1c03082ecda0148d8096f1fd8bf5491eafc7323..git_revision:0e76392e6557cc3ff8d95c3bc012540e0dbc128a Added dependency * src/third_party/android_deps/libs/com_google_flatbuffers_flatbuffers_java DEPS diff: https://chromium.googlesource.com/chromium/src/+/867b87eb29..b56d8868f3/DEPS Clang version changed llvmorg-14-init-6722-g0fbd3aad:llvmorg-14-init-8564-g34b903d8 Details: https://chromium.googlesource.com/chromium/src/+/867b87eb29..b56d8868f3/tools/clang/scripts/update.py TBR=chromium-webrtc-autoroll@webrtc-ci.iam.gserviceaccount.com,marpan@webrtc.org, jianj@chromium.org, BUG=None No-Presubmit: True Change-Id: I721d681c6c0a687c782fa1f34ea6cea3fba6ce02 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/237761 Reviewed-by: Xavier Lepaul‎ <xalep@webrtc.org> Reviewed-by: Harald Alvestrand <hta@webrtc.org> Reviewed-by: Autoroller <chromium-webrtc-autoroll@webrtc-ci.iam.gserviceaccount.com> Reviewed-by: Artem Titov <titovartem@webrtc.org> Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org> Cr-Commit-Position: refs/heads/main@{#35347}
2021-11-15 15:41:28 +01:00
// TODO(bugs.webrtc.org/13383): Re-enable once stack unwinding with
// compiler-rt/libunwind works on Android arm64.
TEST(Stacktrace, DISABLED_TestRtcCriticalSection) {
Use std::make_unique instead of absl::make_unique. WebRTC is now using C++14 so there is no need to use the Abseil version of std::make_unique. This CL has been created with the following steps: git grep -l absl::make_unique | sort | uniq > /tmp/make_unique.txt git grep -l absl::WrapUnique | sort | uniq > /tmp/wrap_unique.txt git grep -l "#include <memory>" | sort | uniq > /tmp/memory.txt diff --new-line-format="" --unchanged-line-format="" \ /tmp/make_unique.txt /tmp/wrap_unique.txt | sort | \ uniq > /tmp/only_make_unique.txt diff --new-line-format="" --unchanged-line-format="" \ /tmp/only_make_unique.txt /tmp/memory.txt | \ xargs grep -l "absl/memory" > /tmp/add-memory.txt git grep -l "\babsl::make_unique\b" | \ xargs sed -i "s/\babsl::make_unique\b/std::make_unique/g" git checkout PRESUBMIT.py abseil-in-webrtc.md cat /tmp/add-memory.txt | \ xargs sed -i \ 's/#include "absl\/memory\/memory.h"/#include <memory>/g' git cl format # Manual fix order of the new inserted #include <memory> cat /tmp/only_make_unique | xargs grep -l "#include <memory>" | \ xargs sed -i '/#include "absl\/memory\/memory.h"/d' git ls-files | grep BUILD.gn | \ xargs sed -i '/\/\/third_party\/abseil-cpp\/absl\/memory/d' python tools_webrtc/gn_check_autofix.py \ -m tryserver.webrtc -b linux_rel # Repead the gn_check_autofix step for other platforms git ls-files | grep BUILD.gn | \ xargs sed -i 's/absl\/memory:memory/absl\/memory/g' git cl format Bug: webrtc:10945 Change-Id: I3fe28ea80f4dd3ba3cf28effd151d5e1f19aff89 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/153221 Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org> Reviewed-by: Alessio Bazzica <alessiob@webrtc.org> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org> Cr-Commit-Position: refs/heads/master@{#29209}
2019-09-17 17:06:18 +02:00
TestStacktrace(std::make_unique<RtcCriticalSectionDeadlock>());
}
#endif
TEST(Stacktrace, TestRtcEventDeadlockDetection) {
// Start looking for the expected log output.
LookoutLogSink sink(/*look_for=*/"Probable deadlock");
rtc::LogMessage::AddLogToStream(&sink, rtc::LS_WARNING);
// Start a thread that waits for an event.
rtc::Event ev;
Reland "Refactor the PlatformThread API." This reverts commit 793bac569fdf1be16cbf24d7871d20d00bbec81b. Reason for revert: rare compilation error fixed Original change's description: > Revert "Refactor the PlatformThread API." > > This reverts commit c89fdd716c4c8af608017c76f75bf27e4c3d602e. > > Reason for revert: Causes rare compilation error on win-libfuzzer-asan trybot. > See https://ci.chromium.org/p/chromium/builders/try/win-libfuzzer-asan-rel/713745? > > Original change's description: > > Refactor the PlatformThread API. > > > > PlatformThread's API is using old style function pointers, causes > > casting, is unintuitive and forces artificial call sequences, and > > is additionally possible to misuse in release mode. > > > > Fix this by an API face lift: > > 1. The class is turned into a handle, which can be empty. > > 2. The only way of getting a non-empty PlatformThread is by calling > > SpawnJoinable or SpawnDetached, clearly conveying the semantics to the > > code reader. > > 3. Handles can be Finalized, which works differently for joinable and > > detached threads: > > a) Handles for detached threads are simply closed where applicable. > > b) Joinable threads are joined before handles are closed. > > 4. The destructor finalizes handles. No explicit call is needed. > > > > Fixed: webrtc:12727 > > Change-Id: Id00a0464edf4fc9e552b6a1fbb5d2e1280e88811 > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/215075 > > Commit-Queue: Markus Handell <handellm@webrtc.org> > > Reviewed-by: Harald Alvestrand <hta@webrtc.org> > > Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org> > > Reviewed-by: Tommi <tommi@webrtc.org> > > Cr-Commit-Position: refs/heads/master@{#33923} > > # Not skipping CQ checks because original CL landed > 1 day ago. > > TBR=handellm@webrtc.org > > Bug: webrtc:12727 > Change-Id: Ic0146be8866f6dd3ad9c364fb8646650b8e07419 > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/217583 > Reviewed-by: Guido Urdaneta <guidou@webrtc.org> > Reviewed-by: Markus Handell <handellm@webrtc.org> > Commit-Queue: Guido Urdaneta <guidou@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#33936} # Not skipping CQ checks because this is a reland. Bug: webrtc:12727 Change-Id: Ifd6f44eac72fed84474277a1be03eb84d2f4376e Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/217881 Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org> Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org> Reviewed-by: Markus Handell <handellm@webrtc.org> Reviewed-by: Harald Alvestrand <hta@webrtc.org> Cr-Commit-Position: refs/heads/master@{#33950}
2021-05-07 15:02:36 +02:00
auto thread = rtc::PlatformThread::SpawnJoinable(
[&ev] { ev.Wait(rtc::Event::kForever); },
"TestRtcEventDeadlockDetection");
// The message should appear after 3 sec. We'll wait up to 10 sec in an
// attempt to not be flaky.
EXPECT_TRUE(sink.WhenFound().Wait(10000));
// Unblock the thread and shut it down.
ev.Set();
Reland "Refactor the PlatformThread API." This reverts commit 793bac569fdf1be16cbf24d7871d20d00bbec81b. Reason for revert: rare compilation error fixed Original change's description: > Revert "Refactor the PlatformThread API." > > This reverts commit c89fdd716c4c8af608017c76f75bf27e4c3d602e. > > Reason for revert: Causes rare compilation error on win-libfuzzer-asan trybot. > See https://ci.chromium.org/p/chromium/builders/try/win-libfuzzer-asan-rel/713745? > > Original change's description: > > Refactor the PlatformThread API. > > > > PlatformThread's API is using old style function pointers, causes > > casting, is unintuitive and forces artificial call sequences, and > > is additionally possible to misuse in release mode. > > > > Fix this by an API face lift: > > 1. The class is turned into a handle, which can be empty. > > 2. The only way of getting a non-empty PlatformThread is by calling > > SpawnJoinable or SpawnDetached, clearly conveying the semantics to the > > code reader. > > 3. Handles can be Finalized, which works differently for joinable and > > detached threads: > > a) Handles for detached threads are simply closed where applicable. > > b) Joinable threads are joined before handles are closed. > > 4. The destructor finalizes handles. No explicit call is needed. > > > > Fixed: webrtc:12727 > > Change-Id: Id00a0464edf4fc9e552b6a1fbb5d2e1280e88811 > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/215075 > > Commit-Queue: Markus Handell <handellm@webrtc.org> > > Reviewed-by: Harald Alvestrand <hta@webrtc.org> > > Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org> > > Reviewed-by: Tommi <tommi@webrtc.org> > > Cr-Commit-Position: refs/heads/master@{#33923} > > # Not skipping CQ checks because original CL landed > 1 day ago. > > TBR=handellm@webrtc.org > > Bug: webrtc:12727 > Change-Id: Ic0146be8866f6dd3ad9c364fb8646650b8e07419 > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/217583 > Reviewed-by: Guido Urdaneta <guidou@webrtc.org> > Reviewed-by: Markus Handell <handellm@webrtc.org> > Commit-Queue: Guido Urdaneta <guidou@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#33936} # Not skipping CQ checks because this is a reland. Bug: webrtc:12727 Change-Id: Ifd6f44eac72fed84474277a1be03eb84d2f4376e Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/217881 Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org> Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org> Reviewed-by: Markus Handell <handellm@webrtc.org> Reviewed-by: Harald Alvestrand <hta@webrtc.org> Cr-Commit-Position: refs/heads/master@{#33950}
2021-05-07 15:02:36 +02:00
thread.Finalize();
rtc::LogMessage::RemoveLogToStream(&sink);
}
} // namespace test
} // namespace webrtc