Repository navigation
Commit 13ab2f1
cuda.core: hold ipc_import_mutex while freeing an imported IPC pointer
With the GIL reorder in place, the concurrent-import test crashes on CUDA 12.9
(SIGSEGV, or glibc "double free or corruption") because the deleter did not
take ipc_import_mutex. When the last reference to a cached import drops, the
cache entry's weak_ptr expires before the deleter has freed the mapping. A
concurrent importer that looks the key up in that window sees a miss and
imports the allocation again; the driver returns a duplicate pointer to the
same mapping (nvbug 5570902), and the first cuMemFreeAsync unmaps it for both.
Release the GIL first, then hold the mutex across unregister and free, so the
concurrent importer waits until the mapping is gone and imports fresh.
Co-Authored-By: Claude Fable 5.1 <[email protected]>1 parent 7d2819d commit 13ab2f1
1 file changed
Lines changed: 7 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1545 | 1545 | | |
1546 | 1546 | | |
1547 | 1547 | | |
1548 | | - | |
| 1548 | + | |
| 1549 | + | |
| 1550 | + | |
| 1551 | + | |
| 1552 | + | |
1549 | 1553 | | |
| 1554 | + | |
| 1555 | + | |
1550 | 1556 | | |
1551 | 1557 | | |
1552 | 1558 | | |
| |||
0 commit comments