Commit 86b3d10
Safety valve for callbacks
When an mca_foo.so gets unloaded any callbacks it registered become invalid and can
segv if called.
This happened in an oshemem testcase that did call shmem_init() and shmem_finalize().
But for whatever reason oshmem unloads the MCAs before they call MPI_Finalize() which
they have in a conditional so they don't necessarily always call MPI_Finalize().
Anyway the failing path goes from oshmem_shmem_finalize() through _shmem_finalize()
which unloads the MCAs (mca_base_framework_close which dlcloses them) and then after
that it will call MPI_Finalize() which will deregister the callback
That could be considered a bug, maybe the reference counters should be set up so the
MCA's .fini call is always called before dlclose() and make sure all such .fini calls
deregister the MCA's callbacks.
But this checkin takes the conservative approach of assuming that bugs like that are
always a possibility and inserts a safety valve around callback usage, so when an MCA
gets unloaded it deregisters any callbacks rather than only having them deregistered
if we go through a proper sequence of finalize calls.
Signed-off-by: Austen Lauria <awlauria@us.ibm.com>1 parent 252b6bf commit 86b3d10
File tree
4 files changed
+39
-2
lines changed- ompi/mca/coll/hcoll
- opal/mca
- btl/uct
- common/ucx
- rcache/base
4 files changed
+39
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
| 20 | + | |
19 | 21 | | |
20 | 22 | | |
21 | 23 | | |
| |||
327 | 329 | | |
328 | 330 | | |
329 | 331 | | |
| 332 | + | |
330 | 333 | | |
331 | 334 | | |
332 | 335 | | |
| |||
447 | 450 | | |
448 | 451 | | |
449 | 452 | | |
450 | | - | |
451 | | - | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| 46 | + | |
| 47 | + | |
46 | 48 | | |
47 | 49 | | |
48 | 50 | | |
| |||
143 | 145 | | |
144 | 146 | | |
145 | 147 | | |
| 148 | + | |
146 | 149 | | |
147 | 150 | | |
148 | 151 | | |
| |||
667 | 670 | | |
668 | 671 | | |
669 | 672 | | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
| 30 | + | |
29 | 31 | | |
30 | 32 | | |
31 | 33 | | |
| |||
179 | 181 | | |
180 | 182 | | |
181 | 183 | | |
| 184 | + | |
182 | 185 | | |
183 | 186 | | |
184 | 187 | | |
| |||
499 | 502 | | |
500 | 503 | | |
501 | 504 | | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
| 41 | + | |
40 | 42 | | |
41 | 43 | | |
42 | 44 | | |
| |||
70 | 72 | | |
71 | 73 | | |
72 | 74 | | |
| 75 | + | |
73 | 76 | | |
74 | 77 | | |
75 | 78 | | |
| |||
121 | 124 | | |
122 | 125 | | |
123 | 126 | | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
0 commit comments