Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ if (crashpad_is_in_chromium || crashpad_is_in_fuchsia) {
}

if (crashpad_is_in_fuchsia) {
import("//src/sys/build/components.gni")
import("//build/components.gni")
fuchsia_test_component("crashpad-test-component") {
manifest = "test/fuchsia_crashpad_tests.cmx"
deps = [
Expand Down
4 changes: 2 additions & 2 deletions build/install_linux_sysroot.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
# https://cs.chromium.org/chromium/src/build/linux/sysroot_scripts/sysroots.json
SERVER = 'https://commondatastorage.googleapis.com'
PATH = 'chrome-linux-sysroot/toolchain'
REVISION = '3c248ba4290a5ad07085b7af07e6785bf1ae5b66'
FILENAME = 'debian_stretch_amd64_sysroot.tar.xz'
REVISION = '43a87bbebccad99325fdcf34166295b121ee15c7'
FILENAME = 'debian_sid_amd64_sysroot.tar.xz'


def main():
Expand Down
5 changes: 3 additions & 2 deletions client/pthread_create_linux.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,11 @@ struct StartParams {
void* InitializeSignalStackAndStart(StartParams* params) {
crashpad::CrashpadClient::InitializeSignalStackForThread();

StartParams local_params = *params;
crashpad::NoCfiIcall<StartRoutineType> start_routine(params->start_routine);
void* arg = params->arg;
delete params;

return local_params.start_routine(local_params.arg);
return start_routine(arg);
}

} // namespace
Expand Down
4 changes: 4 additions & 0 deletions handler/crash_report_upload_thread.cc
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,10 @@ CrashReportUploadThread::UploadResult CrashReportUploadThread::UploadReport(
"application/octet-stream");

std::unique_ptr<HTTPTransport> http_transport(HTTPTransport::Create());
if (!http_transport) {
return UploadResult::kPermanentFailure;
}

HTTPHeaders content_headers;
http_multipart_builder.PopulateContentHeaders(&content_headers);
for (const auto& content_header : content_headers) {
Expand Down
2 changes: 2 additions & 0 deletions test/multiprocess_posix_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,8 @@ class TestMultiprocessClosePipe final : public Multiprocess {
: Multiprocess(),
who_closes_(who_closes),
what_closes_(what_closes) {
// Fails under "threadsafe" mode on macOS 10.11.
testing::GTEST_FLAG(death_test_style) = "fast";
}

~TestMultiprocessClosePipe() {}
Expand Down
12 changes: 10 additions & 2 deletions util/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ if (crashpad_is_mac || crashpad_is_ios) {
migcom_path,
]
}
deps = [ "//build/config/mac:sdk_inputs" ]
if (crashpad_is_mac) {
deps = [ "//build/config/mac:sdk_inputs" ]
}
}
if (sysroot != "") {
if (crashpad_is_in_chromium) {
Expand Down Expand Up @@ -387,7 +389,7 @@ crashpad_static_library("util") {

deps = []

if (crashpad_is_linux || crashpad_is_fuchsia || crashpad_is_android) {
if (crashpad_http_transport_impl == "socket") {
sources += [ "net/http_transport_socket.cc" ]
if (crashpad_use_boringssl_for_http_transport_socket) {
defines += [ "CRASHPAD_USE_BORINGSSL" ]
Expand All @@ -401,6 +403,12 @@ crashpad_static_library("util") {
]
}
}
} else if (crashpad_http_transport_impl == "libcurl") {
sources += [ "net/http_transport_libcurl.cc" ]
if (crashpad_is_in_fuchsia) {
# Host Linux builds in Fuchsia don't have libcurl in a sysroot.
deps += [ "//third_party/curl:libcurl" ]
}
}

if (crashpad_is_android) {
Expand Down
2 changes: 1 addition & 1 deletion util/ios/ios_system_data_collector.mm
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
// util/mac/mac_util.cc).
const char* model = getenv("SIMULATOR_MODEL_IDENTIFIER");
if (model == nullptr) {
switch (UI_USER_INTERFACE_IDIOM()) {
switch ([[UIDevice currentDevice] userInterfaceIdiom]) {
case UIUserInterfaceIdiomPhone:
model = "iPhone";
break;
Expand Down
17 changes: 17 additions & 0 deletions util/misc/no_cfi_icall.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@ class NoCfiIcall {
//! \param function A pointer to the function to be called.
explicit NoCfiIcall(Functor function) : function_(function) {}

//! \see NoCfiIcall
NoCfiIcall() : function_(static_cast<Functor>(nullptr)) {}

//! \see NoCfiIcall
template <typename PointerType,
typename = std::enable_if_t<
Expand All @@ -142,6 +145,20 @@ class NoCfiIcall {

~NoCfiIcall() = default;

//! \brief Updates the pointer to the function to be called.
//!
//! \param function A pointer to the function to be called.
void SetPointer(Functor function) { function_ = function; }

//! \see SetPointer
template <typename PointerType,
typename = std::enable_if_t<
std::is_same<typename std::remove_cv<PointerType>::type,
void*>::value>>
void SetPointer(PointerType function) {
function_ = reinterpret_cast<Functor>(function);
}

//! \brief Calls the function without sanitization by cfi-icall.
template <typename... RunArgs>
decltype(auto) operator()(RunArgs&&... args) const {
Expand Down
2 changes: 1 addition & 1 deletion util/net/http_body_gzip_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ void TestGzipDeflateInflate(const std::string& string) {
std::string MakeString(size_t size) {
std::string string;
for (size_t i = 0; i < size; ++i) {
string.append(1, (i % 256) ^ ((i >> 8) % 256));
string.append(1, static_cast<char>((i % 256) ^ ((i >> 8) % 256)));
}
return string;
}
Expand Down
Loading