parsec icon indicating copy to clipboard operation
parsec copied to clipboard

Make coverity happy for 4.0

Open bosilca opened this issue 2 years ago • 4 comments

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.

bosilca avatar Jan 28 '24 04:01 bosilca

let's keep it as a draft for now, there are some tests failing and I can't yet figure out why.

bosilca avatar Feb 05 '24 16:02 bosilca

Snapshot of investigation:

During parsec_redistribute_dtd_New we create an adt that we cleanup later in that same function.

376         adt = parsec_dtd_create_arena_datatype(parsec, &TARGET);
...
(gdb) n
426         adt = parsec_dtd_get_arena_datatype(parsec, TARGET);
(gdb) p *adt
null

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 SOURCE works, and I suspect that this code in add2arena causes the index to be overwritten with 0 when it should be 1.

260     adt->ht_item.next_item = NULL;  /* keep Coverity happy */
261     adt->ht_item.hash64    = 0;  /* keep Coverity happy */
262     adt->ht_item.key       = 0;  /* keep Coverity happy */

abouteiller avatar Feb 07 '24 16:02 abouteiller

For posterity, a piece of discussion from Slack about the dtd_arena_create and our plan to address the problem

I see what is happening. In general we create the arena with a datatype and we keep it for as long as we need it. 13:56 well … not in DTD. Here we areate an empty arena, I guess just to get an ID that will then be attached to the arena we create with the normal function 13:57 so the “create_arena” cannot reset the ht_key (which is used as the ID) because in DTD this holds important data 13:57 so create is now not really a create, but more like “initialize some fields” 13:58 well, coverity was not complaining about the use of ht_item in DTD, because there it is used. IT was complaining about it in PTG where it is not used at all 14:00we need to go back to a sane use of the arena. We create and that function will set all fields, and then in DTD we will register it with the taskpool, and then it will get its ID (edited) 14:01 with this approach we will keep most of the infrastructure we have today in place. Which means we will still use the hash-table for the DTD arenas for something with an id that monotonically increases …

abouteiller avatar Feb 07 '24 21:02 abouteiller

CI failure is due to #641 this is ready

abouteiller avatar Apr 24 '24 21:04 abouteiller