Repository navigation
Conversation
Renu-Priya411
requested changes
Nov 19, 2026
Renu-Priya411
approved these changes
Nov 20, 2026
Collaborator
|
Kindly rebase the code |
setQFileIndexForPackage() stored each FLDA package with QList::insert(packageNumber - 1, index) but only checked the position against the announced package count. If a package is missing from the trace (dropped messages, recording started or stopped mid-transfer), the position is beyond the list size. QList::insert does not check the range in release builds, so the plugin writes past the end of the list buffer, corrupts the heap and crashes DLT Viewer shortly after such a file is opened. Store the message index per package in a fixed-size table instead: - one slot per announced package, -1 = not received - reject package numbers outside 1..packages - ignore duplicate packages - count a package only when its slot is filled, so a transfer is marked complete only when every package is present This also removes the QList<int>[packages] array that was never freed. Regression from 2addbcc, which replaced the (i-1) <= length() check with (i-1) < packages.
louis-e
force-pushed
the
fix/filetransfer-missing-packages
branch
from
November 20, 2026 08:27
5422905 to
a06c010
Compare
Author
|
Thanks, rebased it! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Opening a trace that contains a file transfer with missing FLDA packages crashes DLT Viewer with a heap corruption (
0xC0000374) or an access violation infiletransferplugin.Root cause
File::setQFileIndexForPackage()callsQList::insert(packageNumber - 1, index). Since 2addbcc the position is only checked against the announced package count, not the current list size. After a gap (for example package 259 followed by 412) the insert position is beyondsize(). Release builds don't check this, so the plugin writes past the end of the buffer. Separately,insert()shifts entries, so a duplicate package would scramble the saved file. Rejected packages were also counted as received, so a transfer could show as complete while slots were still missing.Fix
The index is now a fixed-size
QVector<int>with one slot per announced package. Each package is written into its own slot. Packages that are out of range or duplicated are ignored, and only newly filled slots count as received. This also removes a leakednew QList<int>[packages].Testing
Built on Windows with Qt 6.8.3 and MinGW 13.1. I tested on a ~2 GB trace (12.7 M messages, 304 file transfers, 2 of them with missing packages), which I can't share, using
dlt-viewer -t -e "Filetransfer Plugin|export|<dir>" trace.dlt:0xC0000374.