https://github.com/bugsplat-git/my-ubuntu-crasher
đ§đđĨ Sample Linux application built using clang and integrated with Crashpad
https://github.com/bugsplat-git/my-ubuntu-crasher
bugsplat clang crash crashpad linux minidump reporting ubuntu
Last synced: over 1 year ago
JSON representation
đ§đđĨ Sample Linux application built using clang and integrated with Crashpad
- Host: GitHub
- URL: https://github.com/bugsplat-git/my-ubuntu-crasher
- Owner: BugSplat-Git
- Created: 2020-06-09T15:39:41.000Z (about 6 years ago)
- Default Branch: main
- Last Pushed: 2024-09-12T23:10:18.000Z (almost 2 years ago)
- Last Synced: 2024-09-14T08:58:25.405Z (almost 2 years ago)
- Topics: bugsplat, clang, crash, crashpad, linux, minidump, reporting, ubuntu
- Language: C++
- Homepage: https://docs.bugsplat.com/introduction/getting-started/integrations/desktop/linux/
- Size: 7.88 MB
- Stars: 10
- Watchers: 4
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[](https://bugsplat.com)
#
BugSplat
### **Crash and error reporting built for busy developers.**
## Introduction đ
This sample demonstrates Linux C++ crash reporting with [BugSplat](https://bugsplat.com) and [Crashpad](https://chromium.googlesource.com/crashpad/crashpad/+/master/README.md). The `my-ubuntu-crasher` sample includes a [prebuilt version](https://github.com/BugSplat-Git/my-ubuntu-crasher/tree/main/crashpad/lib) of Crashpad and [symbol-upload](https://github.com/BugSPlat-Git/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
```bash
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
```
4. Generate and upload symbols to BugSplat using symbol-upload and the `--dumpSyms` flag
```bash
$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
```
5. Run the output executable to generate a crash report
```bash
./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
```
7. Log into [BugSplat](https://bugsplat.com) using our public account `fred@bugsplat.com` and password `Flintstone`
8. Navigate to the [Crashes]([https://app.bugsplat.com/v2/crashes](https://app.bugsplat.com/v2/crashes?c0=appName&f0=CONTAINS&v0=myUbuntuCrasher&database=Fred)) page and click the link in the ID column to see a detailed crash report

## 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.