Closed digitalw0lf closed 1 year ago
I've tried to fix this bug by filling entire dataman file with zero's after creation, but encountered another weird behavior: writing of compatibility key failed after that. After some trials and errors, I've settled with strange but working solution: fill entire file except last kilobyte. dm.patch
Solved here: https://github.com/PX4/PX4-Autopilot/pull/21594
Describe the bug
When PX4 creates a dataman file on SD card, contents of this file is not cleared, but contains random data from deleted files on that disk. This is because Nuttx is not fully compliant with Posix standard: using lseek() to expand file size does not erases resulting "gap" in file on FAT32 (yes, FAT32 does not support real sparse files, but according to specs, this "gap" should read as zero bytes anyway). If it happens that this random data looks similar to real dataman records, then PX4 tries to read and process it.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
dataman file should be filled with zero bytes on creation.
Log Files and Screenshots
Drone (please complete the following information):