Skip to content

Photorec deadlock and output‑path corruption during long recovery #211

Description

@artfuldodger348-del

During a large‑scale recovery of MP4 files from a damaged NTFS volume, Photorec exhibited several technical failures that appear related to thread deadlock, state corruption, and incomplete persistence of session metadata.

  1. Hard deadlock during long scans
    Photorec repeatedly entered a state where:

UI stopped updating (timer and sector counter frozen)

CPU usage dropped to zero

Window could not be closed

Process could not be terminated normally

Windows eventually terminated the process silently, leaving the window visible but non‑functional. This suggests a deadlock in the main recovery loop or an unhandled exception in the worker thread.

  1. Resume session does not persist output directory
    After restarting and selecting “Resume previous session,” Photorec correctly restored the sector position but did not restore the output directory. It instead wrote recovered files to default locations (recup_dir.* in root or next to the executable).

This indicates the output path is not included in the session metadata or is not reloaded correctly.

  1. Session resume with corrupted output path
    In several cases, Photorec resumed scanning and incremented the “files recovered” counter, but no files were written to disk in any location. This implies the output path pointer was null or invalid, yet the recovery loop continued.

This behaviour suggests:

output path string corruption

missing validation of the output directory before write

recovery loop continuing despite failed write operations

  1. Silent failure modes
    Photorec did not report:

write failures

invalid output paths

inability to create recup_dir.*

exceptions during resume

The tool continued scanning and reporting recovered files even when no output directory existed.

  1. Impact
    These issues caused:

loss of recovered data

inconsistent output behaviour

difficulty verifying recovery completeness

significant manual effort to locate or confirm output directories

  1. Suggested improvements
    Persist output directory in session metadata

Validate output path on resume

Abort recovery if output directory is invalid

Add error reporting for write failures

Add watchdog or timeout for deadlocked recovery loops

Improve robustness of session resume state

Photorec is a valuable tool, but these reliability issues make long‑running recovery operations unpredictable and difficult to trust

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions