This sample demonstrates Linux C++ crash reporting with BugSplat and Crashpad. The my-ubuntu-crasher
sample includes a prebuilt version of Crashpad and symbol-upload to create .sym
files and upload them to BugSplat.
- Ensure
git
,git-lfs
,llvm
,build-essential
, andclang
are installed on your machine - Clone this repository and ensure all files, including git-lfs artifact
symbol-upload-linux
were downloaded correctly - Build main.cpp with debug information and a build ID and link the Crashpad libraries using clang
clang++ -pthread $PROJECT_DIR/main.cpp \
$CRASHPAD_DIR/lib/libcommon.a \
$CRASHPAD_DIR/lib/libclient.a \
$CRASHPAD_DIR/lib/libutil.a \
$CRASHPAD_DIR/lib/libbase.a \
-I$CRASHPAD_DIR/include \
-I$CRASHPAD_DIR/include/third_party/mini_chromium/mini_chromium \
-I$CRASHPAD_DIR/include/out/Default/gen \
-o$OUT_DIR/$MODULE_NAME \
-g \
-Wl,--build-id
- Generate and upload symbols to BugSplat using symbol-upload and the
--dumpSyms
flag
$CRASHPAD_DIR/tools/symbol-upload-linux -b $BUGSPLAT_DATABASE \
-a $BUGSPLAT_APP_NAME \
-v $BUGSPLAT_APP_VERSION \
-u $BUGSPLAT_EMAIL \
-p $BUGSPLAT_PASSWORD \
-d $PROJECT_DIR/out \
-f $MODULE_NAME \
--dumpSyms
- Run the output executable to generate a crash report
./out/myUbuntuCrasher
# [10939:10939:20240705,155021.774184:ERROR file_io_posix.cc:144] open /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq: No such file or directory (2)
# [10939:10939:20240705,155021.774253:ERROR file_io_posix.cc:144] open /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq: No such file or directory (2)
# Segmentation fault
- Log into BugSplat using our public account
fred@bugsplat.com
and passwordFlintstone
- Navigate to the Crashes page and click the link in the ID column to see a detailed crash report
Please ensure that you increment the version number every time you build and generate/upload new symbol files. If you fail to create and upload symbol files, your crash reports will not contain file names and source line numbers.