pmem / pmemfile

Userspace implementation of file APIs using persistent memory.
Other
34 stars 21 forks source link

posix: handle another case when we rely on undefined behavior in lseek #322

Closed marcinslusarz closed 7 years ago

marcinslusarz commented 7 years ago

SUMMARY: AddressSanitizer: undefined-behavior src/libpmemfile-posix/lseek.c:234:40 in src/libpmemfile-posix/lseek.c:234:40: runtime error: negation of -9223372036854775808 cannot be represented in type 'pmemfile_off_t' (aka 'long'); cast to an unsigned type to negate this value to itself


This change is Reviewable

krzycz commented 7 years ago

Reviewed 1 of 1 files at r1. Review status: all files reviewed at latest revision, all discussions resolved.


Comments from Reviewable

codecov-io commented 7 years ago

Codecov Report

Merging #322 into master will increase coverage by <.01%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #322      +/-   ##
==========================================
+ Coverage   78.16%   78.17%   +<.01%     
==========================================
  Files          90       90              
  Lines       13823    13827       +4     
  Branches     1996     1996              
==========================================
+ Hits        10805    10809       +4     
- Misses       2293     2295       +2     
+ Partials      725      723       -2
Impacted Files Coverage Δ
src/libpmemfile-posix/lseek.c 89.93% <100%> (+0.13%) :arrow_up:
src/libpmemfile-posix/file.c 66.2% <0%> (-1.38%) :arrow_down:
src/libpmemfile/path_resolve.c 87.65% <0%> (-1.1%) :arrow_down:
src/libpmemfile-posix/dir.c 83.29% <0%> (+0.24%) :arrow_up:
src/libpmemfile-posix/inode.c 77.7% <0%> (+0.34%) :arrow_up:
src/libpmemfile-posix/rename.c 90.8% <0%> (+0.39%) :arrow_up:
src/libpmemfile-posix/read.c 93.19% <0%> (+0.68%) :arrow_up:
tests/posix/mt/mt.cpp 86.45% <0%> (+1.04%) :arrow_up:
src/libpmemfile-posix/utils.c 73.43% <0%> (+1.56%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 12b04fc...32ac730. Read the comment docs.

GBuella commented 7 years ago
:lgtm:

Reviewed 1 of 1 files at r2. Review status: all files reviewed at latest revision, all discussions resolved.


Comments from Reviewable