-
Notifications
You must be signed in to change notification settings - Fork 509
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
pmem2: fix valgrind instrumentation in pmem2_map_from_exisiting #5605
Conversation
src/libpmem2/map_posix.c:1: error: wrong copyright date: (is: 2019-2021, should be: 2019-2023) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 2 of 2 files at r1, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @lplewa)
-- commits
line 4 at r1:
#5597
Code quote:
#5598
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @lplewa)
src/libpmem2/map_posix.c
line 2 at r1 (raw file):
// SPDX-License-Identifier: BSD-3-Clause /* Copyright 2019-2021, Intel Corporation */
Suggestion:
2023
src/test/unittest/ut_file.c
line 2 at r1 (raw file):
// SPDX-License-Identifier: BSD-3-Clause /* Copyright 2014-2020, Intel Corporation */
Suggestion:
2014-2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 2 files at r1.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @lplewa)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 2 files at r1, all commit messages.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @lplewa)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 2 of 2 files at r2, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @lplewa)
Codecov Report
@@ Coverage Diff @@
## stable-1.13 #5605 +/- ##
===============================================
+ Coverage 72.68% 74.25% +1.57%
===============================================
Files 145 145
Lines 22634 22131 -503
Branches 3771 3704 -67
===============================================
- Hits 16451 16433 -18
+ Misses 6183 5698 -485 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lplewa please rebase to stable-1.13
Reviewed 2 of 2 files at r2, all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @lplewa)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 2 of 2 files at r2, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @lplewa)
a discussion (no related file):
Maybe it is just me, but after applying these changes I still have one remaining problem:
$ ./RUNTESTS.py pmem2_integration -u 39 -g byte --force-enable pmemcheck -b debug
pmem2_integration/TEST39: SETUP (medium/debug/pmemcheck/byte)
Last 16 lines of /home/jmichal/work/pmdk/src/test/pmem2_integration/pmemcheck39.log below (whole file has 16 lines):
==1998050== pmemcheck-1.0, a simple persistent store checker
==1998050== Copyright (c) 2014-2020, Intel Corporation
==1998050== Using Valgrind-3.20.0 and LibVEX; rerun with -h for copyright info
==1998050== Command: /home/jmichal/work/pmdk/src/test/pmem2_integration/pmem2_integration test_map_from_existing /tmp/pmem2_integration_39/testfile
==1998050== Parent PID: 1998038
==1998050==
==1998050==
==1998050== Number of stores not made persistent: 1
==1998050== Stores not made persistent properly:
==1998050== [0] at 0x401481A: _dl_fixup (dl-machine.h:239)
==1998050== by 0x4001C3D: _dl_runtime_resolve_xsave (dl-trampoline.h:126)
==1998050== by 0x402883: TEST_CASE_PROCESS (unittest.h:700)
==1998050== by 0x405A7A: main (pmem2_integration.c:1030)
==1998050== Address: 0x60f0c8 size: 8 state: DIRTY
==1998050== Total memory not made persistent: 8
==1998050== ERROR SUMMARY: 1 errors
src/libpmem2/map_posix.c
line 593 at r2 (raw file):
return ret; VALGRIND_REMOVE_PMEM_MAPPING(map_addr, map_len);
What if pmem2_map_from_existing()
is called with src->type != PMEM2_SOURCE_FD
so, in effect, the new mapping is not registered to Valgrind? So, I guess, it boils down to whether it is possible that the mapping is not registered (and I think it is possible)? And how Valgrind will react in this case?
src/test/unittest/ut_file.c
line 375 at r2 (raw file):
addr = ut_mmap(file, line, func, NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); return addr;
addr
here is the most ignored variable I have seen for quite some time. xD
What is the purpose of existence? You may ask.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @lplewa)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 0 of 2 files reviewed, 2 unresolved discussions (waiting on @grom72, @janekmi, and @ldorau)
src/libpmem2/map_posix.c
line 593 at r2 (raw file):
Previously, janekmi (Jan Michalski) wrote…
What if
pmem2_map_from_existing()
is called withsrc->type != PMEM2_SOURCE_FD
so, in effect, the new mapping is not registered to Valgrind? So, I guess, it boils down to whether it is possible that the mapping is not registered (and I think it is possible)? And how Valgrind will react in this case?
Done.
src/test/unittest/ut_file.c
line 375 at r2 (raw file):
Previously, janekmi (Jan Michalski) wrote…
addr
here is the most ignored variable I have seen for quite some time. xD
What is the purpose of existence? You may ask.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 2 of 2 files at r3, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @janekmi and @lplewa)
@lplewa, FYI, the CI checks failed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 2 of 2 files at r3, all commit messages.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @janekmi and @lplewa)
src/libpmem2/map_posix.c
line 595 at r3 (raw file):
#ifndef _WIN32 if (map->source.type == PMEM2_SOURCE_FD) { VALGRIND_REMOVE_PMEM_MAPPING(map_addr, map_len);
Remove space before VALGRIND_REMOVE_PMEM_MAPPING
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 2 files at r3, all commit messages.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @lplewa)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 2 files at r3.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @lplewa)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @lplewa)
a discussion (no related file):
Previously, janekmi (Jan Michalski) wrote…
Maybe it is just me, but after applying these changes I still have one remaining problem:
$ ./RUNTESTS.py pmem2_integration -u 39 -g byte --force-enable pmemcheck -b debug pmem2_integration/TEST39: SETUP (medium/debug/pmemcheck/byte) Last 16 lines of /home/jmichal/work/pmdk/src/test/pmem2_integration/pmemcheck39.log below (whole file has 16 lines): ==1998050== pmemcheck-1.0, a simple persistent store checker ==1998050== Copyright (c) 2014-2020, Intel Corporation ==1998050== Using Valgrind-3.20.0 and LibVEX; rerun with -h for copyright info ==1998050== Command: /home/jmichal/work/pmdk/src/test/pmem2_integration/pmem2_integration test_map_from_existing /tmp/pmem2_integration_39/testfile ==1998050== Parent PID: 1998038 ==1998050== ==1998050== ==1998050== Number of stores not made persistent: 1 ==1998050== Stores not made persistent properly: ==1998050== [0] at 0x401481A: _dl_fixup (dl-machine.h:239) ==1998050== by 0x4001C3D: _dl_runtime_resolve_xsave (dl-trampoline.h:126) ==1998050== by 0x402883: TEST_CASE_PROCESS (unittest.h:700) ==1998050== by 0x405A7A: main (pmem2_integration.c:1030) ==1998050== Address: 0x60f0c8 size: 8 state: DIRTY ==1998050== Total memory not made persistent: 8 ==1998050== ERROR SUMMARY: 1 errors
A funny thing. @grom72 confirmed this fix works for him. So, the score is 2:1 for this commit being the fix.
I guess I am doing something atypical which causes this uncommon issue.
I think we can ignore it for the discussion around this commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @lplewa)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @lplewa)
a discussion (no related file):
Previously, janekmi (Jan Michalski) wrote…
A funny thing. @grom72 confirmed this fix works for him. So, the score is 2:1 for this commit being the fix.
I guess I am doing something atypical which causes this uncommon issue.I think we can ignore it for the discussion around this commit.
The score is 3:1 ;-) - both:
$ ./RUNTESTS.py pmem2_integration -u 39 --force-enable pmemcheck
$ ./RUNTESTS.py pmem2_integration -u 41 --force-enable pmemcheck
pass for me.
fixes: #5597
This change is![Reviewable](https://camo.githubusercontent.com/1541c4039185914e83657d3683ec25920c672c6c5c7ab4240ee7bff601adec0b/68747470733a2f2f72657669657761626c652e696f2f7265766965775f627574746f6e2e737667)