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

libc: fix setvbuf_fullbuffer_overflow testcase #379

Merged
merged 1 commit into from
Oct 14, 2024

Conversation

damianloew
Copy link
Contributor

@damianloew damianloew commented Oct 14, 2024

Description

Motivation and Context

The test case checks fully buffered mode. Previous implementation required data overflowing the buffer (sending 10 bytes when a buffer is 8 bytes long) to be written to a file at once which is not required by POSIX. The current solution forces flushing the remaining 2 bytes anyway

JIRA: CI-507

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Chore (refactoring, style fixes, git/CI config, submodule management, no code logic changes)

How Has This Been Tested?

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing linter checks and tests passed.
  • My changes generate no new compilation warnings for any of the targets.

Special treatment

  • This PR needs additional PRs to work (list the PRs, preferably in merge-order).
  • I will merge this PR by myself when appropriate.

The test case checks fully buffered mode.
Previous implementation required data overflowing the buffer
(sending 10 bytes when a buffer is 8 bytes long) to be written to a file at once
which is not required by POSIX.
The current solution forces flushing the remaining 2 bytes anyway.

JIRA: CI-507
@damianloew damianloew force-pushed the damianloew/setvbuf_fullbuffer_overflow branch from 39656eb to 43b4d23 Compare October 14, 2024 10:27
@damianloew damianloew marked this pull request as ready for review October 14, 2024 10:32
Copy link

Unit Test Results

7 741 tests  ±0   7 026 ✅ ±0   41m 20s ⏱️ + 1m 47s
  461 suites ±0     715 💤 ±0 
    1 files   ±0       0 ❌ ±0 

Results for commit 43b4d23. ± Comparison against base commit 0733d9f.

Copy link
Contributor

@adamdebek adamdebek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At this moment, this testcase is tailored to pass in glibc and doesn't check if buffering works correctly on phoenix. I would make this testcase phoenix specific.

Copy link
Contributor

@ziemleszcz ziemleszcz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@damianloew
Copy link
Contributor Author

pass in glibc

Yeah, but then we would test characteristics that are implementation-defined. In those tests we focus on satisfying POSIX requirements which only requires those 8 bytes to be written without flush. Also, it would be much simpler to merge those 'flexible' changes as we accept an older Phoenix implementation.

@damianloew damianloew merged commit 036b90f into master Oct 14, 2024
36 checks passed
@damianloew damianloew deleted the damianloew/setvbuf_fullbuffer_overflow branch October 14, 2024 12:33
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.

3 participants