Skip to content

Reopen lnotspotl/device has crashed#1723

Merged
moratom merged 18 commits intodevelopfrom
lnotspotl/device_has_crashed
Apr 7, 2026
Merged

Reopen lnotspotl/device has crashed#1723
moratom merged 18 commits intodevelopfrom
lnotspotl/device_has_crashed

Conversation

@aljazdu
Copy link
Copy Markdown
Contributor

@aljazdu aljazdu commented Mar 16, 2026

Purpose

Reopening device has crashed PR after fixing some issues.

Specification

This PR now fixes:

  • Broken RVC2 branch pipelines
  • RVC4 devices hanging indefinitely after a crash
  • Crash logs not being collected when re-connection was turned off

Dependencies & Potential Impact

None / not applicable

Deployment Plan

None / not applicable

Testing & Validation

Tested with both the RVC2 and RVC4 devices, with varying settings.

Summary by CodeRabbit

  • New Features

    • Crash dump framework: automatic collection, manual trigger, serialization (bytes/archives), and platform-aware crash dump types
    • Device APIs: platform query, hasCrashed(), crash dump retrieval, and callback registration/removal
    • Python bindings for crash dump objects and platform enum
  • Examples

    • New C++ and Python crash-dump demo scripts
  • Documentation

    • Clarified crash dump configuration variables
  • Tests

    • Added on-device crashdump test suite

@aljazdu aljazdu requested a review from moratom March 16, 2026 14:56
@aljazdu aljazdu self-assigned this Mar 16, 2026
@aljazdu aljazdu added the testable PR is ready to be tested label Mar 16, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 16, 2026

Caution

Review failed

Pull request was closed or merged during review

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 8cc94b0f-78f4-43b2-a367-3098a3f55c57

📥 Commits

Reviewing files that changed from the base of the PR and between bfdd585 and 6b3a42b.

📒 Files selected for processing (2)
  • cmake/Depthai/DepthaiDeviceSideConfig.cmake
  • src/pipeline/Node.cpp
📜 Recent review details
🧰 Additional context used
🧠 Learnings (3)
📚 Learning: 2026-03-24T22:39:04.364Z
Learnt from: MaticTonin
Repo: luxonis/depthai-core PR: 1732
File: src/pipeline/Pipeline.cpp:705-705
Timestamp: 2026-03-24T22:39:04.364Z
Learning: Do not flag the `!= ""` part of the auto-calibration condition as redundant when it appears in `PipelineImpl::build()` (or closely related pipeline build logic). If the code uses `utility::getEnvAs<std::string>(..., default)` with a default such as `"ON_START"`, the explicit empty-string guard may still be intentional to treat an explicitly empty env var as “OFF/disabled” (or to avoid special-casing elsewhere). Only consider removing `!= ""` if the codebase has an explicit, enforceable guarantee that `DEPTHAI_AUTOCALIBRATION` can never be set to an empty string (e.g., via validated parsing/CI checks); otherwise, keep the guard.

Applied to files:

  • src/pipeline/Node.cpp
📚 Learning: 2026-03-16T11:17:12.819Z
Learnt from: pheec
Repo: luxonis/depthai-core PR: 1715
File: include/depthai/pipeline/node/PointCloud.hpp:34-98
Timestamp: 2026-03-16T11:17:12.819Z
Learning: In `include/depthai/pipeline/node/PointCloud.hpp`, the nested `Impl` class inside `PointCloud` is intentionally public (not private/forward-declared) because the on-host unit tests in `tests/src/onhost_tests/point_cloud_test.cpp` directly access `Impl` methods such as `setIntrinsics`, `setExtrinsics`, `useCPU`, `useCPUMT`, `computePointCloudDense`, `applyTransformation`, and `filterValidPoints`. Do not suggest making `Impl` private or forward-declaring it.

Applied to files:

  • src/pipeline/Node.cpp
📚 Learning: 2026-03-24T22:39:00.650Z
Learnt from: MaticTonin
Repo: luxonis/depthai-core PR: 1732
File: src/pipeline/Pipeline.cpp:662-662
Timestamp: 2026-03-24T22:39:00.650Z
Learning: In `src/pipeline/Pipeline.cpp`, the `DEPTHAI_AUTOCALIBRATION` environment variable intentionally defaults to `"ON_START"` (not `""`). This means auto-calibration is initialized by default for stereo pipelines at pipeline build time. The resulting implicit EEPROM/calibration writes on startup are by design and should not be flagged as a backward-incompatible change or unintended side-effect in future reviews.

Applied to files:

  • cmake/Depthai/DepthaiDeviceSideConfig.cmake
🪛 Cppcheck (2.20.0)
src/pipeline/Node.cpp

[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)

🔇 Additional comments (3)
cmake/Depthai/DepthaiDeviceSideConfig.cmake (1)

5-5: Device-side commit pin update looks correct.

This metadata-only change is consistent with syncing device-side artifacts for the crash-handling updates; no issues in this segment.

src/pipeline/Node.cpp (2)

3-4: LGTM!

Both includes are necessary for the new functionality in stopPipeline()<spdlog/spdlog.h> for error logging and <thread> for the detached shutdown thread.


735-745: LGTM — previous review concern addressed.

The detached thread now wraps pipeline.stop() in proper try-catch blocks, catching both std::exception and unknown exceptions. This prevents std::terminate from being called when exceptions escape the thread, and errors are logged via spdlog::error for visibility.

The move-capture (pipeline = std::move(pipeline)) correctly transfers ownership to the detached thread, and mutable is appropriately used to allow calling non-const methods on the captured object.


📝 Walkthrough

Walkthrough

This PR implements a crash-dump subsystem: polymorphic CrashDump model with RVC2/RVC4 variants and serialization, a CrashDumpManager to collect/enrich dumps, DeviceBase/Gate crash-handling and callback APIs, Python bindings for Platform and CrashDump (dict-like extra), archive/compression refactor to libarchive, examples/tests, and related utility changes.

Changes

Cohort / File(s) Summary
Core Crash Dump Model
include/depthai/device/CrashDump.hpp, src/device/CrashDump.cpp
Replace flat CrashDump struct with polymorphic base and final subclasses (CrashDumpRVC2, CrashDumpRVC4). Add metadata fields, JSON-backed extra, tar/archive serialization, toBytes/fromBytes/load APIs, and platform-discriminated (de)serialization.
CrashDump Manager
src/device/CrashDumpManager.hpp, src/device/CrashDumpManager.cpp
New CrashDumpManager class that collects platform-aware crash dumps, populates metadata, supports move semantics, and exposes collectCrashDump()/hasCrashDump().
Device DeviceBase / Gate
include/depthai/device/DeviceBase.hpp, src/device/DeviceBase.cpp, include/depthai/device/DeviceGate.hpp, src/device/DeviceGate.cpp
Add DeviceBase platform query, hasCrashed(), crashdump callback registration/removal; change getState()/getCrashDump() to return unique_ptr; move gate crash retrieval into getCrashDump(); adapt reconnection/close flows to centralized collection and env-var gating.
Platform Extraction
include/depthai/device/Platform.hpp, src/device/Platform.cpp, include/depthai/device/Device.hpp, src/device/Device.cpp
Move Platform enum and converters out of Device.hpp into Platform.hpp/.cpp; remove old Device-level platform helpers.
Python Bindings
bindings/python/src/CrashDumpBindings.hpp, bindings/python/src/CrashDumpBindings.cpp, bindings/python/src/PlatformBindings.hpp, bindings/python/src/PlatformBindings.cpp, bindings/python/src/DeviceBindings.cpp, bindings/python/CMakeLists.txt, bindings/python/src/py_bindings.cpp
New CrashDump and Platform binding modules; CrashDump exposes polymorphic classes and dict-like extra with cached _extra_dict; Device bindings updated to register/remove crashdump callbacks (GIL acquisition + JSON sync) and expose platform accessors.
Compression / Archive Utilities
include/depthai/utility/Compression.hpp, src/utility/Compression.cpp, src/opencv/HolisticRecordReplay.cpp, src/utility/PipelineImplHelper.cpp, tests...
Replace tar-specific APIs with generalized libarchive-based archive APIs: filenamesInTar→filenamesInArchive, tarFiles→archiveFiles/archiveFilesCompressed, untarFiles→extractFiles; remove in-memory deflate/inflate. Update call sites.
Log Collection & Upload
src/utility/LogCollection.hpp, src/utility/LogCollection.cpp
Change logCrashDump to accept CrashDump directly and use CrashDump.toBytes()/toTar() for payload; sanitize timestamp-based filenames; use DEPTHAI_DISABLE_CRASHDUMP_COLLECTION/DEPTHAI_DISABLE_FEEDBACK gating.
Temporary & OS Utilities
src/utility/Platform.hpp, src/utility/Platform.cpp
Add platform::getOSPlatform(), improve getTempPath() with robust temp-dir creation and exception on failure.
Device Info / XLink
include/depthai/xlink/XLinkConnection.hpp
Remove in-class default initializers for DeviceInfo.name and deviceId (no behavioral change).
Examples & Tests
examples/cpp/Misc/CrashDump/crash_dump.cpp, examples/python/Misc/CrashDump/crash_dump.py, tests/CMakeLists.txt, tests/src/ondevice_tests/crashdump_test.cpp
Add C++ and Python crash-dump examples demonstrating callback, manual crash trigger, and hasCrashed polling. Add on-device crashdump test suite and test target.
Build & Docs
CMakeLists.txt, bindings/python/CMakeLists.txt, README.md, cmake/...DepthaiDeviceSideConfig.cmake
Add core sources: src/device/CrashDump.cpp, src/device/CrashDumpManager.cpp, src/device/Platform.cpp; add Python binding sources; clarify README wording for DEPTHAI_CRASHDUMP/DEPTHAI_CRASHDUMP_TIMEOUT; update device-side commit hash.
Pipeline Threading
src/pipeline/Node.cpp
Call Pipeline::stop() from a detached thread inside Node::stopPipeline() to avoid join/deadlock during teardown.
Misc. small changes
include/depthai/device/Device.hpp etc.
Header reorganizations (include Platform.hpp), removed Platform-related symbols from Device.hpp, small initialization tweaks.

Sequence Diagram(s)

sequenceDiagram
    participant Device as Device (hardware)
    participant DeviceBase as DeviceBase
    participant Manager as CrashDumpManager
    participant Archive as Archive (libarchive / fs)
    participant Callback as PythonCallback / Upload

    Device->>DeviceBase: device crash occurs / gate session ends
    DeviceBase->>Manager: collectCrashDump(clear)
    Manager->>DeviceBase: query platform, request gate/device payload
    alt RVC2
        Manager->>DeviceBase: getCrashReportCollectionRVC2(clear)
    else RVC4
        Manager->>DeviceBase: getGateCrashDump()
    end
    Manager->>Archive: serialize payload -> temp tar.gz
    Archive-->>Manager: archive path / bytes
    Manager->>DeviceBase: populate metadata (versions, deviceId, timestamp)
    Manager->>DeviceBase: invoke registered callback (shared_ptr<CrashDump>)
    DeviceBase->>Callback: acquire GIL and call Python callback
    Callback-->>DeviceBase: optionally modify extra -> sync back to CrashDump
    DeviceBase->>Archive: optionally persist/upload (log collection)
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~75 minutes

Possibly related PRs

  • Release 3.5.0 #1718 — Overlapping changes to crash-dump API and Python bindings (crash dump/CrashReport surface and bindings).

Suggested reviewers

  • MaticTonin

Poem

🐰 I hopped through code to catch a fall,
New dumps, new bindings, I bind them all.
Platform split and archives sewn tight,
Callbacks awake in the middle of night.
A carrot-toast to recovery—robust and bright! 🥕

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 6.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'Reopen lnotspotl/device has crashed' is vague and non-descriptive. It references a branch name and a generic action without conveying the specific technical changes or improvements being made. Revise the title to clearly describe the main technical change, such as 'Add crash dump collection and detection for RVC2/RVC4 devices' or 'Fix crash dump handling and device reconnection issues'.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch lnotspotl/device_has_crashed

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 15

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
src/utility/Compression.cpp (1)

131-134: ⚠️ Potential issue | 🟡 Minor

Potential issue with large files or invalid entry sizes.

The entire file is read into memory at once. For large files, this could cause memory issues. Additionally, archive_entry_size may return negative values for unknown sizes (e.g., streaming archives).

Consider adding validation and potentially chunked reading for large files.

Suggested validation
                 size_t size = archive_entry_size(entry);
+                if(size == 0) {
+                    outFileStream.close();
+                    break;
+                }
                 std::vector<uint8_t> buff(size);
