Skip to content

Instantly share code, notes, and snippets.

@nikita-graf
Last active September 6, 2023 10:33
Show Gist options
  • Save nikita-graf/e7d62b0036e5b176f2f1cc072a12bdd5 to your computer and use it in GitHub Desktop.
Save nikita-graf/e7d62b0036e5b176f2f1cc072a12bdd5 to your computer and use it in GitHub Desktop.
How to decode Electron crash dump

Here are steps to decode Electron crashReporter dump on macOS:

  1. Download and install breakpad
  2. Download *-symbols.zip for your Electron release
  3. Setup a simple express app:
const app = require('express')();
const path = require('path');
const fs = require('fs');
const multer = require('multer');
const crashReportsPath = path.join(__dirname, 'reports')
const upload = multer({ dest: crashReportsPath }).single('upload_file_minidump')

app.post('/crash-report', upload, function (req, res) {
  req.body.filename = req.file.filename;
  const crashLog = JSON.stringify(req.body, undefined, 2);

  fs.writeFile(req.file.path + '.json', crashLog, function (err) {
    if (err) return console.error('Error saving crash report: ' + err.message)
    console.log('Saved crash report:\n\t' + crashLog)
  })

  res.end();
})

app.listen(3000);
  1. Setup crashReporter in your application
const {crashReporter} = require('electron')

crashReporter.start({
  productName: 'YourName',
  companyName: 'YourCompany',
  submitURL: 'http://localhost:3000/crash-report',
  autoSubmit: true
})
  1. Inside breakpad directory run src/processor/minidump_stackwalk -s PATH_TO_DUMP_IN_crashReportsPath_DIRECTORY PATH_TO_electron.breakpad.sym
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment