Skip to content

BugSplat-Git/my-ubuntu-crasher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bugsplat-github-banner-basic-outline

BugSplat

Crash and error reporting built for busy developers.

Introduction 👋

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.

Steps 🥾

  1. Ensure git, git-lfs, llvm, build-essential, and clang are installed on your machine
  2. Clone this repository and ensure all files, including git-lfs artifact symbol-upload-linux were downloaded correctly
  3. 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
  1. 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
  1. 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
  1. Log into BugSplat using our public account [email protected] and password Flintstone
  2. Navigate to the Crashes page and click the link in the ID column to see a detailed crash report
myUbuntuCrasher crash on BugSplat

Other ℹ️

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.