-                archive_read_data(a, buff.data(), size);
+                la_ssize_t bytesRead = archive_read_data(a, buff.data(), size);
+                if(bytesRead < 0) {
+                    outFileStream.close();
+                    throw std::runtime_error(fmt::format("Failed to read data from archive: {}", archive_error_string(a)));
+                }
-                outFileStream.write(reinterpret_cast<char*>(buff.data()), size);
+                outFileStream.write(reinterpret_cast<char*>(buff.data()), bytesRead);
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/utility/Compression.cpp` around lines 131 - 134,
archive_entry_size(entry) can be negative/unknown and allocating a vector of
that size reads the whole entry into memory, which fails for large or streaming
entries; instead, validate the size and perform chunked reads: if
archive_entry_size(entry) > 0 you may still prefer to read in fixed-size chunks,
and if size is negative/unknown, loop calling archive_read_data(a, buffer,
bufferSize) until it returns 0 (EOF) or error, writing each returned byte-count
to outFileStream; reference archive_entry_size, archive_read_data, buff (replace
with a fixed-size stack/heap buffer), outFileStream, entry and a to implement
this safe, incremental read-and-write loop and handle/archive_read_* error
returns appropriately.
src/device/DeviceBase.cpp (1)

561-568: ⚠️ Potential issue | 🔴 Critical

Gate crash handling needs an RVC4 + gate guard.

This block now runs for every !isRvc2 device. But gate is only initialized in the X_LINK_GATE* boot path, and CrashDumpManager still throws on Platform::RVC3. That gives you either a null dereference at Line 565 or an exception from Line 609 during close().

Proposed fix
     bool waitForGate = true;
-    if(!isRvc2) {
+    const bool isRvc4 = deviceInfo.platform == X_LINK_RVC4;
+    if(isRvc4 && gate) {
         // Check if the device is still alive and well, if yes, don't wait for gate, crash dump not relevant
         try {
             auto gateState = gate->getState();
             crashed = (gateState == DeviceGate::SessionState::CRASHED || gateState == DeviceGate::SessionState::DESTROYED);
             waitForGate = !pimpl->rpcCall("isRunning").as<bool>();
             pimpl->logger.debug("Will wait for gate: {}", waitForGate);
         } catch(const std::exception& ex) {
             pimpl->logger.debug("isRunning call error: {}", ex.what());
         }
     }
...
-    if(gate && waitForGate) {
+    if(isRvc4 && gate && waitForGate) {
         if(crashed && !crashDumpHandled.load()) {
             collectAndLogCrashDump();
         }
         gate->waitForSessionEnd();
     }

Also applies to: 607-611

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/device/DeviceBase.cpp` around lines 561 - 568, The gate/crash handling
currently runs for all !isRvc2 devices but gate and CrashDumpManager are only
valid for RVC4 paths; fix by adding an explicit RVC4 + gate guard around this
whole block (use isRvc4 && gate != nullptr) so you only call gate->getState(),
set waitForGate, log via pimpl->logger, and create/use CrashDumpManager when
isRvc4 && gate is non-null; also apply the same isRvc4 && gate != nullptr guard
to the later close()/cleanup section referenced (the code that may throw around
CrashDumpManager and gate), and keep existing checks like
DeviceGate::SessionState::CRASHED/DESTROYED and
pimpl->rpcCall("isRunning").as<bool>() intact inside the guarded region.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@include/depthai/device/CrashDump.hpp`:
- Around line 204-206: Extract the repeated literal "1.0.0" into a single
constant on the base class CrashDump (e.g., a protected static constexpr const
char* CRASH_DUMP_FORMAT_VERSION) and then update the derived classes
CrashDumpRVC2 and CrashDumpRVC4 to return that constant from
getCrashDumpVersion() instead of the hard-coded string.

In `@include/depthai/device/DeviceBase.hpp`:
- Around line 970-977: The code uses inconsistent camelCase for crash dump
identifiers; rename crashdumpCallback and crashdumpCallbackMtx to match
crashDumpHandled (e.g., crashDumpCallback and crashDumpCallbackMtx) and update
all references/usages accordingly (including any captures, assignments, mutex
locks, and function parameter references) so the identifier casing is consistent
across DeviceBase.hpp and any compilation units that reference these symbols.

In `@include/depthai/device/DeviceGate.hpp`:
- Around line 45-46: The public API change to waitForSessionEnd() is breaking;
add a deprecated compatibility shim in the DeviceGate class that preserves the
original waitForSessionEnd() behavior and forwards to the new flow (e.g., call
the new wait method(s) and then getCrashDump() as the old sequence did), mark
the shim as [[deprecated]] and document the migration to the new explicit
getCrashDump() call so consumers have time to adopt the new API; reference the
existing symbols waitForSessionEnd() and getCrashDump() when implementing the
wrapper so it simply invokes the new sequence and returns the original expected
result/side-effects.

In `@src/device/CrashDump.cpp`:
- Around line 293-297: The metadata written by CrashDumpRVC4::toTar includes
originalFilename but the deserializers never restore it; update
CrashDumpRVC4::fromTar (and the other deserialization path around the 336-339
area) to read metadata["originalFilename"] (or use
metadata.value("originalFilename", "")) and assign it to the
CrashDumpRVC4::filename member so filename is preserved across archive/bytes
round-trips.

In `@src/device/CrashDumpManager.cpp`:
- Around line 59-67: The CrashDumpCollector is never setting the CrashDump field
depthaiBuildDatetime before serialization; update the same initialization block
that sets dump->depthaiVersionBuildInfo to also assign
dump->depthaiBuildDatetime (e.g., from build::BUILD_DATETIME or the appropriate
build timestamp constant) so that writeMetadata() persists a populated
depthaiBuildDatetime; locate the initialization using the dump pointer and the
depthaiVersion* assignments to add this single assignment.

In `@src/device/CrashDumpManager.hpp`:
- Around line 25-27: CrashDumpManager is declared movable but contains a raw
DeviceBase* (devicePtr), so default moves leave both objects pointing to the
same device; replace the defaulted move constructor and move assignment by
implementing custom move operations that transfer ownership and nullify the
source's devicePtr (update CrashDumpManager(CrashDumpManager&&) to set
this->devicePtr = other.devicePtr and then other.devicePtr = nullptr, and
implement CrashDumpManager& operator=(CrashDumpManager&&) to guard
self-assignment, release or nullify current devicePtr if needed, move the
pointer from other, set other.devicePtr = nullptr, and return *this) so the
moved-from object is left in a safe empty state.

In `@src/device/DeviceBase.cpp`:
- Around line 1157-1164: The monitor currently only treats
DeviceGate::SessionState::CRASHED as a crash and may skip dump collection for
gates that go straight to DeviceGate::SessionState::DESTROYED; update the check
around gate->getState() (and the local crashed flag) to consider either CRASHED
or DESTROYED as a crash condition so that the existing logic that calls
collectAndLogCrashDump() when crashed && !crashDumpHandled.load() will run for
DESTROYED states as well.
- Around line 465-483: crashDumpHandled is being set before running the user
callback and logCollection::logCrashDump, so move the
crashDumpHandled.store(true) to after those operations and only set it when they
complete successfully; specifically, keep the callback copy logic using
crashdumpCallback and crashdumpCallbackMtx, invoke callbackCopy(crashDump) and
then call logCollection::logCrashDump(pipelineSchema, *crashDump, deviceInfo),
and only after both succeed call crashDumpHandled.store(true). Also wrap the
callback and logCrashDump calls in a try/catch so exceptions are caught and
logged via pimpl->logger.warn/error (and crashDumpHandled remains false on
failure) to allow retry paths to still process the dump.
- Around line 492-515: The loop currently exits as soon as getDeviceById()
returns any match because it uses while(!found && ...), causing a timeout if the
device is still in its pre-reboot state; change the loop condition and logic so
polling continues until either the device is observed in a reboot state (check
rebootingDeviceInfo.state == X_LINK_UNBOOTED || X_LINK_BOOTLOADER) or the
timeout elapses. Concretely, keep calling XLinkConnection::getDeviceById(...)
each iteration and only break/handle the crash when found AND the state matches
the reboot states (the same check used to construct DeviceBase rebootingDevice),
otherwise continue polling until timeout; update references to found,
rebootingDeviceInfo, getDeviceById, and the do/while condition accordingly so
you don't stop on the first sighting of an old-state device.

In `@src/utility/Compression.cpp`:
- Line 121: Replace the debug-only assert with a proper runtime check: in the
scope where filesInArchive and filesOnDisk are compared (the code currently
contains assert(filesInArchive.size() == filesOnDisk.size());), validate sizes
at runtime and handle mismatch deterministically (throw a suitable exception or
return an error code/value and log a clear message) instead of using assert;
ensure the check references filesInArchive.size() and filesOnDisk.size() and
that subsequent code path assumes sizes are equal only after the runtime
validation succeeds.
- Line 21: The assert(filesOnDisk.size() == filesInArchive.size()) must be
replaced with a runtime parameter validation that handles mismatches instead of
being removed in release builds; check sizes of filesOnDisk and filesInArchive,
and if they differ, either throw a descriptive exception (e.g.,
std::invalid_argument or std::runtime_error) or return an error status, logging
the sizes and context, so the subsequent loop that iterates both containers
cannot go out-of-bounds; update the surrounding function (the code block using
filesOnDisk/filesInArchive) to propagate the error appropriately.

In `@src/utility/Platform.cpp`:
- Around line 172-177: The current implementation builds basePath/baseStr and
uses _wmktemp_s plus std::filesystem::create_directories, which has a TOCTOU
race; replace this with a retry loop that atomically creates a uniquely-suffixed
directory using the Windows API CreateDirectory (or CreateDirectoryW) rather
than generating a name then creating it, e.g. generate a random/GUID suffix
appended to basePath (where basePath and baseStr are used) and call
CreateDirectoryW in a loop until it succeeds or a retry limit is reached; on
success return the created std::filesystem::path, and on repeated failure throw
the same std::runtime_error with an explanatory message.

In `@tests/src/ondevice_tests/crashdump_test.cpp`:
- Around line 45-58: Replace the fixed 12-second sleep in the TEST_CASE with a
polling loop that repeatedly checks device.hasCrashed() after short sleeps
(e.g., 100–200ms) up to a maximum timeout (e.g., 12s); call device.crashDevice()
as before, then loop: if device.hasCrashed() break and REQUIRE true, otherwise
sleep a short interval and retry until timeout and then
REQUIRE(device.hasCrashed()) fails—update references in the test to use
dai::Device, device.crashDevice(), device.hasCrashed(),
std::this_thread::sleep_for and std::chrono for timing.

In `@tests/src/ondevice_tests/pipeline/node/record_replay_test.cpp`:
- Around line 55-61: filenamesInArchive(RECORDING_PATH) can include directory
entries (paths ending with '/'), and extractFiles(...) will fail if parent
directories don't exist; update the loop that builds recordingExtFiles to skip
entries that are directories (e.g., filename.back() == '/') and for each file
entry call std::filesystem::create_directories(recordingPath.parent_path()) (use
testFolder + "extracted" base) before calling
dai::utility::extractFiles(RECORDING_PATH, recordingFilenames,
recordingExtFiles); ensure you only pass file entries in recordingFilenames and
matching created parent directories for recordingExtFiles when calling
extractFiles (see filenamesInArchive, recordingFilenames, recordingExtFiles,
extractFiles, RECORDING_PATH, testFolder).

In `@tests/src/onhost_tests/replay_test.cpp`:
- Around line 29-35: The code passes raw recordingFilenames from
dai::utility::filenamesInArchive(RECORDING_PATH) into extractFiles which fails
if the archive contains directory entries or nested paths because extractFiles
expects destination parent directories to exist; update the loop that builds
recordingExtFiles to skip directory entries (e.g., filter out entries that are
directory headers or that end with a slash) and ensure you call
std::filesystem::create_directories(...) for each destination's parent_path
before calling dai::utility::extractFiles; reference filenamesInArchive,
recordingFilenames, recordingExtFiles, extractFiles, RECORDING_PATH and
testFolder when making the change.

---

Outside diff comments:
In `@src/device/DeviceBase.cpp`:
- Around line 561-568: The gate/crash handling currently runs for all !isRvc2
devices but gate and CrashDumpManager are only valid for RVC4 paths; fix by
adding an explicit RVC4 + gate guard around this whole block (use isRvc4 && gate
!= nullptr) so you only call gate->getState(), set waitForGate, log via
pimpl->logger, and create/use CrashDumpManager when isRvc4 && gate is non-null;
also apply the same isRvc4 && gate != nullptr guard to the later close()/cleanup
section referenced (the code that may throw around CrashDumpManager and gate),
and keep existing checks like DeviceGate::SessionState::CRASHED/DESTROYED and
pimpl->rpcCall("isRunning").as<bool>() intact inside the guarded region.

In `@src/utility/Compression.cpp`:
- Around line 131-134: archive_entry_size(entry) can be negative/unknown and
allocating a vector of that size reads the whole entry into memory, which fails
for large or streaming entries; instead, validate the size and perform chunked
reads: if archive_entry_size(entry) > 0 you may still prefer to read in
fixed-size chunks, and if size is negative/unknown, loop calling
archive_read_data(a, buffer, bufferSize) until it returns 0 (EOF) or error,
writing each returned byte-count to outFileStream; reference archive_entry_size,
archive_read_data, buff (replace with a fixed-size stack/heap buffer),
outFileStream, entry and a to implement this safe, incremental read-and-write
loop and handle/archive_read_* error returns appropriately.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 0f8121a3-e8a5-4c94-b056-42eda5817494

📥 Commits

Reviewing files that changed from the base of the PR and between c8a7a2e and 7eea19a.

📒 Files selected for processing (39)
  • CMakeLists.txt
  • README.md
  • bindings/python/CMakeLists.txt
  • bindings/python/src/CrashDumpBindings.cpp
  • bindings/python/src/CrashDumpBindings.hpp
  • bindings/python/src/DeviceBindings.cpp
  • bindings/python/src/PlatformBindings.cpp
  • bindings/python/src/PlatformBindings.hpp
  • bindings/python/src/py_bindings.cpp
  • cmake/Depthai/DepthaiDeviceSideConfig.cmake
  • examples/cpp/Misc/CrashDump/CMakeLists.txt
  • examples/cpp/Misc/CrashDump/crash_dump.cpp
  • examples/python/Misc/CrashDump/crash_dump.py
  • include/depthai/device/CrashDump.hpp
  • include/depthai/device/Device.hpp
  • include/depthai/device/DeviceBase.hpp
  • include/depthai/device/DeviceGate.hpp
  • include/depthai/device/Platform.hpp
  • include/depthai/utility/Compression.hpp
  • include/depthai/xlink/XLinkConnection.hpp
  • src/device/CrashDump.cpp
  • src/device/CrashDumpManager.cpp
  • src/device/CrashDumpManager.hpp
  • src/device/Device.cpp
  • src/device/DeviceBase.cpp
  • src/device/DeviceGate.cpp
  • src/device/Platform.cpp
  • src/opencv/HolisticRecordReplay.cpp
  • src/utility/Compression.cpp
  • src/utility/LogCollection.cpp
  • src/utility/LogCollection.hpp
  • src/utility/PipelineImplHelper.cpp
  • src/utility/Platform.cpp
  • src/utility/Platform.hpp
  • tests/CMakeLists.txt
  • tests/src/ondevice_tests/crashdump_test.cpp
  • tests/src/ondevice_tests/dynamic_calibration_test.cpp
  • tests/src/ondevice_tests/pipeline/node/record_replay_test.cpp
  • tests/src/onhost_tests/replay_test.cpp
💤 Files with no reviewable changes (2)
  • examples/cpp/Misc/CrashDump/CMakeLists.txt
  • src/device/Device.cpp

Comment thread include/depthai/device/CrashDump.hpp
Comment thread include/depthai/device/DeviceBase.hpp
Comment thread include/depthai/device/DeviceGate.hpp
Comment thread src/device/CrashDump.cpp
Comment thread src/device/CrashDumpManager.cpp
Comment thread src/utility/Compression.cpp Outdated
Comment thread src/utility/Platform.cpp
Comment thread tests/src/ondevice_tests/crashdump_test.cpp
Comment thread tests/src/ondevice_tests/pipeline/node/record_replay_test.cpp
Comment thread tests/src/onhost_tests/replay_test.cpp
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/utility/Compression.cpp (1)

135-138: ⚠️ Potential issue | 🟠 Major

Missing error handling for archive_read_data().

archive_read_data() returns the number of bytes read, or a negative value on error. The return value is not checked, which could lead to writing garbage or incomplete data to disk if the read fails.

🛠️ Proposed fix
                 size_t size = archive_entry_size(entry);
+                if(size == static_cast<size_t>(-1)) {
+                    throw std::runtime_error(fmt::format("Unknown entry size for file {} in archive.", file));
+                }
                 std::vector<uint8_t> buff(size);
-                archive_read_data(a, buff.data(), size);
+                la_ssize_t bytesRead = archive_read_data(a, buff.data(), size);
+                if(bytesRead < 0) {
+                    throw std::runtime_error(fmt::format("Failed to read data for file {} from archive.", file));
+                }
-                outFileStream.write(reinterpret_cast<char*>(buff.data()), size);
+                outFileStream.write(reinterpret_cast<char*>(buff.data()), bytesRead);
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/utility/Compression.cpp` around lines 135 - 138, Check and handle the
return value of archive_read_data in the extraction loop: call
archive_read_data(a, buff.data(), size) into a ssize_t/ssize_t-like variable,
detect negative values and handle errors (log/throw and abort extraction for
this entry), and handle short reads by looping until the requested size is read
(accumulating into buff) before calling outFileStream.write; reference
archive_read_data, archive_entry_size, buff, outFileStream, entry and a when
locating the code to implement this check-and-loop plus error handling.
♻️ Duplicate comments (1)
src/device/CrashDumpManager.cpp (1)

70-92: ⚠️ Potential issue | 🟡 Minor

Populate depthaiBuildDatetime before serializing the dump.

The CrashDump::writeMetadata() method persists a depthaiBuildDatetime field (separate from depthaiVersionBuildInfo), but this collector never assigns it. Dumps produced here will always have an empty depthaiBuildDatetime.

🐛 Proposed fix
     dump->depthaiVersionBuildInfo = build::BUILD_DATETIME;
+    dump->depthaiBuildDatetime = build::BUILD_DATETIME;
     dump->depthaiCommitHash = build::COMMIT;
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/device/CrashDumpManager.cpp` around lines 70 - 92, The crash dump is
never assigning depthaiBuildDatetime, so CrashDump instances serialized by the
collector lack that field; in the code block where other build metadata is set
(the function that populates the dump object—e.g., the CrashDumpManager routine
that assigns dump->depthaiVersionBuildInfo = build::BUILD_DATETIME), also assign
dump->depthaiBuildDatetime = build::BUILD_DATETIME (or the appropriate build::
constant) before returning the dump so writeMetadata() will persist a non-empty
depthaiBuildDatetime.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/device/CrashDump.cpp`:
- Around line 132-149: The temp directory cleanup in CrashDump::toBytes and
CrashDump::fromBytes is not exception-safe because fs::remove_all(tempPath) is
called only on the normal path; wrap the tempPath lifetime in an RAII guard so
removal always runs on scope exit (even on exceptions). Implement a small local
RAII helper (or use std::unique_ptr with a custom deleter) that captures
tempPath and calls fs::remove_all in its destructor, then remove the explicit
fs::remove_all calls from the end of toBytes and fromBytes so cleanup is
guaranteed; apply the same pattern to other methods in this file that create
tempPath.

In `@src/device/CrashDumpManager.cpp`:
- Around line 1-12: Add explicit standard headers for the STL types used in
CrashDumpManager.cpp: include <chrono> for std::chrono, <sstream> for
std::stringstream, <iomanip> for std::put_time, and <ctime> for std::tm; update
the top-of-file includes (near the existing standard and project includes) so
functions/methods in CrashDumpManager that reference std::chrono,
std::stringstream, std::put_time or std::tm resolve portably and clearly.

In `@src/utility/Compression.cpp`:
- Line 82: Add a null check after the call to archive_read_new() in the function
in Compression.cpp: verify that the returned pointer (variable a) is not null
and if it is, log an error (consistent with existing logging style used later)
and return/cleanup appropriately; locate the archive_read_new() call and mirror
the error handling pattern used around the subsequent
archive_read_support_filter_all/archive_read_support_format_all calls to ensure
consistent early exit when allocation fails.
- Around line 115-119: The preprocessor check for opening the archive is
inconsistent: change the condition guarding the use of
archive_read_open_filename_w to match the other functions (filenamesInArchive
and archiveFilesImpl) by using `#if` defined(_WIN32) (remove the _MSC_VER check)
so MinGW builds use the same wide-character path code path; edit the block that
currently switches between archive_read_open_filename_w and
archive_read_open_filename (the code that uses archivePath.c_str() and sets int
r) to use the same `#if` defined(_WIN32) predicate as the other functions.
- Around line 30-50: Check and handle errors for archive and file operations:
verify archive_write_new() returned non-NULL before using 'a' and call
archive_write_free(a) on failures; check return values from
archive_write_open_filename(a, ...) / archive_write_open_filename_w(a, ...) and
handle non-ARCHIVE_OK by freeing 'a' and returning/throwing; after
archive_write_header(a, entry) verify the status and handle errors (free
entry/archive and abort); validate fileStream.open(file, std::ios::binary) by
checking fileStream.is_open() and/or fileStream.fail() before reading and handle
failures (close/free resources and return/throw); also guard
std::filesystem::file_size(file) with try/catch or pre-check existence to avoid
exceptions. Ensure all error paths free archive_entry_free(entry),
archive_write_free(a), and close fileStream as appropriate.

---

Outside diff comments:
In `@src/utility/Compression.cpp`:
- Around line 135-138: Check and handle the return value of archive_read_data in
the extraction loop: call archive_read_data(a, buff.data(), size) into a
ssize_t/ssize_t-like variable, detect negative values and handle errors
(log/throw and abort extraction for this entry), and handle short reads by
looping until the requested size is read (accumulating into buff) before calling
outFileStream.write; reference archive_read_data, archive_entry_size, buff,
outFileStream, entry and a when locating the code to implement this
check-and-loop plus error handling.

---

