A high-performance crash dump collection and upload service for RDK platforms. Automatically discovers, compresses, and securely uploads minidumps and coredumps to centralized crash analysis servers with built-in rate limiting and privacy controls.
Crashupload is designed for embedded RDK devices (broadband, video, extenders, media clients) to efficiently handle crash diagnostics. The v2.0 migration from shell scripts to compiled C code delivers 37% fewer decision points, 35% smaller binary size, and 40% faster startup while maintaining full backward compatibility.
- Multi-format Support: Handles minidumps (.dmp) and coredumps (core.*, .core)
- Smart Compression: Direct compression with automatic /tmp fallback for space-constrained systems
- Type-Aware Retry: Aggressive retry for minidumps (5×3s), conservative for coredumps (3×10s)
- Rate Limiting: 10 uploads per 10 minutes with crashloop detection (5 uploads/minute)
- Privacy Controls: Telemetry opt-out + RBUS privacy mode integration
- Secure Upload: TLS 1.2 with OCSP stapling support via libcurl
- Zero Script Dependencies: Pure C implementation with ioctl-based networking
crashupload
├── c_sourcecode/ # Main C implementation (v2.0)
│ ├── common/ # Shared types, constants, error codes
│ ├── include/ # Public header files
│ └── src/ # Source modules
│ ├── main.c # 7-step optimized flow
│ ├── config/ # Multi-source config manager
│ ├── scanner/ # Multi-format dump discovery
│ ├── archive/ # Smart compression engine
│ ├── upload/ # TLS 1.2 upload with retry
│ ├── ratelimit/ # Unified rate limiter
│ ├── utils/ # File, network, system utilities
│ └── *Interface/ # RBUS, RFC, T2 telemetry
├── unittest/ # GTest suite (69 test cases)
├── docs/ # HLD, LLD, diagrams, requirements
└── test/ # Functional tests
Performance: 100-120ms startup | 6-8MB memory | ~35KB binary
- Consolidated Init: Single
system_initialize()call (3 steps → 1) - Combined Prerequisites: Network + time validation in one check
- Unified Privacy: Opt-out + privacy mode combined decision
- Smart Archive: Direct compression → /tmp fallback optimization
- Type-Aware Upload: Minidump vs coredump specific retry policies
- Unified Rate Limit: Recovery mode + 10/10min limit in single check
- Batch Cleanup: Single directory scan for all cleanup operations
# Dependencies
- GCC 4.9+ with C11 support
- Autotools (autoconf, automake, libtool)
- OpenSSL 1.0+ (libcrypto for SHA1)
- libcurl 7.0+ with TLS 1.2
- RDK libraries: rdkloggers, rbus, rfc, breakpad, t2# Navigate to C source directory
cd c_sourcecode
# Generate build system
autoreconf -fi
# Configure
./configure --prefix=/usr --sysconfdir=/etc
# Build
make
# Install
sudo make installCFLAGS="-Wall -Werror -O2 -DT2_EVENT_ENABLED"# Enable and start timer
systemctl enable minidump-on-bootup-upload.timer
systemctl start minidump-on-bootup-upload.timer
# Manual trigger
systemctl start minidump-on-bootup-upload.service# Triggered by systemd path unit
systemctl enable coredump-upload.path
systemctl start coredump-upload.path# Minidump mode
crashupload --type minidump --path /minidumps
# Coredump mode
crashupload --type coredump --path /var/lib/systemd/coredump
# Recovery mode (bypass rate limit for reboot)
crashupload --recoveryConfiguration is loaded from multiple sources with priority override:
- Command-line arguments (highest priority)
- RFC configuration (via TR-181 parameters)
- Device properties (
/etc/device.properties) - Default values (fallback)
| Parameter | Default | Description |
|---|---|---|
upload_url |
Platform-specific | Crash upload server URL |
dump_path |
/minidumps (minidump)/var/lib/systemd/coredump (coredump) |
Dump file location |
upload_timeout |
45s | HTTP upload timeout |
ratelimit_max |
10 | Max uploads per window |
ratelimit_window |
600s | Rate limit window (10 min) |
# Check current privacy mode
dmcli eRT getv Device.X_RDKCENTRAL-COM_Privacy.PrivacyMode
# Set to DO_NOT_SHARE (blocks uploads)
dmcli eRT setv Device.X_RDKCENTRAL-COM_Privacy.PrivacyMode string DO_NOT_SHAREcd unittest
# Generate build system
autoreconf -fi
# Configure
./configure
# Build and run tests
make check
# View results
cat test-suite.logTest Coverage: 69 comprehensive test cases across all modules
- Network utilities: 10 tests
- File utilities: 13 tests
- System utilities: 11 tests
- Scanner: 11 tests
- Archive: 11 tests
- Rate limiter: 13 tests
Current code coverage metrics from GTest suite:
Lines......: 90.5% (1903 of 2102 lines)
Functions..: 100.0% (89 of 89 functions)
Branches...: 84.3% (1086 of 1288 branches)
Coverage Target: Maintain >90% line coverage, 100% function coverage, >80% branches coverage
cd test/functional-tests
# Run test suite
./run_tests.shTest Status:
| Module | Feature File | Status |
|---|---|---|
| Argument parsing (TC-008) | arg_parsing.feature |
✅ Complete |
| Failure return codes | failure_return.feature |
✅ Complete |
| Reboot flag / log output | reboot_and_log_scenario.feature |
✅ Complete |
| Config & path selection (TC-006/007/009) | config_and_path.feature |
✅ Complete |
| Dump detection & platform baseline (TC-019–028) | config_checks_and_baseline.feature |
✅ Complete |
| Unsupported device types (TC-004/005/017/018) | unsupported_device_types.feature |
✅ Complete |
| Broadband archive behaviour (TC-067) | broadband_env.feature |
✅ Complete |
| No dumps exit (NODMP-01..04) | no_dumps_exit.feature |
✅ Complete |
| Upload deferral (TC-035/036/037) | upload_deferral.feature |
✅ Complete |
| Lock and exit (TC-012/013/015/085) | test_lock_and_exit.feature |
✅ Complete |
| Lock and wait | test_lock_and_wait.feature |
✅ Complete |
| Lock lifecycle (TC-011/014/016) | lock_lifecycle.feature |
✅ Complete |
| Signal lock cleanup (SIG-01/02) | signal_lock_cleanup.feature |
✅ Complete |
| Startup cleanup batch (TC-041–047) | cleanup_batch.feature |
✅ Complete |
| Rate limiting — block (TC-049/051/055) | ratelimit.feature |
✅ Complete |
| Rate limiting — allow (TC-048/050/052–054) | ratelimit.feature |
✅ Complete |
| Telemetry opt-out (TC-038/039/040) | telemetry_optout.feature |
✅ Complete |
| Crash telemetry (TC-072/073) | crash_telemetry.feature |
✅ Complete |
| Scanner / filename sanitisation (TC-057–059/064) | scanner_behaviour.feature |
✅ Complete |
| Dump processing (TC-060/071) | dump_processing.feature |
✅ Complete |
| Archive naming (TC-061/062/063) | archive_naming.feature |
✅ Complete |
| Archive content (TC-065/066/075/078–080) | archive_content.feature |
✅ Complete |
| Single successful upload (TC-081) | upload.feature |
✅ Complete |
| Upload retry (TC-082/083) | upload_retry.feature |
✅ Complete |
Coverage: 66 / 66 applicable TCs implemented (19 not applicable — see L2_TESTS.md)
- Limit: 10 uploads per 10-minute window
- Crashloop Detection: 5 uploads per 1-minute window
- State Tracking:
/tmp/.crashupload_ratelimit
- Bypasses rate limit for first dump after boot
- Enables upload of crash from previous session
- Self-clears after successful upload
When T2 telemetry is enabled:
SYST_INFO_CrashUpload_Success: Successful uploadSYST_INFO_CrashUpload_Failed: Upload failureSYST_WARN_NoMinidump: No dumps found when expectedSYST_ERR_RateLimit_Exceeded: Rate limit triggered
/minidumps/ # Minidump storage
/var/lib/systemd/coredump/ # Coredump storage
/opt/logs/crashupload.log # Application logs
/tmp/.crashupload_ratelimit # Rate limit state
/tmp/.crashupload_recovery # Recovery mode flag
/tmp/.deny_dump_uploads_till # Temporary upload block
/var/run/crashupload.lock # Process lock file
For backward compatibility, legacy implementation remains:
uploadDumps.sh: Original shell-based implementationuploadDumpsUtils.sh: Utility functionsrunDumpUpload.sh: Wrapper script
Note: These are deprecated and will be removed in v3.0.
- High-Level Design
- Low-Level Design
- Architecture Diagrams
- Requirements
- Implementation Summary
- Changelog
- Check privacy settings:
cat /opt/tmtryoptout(should not exist or be "false") - Verify RBUS privacy mode:
dmcli eRT getv Device.X_RDKCENTRAL-COM_Privacy.PrivacyMode - Check rate limit state:
cat /tmp/.crashupload_ratelimit - Review logs:
cat /opt/logs/crashupload.log
# Clear rate limit state (emergency only)
rm /tmp/.crashupload_ratelimit
# Restart service
systemctl restart minidump-on-bootup-upload.service- Verify network connectivity
- Check upload URL configuration
- Test TLS handshake:
curl -v https://upload-server - Review certificate validity
- RDKEMW-14022
- Implement Minidump Upload test cases
- Implement Coredump Upload test cases
- Implement Ratelimit test cases
- Implement Startup Cleanup test cases
- Implement OptOut test cases
Contributions are welcome! See CONTRIBUTING.md for guidelines.
All contributors must sign the RDK Contributor License Agreement (CLA).
Copyright 2025 RDK Management
Licensed under the Apache License, Version 2.0. See LICENSE for details.
- Issues: GitHub Issues
- Documentation: RDK Central Wiki
- Email: support@rdkcentral.com
Developed by RDK Management for the RDK community.
Special thanks to all contributors who helped migrate from shell scripts to optimized C implementation.