Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix segfault in XDD when buffer file is smaller than reqsize with -datapattern wholefile #39

Merged
merged 1 commit into from
Oct 7, 2024

Conversation

cadegore
Copy link

@cadegore cadegore commented Sep 4, 2024

No description provided.

@cadegore cadegore changed the title Fixed the segmentation fault when bs is smaller than reqsize Fix segfault in XDD when buffer file is smaller than reqsize with -datapattern wholefile Sep 6, 2024
@calccrypto

This comment was marked as outdated.

@calccrypto

This comment was marked as resolved.

tests/functional/test_xdd_file_datapattern_2.sh Outdated Show resolved Hide resolved
tests/functional/test_xdd_file_datapattern_2.sh Outdated Show resolved Hide resolved
tests/functional/test_xdd_file_datapattern_2.sh Outdated Show resolved Hide resolved
@calccrypto

This comment was marked as resolved.

src/common/datapatterns.c Outdated Show resolved Hide resolved
src/common/datapatterns.c Outdated Show resolved Hide resolved
@cadegore cadegore force-pushed the cadegore-xdd branch 9 times, most recently from 95ef0bc to 7d0fd05 Compare October 4, 2024 02:51
@cadegore cadegore force-pushed the cadegore-xdd branch 3 times, most recently from c41e9ca to 83d92bd Compare October 4, 2024 14:50
src/common/datapatterns.c Outdated Show resolved Hide resolved
src/common/datapatterns.c Outdated Show resolved Hide resolved
src/common/datapatterns.c Outdated Show resolved Hide resolved
src/common/datapatterns.c Outdated Show resolved Hide resolved
…tapattern wholefile (MigeljanImeri#38)

This commit rewrites the logic for handling the -datapattern wholefile
option to ensure that even when the blocksize (bs) is smaller than the
request size (reqsize), the code runs without segmentation faults. The
changes include calculating the offset within the data pattern buffer,
allocating a buffer if not already allocated, and copying data in chunks
from the data pattern to the buffer until the entire transfer size is
copied. The offset is correctly calculated and reset after the first
iteration. In addition, a test case also added to verify that the code
correctly handles cases where the blocksize is smaller than the request
size. The test compares the input file and output file to ensure they
match and that the offset is correctly calculated with different numbers
of queue depth (qd).

Signed-off-by: Cade Gore <79346293+cadegore@users.noreply.github.com>
@MigeljanImeri MigeljanImeri merged commit 4decae6 into MigeljanImeri:xdd-2.0 Oct 7, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants