You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After PR #15041, there are failures in test/parallel/taskPar/elliot/barrier/array-of-barriers.chpl due to errors in the memory management of barriers. Memory management for barriers started in PR #4945.
Here is an example that changed behavior after PR #15041:
var barArr:[1..1] Barrier;
barArr[1]=new Barrier(1);
the new barrier is now deinited immediately after the assignment statement. The array stores a Barrier with isowned=false, which is then used in a use-after-free.
Even before that PR, the memory management strategy in Barrier (always set isowned=true in = or init=) was problematic. In particular, it is impossible to initialize some Barrier objects in a loop. For example:
use Barriers;
var ba =[i in1..10]new Barrier(1);
for bar in ba do bar.barrier();
has use-after-free memory errors even before my PR.
How can Barrier manage memory more appropriately? (And, should Barrier be renamed to barrier ?)
Here are some possible short-term directions:
future-ize array-of-barriers.chpl
change Barrier to store an owned class field
make Barrier produce a compilation error if one is copied or assigned
The text was updated successfully, but these errors were encountered:
Future-ize array-of-barriers test
This PR future-izes the test
test/parallel/taskPar/elliot/barrier/array-of-barriers.chpl
for until #15116 is solved.
Trivial and not reviewed (but discussed with @daviditen ).
Is this issue expected to have an impact on users? Only if they use arrays of barriers or in general? Does it represent a backslide from the previous release? Should we be prioritizing addressing it?
Is this issue expected to have an impact on users? Only if they use arrays of barriers or in general? Does it represent a backslide from the previous release? Should we be prioritizing addressing it?
I don't expect users have arrays of barriers.
Does it represent a backslide from the previous release?
Arrays created in any kind of loop wouldn't have worked in previous releases.
Should we be prioritizing addressing it?
I suspect arrays of barriers are rare and the typical use case has the barrier in a variable. So I think we could choose to put it off if we like.
After PR #15041, there are failures in test/parallel/taskPar/elliot/barrier/array-of-barriers.chpl due to errors in the memory management of barriers. Memory management for barriers started in PR #4945.
Here is an example that changed behavior after PR #15041:
the new barrier is now deinited immediately after the assignment statement. The array stores a Barrier with
isowned=false
, which is then used in a use-after-free.Even before that PR, the memory management strategy in Barrier (always set
isowned=true
in=
orinit=
) was problematic. In particular, it is impossible to initialize some Barrier objects in a loop. For example:has use-after-free memory errors even before my PR.
How can
Barrier
manage memory more appropriately? (And, shouldBarrier
be renamed tobarrier
?)Here are some possible short-term directions:
Barrier
to store anowned
class fieldBarrier
produce a compilation error if one is copied or assignedThe text was updated successfully, but these errors were encountered: