Improve Linux panic reporting (#22202)
- [x] Upload separate debug symbols for Linux binaries to DigitalOcean
- [x] Send raw offsets with panic report JSON on Linux
- [x] Update `symbolicate` script to handle Linux crashes
- [x] Demangle backtraces 🎉
- [x] Check that it works
- [x] Improve deduplication (?)
Release Notes:
- N/A
---------
Co-authored-by: Conrad <conrad@zed.dev>
This commit is contained in:
parent
b51a28b75f
commit
a2022d7da3
9 changed files with 173 additions and 55 deletions
|
@ -1,6 +1,7 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -euxo pipefail
|
||||
source script/lib/blob-store.sh
|
||||
|
||||
# Function for displaying help info
|
||||
help_info() {
|
||||
|
@ -61,12 +62,24 @@ if [[ "$remote_server_triple" == "$musl_triple" ]]; then
|
|||
fi
|
||||
cargo build --release --target "${remote_server_triple}" --package remote_server
|
||||
|
||||
# Strip the binary of all debug symbols
|
||||
# Later, we probably want to do something like this: https://github.com/GabrielMajeri/separate-symbols
|
||||
strip --strip-debug "${target_dir}/${target_triple}/release/zed"
|
||||
strip --strip-debug "${target_dir}/${target_triple}/release/cli"
|
||||
strip --strip-debug "${target_dir}/${remote_server_triple}/release/remote_server"
|
||||
# Strip debug symbols and save them for upload to DigitalOcean
|
||||
objcopy --only-keep-debug "${target_dir}/${target_triple}/release/zed" "${target_dir}/${target_triple}/release/zed.dbg"
|
||||
objcopy --only-keep-debug "${target_dir}/${remote_server_triple}/release/remote_server" "${target_dir}/${remote_server_triple}/release/remote_server.dbg"
|
||||
objcopy --strip-debug "${target_dir}/${target_triple}/release/zed"
|
||||
objcopy --strip-debug "${target_dir}/${target_triple}/release/cli"
|
||||
objcopy --strip-debug "${target_dir}/${remote_server_triple}/release/remote_server"
|
||||
|
||||
gzip "${target_dir}/${target_triple}/release/zed.dbg"
|
||||
upload_to_blob_store_public \
|
||||
"zed-debug-symbols" \
|
||||
"${target_dir}/${target_triple}/release/zed.dbg.gz" \
|
||||
"$channel/zed-$version-${target_triple}.dbg.gz"
|
||||
|
||||
gzip "${target_dir}/${remote_server_triple}/release/remote_server.dbg"
|
||||
upload_to_blob_store_public \
|
||||
"zed-debug-symbols" \
|
||||
"${target_dir}/${remote_server_triple}/release/remote_server.dbg.gz" \
|
||||
"$channel/remote_server-$version-${remote_server_triple}.dbg.gz"
|
||||
|
||||
# Ensure that remote_server does not depend on libssl nor libcrypto, as we got rid of these deps.
|
||||
if ldd "${target_dir}/${remote_server_triple}/release/remote_server" | grep -q 'libcrypto\|libssl'; then
|
||||
|
|
|
@ -2,40 +2,64 @@
|
|||
|
||||
set -eu
|
||||
if [[ $# -eq 0 ]] || [[ "$1" == "--help" ]]; then
|
||||
echo "Usage: $(basename $0) <path_to_ips_file>"
|
||||
echo "This script symbolicates the provided .ips file using the appropriate dSYM file from digital ocean"
|
||||
echo "Usage: $(basename $0) <path_to_ips_file_or_json>"
|
||||
echo "This script symbolicates the provided .ips file or .json panic report using the appropriate debug symbols from DigitalOcean"
|
||||
echo ""
|
||||
exit 1
|
||||
fi
|
||||
|
||||
ips_file=$1;
|
||||
input_file=$1;
|
||||
|
||||
version=$(cat $ips_file | head -n 1 | jq -r .app_version)
|
||||
bundle_id=$(cat $ips_file | head -n 1 | jq -r .bundleID)
|
||||
cpu_type=$(cat $ips_file | tail -n+2 | jq -r .cpuType)
|
||||
if [[ "$input_file" == *.json ]]; then
|
||||
version=$(cat $input_file | jq -r .app_version)
|
||||
channel=$(cat $input_file | jq -r .release_channel)
|
||||
target_triple=$(cat $input_file | jq -r .target)
|
||||
|
||||
which symbolicate >/dev/null || cargo install symbolicate
|
||||
which llvm-symbolizer rustfilt >dev/null || echo Need to install llvm-symbolizer and rustfilt
|
||||
|
||||
echo $channel;
|
||||
|
||||
mkdir -p target/dsyms/$channel
|
||||
|
||||
dsym="$channel/zed-$version-$target_triple.dbg"
|
||||
if [[ ! -f target/dsyms/$dsym ]]; then
|
||||
echo "Downloading $dsym..."
|
||||
curl -o target/dsyms/$dsym.gz "https://zed-debug-symbols.nyc3.digitaloceanspaces.com/$dsym.gz"
|
||||
gunzip target/dsyms/$dsym.gz
|
||||
fi
|
||||
|
||||
cat $input_file | jq -r .backtrace[] | sed s'/.*+//' | llvm-symbolizer --no-demangle --obj=target/dsyms/$dsym | rustfilt
|
||||
|
||||
else # ips file
|
||||
|
||||
version=$(cat $input_file | head -n 1 | jq -r .app_version)
|
||||
bundle_id=$(cat $input_file | head -n 1 | jq -r .bundleID)
|
||||
cpu_type=$(cat $input_file | tail -n+2 | jq -r .cpuType)
|
||||
|
||||
which symbolicate >/dev/null || cargo install symbolicate
|
||||
|
||||
arch="x86_64-apple-darwin"
|
||||
if [[ "$cpu_type" == *ARM-64* ]]; then
|
||||
arch="aarch64-apple-darwin"
|
||||
fi
|
||||
echo $bundle_id;
|
||||
|
||||
channel="stable"
|
||||
if [[ "$bundle_id" == *Nightly* ]]; then
|
||||
channel="nightly"
|
||||
elif [[ "$bundle_id" == *Preview* ]]; then
|
||||
channel="preview"
|
||||
fi
|
||||
|
||||
mkdir -p target/dsyms/$channel
|
||||
|
||||
dsym="$channel/Zed-$version-$arch.dwarf"
|
||||
if [[ ! -f target/dsyms/$dsym ]]; then
|
||||
echo "Downloading $dsym..."
|
||||
curl -o target/dsyms/$dsym.gz "https://zed-debug-symbols.nyc3.digitaloceanspaces.com/$channel/Zed-$version-$arch.dwarf.gz"
|
||||
gunzip target/dsyms/$dsym.gz
|
||||
fi
|
||||
|
||||
symbolicate $input_file target/dsyms/$dsym
|
||||
|
||||
arch="x86_64-apple-darwin"
|
||||
if [[ "$cpu_type" == *ARM-64* ]]; then
|
||||
arch="aarch64-apple-darwin"
|
||||
fi
|
||||
echo $bundle_id;
|
||||
|
||||
channel="stable"
|
||||
if [[ "$bundle_id" == *Nightly* ]]; then
|
||||
channel="nightly"
|
||||
elif [[ "$bundle_id" == *Preview* ]]; then
|
||||
channel="preview"
|
||||
fi
|
||||
|
||||
mkdir -p target/dsyms/$channel
|
||||
|
||||
dsym="$channel/Zed-$version-$arch.dwarf"
|
||||
if [[ ! -f target/dsyms/$dsym ]]; then
|
||||
echo "Downloading $dsym..."
|
||||
curl -o target/dsyms/$dsym.gz "https://zed-debug-symbols.nyc3.digitaloceanspaces.com/$channel/Zed-$version-$arch.dwarf.gz"
|
||||
gunzip target/dsyms/$dsym.gz
|
||||
fi
|
||||
|
||||
symbolicate $ips_file target/dsyms/$dsym
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue