Skip to content

Latest commit

 

History

History
155 lines (127 loc) · 4.91 KB

CrashAnalysis_HOWTO.md

File metadata and controls

155 lines (127 loc) · 4.91 KB

How to Analyze the Crash Dump (Step-by-Step Guide)

Quick Summary

  • Dump File: D:\Creality\CrashDumps\CrealityScan 4.exe_251225_233457.dmp (1.1 GB)
  • PDB File: D:\Projects\OrbbecSDK_v2\build_win_x64\bin\RelWithDebInfo\OrbbecSDK.pdb
  • Crash Address: OrbbecSDK+0x115c20
  • Exception: Access Violation (c0000005 - likely null pointer dereference)

Option 1: Using Visual Studio (Easiest)

Steps:

  1. Open Visual Studio 2022
  2. Debug → Open Dump File → Select CrealityScan 4.exe_251225_233457.dmp
  3. When prompted for debugging symbols:
    • Click Settings → Symbol Settings
    • Add folder: D:\Projects\OrbbecSDK_v2\build_win_x64\bin\RelWithDebInfo
    • Also add: SRV*C:\Symbols*https://msdl.microsoft.com/download/symbols
  4. Click "Debug Mixed" to analyze
  5. In Debug Console, run:
    !analyze -v
    kp
    lm m OrbbecSDK
    
  6. Look for:
    • Exception code (should be c0000005)
    • Faulting instruction address
    • Call stack leading to crash
    • Which parameter was null/invalid

Option 2: Using WinDbg (Most Detailed)

Installation:

  1. Download WinDbg Preview from Microsoft Store, OR
  2. Download Windows Debuggers from Windows SDK

Steps:

  1. Open WinDbg Preview or windbg.exe
  2. File → Open Dump File → Select the .dmp file
  3. In Command Window, paste:
    .symfix
    .sympath+ D:\Projects\OrbbecSDK_v2\build_win_x64\bin\RelWithDebInfo
    .reload /f OrbbecSDK.dll
    !analyze -v
    
  4. Key commands:
    ln OrbbecSDK+0x115c20          // Shows function name at offset
    lm m OrbbecSDK                 // Module info and symbols status
    kp                             // Full stack with parameters
    dds rsp L20                    // Dump stack memory
    ? poi(<address>)               // Dereference pointer (check if null)
    

Option 3: Command-Line CDB (If WinDbg Not Available)

# Set up environment
$WinKitPath = "C:\Program Files (x86)\Windows Kits\10\Debuggers\x64"
$cdb = "$WinKitPath\cdb.exe"

# Create command script
@"
.sympath+ D:\Projects\OrbbecSDK_v2\build_win_x64\bin\RelWithDebInfo
.reload /f
!analyze -v
ln OrbbecSDK+0x115c20
kp
q
"@ | Out-File -FilePath "$env:TEMP\analyze.txt" -Encoding ASCII

# Run analysis
& $cdb -y "D:\Projects\OrbbecSDK_v2\build_win_x64\bin\RelWithDebInfo" `
        -z "D:\Creality\CrashDumps\CrealityScan 4.exe_251225_233457.dmp" `
        -cf "$env:TEMP\analyze.txt"

What to Look For in Output

Exception Details:

EXCEPTION_RECORD:  xxxxxxxx
 ExceptionAddress: 00007ffc`12345c20
 ExceptionCode: c0000005 (Access violation)
 ExceptionFlags: 00000000
 NumberParameters: 2
  [0]: 0000000000000000 (Read)
  [1]: 0000000000000000 (Address accessed)

Stack Trace Key Points:

  • Top frame = crash location (should show function name if PDB matched)
  • Look for device-related functions like:
    • DeviceManager::enumDevices()
    • Pipeline::start()
    • Sensor::readFrame()
    • Property accessors

Example Analysis Output:

OrbbecSDK!DeviceManager::queryDevice+0x1a2
  -> This indicates a null device pointer in queryDevice()
  
OrbbecSDK!DeviceBase::getSensor+0x28
  -> Sensor object not initialized before access

OrbbecSDK!Frame::getData+0x10
  -> Trying to read from null frame pointer

Diagnostic Info You'll Need to Provide

Once you run the dump analysis, collect:

  1. Exact function name where crash occurs
  2. Call stack (first 10-15 frames)
  3. Parameter values visible in stack dump
  4. Device model being used when crash occurred
  5. Steps to reproduce if known

If PDB Doesn't Match (GUID Mismatch)

If WinDbg says SYMOPT_EXACT_SYMBOLS failure:

  • The rebuilt DLL/PDB may not match the shipped version
  • You can still use !uniqstack to get a generic stack trace
  • Contact Orbbec/Creality for official PDBs matching their build
  • Alternative: Rebuild OrbbecSDK with exact same flags as their build

Expected Outcomes & Next Steps

If crash is in device enumeration:

  • → Add null checks before device access
  • → Test device insertion/removal during startup

If crash is in stream processing:

  • → Validate frame before use
  • → Check stream state before reading

If crash is in property accessor:

  • → Add try-catch around vendor-specific properties
  • → Check device support before accessing property

If crash is race condition:

  • → Add mutex/locks around device list
  • → Use observer pattern safely

Files Ready for Analysis

  • Dump: D:\Creality\CrashDumps\CrealityScan 4.exe_251225_233457.dmp
  • PDB: D:\Projects\OrbbecSDK_v2\build_win_x64\bin\RelWithDebInfo\OrbbecSDK.pdb
  • DLL (for comparison): D:\Projects\OrbbecSDK_v2\build_win_x64\win_x64\bin\OrbbecSDK.dll
  • Analysis docs: See OffsetAnalysis.md for pattern matching

Next: Run Visual Studio or WinDbg with above steps to identify the exact crashing function.