anlsys / libnrm

Node Resource Manager communication library
BSD 3-Clause "New" or "Revised" License
7 stars 0 forks source link

fix bad handling of nrm_vector_t (storing objects instead of pointers) #37

Closed perarnau closed 1 year ago

perarnau commented 1 year ago

A small number of places in the code are storing full objects inside a nrm_vector_t instead of just storing pointers de the objects.

This need to be fixed in the general case. Be careful though that the internal msg API probably still need to do that, deep copies when sending messages avoid lifetime issues between the daemon and the messaging layer.

iddaoudi commented 1 year ago

Please provide an example of a place where full objects are stored inside an nrm_vector_t as I was not successful in finding one.

perarnau commented 1 year ago

src/binaries/nrmd.c, function nrmd_timer_callback, lines 424 to 447 are an example. But as indicated above, this one is ok. This issue dates from before nrm_hash_t existed, and many vector uses disappeared, so maybe there's nothing left to fix.

iddaoudi commented 1 year ago

Therefore I can confirm that there isn't any occurrence where full objects are stored in an nrm_vector_t.