Skip to content

Crashupload Compiled Code

gomathishankar37 edited this page Jun 30, 2026 · 4 revisions

Crashupload - Compiled Code

This page covers the C implementation under c_sourcecode/.

Build

From repo root:

./cov_build.sh

L2 test-mode build:

./cov_build.sh --l2-test

Notes:

  • cov_build.sh installs to /usr/local/bin/crashupload
  • --l2-test adds -DL2_TEST so uptime is read from /opt/uptime

CLI contract

Current positional pattern:

crashupload <arg1> <dump_type> [secure] [wait_for_lock]
  • <dump_type>: 0 minidump, 1 coredump
  • secure: use /opt/secure/* paths
  • wait_for_lock: wait for lock instead of immediate exit

Key implementation areas

  • c_sourcecode/src/main.c: high-level orchestration
  • c_sourcecode/src/config/config_manager.c: config loading and dump mode
  • c_sourcecode/src/scanner/: dump discovery
  • c_sourcecode/src/archive/: archive creation
  • c_sourcecode/src/upload/: upload pipeline
  • c_sourcecode/src/ratelimit/: rate limiting

Rate-limit behavior notes

  • Global cooldown gate: /tmp/.deny_dump_uploads_till
    • Checked first by ratelimit_check_unified().
    • If active, upload processing is blocked for both minidump and coredump runs.
  • Minidump counter gate: /tmp/.minidump_upload_timestamps
    • Checked only for minidump mode.
    • Used to trigger the global cooldown when threshold conditions are met.

Runtime caveat

Even when C binary exists, uploadDumps.sh currently routes:

  • mediaclient: binary-first
  • broadband and extender: legacy script path

See Crashupload - Script Method for legacy behavior.

Testing references

  • L1 unit tests: ./run_ut.sh
  • L2 functional tests: ./run_l2.sh (after ./cov_build.sh --l2-test)
  • L2 mapping details: test/L2_TESTS.md

Navigation

Clone this wiki locally