Skip to content

Commit

Permalink
Linux: use chrome_crashpad_handler instead of crashpad_handler
Browse files Browse the repository at this point in the history
Linux needs to use our custom chrome_crashpad_handler instead of
crashpad's upstream default crashpad_handler, like Windows and Mac,
in order to add custom chrome-specific GWP-ASAN stack traces.

Installers should bundle the chrome_crashpad_handler executable rather
than crashpad_handler.

Bug: 1233008
Change-Id: I71291dcf4a420252b300ee3954c55eafd4b01729
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3054290
Commit-Queue: Matthew Denton <mpdenton@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@google.com>
Reviewed-by: Peter Beverloo <peter@chromium.org>
Cr-Commit-Position: refs/heads/master@{#908155}
  • Loading branch information
mdenton8 authored and Chromium LUCI CQ committed Aug 3, 2021
1 parent 72301c5 commit f9d1fd9
Show file tree
Hide file tree
Showing 12 changed files with 25 additions and 24 deletions.
3 changes: 2 additions & 1 deletion build/lacros/lacros_resource_sizes.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ def __init__(self, paths, title, track_stripped=False,
title='File: chrome',
track_stripped=True,
track_compressed=True),
_Group(paths=['crashpad_handler'], title='File: crashpad_handler'),
_Group(paths=['chrome_crashpad_handler'],
title='File: chrome_crashpad_handler'),
_Group(paths=['icudtl.dat'], title='File: icudtl.dat'),
_Group(paths=['nacl_helper'], title='File: nacl_helper'),
_Group(paths=['nacl_irt_x86_64.nexe'], title='File: nacl_irt_x86_64.nexe'),
Expand Down
10 changes: 6 additions & 4 deletions chrome/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,8 @@ if (!is_android && !is_mac) {
"//chrome/common:buildflags",
]

data_deps += [ "//components/crash/core/app:chrome_crashpad_handler" ]

ldflags = []

# Chrome OS debug builds for arm need to pass --long-plt to the linker.
Expand Down Expand Up @@ -1681,8 +1683,8 @@ if (is_linux || is_chromeos) {
deps = [
":angle_egl_symbols",
":angle_gles_symbols",
":chrome_crashpad_symbols",
":chrome_symbols",
":crashpad_symbols",
":swiftshader_egl_symbols",
":swiftshader_gles_symbols",
]
Expand All @@ -1705,8 +1707,8 @@ if (is_linux || is_chromeos) {

deps = [ ":chrome" ]
}
extract_symbols("crashpad_symbols") {
binary = "$root_out_dir/crashpad_handler"
extract_symbols("chrome_crashpad_symbols") {
binary = "$root_out_dir/chrome_crashpad_handler"

if (current_cpu == "x86") {
# GYP used "ia32" so keep that naming for back-compat.
Expand All @@ -1715,7 +1717,7 @@ if (is_linux || is_chromeos) {
symbol_file = "$root_out_dir/crashpad.breakpad.$current_cpu"
}

deps = [ "//third_party/crashpad/crashpad/handler:crashpad_handler" ]
deps = [ "//components/crash/core/app:chrome_crashpad_handler" ]
}
extract_symbols("swiftshader_egl_symbols") {
binary = "$root_out_dir/swiftshader/libEGL.so"
Expand Down
4 changes: 2 additions & 2 deletions chrome/installer/linux/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ assert(is_linux || is_chromeos)

packaging_files_executables = [
"$root_out_dir/chrome",
"$root_out_dir/chrome_crashpad_handler",
"$root_out_dir/chrome_sandbox",
"$root_out_dir/crashpad_handler",
]
packaging_files_shlibs = []

Expand Down Expand Up @@ -322,8 +322,8 @@ group("installer_deps") {
"//chrome",
"//chrome:packed_resources",
"//chrome/browser/resources/media/mei_preload:component",
"//components/crash/core/app:chrome_crashpad_handler",
"//sandbox/linux:chrome_sandbox",
"//third_party/crashpad/crashpad/handler:crashpad_handler",
]
if (enable_nacl) {
public_deps += [
Expand Down
4 changes: 2 additions & 2 deletions chrome/installer/linux/common/installer.include
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,11 @@ stage_install_common() {
install -m 755 "${STRIPPEDFILE}" "${STAGEDIR}/${INSTALLDIR}/${PROGNAME}"

# crashpad
buildfile="${OUTPUTDIR}/crashpad_handler"
buildfile="${OUTPUTDIR}/chrome_crashpad_handler"
strippedfile="${buildfile}.stripped"
debugfile="${buildfile}.debug"
"${OUTPUTDIR}/installer/common/eu-strip" -o "${strippedfile}" -f "${debugfile}" "${buildfile}"
install -m 755 "${strippedfile}" "${STAGEDIR}/${INSTALLDIR}/crashpad_handler"
install -m 755 "${strippedfile}" "${STAGEDIR}/${INSTALLDIR}/chrome_crashpad_handler"

# resources
install -m 644 "${OUTPUTDIR}/resources.pak" "${STAGEDIR}/${INSTALLDIR}/"
Expand Down
2 changes: 1 addition & 1 deletion chrome/tools/build/chromeos/FILES.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ FILES = [
'buildtype': ['dev', 'official'],
},
{
'filename': 'crashpad_handler',
'filename': 'chrome_crashpad_handler',
'buildtype': ['dev', 'official'],
},
{
Expand Down
2 changes: 1 addition & 1 deletion chrome/tools/build/linux/FILES.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ FILES = [
'buildtype': ['dev', 'official'],
},
{
'filename': 'crashpad_handler',
'filename': 'chrome_crashpad_handler',
'buildtype': ['dev', 'official'],
},
{
Expand Down
6 changes: 1 addition & 5 deletions components/crash/core/app/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,6 @@ static_library("app") {
if (is_ios) {
sources += [ "crashpad_ios.mm" ]
}

if (is_linux || is_chromeos) {
data_deps = [ "//third_party/crashpad/crashpad/handler:crashpad_handler" ]
}
}

if (is_win) {
Expand Down Expand Up @@ -214,7 +210,7 @@ if (is_win) {
}
}

if (is_mac || is_android) {
if (is_mac || is_android || is_linux || is_chromeos) {
# We build a chromium-specific crashpad_handler executable so that we can
# define custom UserStreamDataSources.
executable("chrome_crashpad_handler") {
Expand Down
2 changes: 1 addition & 1 deletion components/crash/core/app/crashpad_linux.cc
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ base::FilePath PlatformCrashpadInitialization(
if (!base::PathService::Get(base::DIR_EXE, &handler_path)) {
return database_path;
}
handler_path = handler_path.Append("crashpad_handler");
handler_path = handler_path.Append("chrome_crashpad_handler");

// When --use-cros-crash-reporter is set (below), the handler passes dumps
// to ChromeOS's /sbin/crash_reporter which in turn passes the dump to
Expand Down
4 changes: 3 additions & 1 deletion content/shell/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -538,9 +538,11 @@ if (is_android) {
}
}

if (is_win || is_linux || is_chromeos) {
if (is_win) {
data_deps +=
[ "//third_party/crashpad/crashpad/handler:crashpad_handler" ]
} else if (is_linux || is_chromeos) {
data_deps += [ "//components/crash/core/app:chrome_crashpad_handler" ]
}

if ((is_linux || is_chromeos) && !is_component_build) {
Expand Down
4 changes: 2 additions & 2 deletions infra/config/generated/cr-buildbucket.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -38144,7 +38144,7 @@ buckets {
' "chrome",'
' "chrome_100_percent.pak",'
' "chrome_200_percent.pak",'
' "crashpad_handler",'
' "chrome_crashpad_handler",'
' "headless_lib.pak",'
' "icudtl.dat",'
' "nacl_helper",'
Expand Down Expand Up @@ -39623,7 +39623,7 @@ buckets {
' "chrome",'
' "chrome_100_percent.pak",'
' "chrome_200_percent.pak",'
' "crashpad_handler",'
' "chrome_crashpad_handler",'
' "headless_lib.pak",'
' "icudtl.dat",'
' "libminigbm.so",'
Expand Down
4 changes: 2 additions & 2 deletions infra/config/subprojects/chromium/ci.star
Original file line number Diff line number Diff line change
Expand Up @@ -1846,7 +1846,7 @@ ci.chromiumos_builder(
"chrome",
"chrome_100_percent.pak",
"chrome_200_percent.pak",
"crashpad_handler",
"chrome_crashpad_handler",
"headless_lib.pak",
"icudtl.dat",
"nacl_helper",
Expand Down Expand Up @@ -3306,7 +3306,7 @@ ci.fyi_builder(
"chrome",
"chrome_100_percent.pak",
"chrome_200_percent.pak",
"crashpad_handler",
"chrome_crashpad_handler",
"headless_lib.pak",
"icudtl.dat",
"libminigbm.so",
Expand Down
4 changes: 2 additions & 2 deletions tools/bisect_repackage/bisect_repackage.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
'chrome_100_percent.pak',
'chrome_200_percent.pak',
'chromedriver',
'crashpad_handler',
'chrome_crashpad_handler',
'default_apps/',
'icudtl.dat',
'ClearKeyCdm/',
Expand Down Expand Up @@ -97,7 +97,7 @@
CHROME_STRIP_LIST = {
'linux': [
'chrome',
'crashpad_handler',
'chrome_crashpad_handler',
'nacl_helper'
]
}
Expand Down

0 comments on commit f9d1fd9

Please sign in to comment.