-
Notifications
You must be signed in to change notification settings - Fork 17
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
Make coverity happy for 4.0 #623
base: master
Are you sure you want to change the base?
Conversation
b6c8edf
to
a1e80e5
Compare
a1e80e5
to
635cdc5
Compare
Don't generate the args code if there are no successors compute the key using 64 bits arithmetic ensure vpid is within expected range Signed-off-by: George Bosilca <bosilca@icl.utk.edu>
This is only used by the DTD interface, but it needs to be completely initialized in all cases. Signed-off-by: George Bosilca <bosilca@icl.utk.edu>
Signed-off-by: George Bosilca <bosilca@icl.utk.edu>
635cdc5
to
538dea3
Compare
let's keep it as a draft for now, there are some tests failing and I can't yet figure out why. |
Snapshot of investigation: During parsec_redistribute_dtd_New we create an
we later dereference null+8 as an input to parsec_datatype_free, which may also explain why we would see these weird MPI_TYPE_FREE errors in some cases recently. The same code for
|
Signed-off-by: Aurelien Bouteiller <bouteill@icl.utk.edu>
For posterity, a piece of discussion from Slack about the dtd_arena_create and our plan to address the problem
|
…ena_datatypes in a consistent order (ICLDisco/parsec#623)
and avoid memory leakage in certain cases
adt construct form
193050d
to
45d6c62
Compare
CI failure is due to #641 this is ready |
@@ -351,9 +349,11 @@ char *parsec_argv_join_range(char **argv, size_t start, size_t end, int delimite | |||
for (p = &argv[start], i=start; *p && i < end; ++p, ++i) { | |||
str_len += strlen(*p) + 1; | |||
} | |||
if (0 == str_len) { |
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.
Why returning a copy of an empty string instead of NULL ? It is not like this function is heavily used, but why do we need to change the logic ?
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.
you did that as part of the first commit addressing coverity errors. I suppose we free the value later on without checking for NULL?
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.
I don't see why I did that, it turns out that function is never used.
@@ -252,8 +242,6 @@ int main(int argc, char *argv[]) | |||
|
|||
ctp->arenas_datatypes[PARSEC_remote_no_re_reshape_DEFAULT_ADT_IDX] = adt_default; | |||
ctp->arenas_datatypes[PARSEC_remote_no_re_reshape_LOWER_TILE_ADT_IDX] = adt_lower; | |||
PARSEC_OBJ_RETAIN(adt_default.arena); |
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.
Does this means we are not tracking the refcount on the arena anymore ? How does it get deallocated ?
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.
We still track the arena counts, but the adt is not destructed implicitly by the generated code, thus there is no need for the extra retain (which was to prevent said deallocation by the generated code), this is documented in both jdf2c (generate_constructors) and data.c (class declaration),
the arena gets deallocated when we destruct the adt (destructor called when the wrapper or main calls the obj_release(adt) or obj_destruct(adt), or the dtd helper function that also calls obj_release)
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.
During my own review of these changes I found the following issue that contradict some aspect of my previous message:
- What I said above is correct for all codes that use parsec_matrix_adt_define_xyz, and codes that are using the DTD attach type, they have all the correct hooking points ready to call the symetric cleanup (and have to, because they have to free the actual MPI datatype they created).
- This is not the case for the
examples/Ex0?.jdf
, they useparsec_arena_datatype_set_type
and use a predefined datatype to populate the static PTG adt arrays. Without the auto OBJ_DESTRUCT in the generated code, these will need to call an explicit cleanup function to be leak free. These should be straightforward to adapt. - This is also incorrect for a number of PTG testers (e.g., touch.jdf, a2a.jdf, BT_reduction_wrapper, merge_sort_wrapper, rtt_wrapper, collections/reduce.c, all the ptgpp testers,
We had a discussion about this on Friday during the team meeting
Q: because we don't auto cleanup the examples are now incorrect (they leak the arenas), should I (Aurelien) revert the change that removed the automatic OBJ_DESTRUCT on the static ADTs or do we prefer adapting the offending testers.
A: (Thomas): I like that the user has to make symmetrical calls, so users will need to call parsec_arena_datatype_unset_type
(new function wrapping around OBJ_DESTRUCT, essentially)
A: (Aurelien): a subset of offenders in group 3. are missing the corresponding _finalize
call to match their xyz_initialize
and directly call taskpool_free
, these require a larger change to adapt.
Documenting the discussion so that @bosilca can react.
contructor/destructor naming conventions
…ena_datatypes in a consistent order (ICLDisco/parsec#623)
Coverity identified 692 legitimate issues with the node. Luckily for us most of them are in the generated code and have relatively simple solutions. This PR is a placeholder to address all of the issues that can be addressed in a reasonable time frame.