Duplicate comments:
In `@src/device/CrashDumpManager.cpp`:
- Around line 70-92: The crash dump is never assigning depthaiBuildDatetime, so
CrashDump instances serialized by the collector lack that field; in the code
block where other build metadata is set (the function that populates the dump
object—e.g., the CrashDumpManager routine that assigns
dump->depthaiVersionBuildInfo = build::BUILD_DATETIME), also assign
dump->depthaiBuildDatetime = build::BUILD_DATETIME (or the appropriate build::
constant) before returning the dump so writeMetadata() will persist a non-empty
depthaiBuildDatetime.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: f3b064d6-24fa-4714-acf5-35a8efd6034d

📥 Commits

Reviewing files that changed from the base of the PR and between 7eea19a and cbf4632.

📒 Files selected for processing (4)
  • src/device/CrashDump.cpp
  • src/device/CrashDumpManager.cpp
  • src/device/CrashDumpManager.hpp
  • src/utility/Compression.cpp
📜 Review details
🧰 Additional context used
🧬 Code graph analysis (2)
src/device/CrashDumpManager.cpp (3)
src/device/CrashDumpManager.hpp (7)
  • CrashDumpManager (17-17)
  • CrashDumpManager (19-19)
  • CrashDumpManager (22-22)
  • CrashDumpManager (26-26)
  • other (27-27)
  • clear (34-34)
  • clear (42-42)
include/depthai/device/DeviceBase.hpp (1)
  • clear (961-961)
src/utility/Platform.cpp (2)
  • getOSPlatform (147-157)
  • getOSPlatform (147-147)
src/utility/Compression.cpp (5)
src/utility/ArchiveUtil.hpp (1)
  • entry (32-32)
src/device/CalibrationHandler.cpp (1)
  • file (187-187)
src/modelzoo/Zoo.cpp (1)
  • file (413-413)
src/utility/Files.hpp (1)
  • file (19-19)
src/openvino/OpenVINO.cpp (1)
  • file (144-144)
🪛 Cppcheck (2.20.0)
src/device/CrashDumpManager.cpp

[information] 4-4: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 8-8: Include file

(missingIncludeSystem)


[information] 11-11: Include file

(missingIncludeSystem)


[information] 12-12: Include file

(missingIncludeSystem)


[information] 13-13: Include file

(missingIncludeSystem)


[information] 14-14: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 15-15: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 8-8: Include file

(missingIncludeSystem)


[information] 9-9: Include file

(missingIncludeSystem)


[information] 10-10: Include file

(missingIncludeSystem)


[information] 11-11: Include file

(missingIncludeSystem)


[information] 12-12: Include file

(missingIncludeSystem)


[information] 13-13: Include file

(missingIncludeSystem)


[information] 14-14: Include file

(missingIncludeSystem)


[information] 15-15: Include file

(missingIncludeSystem)


[information] 2-2: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 2-2: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 2-2: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 2-2: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 8-8: Include file

(missingIncludeSystem)


[information] 9-9: Include file

(missingIncludeSystem)


[information] 12-12: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 31-31: Include file

(missingIncludeSystem)


[information] 32-32: Include file

(missingIncludeSystem)


[information] 33-33: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 8-8: Include file

(missingIncludeSystem)


[information] 9-9: Include file

(missingIncludeSystem)


[information] 10-10: Include file

(missingIncludeSystem)


[information] 11-11: Include file

(missingIncludeSystem)


[information] 12-12: Include file

(missingIncludeSystem)


[information] 13-13: Include file

(missingIncludeSystem)


[information] 14-14: Include file

(missingIncludeSystem)


[information] 20-20: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 8-8: Include file

(missingIncludeSystem)


[information] 10-10: Include file

(missingIncludeSystem)


[information] 13-13: Include file

(missingIncludeSystem)


[information] 14-14: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 15-15: Include file

(missingIncludeSystem)


[information] 16-16: Include file

(missingIncludeSystem)


[information] 17-17: Include file

(missingIncludeSystem)


[information] 18-18: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 8-8: Include file

(missingIncludeSystem)


[information] 10-10: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 2-2: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 2-2: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingInclude)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 8-8: Include file

(missingIncludeSystem)


[information] 9-9: Include file

(missingIncludeSystem)


[information] 10-10: Include file

(missingIncludeSystem)


[information] 11-11: Include file

(missingIncludeSystem)


[information] 12-12: Include file

(missingIncludeSystem)


[information] 13-13: Include file

(missingIncludeSystem)


[information] 2-2: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 8-8: Include file

(missingIncludeSystem)


[information] 9-9: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 17-17: Include file

(missingIncludeSystem)


[information] 18-18: Include file

(missingIncludeSystem)


[information] 12-12: Include file

(missingInclude)


[information] 20-20: Include file

(missingIncludeSystem)


[information] 21-21: Include file

(missingIncludeSystem)

src/utility/Compression.cpp

[style] 64-64: The function 'archiveFiles' is never used.

(unusedFunction)


[style] 70-70: The function 'archiveFilesCompressed' is never used.

(unusedFunction)


[style] 76-76: The function 'filenamesInArchive' is never used.

(unusedFunction)


[style] 105-105: The function 'extractFiles' is never used.

(unusedFunction)

src/device/CrashDump.cpp

