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: Ensure that test for increasing offsets is not affected by overflow #291

Merged
merged 2 commits into from
Aug 28, 2023

Conversation

paleolimbot
Copy link
Member

Closes #290.

This PR fixes the check for increasing offsets: previously it calculated a diff between pairs of elements and ensured that the value was > 0. This failed for expressions like int32_t diff = (int32_t)-2147483648 - (int32_t)2080374784, where because of overflow, diff evalutes to > 0.

Copy link
Member

@lidavidm lidavidm left a comment

Choose a reason for hiding this comment

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

Is it possible to add a test to check the overflow case?

@codecov-commenter
Copy link

codecov-commenter commented Aug 28, 2023

Codecov Report

Merging #291 (b009352) into main (a3f0929) will increase coverage by 0.01%.
Report is 1 commits behind head on main.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #291      +/-   ##
==========================================
+ Coverage   87.03%   87.05%   +0.01%     
==========================================
  Files          66       66              
  Lines       10329    10325       -4     
==========================================
- Hits         8990     8988       -2     
+ Misses       1339     1337       -2     
Files Changed Coverage Δ
src/nanoarrow/array.c 91.39% <100.00%> (-0.03%) ⬇️

... and 1 file with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@paleolimbot paleolimbot merged commit f29659b into apache:main Aug 28, 2023
27 checks passed
@paleolimbot paleolimbot deleted the fix-ipc-crash2 branch August 29, 2023 19:20
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.

IPC input with out-of-range (but correctly increasing) last offset causes segfault when element is accessed
3 participants