lvauvillier / dji-log-parser

A library to parse records from DJI .txt logs
MIT License
9 stars 5 forks source link

Error: failed to fill whole buffer #4

Closed MAVProxyUser closed 3 months ago

MAVProxyUser commented 3 months ago

Same dataset as before... a few files trigger this error. Any idea what may cause it?

thread 'main' panicked at src/main.rs:46:45: Unable to parse file: InfoParseError("\n ╺━━━━━━━━━━━━━━━━━━━━┅ Backtrace ┅━━━━━━━━━━━━━━━━━━━━╸\n\n 0: \u{1b}[1m\u{1b}[1mError: failed to fill whole buffer\u{1b}[22m\n \u{1b}[1mWhile parsing field 'app_version' in Info\u{1b}[22m\u{1b}[22m\n at src/layout/info.rs:79\n\n ╺━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╸\n\n") stack backtrace: 0: rust_begin_unwind at /build/rustc-60UC9b/rustc-1.75.0+dfsg0ubuntu1~bpo0/library/std/src/panicking.rs:645:5 1: core::panicking::panic_fmt at /build/rustc-60UC9b/rustc-1.75.0+dfsg0ubuntu1~bpo0/library/core/src/panicking.rs:72:14 2: core::result::unwrap_failed at /build/rustc-60UC9b/rustc-1.75.0+dfsg0ubuntu1~bpo0/library/core/src/result.rs:1653:5 3: core::result::Result<T,E>::expect at /build/rustc-60UC9b/rustc-1.75.0+dfsg0ubuntu1~bpo0/library/core/src/result.rs:1034:23 4: dji_log_parser::main at /media/kfinisterre/bdb99222-a06f-476b-ae0c-a4110a7ef82e/dji-log-parser/src/main.rs:46:18 5: core::ops::function::FnOnce::call_once at /build/rustc-60UC9b/rustc-1.75.0+dfsg0ubuntu1~bpo0/library/core/src/ops/function.rs:250:5 note: Some details are omitted, run with RUST_BACKTRACE=full for a verbose backtrace.

lvauvillier commented 3 months ago

@MAVProxyUser, I've obtained the dataset but, could you indicate which log files are causing the crash?

MAVProxyUser commented 3 months ago

@MAVProxyUser, I've obtained the dataset but, could you indicate which log files are causing the crash?

I’ve been bulk processing them with the find command. I’ll see if I can augment it to print the file name:

find /path/to/dump/FlightLogs/ -type f -name '*.txt' -exec bash -c ' filepath="$1" basepath="/path/to/dump/FlightLogs/" relpath="${filepath#$basepath}" dir="./ParsedLogs/$(dirname "$relpath")" mkdir -p "$dir" base="$dir/$(basename "${filepath%.txt}")" mkdir -p "$base" pushd "$base" /path/to/dump/dji-log-parser/target/debug/dji-log-parser "$filepath" --images "image%d.jpeg" --output "records.json" popd ' bash {} \;

lvauvillier commented 3 months ago

Ok, this is an old log version 2 format that produces this error. The info section size is 350 bytes instead of 400. I'll try to fix it tomorrow.

lvauvillier commented 3 months ago

Fixed. Thanks!

ZaneM26 commented 3 months ago

@MAVProxyUser can you share the rb files you mentioned (record_data_v1.rb, etc.)?

MAVProxyUser commented 3 months ago

@ZaneM26 https://github.com/MAVProxyUser/UserPortrait/blob/master/Fly%20Record.zip

ZaneM26 commented 3 months ago

@MAVProxyUser thank you!