[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 8-8: Include file

(missingIncludeSystem)


[information] 11-11: Include file

(missingIncludeSystem)


[information] 12-12: Include file

(missingIncludeSystem)


[information] 13-13: Include file

(missingIncludeSystem)


[information] 14-14: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 15-15: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 8-8: Include file

(missingIncludeSystem)


[information] 9-9: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 17-17: Include file

(missingIncludeSystem)


[information] 18-18: Include file

(missingIncludeSystem)


[information] 14-14: Include file

(missingIncludeSystem)


[information] 15-15: Include file

(missingIncludeSystem)


[information] 17-17: Include file

(missingIncludeSystem)


[error] 134-134: There is an unknown macro here somewhere. Configuration is required. If DEPTHAI_NLOHMANN_DEFINE_TYPE_INTRUSIVE is a macro then please configure it.

(unknownMacro)


[information] 15-15: Include file

(missingIncludeSystem)

🔇 Additional comments (14)
src/utility/Compression.cpp (3)

21-23: Past review comment addressed.

The runtime validation replacing assert has been properly implemented.


64-74: LGTM!

Clean wrapper functions with appropriate delegation.


123-125: Past review comment addressed.

The runtime validation replacing assert has been properly implemented.

src/device/CrashDumpManager.hpp (2)

25-27: LGTM! Move semantics properly addressed.

The move constructor and move assignment operator are now custom-declared (not defaulted), and the implementations in CrashDumpManager.cpp correctly nullify other.devicePtr after transfer, leaving moved-from objects in a safe state.


15-46: LGTM! Clean class design.

The class follows good C++ practices:

  • Explicit single-argument constructor prevents implicit conversions
  • Copy operations deleted, move operations properly declared
  • Clear separation between public API and private implementation details
  • Appropriate Doxygen-style documentation for public methods
src/device/CrashDump.cpp (5)

32-79: LGTM! File I/O helpers are well-designed.

The helper functions have consistent error handling, throwing descriptive exceptions on failure. The binary/text file operations are properly implemented with appropriate stream modes.


89-128: LGTM! Factory method with robust error handling.

The load method correctly discriminates platform from metadata and instantiates the appropriate derived type. Error cases (missing metadata, unsupported platform) are properly handled with descriptive exceptions.


336-340: LGTM! Past review concern addressed.

The filename member is now properly restored from metadata via fromJson(metadata, "originalFilename", "") on line 340, ensuring round-trip preservation through archive serialization.


159-207: LGTM! Symmetric metadata serialization.

The writeMetadata and readMetadata methods maintain proper symmetry, and the fromJson helper provides graceful degradation for missing fields during deserialization.


209-285: LGTM! RVC2 crash dump implementation.

The toTar and fromTar methods properly handle serialization with consistent error checking for required files and graceful handling of optional extra.json.

src/device/CrashDumpManager.cpp (4)

16-28: LGTM! Thread-safe timestamp generation.

The getCurrentTimestamp function correctly uses platform-appropriate thread-safe variants (localtime_s on Windows, localtime_r on POSIX) to avoid data races.


36-46: LGTM! Move operations correctly implemented.

Both move constructor and move assignment properly transfer ownership and nullify the source pointer, ensuring moved-from objects are in a safe, empty state.


95-101: LGTM! Defensive check before collection.

The method correctly checks hasCrashDump() before attempting to retrieve crash reports, and returns an empty dump when no crash data exists.


103-118: LGTM! RVC4 collection with appropriate fallback.

The method validates gate availability, transfers data efficiently via std::move, and logs a warning when the gate returns no dump despite a detected crash. Returning an empty dump rather than nullptr provides consistent behavior.

Comment thread src/device/CrashDump.cpp
Comment thread src/device/CrashDumpManager.cpp
Comment thread src/utility/Compression.cpp
Comment thread src/utility/Compression.cpp
Comment thread src/utility/Compression.cpp Outdated
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/device/DeviceBase.cpp`:
- Around line 1904-1922: In DeviceBase::getPlatform(), the switch cases (e.g.,
X_LINK_MYRIAD_X, X_LINK_RVC3, X_LINK_RVC4 and default) return Platform values
and therefore the trailing break statements after each return are unreachable;
remove those redundant break statements to clean up the switch body while
keeping the same return/throw behavior in getDeviceInfo().platform handling.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: ebf0ee23-17b6-492d-aa39-582ce9ceca07

📥 Commits

Reviewing files that changed from the base of the PR and between cbf4632 and 840e4e4.

📒 Files selected for processing (6)
  • CMakeLists.txt
  • README.md
  • cmake/Depthai/DepthaiDeviceSideConfig.cmake
  • examples/cpp/Misc/CrashDump/CMakeLists.txt
  • include/depthai/device/CrashDump.hpp
  • src/device/DeviceBase.cpp
💤 Files with no reviewable changes (1)
  • examples/cpp/Misc/CrashDump/CMakeLists.txt
📜 Review details
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2026-03-17T08:07:19.141Z
Learnt from: JakubFara
Repo: luxonis/depthai-core PR: 1718
File: src/pipeline/node/AutoCalibration.cpp:167-216
Timestamp: 2026-03-17T08:07:19.141Z
Learning: In `src/pipeline/node/AutoCalibration.cpp`, the `getNewCalibration` method intentionally opens the gate once before the outer recalibration retry loop and closes it only at the end (or on success). There is no need to isolate gate state between individual recalibration attempts — this single open/close pattern is by design and should not be flagged as a bug in future reviews.

Applied to files:

  • src/device/DeviceBase.cpp
📚 Learning: 2026-03-16T11:17:12.819Z
Learnt from: pheec
Repo: luxonis/depthai-core PR: 1715
File: include/depthai/pipeline/node/PointCloud.hpp:34-98
Timestamp: 2026-03-16T11:17:12.819Z
Learning: In `include/depthai/pipeline/node/PointCloud.hpp`, the nested `Impl` class inside `PointCloud` is intentionally public (not private/forward-declared) because the on-host unit tests in `tests/src/onhost_tests/point_cloud_test.cpp` directly access `Impl` methods such as `setIntrinsics`, `setExtrinsics`, `useCPU`, `useCPUMT`, `computePointCloudDense`, `applyTransformation`, and `filterValidPoints`. Do not suggest making `Impl` private or forward-declaring it.

Applied to files:

  • src/device/DeviceBase.cpp
🧬 Code graph analysis (2)
src/device/DeviceBase.cpp (6)
include/depthai/device/DeviceBase.hpp (4)
  • device (959-959)
  • connection (852-854)
  • connection (859-861)
  • clear (961-961)
src/device/CrashDumpManager.cpp (4)
  • CrashDumpManager (30-34)
  • CrashDumpManager (36-38)
  • hasCrashDump (120-122)
  • hasCrashDump (120-120)
src/device/CrashDumpManager.hpp (6)
  • CrashDumpManager (17-17)
  • CrashDumpManager (19-19)
  • CrashDumpManager (22-22)
  • CrashDumpManager (26-26)
  • clear (34-34)
  • clear (42-42)
src/utility/LogCollection.cpp (2)
  • logCrashDump (175-247)
  • logCrashDump (175-175)
src/utility/LogCollection.hpp (1)
  • logCrashDump (12-12)
src/device/DeviceGate.cpp (6)
  • getState (568-574)
  • getState (568-568)
  • getState (576-609)
  • getState (576-576)
  • getState (611-659)
  • getState (611-611)
include/depthai/device/CrashDump.hpp (1)
src/device/CrashDump.cpp (5)
  • CrashDump (130-130)
  • key (151-153)
  • key (151-151)
  • key (155-157)
  • key (155-155)
🪛 Cppcheck (2.20.0)
src/device/DeviceBase.cpp

[information] 33-33: Include file

(missingIncludeSystem)


[information] 33-33: Include file

(missingInclude)

🔇 Additional comments (14)
include/depthai/device/CrashDump.hpp (4)

208-210: Version string duplication noted.

Both CrashDumpRVC2 and CrashDumpRVC4 return "1.0.0" from getCrashDumpVersion(). This was already flagged in a previous review suggesting extraction to a base class constant.

Also applies to: 232-234


19-120: Well-structured polymorphic crash dump design.

The base CrashDump class provides a clean abstraction with:

  • Common metadata fields for version tracking and device identification
  • Factory methods (load, fromBytes) for deserialization
  • Pure virtual methods for platform-specific serialization
  • Proper virtual destructor for safe polymorphic destruction

122-216: LGTM!

CrashDumpRVC2 correctly encapsulates the RVC2-specific crash report collection with nested structures for processor info, error context, thread callstacks, and device prints.


218-241: LGTM!

CrashDumpRVC4 appropriately uses a simple binary blob (data) with filename for platform-specific crash data, as RVC4 crash dumps have a different structure.

src/device/DeviceBase.cpp (7)

460-485: crashDumpHandled is set before callback execution.

Setting crashDumpHandled.store(true) at line 465 before invoking the callback and logCrashDump() means if either throws, retry paths will skip the dump because they check !crashDumpHandled.load().


492-517: Loop may exit prematurely on first device sighting.

The loop at line 513 uses while(!found && ...) which exits as soon as getDeviceById() returns any match. If the device is still reported in its pre-reboot state (not X_LINK_UNBOOTED or X_LINK_BOOTLOADER), it sets found=true but doesn't enter the state-check block, causing an immediate timeout report without crash dump collection.


1157-1168: Monitor path only checks CRASHED, not DESTROYED.

Line 1158 only checks DeviceGate::SessionState::CRASHED. If a gate transitions directly to DESTROYED, the crash dump won't be collected here. This is inconsistent with the shutdown path (line 566) and waitForRebootAndCollectCrashDump (line 501) which both check for DESTROYED as well.


540-559: LGTM!

The RVC2 crash dump collection in closeImpl properly checks !crashDumpHandled.load() to avoid duplicate collection, and correctly handles both the pre-existing crash dump case and the pipeline shutdown error case.


562-572: LGTM!

The RVC4/gate path correctly checks both CRASHED and DESTROYED states when determining if the device crashed.


1501-1530: LGTM!

The getState(), getCrashDump(), and getCrashReportCollectionRVC2() methods properly use the new CrashDumpManager API and return the correct types. The platform check in getState() appropriately restricts it to RVC2.


1566-1574: LGTM!

The crash dump callback registration/removal methods properly use mutex protection and follow a clean pattern for managing the callback lifecycle.

cmake/Depthai/DepthaiDeviceSideConfig.cmake (1)

5-5: LGTM!

The RVC2 firmware commit hash update aligns with the PR objective of fixing broken RVC2 branch pipelines.

CMakeLists.txt (1)

274-281: LGTM!

The new crash dump and platform source files are correctly added to the core library build. The file organization follows the existing pattern for device-related sources.

README.md (1)

218-219: LGTM!

The documentation update correctly reflects that setting DEPTHAI_CRASHDUMP=0 disables crash dump retrieval, while DEPTHAI_CRASHDUMP_TIMEOUT only controls the wait duration. This aligns with the implementation in LogCollection.cpp.

Comment thread src/device/DeviceBase.cpp
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@bindings/python/src/CrashDumpBindings.cpp`:
- Around line 250-255: CrashDumpRVC4 bindings are missing documentation macros
for its members; add the same DOC(...) macros used for CrashDumpRVC2 so the API
docs include member descriptions. Update the two def_readwrite lines for
CrashDumpRVC4 (the ones that reference CrashDumpRVC4::data and
CrashDumpRVC4::filename) to include the DOC macro as the third argument (e.g.
use the pattern .def_readwrite("data", &CrashDumpRVC4::data, DOC(CrashDumpRVC4,
data)) and similarly for "filename") so documentation is consistent.
- Around line 57-67: Add defensive checks before casting and using pCallstack:
verify pCallstack is non-null and that the Callstack (cast from pCallstack) is
not empty before calling top() and pop(); if either check fails, avoid
dereferencing (e.g. return early or raise a Python exception/log an error)
instead of calling cb. Update the block around Callstack* callstack =
(Callstack*)pCallstack; auto cb = callstack->top(); callstack->pop(); cb(m,
pCallstack); to perform null-check on pCallstack, check callstack->empty() (or
size), and only retrieve and invoke cb when safe. Ensure the chosen failure path
cleanly aborts module binding initialization to prevent crashes.
- Around line 129-138: Replace the raw Python C API call in the __delitem__
lambda with a pybind11 dictionary operation: after getting d via
getExtraDict(self) and checking contains(key), cast d to a py::dict (e.g. auto
dict = d.cast<py::dict>();) and remove the key using the pybind11 API (e.g.
dict.erase(key) or dict.attr("pop")(key)); then continue to cast self to
CrashDump and call syncExtraToNative(self, dump) as before. This removes
PyDict_DelItemString and keeps the logic inside __delitem__, getExtraDict, and
syncExtraToNative consistent with pybind11 usage.
- Around line 185-189: The DOC macro references at the end of the binding block
are using the wrong type namespace; replace DOC(dai, CrashDump, CrashReport,
...) with DOC(dai, CrashDumpRVC2, CrashReport, ...) for the .def_readwrite
entries that set threadCallstack, prints, uptimeNs, timerRaw, and statusFlags so
they match the existing CrashDumpRVC2::CrashReport bindings and fix
documentation generation.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 80c6399e-8938-405c-a90b-6fabd2adaff3

📥 Commits

Reviewing files that changed from the base of the PR and between 840e4e4 and 99377a8.

📒 Files selected for processing (1)
  • bindings/python/src/CrashDumpBindings.cpp
📜 Review details
🧰 Additional context used
🧬 Code graph analysis (1)
bindings/python/src/CrashDumpBindings.cpp (3)
bindings/python/src/CrashDumpBindings.hpp (1)
  • m (7-7)
src/device/CrashDump.cpp (21)
  • CrashDump (130-130)
  • CrashDumpRVC2 (209-211)
  • CrashDumpRVC4 (289-291)
  • toTar (213-239)
  • toTar (213-213)
  • toTar (293-318)
  • toTar (293-293)
  • fromTar (241-285)
  • fromTar (241-241)
  • fromTar (320-362)
  • fromTar (320-320)
  • toBytes (132-140)
  • toBytes (132-132)
  • fromBytes (142-149)
  • fromBytes (142-142)
  • load (90-128)
  • load (90-90)
  • key (151-153)
  • key (151-151)
  • key (155-157)
  • key (155-155)
include/depthai/device/CrashDump.hpp (15)
  • CrashDump (30-30)
  • CrashDumpRVC2 (196-196)
  • CrashDumpRVC2 (202-202)
  • CrashDumpRVC4 (220-220)
  • CrashDumpRVC4 (226-226)
  • tarPath (62-62)
  • tarPath (68-68)
  • tarPath (88-88)
  • tarPath (212-212)
  • tarPath (213-213)
  • tarPath (236-236)
  • tarPath (237-237)
  • bytes (81-81)
  • key (49-49)
  • key (56-56)
🪛 Cppcheck (2.20.0)
bindings/python/src/CrashDumpBindings.cpp

[information] 9-9: Include file

(missingIncludeSystem)


[information] 10-10: Include file

(missingIncludeSystem)


[information] 11-11: Include file

(missingIncludeSystem)


[information] 12-12: Include file

(missingIncludeSystem)


[information] 13-13: Include file

(missingIncludeSystem)


[information] 14-14: Include file

(missingIncludeSystem)


[information] 16-16: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 8-8: Include file

(missingIncludeSystem)


[information] 11-11: Include file

(missingIncludeSystem)


[information] 12-12: Include file

(missingIncludeSystem)


[information] 13-13: Include file

(missingIncludeSystem)


[information] 14-14: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 18-18: Include file

(missingIncludeSystem)


[information] 19-19: Include file

(missingIncludeSystem)


[information] 20-20: Include file

(missingIncludeSystem)


[information] 23-23: Include file

(missingInclude)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 15-15: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 8-8: Include file

(missingIncludeSystem)


[information] 9-9: Include file

(missingIncludeSystem)


[information] 10-10: Include file

(missingIncludeSystem)


[information] 11-11: Include file

(missingIncludeSystem)


[information] 12-12: Include file

(missingIncludeSystem)


[information] 13-13: Include file

(missingIncludeSystem)


[information] 14-14: Include file

(missingIncludeSystem)


[information] 15-15: Include file

(missingIncludeSystem)


[information] 2-2: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 2-2: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 2-2: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 2-2: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 8-8: Include file

(missingIncludeSystem)


[information] 9-9: Include file

(missingIncludeSystem)


[information] 12-12: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 31-31: Include file

(missingIncludeSystem)


[information] 32-32: Include file

(missingIncludeSystem)


[information] 33-33: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 8-8: Include file

(missingIncludeSystem)


[information] 9-9: Include file

(missingIncludeSystem)


[information] 10-10: Include file

(missingIncludeSystem)


[information] 11-11: Include file

(missingIncludeSystem)


[information] 12-12: Include file

(missingIncludeSystem)


[information] 13-13: Include file

(missingIncludeSystem)


[information] 14-14: Include file

(missingIncludeSystem)


[information] 20-20: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 8-8: Include file

(missingIncludeSystem)


[information] 10-10: Include file

(missingIncludeSystem)


[information] 13-13: Include file

(missingIncludeSystem)


[information] 14-14: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 15-15: Include file

(missingIncludeSystem)


[information] 16-16: Include file

(missingIncludeSystem)


[information] 17-17: Include file

(missingIncludeSystem)


[information] 18-18: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 8-8: Include file

(missingIncludeSystem)


[information] 10-10: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 2-2: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 2-2: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 8-8: Include file

(missingInclude)


[information] 11-11: Include file

(missingIncludeSystem)


[error] 134-134: There is an unknown macro here somewhere. Configuration is required. If DEPTHAI_NLOHMANN_DEFINE_TYPE_INTRUSIVE is a macro then please configure it.

(unknownMacro)


[information] 20-20: Include file

(missingIncludeSystem)


[information] 21-21: Include file

(missingIncludeSystem)

🔇 Additional comments (2)
bindings/python/src/CrashDumpBindings.cpp (2)

13-29: Well-designed caching pattern for extra dict synchronization.

The lazy initialization in getExtraDict and sync-back in syncExtraToNative correctly handle the copy semantics of pyjson::from_json/to_json conversions, ensuring Python users can mutate the extra dict naturally while keeping the C++ side in sync.


191-248: LGTM - Nested type bindings are complete and consistent.

All nested types within CrashDumpRVC2 are properly bound with constructors and member accessors. The DOC macro references correctly use CrashDumpRVC2 namespace throughout.

Comment thread bindings/python/src/CrashDumpBindings.cpp
Comment thread bindings/python/src/CrashDumpBindings.cpp
Comment thread bindings/python/src/CrashDumpBindings.cpp Outdated
Comment thread bindings/python/src/CrashDumpBindings.cpp
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/device/DeviceBase.cpp (1)

1194-1215: ⚠️ Potential issue | 🟠 Major

Keep hasCrashed() latched after a recovered crash.

Lines 1195 and 1214 re-derive crashed from hasCrashDump(). Because collectAndLogCrashDump() clears the device-side dump, a successful recovery flips hasCrashed() back to false, so callers lose the crash signal right after reconnection.

♻️ Suggested fix
-                    crashed = hasCrashDump();
+                    crashed.store(crashed.load() || hasCrashDump());
                     if(crashed && !crashDumpHandled.load()) {
                         collectAndLogCrashDump();
                     }
@@
-            crashed = hasCrashDump();
+            // Keep `crashed` latched for this device session.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/device/DeviceBase.cpp` around lines 1194 - 1215, The code currently
reassigns the local variable crashed from hasCrashDump() after calling
collectAndLogCrashDump(), which clears the dump and resets the crash signal;
change the logic so the crashed flag is latched once true and never flipped back
to false by subsequent hasCrashDump() calls. Concretely, in the reconnection
loop replace direct reassignments like crashed = hasCrashDump() with a latched
update (e.g., crashed = crashed || hasCrashDump()) or only set crashed when it
is currently false, ensuring collectAndLogCrashDump(), hasCrashDump(), and the
local variable crashed preserve the “crashed” state across reconnection and
callback handling.
♻️ Duplicate comments (3)
src/device/DeviceBase.cpp (3)

460-483: ⚠️ Potential issue | 🟠 Major

Move crashDumpHandled below the callback/logging path.

Line 465 marks the dump as handled before the user callback and logCrashDump() run. If either throws, later paths suppress retries and shutdown can unwind with the dump neither persisted nor uploaded.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/device/DeviceBase.cpp` around lines 460 - 483, The code marks
crashDumpHandled (in DeviceBase::collectAndLogCrashDump) too early; move the
crashDumpHandled.store(true) so it is set only after the user callback
(crashdumpCallback) and the log/save/upload path (logCollection::logCrashDump)
complete successfully to avoid suppressing retries when those operations throw;
locate crashDumpHandled, crashdumpCallback, and the call to
logCollection::logCrashDump and update the control flow so you copy and invoke
crashdumpCallback, run the DEPTHAI_CRASHDUMP check and logCrashDump, and only
then call crashDumpHandled.store(true) (preserving the existing mutex around
crashdumpCallback and keeping behavior when crashDump is null).

1156-1168: ⚠️ Potential issue | 🟠 Major

Treat DESTROYED as crashed in the monitor path.

This branch only checks DeviceGate::SessionState::CRASHED. Sessions that jump straight to DESTROYED miss collectAndLogCrashDump(), even though the shutdown path already treats DESTROYED as a crash.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/device/DeviceBase.cpp` around lines 1156 - 1168, The monitor path only
marks a session as crashed when gate->getState() ==
DeviceGate::SessionState::CRASHED, so sessions that jump to
DeviceGate::SessionState::DESTROYED never trigger collectAndLogCrashDump();
update the check in the monitoring block (the gate->getState() conditional that
sets crashed) to treat DESTROYED the same as CRASHED (e.g., set crashed = true
when state == CRASHED || state == DESTROYED) so crashDumpHandled and
collectAndLogCrashDump() are invoked consistently with the shutdown path.

492-513: ⚠️ Potential issue | 🔴 Critical

Keep polling until the reboot state is observed.

while(!found && ...) exits on the first getDeviceById() hit, even if the device is still reported in its old state. That turns a reboot-in-progress into a false timeout and skips crash-dump collection.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/device/DeviceBase.cpp` around lines 492 - 513, The loop currently exits
as soon as getDeviceById returns found regardless of the device's state, which
can treat an in-progress reboot as a timeout; change the polling condition and
body so you continue looping until a reboot state is observed (i.e.
rebootingDeviceInfo.state == X_LINK_UNBOOTED or X_LINK_BOOTLOADER) or the
timeout elapses: call XLinkConnection::getDeviceById in the do/while as shown,
update the loop condition to check both time and that the found device is in a
reboot state (use the rebootingDeviceInfo/state check rather than stopping on
found alone), and only run the crash-dump handling (collectAndLogCrashDump on
DeviceBase rebootingDevice) once you have confirmed the reboot state; refer to
getDeviceById, rebootingDeviceInfo, found, DeviceBase::DeviceBase(...) and
collectAndLogCrashDump to locate and modify the logic.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@bindings/python/src/DeviceBindings.cpp`:
- Around line 559-584: The current wrappers for
DeviceBase::registerCrashdumpCallback and DeviceBase::removeCrashdumpCallback
release the GIL (py::gil_scoped_release) while copying/destroying Python
callbacks, which is unsafe; remove the py::gil_scoped_release in both lambda
wrappers so the GIL is held while calling d.registerCrashdumpCallback(...) and
d.removeCrashdumpCallback(), keep the inner pythonCallback acquiring the GIL
(py::gil_scoped_acquire) when invoked, and leave the callback capture
([callback]) as-is so refcounting happens under the GIL.

---

Outside diff comments:
In `@src/device/DeviceBase.cpp`:
- Around line 1194-1215: The code currently reassigns the local variable crashed
from hasCrashDump() after calling collectAndLogCrashDump(), which clears the
dump and resets the crash signal; change the logic so the crashed flag is
latched once true and never flipped back to false by subsequent hasCrashDump()
calls. Concretely, in the reconnection loop replace direct reassignments like
crashed = hasCrashDump() with a latched update (e.g., crashed = crashed ||
hasCrashDump()) or only set crashed when it is currently false, ensuring
collectAndLogCrashDump(), hasCrashDump(), and the local variable crashed
preserve the “crashed” state across reconnection and callback handling.

---

Duplicate comments:
In `@src/device/DeviceBase.cpp`:
- Around line 460-483: The code marks crashDumpHandled (in
DeviceBase::collectAndLogCrashDump) too early; move the
crashDumpHandled.store(true) so it is set only after the user callback
(crashdumpCallback) and the log/save/upload path (logCollection::logCrashDump)
complete successfully to avoid suppressing retries when those operations throw;
locate crashDumpHandled, crashdumpCallback, and the call to
logCollection::logCrashDump and update the control flow so you copy and invoke
crashdumpCallback, run the DEPTHAI_CRASHDUMP check and logCrashDump, and only
then call crashDumpHandled.store(true) (preserving the existing mutex around
crashdumpCallback and keeping behavior when crashDump is null).
- Around line 1156-1168: The monitor path only marks a session as crashed when
gate->getState() == DeviceGate::SessionState::CRASHED, so sessions that jump to
DeviceGate::SessionState::DESTROYED never trigger collectAndLogCrashDump();
update the check in the monitoring block (the gate->getState() conditional that
sets crashed) to treat DESTROYED the same as CRASHED (e.g., set crashed = true
when state == CRASHED || state == DESTROYED) so crashDumpHandled and
collectAndLogCrashDump() are invoked consistently with the shutdown path.
- Around line 492-513: The loop currently exits as soon as getDeviceById returns
found regardless of the device's state, which can treat an in-progress reboot as
a timeout; change the polling condition and body so you continue looping until a
reboot state is observed (i.e. rebootingDeviceInfo.state == X_LINK_UNBOOTED or
X_LINK_BOOTLOADER) or the timeout elapses: call XLinkConnection::getDeviceById
in the do/while as shown, update the loop condition to check both time and that
the found device is in a reboot state (use the rebootingDeviceInfo/state check
rather than stopping on found alone), and only run the crash-dump handling
(collectAndLogCrashDump on DeviceBase rebootingDevice) once you have confirmed
the reboot state; refer to getDeviceById, rebootingDeviceInfo, found,
DeviceBase::DeviceBase(...) and collectAndLogCrashDump to locate and modify the
logic.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: d6f04c93-5ba1-43be-8779-1a50e41ef3f5

📥 Commits

Reviewing files that changed from the base of the PR and between 99377a8 and 9c0dec0.

📒 Files selected for processing (3)
  • bindings/python/src/DeviceBindings.cpp
  • include/depthai/device/DeviceBase.hpp
  • src/device/DeviceBase.cpp
📜 Review details
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2026-03-16T11:17:12.819Z
Learnt from: pheec
Repo: luxonis/depthai-core PR: 1715
File: include/depthai/pipeline/node/PointCloud.hpp:34-98
Timestamp: 2026-03-16T11:17:12.819Z
Learning: In `include/depthai/pipeline/node/PointCloud.hpp`, the nested `Impl` class inside `PointCloud` is intentionally public (not private/forward-declared) because the on-host unit tests in `tests/src/onhost_tests/point_cloud_test.cpp` directly access `Impl` methods such as `setIntrinsics`, `setExtrinsics`, `useCPU`, `useCPUMT`, `computePointCloudDense`, `applyTransformation`, and `filterValidPoints`. Do not suggest making `Impl` private or forward-declaring it.

Applied to files:

  • include/depthai/device/DeviceBase.hpp
  • src/device/DeviceBase.cpp
📚 Learning: 2026-03-17T08:07:19.141Z
Learnt from: JakubFara
Repo: luxonis/depthai-core PR: 1718
File: src/pipeline/node/AutoCalibration.cpp:167-216
Timestamp: 2026-03-17T08:07:19.141Z
Learning: In `src/pipeline/node/AutoCalibration.cpp`, the `getNewCalibration` method intentionally opens the gate once before the outer recalibration retry loop and closes it only at the end (or on success). There is no need to isolate gate state between individual recalibration attempts — this single open/close pattern is by design and should not be flagged as a bug in future reviews.

Applied to files:

  • src/device/DeviceBase.cpp
🧬 Code graph analysis (3)
include/depthai/device/DeviceBase.hpp (1)
src/device/CrashDumpManager.hpp (2)
  • clear (34-34)
  • clear (42-42)
bindings/python/src/DeviceBindings.cpp (2)
src/device/DeviceBase.cpp (26)
  • hasCrashed (646-648)
  • hasCrashed (646-646)
  • DeviceBase (357-357)
  • DeviceBase (359-361)
  • DeviceBase (363-367)
  • DeviceBase (369-371)
  • DeviceBase (373-373)
  • DeviceBase (375-375)
  • DeviceBase (377-379)
  • DeviceBase (381-383)
  • DeviceBase (385-388)
  • DeviceBase (390-392)
  • DeviceBase (394-396)
  • DeviceBase (437-440)
  • DeviceBase (442-444)
  • DeviceBase (650-652)
  • registerCrashdumpCallback (1570-1573)
  • registerCrashdumpCallback (1570-1570)
  • removeCrashdumpCallback (1575-1578)
  • removeCrashdumpCallback (1575-1575)
  • getSupportedDeviceModels (1429-1431)
  • getSupportedDeviceModels (1429-1429)
  • getPlatform (1908-1926)
  • getPlatform (1908-1908)
  • getPlatformAsString (1928-1930)
  • getPlatformAsString (1928-1928)
include/depthai/device/DeviceBase.hpp (5)
  • DeviceBase (172-172)
  • DeviceBase (178-178)
  • clearCrashDump (452-452)
  • callback (472-472)
  • callback (837-837)
src/device/DeviceBase.cpp (10)
include/depthai/device/DeviceBase.hpp (6)
  • device (967-967)
  • timeout (101-101)
  • timeout (117-117)
  • connection (860-862)
  • connection (867-869)
  • clear (969-969)
src/device/CrashDumpManager.cpp (4)
  • CrashDumpManager (30-34)
  • CrashDumpManager (36-38)
  • hasCrashDump (120-122)
  • hasCrashDump (120-120)
src/device/CrashDumpManager.hpp (6)
  • CrashDumpManager (17-17)
  • CrashDumpManager (19-19)
  • CrashDumpManager (22-22)
  • CrashDumpManager (26-26)
  • clear (34-34)
  • clear (42-42)
src/utility/LogCollection.cpp (2)
  • logCrashDump (175-247)
  • logCrashDump (175-175)
src/utility/LogCollection.hpp (1)
  • logCrashDump (12-12)
src/device/DeviceGate.cpp (6)
  • getState (568-574)
  • getState (568-568)
  • getState (576-609)
  • getState (576-576)
  • getState (611-659)
  • getState (611-611)
include/depthai/device/CrashDump.hpp (2)
  • RVC2 (204-206)
  • RVC4 (228-230)
include/depthai/utility/CircularBuffer.hpp (1)
  • runtime_error (219-224)
include/depthai/device/Platform.hpp (1)
  • platform2string (19-19)
src/device/Platform.cpp (2)
  • platform2string (9-19)
  • platform2string (9-9)
🪛 Cppcheck (2.20.0)
bindings/python/src/DeviceBindings.cpp

[information] 11-11: Include file

(missingIncludeSystem)


[information] 12-12: Include file

(missingIncludeSystem)


[information] 13-13: Include file

(missingIncludeSystem)


[information] 14-14: Include file

(missingIncludeSystem)


[information] 16-16: Include file

(missingIncludeSystem)


[information] 11-11: Include file

(missingIncludeSystem)


[information] 12-12: Include file

(missingIncludeSystem)


[information] 13-13: Include file

(missingIncludeSystem)


[information] 14-14: Include file

(missingIncludeSystem)


[information] 11-11: Include file

(missingIncludeSystem)


[information] 12-12: Include file

(missingIncludeSystem)


[information] 11-11: Include file

(missingIncludeSystem)


[information] 12-12: Include file

(missingIncludeSystem)


[information] 13-13: Include file

(missingIncludeSystem)


[information] 14-14: Include file

(missingIncludeSystem)


[information] 15-15: Include file

(missingIncludeSystem)


[information] 12-12: Include file

(missingIncludeSystem)


[information] 11-11: Include file

(missingIncludeSystem)


[information] 12-12: Include file

(missingIncludeSystem)


[information] 13-13: Include file

(missingIncludeSystem)


[information] 14-14: Include file

(missingIncludeSystem)


[information] 13-13: Include file

(missingIncludeSystem)


[information] 14-14: Include file

(missingIncludeSystem)


[information] 15-15: Include file

(missingIncludeSystem)


[information] 16-16: Include file

(missingIncludeSystem)


[information] 15-15: Include file

(missingIncludeSystem)


[information] 14-14: Include file

(missingIncludeSystem)


[information] 15-15: Include file

(missingIncludeSystem)


[information] 16-16: Include file

(missingIncludeSystem)


[information] 12-12: Include file

(missingInclude)


[information] 15-15: Include file

(missingIncludeSystem)

src/device/DeviceBase.cpp

[information] 33-33: Include file

(missingIncludeSystem)


[information] 33-33: Include file

(missingInclude)

Comment thread bindings/python/src/DeviceBindings.cpp Outdated
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 6

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/utility/Compression.cpp (1)

140-140: ⚠️ Potential issue | 🟡 Minor

archive_read_data() return value not checked.

archive_read_data() returns the number of bytes read, or a negative error code. If it fails or reads fewer bytes than expected, the output file will contain incomplete or corrupted data.

🛡️ Proposed fix
-                archive_read_data(a, buff.data(), size);
+                la_ssize_t bytesRead = archive_read_data(a, buff.data(), size);
+                if(bytesRead < 0 || static_cast<size_t>(bytesRead) != size) {
+                    outFileStream.close();
+                    throw std::runtime_error(fmt::format("Failed to read entry data for {}.", file));
+                }
                 outFileStream.write(reinterpret_cast<char*>(buff.data()), size);
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/utility/Compression.cpp` at line 140, In Compression.cpp, check the
return value of archive_read_data(a, buff.data(), size) (and any subsequent
calls if reading in a loop) instead of ignoring it: capture the
ssize_t/ssize_t-like return, treat negative values as errors (use
archive_error_string(a) for a message) and handle them by failing the
extraction/returning an error; if it returns 0 or fewer bytes than requested,
loop to read the remaining bytes until total_read == size (or handle EOF as an
error) and only write the buffer out when you have the expected amount, updating
the code around the archive_read_data call and any surrounding write logic to
abort and log on error.
♻️ Duplicate comments (1)
src/device/DeviceBase.cpp (1)

460-483: ⚠️ Potential issue | 🔴 Critical

Don’t let crash-dump handling exceptions escape this path.

Anything in here can throw: collection, the user callback, or logCollection::logCrashDump(...). In the closeImpl() call sites that can unwind DeviceBase::~DeviceBase() and terminate the process; in the monitor thread it aborts the rest of recovery.

♻️ Suggested fix
 void DeviceBase::collectAndLogCrashDump(DeviceBase* device) {
     if(!device) device = this;
-    auto crashDumpUnique = dai::CrashDumpManager(device).collectCrashDump();
-    std::shared_ptr<CrashDump> crashDump = std::move(crashDumpUnique);
-    if(crashDump) {
-        decltype(crashdumpCallback) callbackCopy;
-
-        // Create a copy of the callback function to avoid race conditions
-        // (user could set a new callback from within the callback, leading to a deadlock)
-        {
-            std::unique_lock<std::mutex> l(crashdumpCallbackMtx);
-            callbackCopy = crashdumpCallback;
-        }
-
-        if(callbackCopy) callbackCopy(crashDump);
-
-        // Only save/upload the crash dump when not explicitly disabled
-        auto crashDumpPathStr = utility::getEnvAs<std::string>("DEPTHAI_CRASHDUMP", "");
-        if(crashDumpPathStr == "0") {
-            pimpl->logger.warn("Firmware crashed but DEPTHAI_CRASHDUMP is set to 0, the crash dump will not be saved nor uploaded to the Luxonis servers.");
-        } else {
-            logCollection::logCrashDump(pipelineSchema, *crashDump, deviceInfo);
-        }
-        crashDumpHandled.store(true);
-    }
+    try {
+        auto crashDumpUnique = dai::CrashDumpManager(device).collectCrashDump();
+        std::shared_ptr<CrashDump> crashDump = std::move(crashDumpUnique);
+        if(!crashDump) return;
+
+        decltype(crashdumpCallback) callbackCopy;
+        {
+            std::unique_lock<std::mutex> l(crashdumpCallbackMtx);
+            callbackCopy = crashdumpCallback;
+        }
+
+        if(callbackCopy) callbackCopy(crashDump);
+
+        auto crashDumpPathStr = utility::getEnvAs<std::string>("DEPTHAI_CRASHDUMP", "");
+        if(crashDumpPathStr == "0") {
+            pimpl->logger.warn("Firmware crashed but DEPTHAI_CRASHDUMP is set to 0, the crash dump will not be saved nor uploaded to the Luxonis servers.");
+        } else {
+            logCollection::logCrashDump(pipelineSchema, *crashDump, deviceInfo);
+        }
+        crashDumpHandled.store(true);
+    } catch(const std::exception& ex) {
+        pimpl->logger.error("Crash dump handling failed: {}", ex.what());
+    } catch(...) {
+        pimpl->logger.error("Crash dump handling failed with a non-standard exception");
+    }
 }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/device/DeviceBase.cpp` around lines 460 - 483, The collectAndLogCrashDump
path can throw from dai::CrashDumpManager(device).collectCrashDump(), the user
callback (crashdumpCallback) or logCollection::logCrashDump(...) and must not
let exceptions escape; wrap the body of DeviceBase::collectAndLogCrashDump
(including the collectCrashDump call, the callback copy/invocation protected by
crashdumpCallbackMtx, and the logCollection::logCrashDump call) in a
try/catch(...) that catches all exceptions, logs the error via pimpl->logger
(with context), ensures crashDumpHandled.store(true) is still set, and prevents
rethrow so destructors/monitor threads aren’t unwound by exceptions. Ensure you
still respect DEPTHAI_CRASHDUMP logic inside the try block and handle nullptr
crashDump safely.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@bindings/python/src/DeviceBindings.cpp`:
- Around line 559-571: The python wrapper for CrashDump may be GC'd between
callback(dump) and the later py::cast(dump), losing _extra_dict changes; modify
the lambda passed to registerCrashdumpCallback so it casts dump to a py::object
once before invoking callback (i.e., create pyDump = py::cast(dump) while
holding the GIL), pass that same pyDump into the user's callback (or ensure
callback is invoked with pyDump rather than re-casting), then after callback
read pyDump.attr("_extra_dict") to sync into dump->extra; update the
pythonCallback closure in registerCrashdumpCallback accordingly to use the
single pyDump instance and preserve _extra_dict modifications.

In `@src/device/CrashDumpManager.cpp`:
- Around line 95-117: collectDumpRVC2 and collectDumpRVC4 must return nullptr
when no crash dump exists: in collectDumpRVC2, do not allocate CrashDumpRVC2
up-front—check hasCrashDump() first and if false return nullptr, otherwise
construct a CrashDumpRVC2 and populate crashReports via
devicePtr->getCrashReportCollectionRVC2(clear); in collectDumpRVC4, call
devicePtr->gate->getCrashDump() and if it returns nullptr return nullptr,
otherwise construct CrashDumpRVC4 and move gateDump->data and gateDump->filename
into it; additionally update DeviceBase::getState to construct a CrashDumpRVC2
directly where needed instead of calling collectCrashDump(false) so you don't
get an unconditional empty object.

In `@src/utility/Compression.cpp`:
- Line 115: The call to archive_read_new() stores its result in variable 'a' but
lacks a null check; mirror the defensive pattern used in filenamesInArchive by
testing if 'a' is nullptr immediately after archive_read_new(), handling the
error the same way (e.g., log or return the appropriate error/empty result and
avoid using 'a'), and ensure any allocated resources are cleaned up consistently
with the filenamesInArchive implementation.
- Around line 126-128: The size-check for filesInArchive vs filesOnDisk is
performed after creating the archive reader `a`, risking a resource leak if you
throw; move the validation (the if comparing filesInArchive.size() and
filesOnDisk.size()) to occur before opening/creating the archive reader `a` in
the function (or alternatively ensure `a` is properly freed/destroyed before
throwing), so that you either validate inputs up-front or release `a` prior to
throwing; update the code paths around the archive-open logic (the block that
constructs/uses `a`) accordingly.

In `@tests/src/ondevice_tests/crashdump_test.cpp`:
- Around line 12-13: The test mutates global env vars via
dai::utility::setEnv("DEPTHAI_CRASHDUMP", ...) and
setEnv("DEPTHAI_CRASH_DEVICE", ...) which leak into other Catch2 cases; fix by
saving the original values before calling setEnv (using the corresponding
get/env query helper or getenv), then restore those originals after the test
completes (use RAII, a scope guard/SCOPE_EXIT, or Catch2 teardown) for both
occurrences (the ones at setEnv lines and the other pair mentioned) so
crashdump/crashDevice behavior is returned to its prior state.
- Around line 15-27: The callback currently captures local objects (mtx, cv,
callbackInvoked, receivedDump) that may be destroyed before
dai::Device::~Device() releases the callback, causing a use-after-free; fix by
ensuring the captured state outlives the device — for example, make mtx, cv,
callbackInvoked and receivedDump heap-allocated (std::shared_ptr<std::mutex>,
std::shared_ptr<std::condition_variable>, std::shared_ptr<std::atomic<bool>>,
std::shared_ptr<dai::CrashDump>) and capture shared_ptr copies in the lambda
passed to device.registerCrashdumpCallback, OR explicitly unregister the
callback (device.unregisterCrashdumpCallback or equivalent) before destroying
the locals/device; update the code that references registerCrashdumpCallback and
any teardown path to guarantee the callback is removed or its captures are
shared_ptr-managed.

---

Outside diff comments:
In `@src/utility/Compression.cpp`:
- Line 140: In Compression.cpp, check the return value of archive_read_data(a,
buff.data(), size) (and any subsequent calls if reading in a loop) instead of
ignoring it: capture the ssize_t/ssize_t-like return, treat negative values as
errors (use archive_error_string(a) for a message) and handle them by failing
the extraction/returning an error; if it returns 0 or fewer bytes than
requested, loop to read the remaining bytes until total_read == size (or handle
EOF as an error) and only write the buffer out when you have the expected
amount, updating the code around the archive_read_data call and any surrounding
write logic to abort and log on error.

---

Duplicate comments:
In `@src/device/DeviceBase.cpp`:
- Around line 460-483: The collectAndLogCrashDump path can throw from
dai::CrashDumpManager(device).collectCrashDump(), the user callback
(crashdumpCallback) or logCollection::logCrashDump(...) and must not let
exceptions escape; wrap the body of DeviceBase::collectAndLogCrashDump
(including the collectCrashDump call, the callback copy/invocation protected by
crashdumpCallbackMtx, and the logCollection::logCrashDump call) in a
try/catch(...) that catches all exceptions, logs the error via pimpl->logger
(with context), ensures crashDumpHandled.store(true) is still set, and prevents
rethrow so destructors/monitor threads aren’t unwound by exceptions. Ensure you
still respect DEPTHAI_CRASHDUMP logic inside the try block and handle nullptr
crashDump safely.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 79dd8a38-d5d7-47b9-bf67-2186b24c2dc5

📥 Commits

Reviewing files that changed from the base of the PR and between 99377a8 and d7e579d.

📒 Files selected for processing (7)
  • bindings/python/src/CrashDumpBindings.cpp
  • bindings/python/src/DeviceBindings.cpp
  • include/depthai/device/DeviceBase.hpp
  • src/device/CrashDumpManager.cpp
  • src/device/DeviceBase.cpp
  • src/utility/Compression.cpp
  • tests/src/ondevice_tests/crashdump_test.cpp

Comment thread bindings/python/src/DeviceBindings.cpp
Comment thread src/device/CrashDumpManager.cpp
Comment thread src/utility/Compression.cpp
Comment thread src/utility/Compression.cpp Outdated
Comment thread tests/src/ondevice_tests/crashdump_test.cpp Outdated
Comment thread tests/src/ondevice_tests/crashdump_test.cpp Outdated
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/utility/Compression.cpp (1)

142-146: ⚠️ Potential issue | 🟠 Major

Check archive_read_data return value to detect extraction failures.

archive_read_data returns the number of bytes read, or a negative error code on failure. The current code assumes the full size bytes are read successfully. A partial read or error would silently produce a corrupt/incomplete output file.

🛠️ Proposed fix
                 size_t size = archive_entry_size(entry);
                 std::vector<uint8_t> buff(size);
-                archive_read_data(a, buff.data(), size);
-                outFileStream.write(reinterpret_cast<char*>(buff.data()), size);
+                la_ssize_t bytesRead = archive_read_data(a, buff.data(), size);
+                if(bytesRead < 0) {
+                    outFileStream.close();
+                    archive_read_free(a);
+                    throw std::runtime_error(fmt::format("Failed to read data for {} from archive.", file));
+                }
+                outFileStream.write(reinterpret_cast<char*>(buff.data()), static_cast<std::streamsize>(bytesRead));
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/utility/Compression.cpp` around lines 142 - 146, archive_read_data call
result is not checked after allocating buffer based on
archive_entry_size(entry), so partial reads or negative error codes will produce
corrupt output; update the extraction logic around archive_entry_size(entry),
archive_read_data(...), and outFileStream so you: call archive_read_data in a
loop (or repeatedly call until total bytes read == size), check each return
value for negative errors, handle short reads by accumulating bytes into buff,
and on error close outFileStream and remove the partial file and surface/log the
archive error (use archive_error_string or equivalent); ensure you treat a
negative return as failure and only write outFileStream when the expected total
bytes have been read.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@src/utility/Compression.cpp`:
- Around line 142-146: archive_read_data call result is not checked after
allocating buffer based on archive_entry_size(entry), so partial reads or
negative error codes will produce corrupt output; update the extraction logic
around archive_entry_size(entry), archive_read_data(...), and outFileStream so
you: call archive_read_data in a loop (or repeatedly call until total bytes read
== size), check each return value for negative errors, handle short reads by
accumulating bytes into buff, and on error close outFileStream and remove the
partial file and surface/log the archive error (use archive_error_string or
equivalent); ensure you treat a negative return as failure and only write
outFileStream when the expected total bytes have been read.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: cc429af0-f7c5-4200-bfd6-72f0ac1b2d06

📥 Commits

Reviewing files that changed from the base of the PR and between d7e579d and 24a0c95.

📒 Files selected for processing (5)
  • bindings/python/src/DeviceBindings.cpp
  • include/depthai/device/DeviceBase.hpp
  • src/device/CrashDumpManager.hpp
  • src/utility/Compression.cpp
  • tests/src/ondevice_tests/crashdump_test.cpp
📜 Review details
🧰 Additional context used
🧠 Learnings (3)
📚 Learning: 2026-03-17T08:07:19.141Z
Learnt from: JakubFara
Repo: luxonis/depthai-core PR: 1718
File: src/pipeline/node/AutoCalibration.cpp:167-216
Timestamp: 2026-03-17T08:07:19.141Z
Learning: In `src/pipeline/node/AutoCalibration.cpp`, the `getNewCalibration` method intentionally opens the gate once before the outer recalibration retry loop and closes it only at the end (or on success). There is no need to isolate gate state between individual recalibration attempts — this single open/close pattern is by design and should not be flagged as a bug in future reviews.

Applied to files:

  • tests/src/ondevice_tests/crashdump_test.cpp
📚 Learning: 2026-03-13T19:40:56.303Z
Learnt from: MaticTonin
Repo: luxonis/depthai-core PR: 1718
File: src/pipeline/node/AutoCalibration.cpp:327-330
Timestamp: 2026-03-13T19:40:56.303Z
Learning: In `src/pipeline/node/AutoCalibration.cpp`, the hard-coded 1280x800 resolution check in `AutoCalibration::validateIncomingData()` is intentional. The AutoCalibration node in the depthai-core (C++) project is designed to support only 1280x800 sensor resolution and this constraint should not be flagged as a usability issue in future reviews.

Applied to files:

  • tests/src/ondevice_tests/crashdump_test.cpp
📚 Learning: 2026-03-16T11:17:12.819Z
Learnt from: pheec
Repo: luxonis/depthai-core PR: 1715
File: include/depthai/pipeline/node/PointCloud.hpp:34-98
Timestamp: 2026-03-16T11:17:12.819Z
Learning: In `include/depthai/pipeline/node/PointCloud.hpp`, the nested `Impl` class inside `PointCloud` is intentionally public (not private/forward-declared) because the on-host unit tests in `tests/src/onhost_tests/point_cloud_test.cpp` directly access `Impl` methods such as `setIntrinsics`, `setExtrinsics`, `useCPU`, `useCPUMT`, `computePointCloudDense`, `applyTransformation`, and `filterValidPoints`. Do not suggest making `Impl` private or forward-declaring it.

Applied to files:

  • include/depthai/device/DeviceBase.hpp
🧬 Code graph analysis (2)
bindings/python/src/DeviceBindings.cpp (2)
src/device/DeviceBase.cpp (24)
  • hasCrashed (646-648)
  • hasCrashed (646-646)
  • DeviceBase (357-357)
  • DeviceBase (359-361)
  • DeviceBase (363-367)
  • DeviceBase (369-371)
  • DeviceBase (373-373)
  • DeviceBase (375-375)
  • DeviceBase (377-379)
  • DeviceBase (381-383)
  • DeviceBase (385-388)
  • DeviceBase (390-392)
  • DeviceBase (394-396)
  • DeviceBase (437-440)
  • DeviceBase (442-444)
  • DeviceBase (650-652)
  • registerCrashdumpCallback (1571-1574)
  • registerCrashdumpCallback (1571-1571)
  • removeCrashdumpCallback (1576-1579)
  • removeCrashdumpCallback (1576-1576)
  • getPlatform (1909-1923)
  • getPlatform (1909-1909)
  • getPlatformAsString (1925-1927)
  • getPlatformAsString (1925-1925)
include/depthai/device/DeviceBase.hpp (5)
  • DeviceBase (172-172)
  • DeviceBase (178-178)
  • clearCrashDump (452-452)
  • callback (472-472)
  • callback (837-837)
src/device/CrashDumpManager.hpp (2)
src/device/CrashDumpManager.cpp (4)
  • CrashDumpManager (30-34)
  • CrashDumpManager (36-38)
  • other (40-46)
  • other (40-40)
include/depthai/device/DeviceBase.hpp (1)
  • clear (969-969)
🪛 Cppcheck (2.20.0)
tests/src/ondevice_tests/crashdump_test.cpp

[information] 1-1: Include file

(missingIncludeSystem)


[information] 2-2: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 2-2: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 2-2: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 8-8: Include file

(missingIncludeSystem)


[information] 11-11: Include file

(missingIncludeSystem)


[information] 12-12: Include file

(missingIncludeSystem)


[information] 13-13: Include file

(missingIncludeSystem)


[information] 14-14: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 8-8: Include file

(missingIncludeSystem)


[information] 9-9: Include file

(missingIncludeSystem)


[information] 10-10: Include file

(missingIncludeSystem)


[information] 11-11: Include file

(missingIncludeSystem)


[information] 12-12: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 8-8: Include file

(missingIncludeSystem)


[information] 9-9: Include file

(missingIncludeSystem)


[information] 10-10: Include file

(missingIncludeSystem)


[information] 11-11: Include file

(missingIncludeSystem)


[information] 12-12: Include file

(missingIncludeSystem)


[information] 13-13: Include file

(missingIncludeSystem)


[information] 14-14: Include file

(missingIncludeSystem)


[information] 15-15: Include file

(missingIncludeSystem)


[information] 2-2: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 2-2: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 8-8: Include file

(missingIncludeSystem)


[information] 9-9: Include file

(missingIncludeSystem)


[information] 12-12: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 31-31: Include file

(missingIncludeSystem)


[information] 32-32: Include file

(missingIncludeSystem)


[information] 33-33: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 8-8: Include file

(missingIncludeSystem)


[information] 9-9: Include file

(missingIncludeSystem)


[information] 10-10: Include file

(missingIncludeSystem)


[information] 11-11: Include file

(missingIncludeSystem)


[information] 12-12: Include file

(missingIncludeSystem)


[information] 13-13: Include file

(missingIncludeSystem)


[information] 14-14: Include file

(missingIncludeSystem)


[information] 20-20: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 8-8: Include file

(missingIncludeSystem)


[information] 10-10: Include file

(missingIncludeSystem)


[information] 13-13: Include file

(missingIncludeSystem)


[information] 14-14: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 15-15: Include file

(missingIncludeSystem)


[information] 16-16: Include file

(missingIncludeSystem)


[information] 17-17: Include file

(missingIncludeSystem)


[information] 18-18: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 8-8: Include file

(missingIncludeSystem)


[information] 10-10: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 2-2: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 2-2: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 15-15: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingInclude)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 9-9: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 8-8: Include file

(missingIncludeSystem)


[information] 9-9: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 2-2: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 14-14: Include file

(missingIncludeSystem)


[information] 15-15: Include file

(missingIncludeSystem)


[information] 16-16: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 26-26: Include file

(missingIncludeSystem)


[information] 2-2: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 2-2: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 1-1: Include file

(missingIncludeSystem)


[information] 2-2: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 2-2: Include file

(missingIncludeSystem)


[information] 17-17: Include file

(missingInclude)


[information] 18-18: Include file

(missingInclude)


[information] 19-19: Include file

(missingInclude)


[information] 20-20: Include file

(missingInclude)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 2-2: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 8-8: Include file

(missingIncludeSystem)


[information] 9-9: Include file

(missingIncludeSystem)


[information] 10-10: Include file

(missingIncludeSystem)


[information] 11-11: Include file

(missingIncludeSystem)


[information] 12-12: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 11-11: Include file

(missingIncludeSystem)


[information] 12-12: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 8-8: Include file

(missingIncludeSystem)


[information] 9-9: Include file

(missingIncludeSystem)


[information] 10-10: Include file

(missingIncludeSystem)


[information] 14-14: Include file

(missingIncludeSystem)


[information] 9-9: Include file

(missingIncludeSystem)


[information] 10-10: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 12-12: Include file

(missingIncludeSystem)


[information] 13-13: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 8-8: Include file

(missingIncludeSystem)


[information] 9-9: Include file

(missingIncludeSystem)


[information] 10-10: Include file

(missingIncludeSystem)


[information] 11-11: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 8-8: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 8-8: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 10-10: Include file

(missingIncludeSystem)


[information] 8-8: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 2-2: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 9-9: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 9-9: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 2-2: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 8-8: Include file

(missingIncludeSystem)


[information] 9-9: Include file

(missingIncludeSystem)


[information] 10-10: Include file

(missingIncludeSystem)


[information] 11-11: Include file

(missingIncludeSystem)


[information] 12-12: Include file

(missingIncludeSystem)


[information] 13-13: Include file

(missingIncludeSystem)


[information] 2-2: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[error] 23-23: There is an unknown macro here somewhere. Configuration is required. If DEPTHAI_NLOHMANN_DEFINE_TYPE_INTRUSIVE is a macro then please configure it.

(unknownMacro)


[information] 20-20: Include file

(missingIncludeSystem)


[information] 21-21: Include file

(missingIncludeSystem)


[information] 10-10: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 12-12: Include file

(missingIncludeSystem)


[information] 13-13: Include file

(missingIncludeSystem)


[information] 25-25: Include file

(missingIncludeSystem)


[information] 26-26: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 15-15: Include file

(missingIncludeSystem)


[information] 16-16: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 8-8: Include file

(missingIncludeSystem)


[information] 9-9: Include file

(missingIncludeSystem)


[information] 10-10: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 13-13: Include file

(missingIncludeSystem)


[information] 14-14: Include file

(missingIncludeSystem)

bindings/python/src/DeviceBindings.cpp

[information] 11-11: Include file

(missingIncludeSystem)


[information] 12-12: Include file

(missingIncludeSystem)


[information] 13-13: Include file

(missingIncludeSystem)


[information] 14-14: Include file

(missingIncludeSystem)


[information] 16-16: Include file

(missingIncludeSystem)


[information] 11-11: Include file

(missingIncludeSystem)


[information] 12-12: Include file

(missingIncludeSystem)


[information] 13-13: Include file

(missingIncludeSystem)


[information] 14-14: Include file

(missingIncludeSystem)


[information] 11-11: Include file

(missingIncludeSystem)


[information] 12-12: Include file

(missingIncludeSystem)


[information] 11-11: Include file

(missingIncludeSystem)


[information] 12-12: Include file

(missingIncludeSystem)


[information] 13-13: Include file

(missingIncludeSystem)


[information] 14-14: Include file

(missingIncludeSystem)


[information] 15-15: Include file

(missingIncludeSystem)


[information] 12-12: Include file

(missingIncludeSystem)


[information] 11-11: Include file

(missingIncludeSystem)


[information] 12-12: Include file

(missingIncludeSystem)


[information] 13-13: Include file

(missingIncludeSystem)


[information] 14-14: Include file

(missingIncludeSystem)


[information] 13-13: Include file

(missingIncludeSystem)


[information] 14-14: Include file

(missingIncludeSystem)


[information] 15-15: Include file

(missingIncludeSystem)


[information] 16-16: Include file

(missingIncludeSystem)


[information] 15-15: Include file

(missingIncludeSystem)


[information] 14-14: Include file

(missingIncludeSystem)


[information] 15-15: Include file

(missingIncludeSystem)


[information] 16-16: Include file

(missingIncludeSystem)


[information] 12-12: Include file

(missingInclude)


[information] 15-15: Include file

(missingIncludeSystem)

src/utility/Compression.cpp

[style] 64-64: The function 'archiveFiles' is never used.

(unusedFunction)


[style] 70-70: The function 'archiveFilesCompressed' is never used.

(unusedFunction)


[style] 76-76: The function 'filenamesInArchive' is never used.

(unusedFunction)


[style] 108-108: The function 'extractFiles' is never used.

(unusedFunction)

🔇 Additional comments (15)
src/utility/Compression.cpp (3)

30-50: Missing error handling for archive creation and file operations.

Several critical operations still lack error checks:

  1. archive_write_new() at line 30 can return NULL on allocation failure
  2. archive_write_open_filename*() at lines 34/36 returns a status that is ignored
  3. fileStream.open() at line 50 is not validated before reading
  4. std::filesystem::file_size(file) at line 46 can throw if file doesn't exist

These gaps could lead to null pointer dereference or silent data corruption.

🛠️ Proposed fix
     a = archive_write_new();
+    if(a == nullptr) {
+        throw std::runtime_error("Could not create archive writer.");
+    }
     if(gzip) archive_write_add_filter_gzip(a);  // add gzip filter if requested
     archive_write_set_format_pax_restricted(a);
 `#ifdef` _WIN32
-    archive_write_open_filename_w(a, archivePath.c_str());
+    int r = archive_write_open_filename_w(a, archivePath.c_str());
 `#else`
-    archive_write_open_filename(a, archivePath.c_str());
+    int r = archive_write_open_filename(a, archivePath.c_str());
 `#endif`
+    if(r != ARCHIVE_OK) {
+        archive_write_free(a);
+        throw std::runtime_error(fmt::format("Could not open archive for writing: {}", archivePath));
+    }
     for(size_t i = 0; i < filesOnDisk.size(); i++) {
         const auto& file = filesOnDisk[i];
         const std::string& outFile = filesInArchive[i];
         entry = archive_entry_new();
         archive_entry_set_pathname(entry, outFile.c_str());
         archive_entry_set_filetype(entry, AE_IFREG);
         archive_entry_set_perm(entry, 0644);

-        auto entrysize = static_cast<la_int64_t>(std::filesystem::file_size(file));
+        std::error_code ec;
+        auto entrysize = static_cast<la_int64_t>(std::filesystem::file_size(file, ec));
+        if(ec) {
+            archive_entry_free(entry);
+            archive_write_close(a);
+            archive_write_free(a);
+            throw std::runtime_error(fmt::format("Could not get file size for {}: {}", file, ec.message()));
+        }
         archive_entry_set_size(entry, entrysize);

         archive_write_header(a, entry);
         fileStream.open(file, std::ios::binary);
+        if(!fileStream) {
+            archive_entry_free(entry);
+            archive_write_close(a);
+            archive_write_free(a);
+            throw std::runtime_error(fmt::format("Could not open file {} for reading.", file));
+        }

64-74: LGTM!

Clean wrapper functions providing a clear public API for compressed vs uncompressed archives.


76-106: LGTM!

Well-structured archive listing with proper null checks, consistent Windows handling, and clean resource cleanup.

bindings/python/src/DeviceBindings.cpp (4)

559-577: Pass pyDump to callback to guarantee modifications are synced.

The comment on line 565 states the intent to "Keep one stable Python wrapper alive," but line 567 passes the C++ dump instead of pyDump. While pybind11's object cache may return the same wrapper, this behavior isn't guaranteed—if the cache entry is evicted or GC'd between py::cast(dump) and the internal conversion inside callback(dump), a new wrapper is created and user modifications to _extra_dict are lost during sync.

To reliably sync modifications, use py::function and pass the Python object directly:

♻️ Suggested fix
         .def(
             "registerCrashdumpCallback",
-            [](DeviceBase& d, std::function<void(std::shared_ptr<CrashDump>)> callback) {
-                // Create a python-compatible callback function that acquires the GIL
-                auto pythonCallback = [callback](std::shared_ptr<CrashDump> dump) {
+            [](DeviceBase& d, py::function callback) {
+                auto pythonCallback = [callback = std::move(callback)](std::shared_ptr<CrashDump> dump) {
                     py::gil_scoped_acquire acquire;
-                    // Keep one stable Python wrapper alive across callback and sync.
                     py::object pyDump = py::cast(dump);
-                    callback(dump);
+                    callback(pyDump);

                     // After callback, sync _extra_dict to native extra
                     if(py::hasattr(pyDump, "_extra_dict")) {

308-308: LGTM!

The hasCrashed binding is correctly exposed without releasing the GIL, which is appropriate since it only reads an atomic boolean.


388-408: LGTM!

The explicit return types -> std::shared_ptr<CrashDump> for getCrashDump and getState properly match the updated C++ API signatures.


869-871: LGTM!

Platform accessors are correctly bound directly to DeviceBase without GIL release, which is appropriate for simple getter methods.

tests/src/ondevice_tests/crashdump_test.cpp (2)

1-42: LGTM! Test structure and callback lifetime are correct.

The callback test properly declares device after the captured variables (mtx, cv, callbackInvoked, receivedDump) on lines 15-19, ensuring the captures remain valid during Device::~Device() shutdown. The 60-second timeout with condition variable is appropriate for crash detection scenarios.


44-60: LGTM! Polling approach is well-implemented.

The polling loop with 200ms intervals and a 12-second deadline is a robust approach for detecting crash state changes, avoiding both unnecessarily long waits and flaky timing issues.

src/device/CrashDumpManager.hpp (1)

15-46: LGTM! Move semantics are correctly implemented.

The move constructor and move assignment operator are correctly declared as noexcept, and based on the implementation in CrashDumpManager.cpp, they properly nullify the source's devicePtr to prevent double-use issues. The class design with platform-specific collection helpers is clean and follows good ownership patterns.

include/depthai/device/DeviceBase.hpp (5)

46-55: LGTM!

The forward declaration and friend class relationship for CrashDumpManager is appropriate to allow internal access during crash dump collection while maintaining encapsulation.


269-279: LGTM!

Platform query APIs are well-documented and provide both enum and string representations for flexibility.


445-452: Note: Breaking API change for crash dump methods.

getState() and getCrashDump() now return std::unique_ptr<CrashDump> instead of value types. This is a breaking change for existing callers that may assign to CrashDump values directly. The change is appropriate for the new polymorphic crash dump architecture but warrants mention in release notes.


830-849: LGTM!

The crash dump callback API is well-designed:

  • registerCrashdumpCallback takes std::shared_ptr<CrashDump> allowing callbacks to modify the dump before storage
  • Single callback model (register replaces previous) is documented clearly
  • hasCrashed() provides a non-blocking way to poll crash state

978-985: LGTM!

Thread safety is properly implemented with mutex protection for the callback and atomic flags for crash state tracking.

Comment thread src/device/DeviceBase.cpp
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/utility/LogCollection.cpp (1)

241-248: ⚠️ Potential issue | 🟡 Minor

Populate the pipeline filename before building the multipart payload.

This branch fills content and sha1Hash but never sets pipelineData->name. sendLogsToServer() uses that field as the multipart filename, so crashdump uploads with an attached pipeline currently send an unnamed file.

📎 Proposed fix
     if(pipelineSchema) {
         pipelineData = FileWithSHA1{};
         std::string pipelineJson = nlohmann::json(*pipelineSchema).dump();
         std::string pipelineSHA1 = calculateSHA1(pipelineJson);
         pipelineData->content = std::move(pipelineJson);
         pipelineData->sha1Hash = std::move(pipelineSHA1);
+        pipelineData->name = "pipeline.json";
     }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/utility/LogCollection.cpp` around lines 241 - 248, The pipelineFile
branch constructs a FileWithSHA1 (pipelineData) and sets content and sha1Hash
but never sets the name, so sendLogsToServer() will attach an unnamed multipart
file; update the pipelineData initialization in the pipelineSchema branch (where
pipelineData, pipelineJson, pipelineSHA1 are created) to also set
pipelineData->name to a meaningful filename (e.g., "pipeline.json" or derive
from pipelineSchema) before returning/using it so sendLogsToServer() receives a
populated filename for the multipart upload.
♻️ Duplicate comments (1)
src/device/DeviceBase.cpp (1)

497-506: ⚠️ Potential issue | 🔴 Critical

Keep callback and persistence failures inside collectAndLogCrashDump().

This helper runs on the shutdown path. If the registered callback or logCollection::logCrashDump() throws here, the exception escapes close(), and ~DeviceBase() can terminate the process during cleanup.

🛡️ Proposed fix
-        if(callbackCopy) callbackCopy(crashDump);
-
-        // Only save/upload the crash dump when not explicitly disabled
-        auto crashDumpPathStr = utility::getEnvAs<std::string>("DEPTHAI_CRASHDUMP", "", false);
-        if(crashDumpPathStr == "0") {
-            pimpl->logger.warn("Firmware crashed but DEPTHAI_CRASHDUMP is set to 0, the crash dump will not be saved nor uploaded to the Luxonis servers.");
-        } else {
-            logCollection::logCrashDump(pipelineSchema, *crashDump, deviceInfo);
-        }
-        crashDumpHandled.store(true);
+        try {
+            if(callbackCopy) callbackCopy(crashDump);
+        } catch(const std::exception& ex) {
+            pimpl->logger.error("Crashdump callback threw: {}", ex.what());
+        } catch(...) {
+            pimpl->logger.error("Crashdump callback threw");
+        }
+
+        try {
+            // Only save/upload the crash dump when not explicitly disabled
+            auto crashDumpPathStr = utility::getEnvAs<std::string>("DEPTHAI_CRASHDUMP", "", false);
+            if(crashDumpPathStr == "0") {
+                pimpl->logger.warn("Firmware crashed but DEPTHAI_CRASHDUMP is set to 0, the crash dump will not be saved nor uploaded to the Luxonis servers.");
+            } else {
+                logCollection::logCrashDump(pipelineSchema, *crashDump, deviceInfo);
+            }
+            crashDumpHandled.store(true);
+        } catch(const std::exception& ex) {
+            pimpl->logger.error("Failed to persist crashdump: {}", ex.what());
+        }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/device/DeviceBase.cpp` around lines 497 - 506, The code in
collectAndLogCrashDump() currently calls callbackCopy(crashDump) and
logCollection::logCrashDump(...) directly which can throw and escape through
close()/~DeviceBase(); wrap the callback invocation and the persistence/upload
call (callbackCopy and logCollection::logCrashDump) each in try/catch blocks so
any exception is caught and logged via pimpl->logger.error (or warn) and does
not propagate, and ensure crashDumpHandled.store(true) still runs (use a
finally-style guarantee or catch around both calls) so the shutdown path cannot
terminate the process in DeviceBase::~DeviceBase().
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/device/DeviceBase.cpp`:
- Around line 1238-1242: The code overwrites the buffered crash flag `crashed`
with the current `hasCrashDump()` result causing the "crashed" state to be lost;
change the assignment to make `crashed` sticky (e.g., set `crashed = crashed ||
hasCrashDump()`) so once a crash is observed it stays true, and apply the same
change at the other occurrence (the block around
`crashDumpHandled`/`collectAndLogCrashDump()` referenced in the comment); ensure
existing `crashDumpHandled.load()` and `collectAndLogCrashDump()` behavior
remains unchanged.

In `@src/device/DeviceGate.cpp`:
- Around line 721-736: The polling loop in waitForSessionEnd()/DeviceGate is
treating SessionState::NOT_CREATED as transient and continues sleeping forever;
change the switch so SessionState::NOT_CREATED is handled as a terminal state
(like ERROR_STATE/STOPPED/CRASHED/DESTROYED) and return immediately instead of
breaking, i.e., move SessionState::NOT_CREATED out of the break group and add a
return branch for it to avoid indefinite polling when session creation never
completed.

In `@tests/src/ondevice_tests/crashdump_test.cpp`:
- Around line 22-24: The negative-path assertions use NO_CALLBACK_TIMEOUT (5s)
but the allowed callback window is CRASH_DUMP_CALLBACK_TIMEOUT (30s); update
calls to waitForNoCallback() (and any related negative checks in the crashdump
test functions) to use CRASH_DUMP_CALLBACK_TIMEOUT instead of
NO_CALLBACK_TIMEOUT so the test waits the full allowed 30s and catches callbacks
that occur in the 6–30s window; ensure the change is applied for all occurrences
(including the other instances referenced around lines 143–145) and keep
CRASH_DUMP_FILE_TIMEOUT untouched.

---

Outside diff comments:
In `@src/utility/LogCollection.cpp`:
- Around line 241-248: The pipelineFile branch constructs a FileWithSHA1
(pipelineData) and sets content and sha1Hash but never sets the name, so
sendLogsToServer() will attach an unnamed multipart file; update the
pipelineData initialization in the pipelineSchema branch (where pipelineData,
pipelineJson, pipelineSHA1 are created) to also set pipelineData->name to a
meaningful filename (e.g., "pipeline.json" or derive from pipelineSchema) before
returning/using it so sendLogsToServer() receives a populated filename for the
multipart upload.

---

Duplicate comments:
In `@src/device/DeviceBase.cpp`:
- Around line 497-506: The code in collectAndLogCrashDump() currently calls
callbackCopy(crashDump) and logCollection::logCrashDump(...) directly which can
throw and escape through close()/~DeviceBase(); wrap the callback invocation and
the persistence/upload call (callbackCopy and logCollection::logCrashDump) each
in try/catch blocks so any exception is caught and logged via
pimpl->logger.error (or warn) and does not propagate, and ensure
crashDumpHandled.store(true) still runs (use a finally-style guarantee or catch
around both calls) so the shutdown path cannot terminate the process in
DeviceBase::~DeviceBase().
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: a49eb804-050a-4d20-8ec6-f63c1396ab8b

📥 Commits

Reviewing files that changed from the base of the PR and between 24a0c95 and 94647f7.

📒 Files selected for processing (7)
  • README.md
  • bindings/python/src/CrashDumpBindings.cpp
  • include/depthai/device/DeviceBase.hpp
  • src/device/DeviceBase.cpp
  • src/device/DeviceGate.cpp
  • src/utility/LogCollection.cpp
  • tests/src/ondevice_tests/crashdump_test.cpp
📜 Review details
🧰 Additional context used
🧠 Learnings (6)
📚 Learning: 2026-03-23T09:35:34.824Z
Learnt from: aljazkonec1
Repo: luxonis/depthai-core PR: 1728
File: protos/common.proto:20-25
Timestamp: 2026-03-23T09:35:34.824Z
Learning: In the depthai-core repository (luxonis/depthai-core), the `LengthUnit` and `CameraBoardSocket` enums (defined in both C++ headers and `protos/common.proto`) are already released as public API and must not have their existing enumerator values changed or have new zero-value "UNSPECIFIED" entries prepended, as that would break existing user code and serialized data.

Applied to files:

  • README.md
📚 Learning: 2026-03-24T22:39:05.647Z
Learnt from: MaticTonin
Repo: luxonis/depthai-core PR: 1732
File: src/pipeline/Pipeline.cpp:705-705
Timestamp: 2026-03-24T22:39:05.647Z
Learning: In `src/pipeline/Pipeline.cpp`, within `PipelineImpl::build()`, the condition `autoCalibrationString != "OFF" && autoCalibrationString != ""` intentionally retains the empty-string check. Even though `utility::getEnvAs<std::string>("DEPTHAI_AUTOCALIBRATION", "ON_START")` provides a default of `"ON_START"`, the explicit `!= ""` guard is kept on purpose and should not be flagged as redundant in future reviews.

Applied to files:

  • tests/src/ondevice_tests/crashdump_test.cpp
  • src/utility/LogCollection.cpp
📚 Learning: 2026-03-17T08:07:19.141Z
Learnt from: JakubFara
Repo: luxonis/depthai-core PR: 1718
File: src/pipeline/node/AutoCalibration.cpp:167-216
Timestamp: 2026-03-17T08:07:19.141Z
Learning: In `src/pipeline/node/AutoCalibration.cpp`, the `getNewCalibration` method intentionally opens the gate once before the outer recalibration retry loop and closes it only at the end (or on success). There is no need to isolate gate state between individual recalibration attempts — this single open/close pattern is by design and should not be flagged as a bug in future reviews.

Applied to files:

  • tests/src/ondevice_tests/crashdump_test.cpp
  • src/device/DeviceGate.cpp
  • src/device/DeviceBase.cpp
📚 Learning: 2026-03-24T22:39:00.650Z
Learnt from: MaticTonin
Repo: luxonis/depthai-core PR: 1732
File: src/pipeline/Pipeline.cpp:662-662
Timestamp: 2026-03-24T22:39:00.650Z
Learning: In `src/pipeline/Pipeline.cpp`, the `DEPTHAI_AUTOCALIBRATION` environment variable intentionally defaults to `"ON_START"` (not `""`). This means auto-calibration is initialized by default for stereo pipelines at pipeline build time. The resulting implicit EEPROM/calibration writes on startup are by design and should not be flagged as a backward-incompatible change or unintended side-effect in future reviews.

Applied to files:

  • tests/src/ondevice_tests/crashdump_test.cpp
  • src/utility/LogCollection.cpp
  • src/device/DeviceBase.cpp
📚 Learning: 2026-03-13T19:40:56.303Z
Learnt from: MaticTonin
Repo: luxonis/depthai-core PR: 1718
File: src/pipeline/node/AutoCalibration.cpp:327-330
Timestamp: 2026-03-13T19:40:56.303Z
Learning: In `src/pipeline/node/AutoCalibration.cpp`, the hard-coded 1280x800 resolution check in `AutoCalibration::validateIncomingData()` is intentional. The AutoCalibration node in the depthai-core (C++) project is designed to support only 1280x800 sensor resolution and this constraint should not be flagged as a usability issue in future reviews.

Applied to files:

  • tests/src/ondevice_tests/crashdump_test.cpp
📚 Learning: 2026-03-16T11:17:12.819Z
Learnt from: pheec
Repo: luxonis/depthai-core PR: 1715
File: include/depthai/pipeline/node/PointCloud.hpp:34-98
Timestamp: 2026-03-16T11:17:12.819Z
Learning: In `include/depthai/pipeline/node/PointCloud.hpp`, the nested `Impl` class inside `PointCloud` is intentionally public (not private/forward-declared) because the on-host unit tests in `tests/src/onhost_tests/point_cloud_test.cpp` directly access `Impl` methods such as `setIntrinsics`, `setExtrinsics`, `useCPU`, `useCPUMT`, `computePointCloudDense`, `applyTransformation`, and `filterValidPoints`. Do not suggest making `Impl` private or forward-declaring it.

Applied to files:

  • include/depthai/device/DeviceBase.hpp
  • src/device/DeviceBase.cpp
🪛 Cppcheck (2.20.0)
tests/src/ondevice_tests/crashdump_test.cpp

[information] 1-1: Include file

(missingIncludeSystem)


[information] 2-2: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 8-8: Include file

(missingIncludeSystem)


[information] 9-9: Include file

(missingIncludeSystem)


[information] 10-10: Include file

(missingIncludeSystem)


[information] 11-11: Include file

(missingIncludeSystem)


[information] 12-12: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 2-2: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 2-2: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 8-8: Include file

(missingIncludeSystem)


[information] 11-11: Include file

(missingIncludeSystem)


[information] 12-12: Include file

(missingIncludeSystem)


[information] 13-13: Include file

(missingIncludeSystem)


[information] 14-14: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 8-8: Include file

(missingIncludeSystem)


[information] 9-9: Include file

(missingIncludeSystem)


[information] 10-10: Include file

(missingIncludeSystem)


[information] 11-11: Include file

(missingIncludeSystem)


[information] 12-12: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 8-8: Include file

(missingIncludeSystem)


[information] 9-9: Include file

(missingIncludeSystem)


[information] 10-10: Include file

(missingIncludeSystem)


[information] 11-11: Include file

(missingIncludeSystem)


[information] 12-12: Include file

(missingIncludeSystem)


[information] 13-13: Include file

(missingIncludeSystem)


[information] 14-14: Include file

(missingIncludeSystem)


[information] 15-15: Include file

(missingIncludeSystem)


[information] 2-2: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 2-2: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 8-8: Include file

(missingIncludeSystem)


[information] 9-9: Include file

(missingIncludeSystem)


[information] 12-12: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 31-31: Include file

(missingIncludeSystem)


[information] 32-32: Include file

(missingIncludeSystem)


[information] 33-33: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 8-8: Include file

(missingIncludeSystem)


[information] 9-9: Include file

(missingIncludeSystem)


[information] 10-10: Include file

(missingIncludeSystem)


[information] 11-11: Include file

(missingIncludeSystem)


[information] 12-12: Include file

(missingIncludeSystem)


[information] 13-13: Include file

(missingIncludeSystem)


[information] 14-14: Include file

(missingIncludeSystem)


[information] 20-20: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 8-8: Include file

(missingIncludeSystem)


[information] 10-10: Include file

(missingIncludeSystem)


[information] 13-13: Include file

(missingIncludeSystem)


[information] 14-14: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 15-15: Include file

(missingIncludeSystem)


[information] 16-16: Include file

(missingIncludeSystem)


[information] 17-17: Include file

(missingIncludeSystem)


[information] 18-18: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 8-8: Include file

(missingIncludeSystem)


[information] 10-10: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 2-2: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 2-2: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 15-15: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingInclude)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 9-9: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 8-8: Include file

(missingIncludeSystem)


[information] 9-9: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 2-2: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 14-14: Include file

(missingIncludeSystem)


[information] 15-15: Include file

(missingIncludeSystem)


[information] 16-16: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 26-26: Include file

(missingIncludeSystem)


[information] 2-2: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 2-2: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 1-1: Include file

(missingIncludeSystem)


[information] 2-2: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 2-2: Include file

(missingIncludeSystem)


[information] 17-17: Include file

(missingInclude)


[information] 18-18: Include file

(missingInclude)


[information] 19-19: Include file

(missingInclude)


[information] 20-20: Include file

(missingInclude)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 2-2: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 8-8: Include file

(missingIncludeSystem)


[information] 9-9: Include file

(missingIncludeSystem)


[information] 10-10: Include file

(missingIncludeSystem)


[information] 11-11: Include file

(missingIncludeSystem)


[information] 12-12: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 11-11: Include file

(missingIncludeSystem)


[information] 12-12: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 8-8: Include file

(missingIncludeSystem)


[information] 9-9: Include file

(missingIncludeSystem)


[information] 10-10: Include file

(missingIncludeSystem)


[information] 14-14: Include file

(missingIncludeSystem)


[information] 9-9: Include file

(missingIncludeSystem)


[information] 10-10: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 12-12: Include file

(missingIncludeSystem)


[information] 13-13: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 8-8: Include file

(missingIncludeSystem)


[information] 9-9: Include file

(missingIncludeSystem)


[information] 10-10: Include file

(missingIncludeSystem)


[information] 11-11: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 8-8: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 8-8: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 10-10: Include file

(missingIncludeSystem)


[information] 8-8: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 2-2: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 9-9: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 9-9: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 2-2: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 8-8: Include file

(missingIncludeSystem)


[information] 9-9: Include file

(missingIncludeSystem)


[information] 10-10: Include file

(missingIncludeSystem)


[information] 11-11: Include file

(missingIncludeSystem)


[information] 12-12: Include file

(missingIncludeSystem)


[information] 13-13: Include file

(missingIncludeSystem)


[information] 2-2: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[error] 23-23: There is an unknown macro here somewhere. Configuration is required. If DEPTHAI_NLOHMANN_DEFINE_TYPE_INTRUSIVE is a macro then please configure it.

(unknownMacro)


[information] 20-20: Include file

(missingIncludeSystem)


[information] 21-21: Include file

(missingIncludeSystem)


[information] 10-10: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 12-12: Include file

(missingIncludeSystem)


[information] 13-13: Include file

(missingIncludeSystem)


[information] 25-25: Include file

(missingIncludeSystem)


[information] 26-26: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 15-15: Include file

(missingIncludeSystem)


[information] 16-16: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 8-8: Include file

(missingIncludeSystem)


[information] 9-9: Include file

(missingIncludeSystem)


[information] 10-10: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 13-13: Include file

(missingIncludeSystem)


[information] 14-14: Include file

(missingIncludeSystem)

src/utility/LogCollection.cpp

[information] 17-17: Include file

(missingIncludeSystem)


[information] 17-17: Include file

(missingIncludeSystem)


[information] 31-31: Include file

(missingIncludeSystem)


[information] 32-32: Include file

(missingIncludeSystem)


[information] 33-33: Include file

(missingIncludeSystem)

src/device/DeviceBase.cpp

[information] 33-33: Include file

(missingIncludeSystem)


[information] 33-33: Include file

(missingInclude)

bindings/python/src/CrashDumpBindings.cpp

[information] 9-9: Include file

(missingIncludeSystem)


[information] 10-10: Include file

(missingIncludeSystem)


[information] 11-11: Include file

(missingIncludeSystem)


[information] 12-12: Include file

(missingIncludeSystem)


[information] 13-13: Include file

(missingIncludeSystem)


[information] 14-14: Include file

(missingIncludeSystem)


[information] 16-16: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 8-8: Include file

(missingIncludeSystem)


[information] 11-11: Include file

(missingIncludeSystem)


[information] 12-12: Include file

(missingIncludeSystem)


[information] 13-13: Include file

(missingIncludeSystem)


[information] 14-14: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 18-18: Include file

(missingIncludeSystem)


[information] 19-19: Include file

(missingIncludeSystem)


[information] 20-20: Include file

(missingIncludeSystem)


[information] 23-23: Include file

(missingInclude)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 15-15: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 8-8: Include file

(missingIncludeSystem)


[information] 9-9: Include file

(missingIncludeSystem)


[information] 10-10: Include file

(missingIncludeSystem)


[information] 11-11: Include file

(missingIncludeSystem)


[information] 12-12: Include file

(missingIncludeSystem)


[information] 13-13: Include file

(missingIncludeSystem)


[information] 14-14: Include file

(missingIncludeSystem)


[information] 15-15: Include file

(missingIncludeSystem)


[information] 2-2: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 2-2: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 2-2: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 2-2: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 8-8: Include file

(missingIncludeSystem)


[information] 9-9: Include file

(missingIncludeSystem)


[information] 12-12: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 31-31: Include file

(missingIncludeSystem)


[information] 32-32: Include file

(missingIncludeSystem)


[information] 33-33: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 8-8: Include file

(missingIncludeSystem)


[information] 9-9: Include file

(missingIncludeSystem)


[information] 10-10: Include file

(missingIncludeSystem)


[information] 11-11: Include file

(missingIncludeSystem)


[information] 12-12: Include file

(missingIncludeSystem)


[information] 13-13: Include file

(missingIncludeSystem)


[information] 14-14: Include file

(missingIncludeSystem)


[information] 20-20: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 8-8: Include file

(missingIncludeSystem)


[information] 10-10: Include file

(missingIncludeSystem)


[information] 13-13: Include file

(missingIncludeSystem)


[information] 14-14: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 15-15: Include file

(missingIncludeSystem)


[information] 16-16: Include file

(missingIncludeSystem)


[information] 17-17: Include file

(missingIncludeSystem)


[information] 18-18: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 8-8: Include file

(missingIncludeSystem)


[information] 10-10: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 2-2: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 2-2: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 6-6: Include file

(missingIncludeSystem)


[information] 7-7: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 5-5: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 4-4: Include file

(missingIncludeSystem)


[information] 8-8: Include file

(missingInclude)


[information] 11-11: Include file

(missingIncludeSystem)


[error] 134-134: There is an unknown macro here somewhere. Configuration is required. If DEPTHAI_NLOHMANN_DEFINE_TYPE_INTRUSIVE is a macro then please configure it.

(unknownMacro)


[information] 20-20: Include file

(missingIncludeSystem)


[information] 21-21: Include file

(missingIncludeSystem)

Comment thread src/device/DeviceBase.cpp
Comment thread src/device/DeviceGate.cpp
Comment thread tests/src/ondevice_tests/crashdump_test.cpp
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

♻️ Duplicate comments (1)
src/device/DeviceBase.cpp (1)

1259-1261: ⚠️ Potential issue | 🟠 Major

Same stickiness issue applies here.

🩹 Proposed fix
             if(isCrashDumpCollectionEnabled()) {
-                crashed = hasCrashDump();
+                if(hasCrashDump()) {
+                    crashed = true;
+                }
             }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/device/DeviceBase.cpp` around lines 1259 - 1261, The current assignment
"crashed = hasCrashDump()" overwrites prior crash state (stickiness) — change it
so the crash flag remains true once set; update the logic in the block
containing isCrashDumpCollectionEnabled(), hasCrashDump(), and the crashed
variable to set crashed = crashed || hasCrashDump() (or only set crashed to true
when hasCrashDump() returns true) so existing true state is not cleared.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/device/DeviceBase.cpp`:
- Around line 500-505: The check against DEPTHAI_CRASHDUMP == "0" inside
DeviceBase.cpp is dead because isCrashDumpCollectionEnabled() already returns
false for that value; remove the unreachable branch (the conditional that logs
the warn and the else that calls logCollection::logCrashDump) and directly call
logCollection::logCrashDump when a crash dump should be handled, or
alternatively update isCrashDumpCollectionEnabled() to return distinct states
(e.g., callback-only vs full collection) and then use that state here to decide
between invoking callbacks only or persisting/uploading via
logCollection::logCrashDump; refer to isCrashDumpCollectionEnabled(),
DEPTHAI_CRASHDUMP, and logCollection::logCrashDump to locate the code to change.
- Around line 555-559: The current else branch emits "Device crashed, but no
crash dump could be extracted" even when crashDumpHandled.load() is true; change
the branching so that when crashed && !crashDumpHandled.load() you call
collectAndLogCrashDump(&rebootingDevice), when crashed &&
crashDumpHandled.load() you emit a clear message like "Device crashed; crash
dump was already collected/handled" (use pimpl->logger.info or warn as
appropriate), and only emit the "no crash dump could be extracted" message for
the case where crashed is true and no dump could be extracted (i.e.,
differentiate the three cases around the crashed variable and
crashDumpHandled.load()); reference the variables/func: crashed,
crashDumpHandled.load(), collectAndLogCrashDump, and pimpl->logger.warn.

In `@src/pipeline/Node.cpp`:
- Around line 734-736: The detached lambda that calls pipeline.stop() must catch
and handle any exceptions from PipelineImpl::stop to avoid std::terminate;
update the std::thread([pipeline = std::move(pipeline)]() mutable {
pipeline.stop(); }).detach(); lambda to wrap the pipeline.stop() call in a
try-catch, logging the caught exception (and any unknown exceptions) via the
project's logger (or stderr) so errors from node->stop(), queue->close(),
tasks.destruct(), defaultDevice->close() are reported instead of aborting the
process.

---

Duplicate comments:
In `@src/device/DeviceBase.cpp`:
- Around line 1259-1261: The current assignment "crashed = hasCrashDump()"
overwrites prior crash state (stickiness) — change it so the crash flag remains
true once set; update the logic in the block containing
isCrashDumpCollectionEnabled(), hasCrashDump(), and the crashed variable to set
crashed = crashed || hasCrashDump() (or only set crashed to true when
hasCrashDump() returns true) so existing true state is not cleared.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 4a0f07a4-cfd2-49a1-a061-ee6ccc761af7

📥 Commits

Reviewing files that changed from the base of the PR and between 94647f7 and 3438d96.

📒 Files selected for processing (2)
  • src/device/DeviceBase.cpp
  • src/pipeline/Node.cpp
📜 Review details
🧰 Additional context used
🧠 Learnings (4)
📚 Learning: 2026-03-16T11:17:12.819Z
Learnt from: pheec
Repo: luxonis/depthai-core PR: 1715
File: include/depthai/pipeline/node/PointCloud.hpp:34-98
Timestamp: 2026-03-16T11:17:12.819Z
Learning: In `include/depthai/pipeline/node/PointCloud.hpp`, the nested `Impl` class inside `PointCloud` is intentionally public (not private/forward-declared) because the on-host unit tests in `tests/src/onhost_tests/point_cloud_test.cpp` directly access `Impl` methods such as `setIntrinsics`, `setExtrinsics`, `useCPU`, `useCPUMT`, `computePointCloudDense`, `applyTransformation`, and `filterValidPoints`. Do not suggest making `Impl` private or forward-declaring it.

Applied to files:

  • src/pipeline/Node.cpp
  • src/device/DeviceBase.cpp
📚 Learning: 2026-03-24T22:39:04.364Z
Learnt from: MaticTonin
Repo: luxonis/depthai-core PR: 1732
File: src/pipeline/Pipeline.cpp:705-705
Timestamp: 2026-03-24T22:39:04.364Z
Learning: Do not flag the `!= ""` part of the auto-calibration condition as redundant when it appears in `PipelineImpl::build()` (or closely related pipeline build logic). If the code uses `utility::getEnvAs<std::string>(..., default)` with a default such as `"ON_START"`, the explicit empty-string guard may still be intentional to treat an explicitly empty env var as “OFF/disabled” (or to avoid special-casing elsewhere). Only consider removing `!= ""` if the codebase has an explicit, enforceable guarantee that `DEPTHAI_AUTOCALIBRATION` can never be set to an empty string (e.g., via validated parsing/CI checks); otherwise, keep the guard.

Applied to files:

  • src/pipeline/Node.cpp
📚 Learning: 2026-03-17T08:07:19.141Z
Learnt from: JakubFara
Repo: luxonis/depthai-core PR: 1718
File: src/pipeline/node/AutoCalibration.cpp:167-216
Timestamp: 2026-03-17T08:07:19.141Z
Learning: In `src/pipeline/node/AutoCalibration.cpp`, the `getNewCalibration` method intentionally opens the gate once before the outer recalibration retry loop and closes it only at the end (or on success). There is no need to isolate gate state between individual recalibration attempts — this single open/close pattern is by design and should not be flagged as a bug in future reviews.

Applied to files:

  • src/device/DeviceBase.cpp
📚 Learning: 2026-03-24T22:39:00.650Z
Learnt from: MaticTonin
Repo: luxonis/depthai-core PR: 1732
File: src/pipeline/Pipeline.cpp:662-662
Timestamp: 2026-03-24T22:39:00.650Z
Learning: In `src/pipeline/Pipeline.cpp`, the `DEPTHAI_AUTOCALIBRATION` environment variable intentionally defaults to `"ON_START"` (not `""`). This means auto-calibration is initialized by default for stereo pipelines at pipeline build time. The resulting implicit EEPROM/calibration writes on startup are by design and should not be flagged as a backward-incompatible change or unintended side-effect in future reviews.

Applied to files:

  • src/device/DeviceBase.cpp
🪛 Cppcheck (2.20.0)
src/pipeline/Node.cpp

[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)


[information] 3-3: Include file

(missingIncludeSystem)

src/device/DeviceBase.cpp

[information] 33-33: Include file

(missingIncludeSystem)


[information] 33-33: Include file

(missingInclude)

🔇 Additional comments (13)
src/device/DeviceBase.cpp (12)

1238-1242: Keep crashed sticky after the first detected crash.

These assignments overwrite the buffered crash flag with the current hasCrashDump() result. Once the dump has been collected or cleared during recovery, hasCrashed() will incorrectly flip back to false even though this DeviceBase already observed a crash.

🩹 Proposed fix
                     if(isCrashDumpCollectionEnabled()) {
-                        crashed = hasCrashDump();
+                        if(hasCrashDump()) {
+                            crashed = true;
+                        }
                         if(crashed && !crashDumpHandled.load()) {
                             collectAndLogCrashDump();
                         }

460-465: LGTM!

The dual-check logic correctly allows disabling crash dump collection via either DEPTHAI_CRASHDUMP=0 or DEPTHAI_CRASHDUMP_TIMEOUT=0, with sensible defaults.


510-531: LGTM!

The crashed flag is correctly made sticky using the || operator at line 517. The 5-second delay allows firmware time to generate crash dump and log files.


591-597: LGTM!

The RVC2 crash dump extraction logic correctly checks for existing crash dumps before triggering collection, and appropriately sets rebootOnDestruction when a crash is detected.


616-617: LGTM!

The gate state check correctly includes both CRASHED and DESTROYED states.


1552-1573: LGTM!

The RVC2-only getState() implementation correctly uses CrashDumpManager for metadata collection and fetches the actual state via RPC. The separate clearCrashDump call with exception handling is a reasonable trade-off to avoid hangs during state retrieval.


1617-1630: LGTM!

The callback registration is thread-safe, and the copy-before-invoke pattern in collectAndLogCrashDump() (lines 492-495) prevents deadlocks if users call removeCrashdumpCallback() from within their callback.


1960-1978: LGTM!

Clean platform mapping implementation. The unreachable break statements from the previous review have been removed.


1207-1216: LGTM!

The logic correctly ensures crash dump collection happens even when reconnection is disabled (reconnectionTimeoutMs <= 0), addressing the PR objective about crash logs not being collected when reconnection was turned off.


1575-1581: LGTM!

Clean delegation to CrashDumpManager for platform-agnostic crash dump collection, with getCrashReportCollectionRVC2 as a low-level RVC2-specific accessor.


752-752: LGTM!

Resetting crashDumpHandled to false during init2() ensures fresh crash dump collection state on reconnection.


698-700: No thread-safety issue here. crashed is declared as std::atomic<bool> (line 986 in DeviceBase.hpp), so the read in hasCrashed() and writes from monitorCallback() are already synchronized.

			> Likely an incorrect or invalid review comment.
src/pipeline/Node.cpp (1)

3-3: Required header added for the helper-thread shutdown path.

This include matches the new std::thread usage in Node::stopPipeline().

Comment thread src/device/DeviceBase.cpp
Comment on lines +500 to +505
auto crashDumpPathStr = utility::getEnvAs<std::string>("DEPTHAI_CRASHDUMP", "", false);
if(crashDumpPathStr == "0") {
pimpl->logger.warn("Firmware crashed but DEPTHAI_CRASHDUMP is set to 0, the crash dump will not be saved nor uploaded to the Luxonis servers.");
} else {
logCollection::logCrashDump(pipelineSchema, *crashDump, deviceInfo);
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Unreachable code path.

This block can never execute because isCrashDumpCollectionEnabled() already returns false when DEPTHAI_CRASHDUMP == "0" (line 461), causing an early return at line 469. If execution reaches line 500, DEPTHAI_CRASHDUMP cannot be "0".

Consider removing this dead code or, if the intent is to allow callbacks while skipping persistence, adjust isCrashDumpCollectionEnabled() to differentiate between callback-only mode and full collection.

🧹 Suggested removal
         if(callbackCopy) callbackCopy(crashDump);

-        // Only save/upload the crash dump when not explicitly disabled
-        auto crashDumpPathStr = utility::getEnvAs<std::string>("DEPTHAI_CRASHDUMP", "", false);
-        if(crashDumpPathStr == "0") {
-            pimpl->logger.warn("Firmware crashed but DEPTHAI_CRASHDUMP is set to 0, the crash dump will not be saved nor uploaded to the Luxonis servers.");
-        } else {
-            logCollection::logCrashDump(pipelineSchema, *crashDump, deviceInfo);
-        }
+        logCollection::logCrashDump(pipelineSchema, *crashDump, deviceInfo);
         crashDumpHandled.store(true);
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/device/DeviceBase.cpp` around lines 500 - 505, The check against
DEPTHAI_CRASHDUMP == "0" inside DeviceBase.cpp is dead because
isCrashDumpCollectionEnabled() already returns false for that value; remove the
unreachable branch (the conditional that logs the warn and the else that calls
logCollection::logCrashDump) and directly call logCollection::logCrashDump when
a crash dump should be handled, or alternatively update
isCrashDumpCollectionEnabled() to return distinct states (e.g., callback-only vs
full collection) and then use that state here to decide between invoking
callbacks only or persisting/uploading via logCollection::logCrashDump; refer to
isCrashDumpCollectionEnabled(), DEPTHAI_CRASHDUMP, and
logCollection::logCrashDump to locate the code to change.

Comment thread src/device/DeviceBase.cpp
Comment on lines +555 to +559
if(crashed && !crashDumpHandled.load()) {
collectAndLogCrashDump(&rebootingDevice);
} else {
pimpl->logger.warn("Device crashed, but no crash dump could be extracted.");
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Misleading log message when crash dump was already handled.

When crashDumpHandled.load() is true, the message "Device crashed, but no crash dump could be extracted" is misleading—the dump was already extracted in a prior collection.

🩹 Suggested fix
             if(crashed && !crashDumpHandled.load()) {
                 collectAndLogCrashDump(&rebootingDevice);
-            } else {
+            } else if(!crashed) {
                 pimpl->logger.warn("Device crashed, but no crash dump could be extracted.");
             }
+            // If crashDumpHandled is true, dump was already collected - no warning needed
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/device/DeviceBase.cpp` around lines 555 - 559, The current else branch
emits "Device crashed, but no crash dump could be extracted" even when
crashDumpHandled.load() is true; change the branching so that when crashed &&
!crashDumpHandled.load() you call collectAndLogCrashDump(&rebootingDevice), when
crashed && crashDumpHandled.load() you emit a clear message like "Device
crashed; crash dump was already collected/handled" (use pimpl->logger.info or
warn as appropriate), and only emit the "no crash dump could be extracted"
message for the case where crashed is true and no dump could be extracted (i.e.,
differentiate the three cases around the crashed variable and
crashDumpHandled.load()); reference the variables/func: crashed,
crashDumpHandled.load(), collectAndLogCrashDump, and pimpl->logger.warn.

Comment thread src/pipeline/Node.cpp Outdated
@moratom moratom merged commit fc2b59b into develop Apr 7, 2026
1 check was pending
@moratom moratom deleted the lnotspotl/device_has_crashed branch April 7, 2026 09:07
@coderabbitai coderabbitai bot mentioned this pull request Apr 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

testable PR is ready to be tested

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants