File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -879,20 +879,14 @@ class ET_EXPERIMENTAL CudaBackend final
879879 // NOTE: AOTInductorModelContainerDelete does not work correctly with
880880 // multiple .so files. Deleting one container frees shared resources,
881881 // which causes segmentation faults when attempting to delete other
882- // containers. As a workaround, we skip explicit container deletion
883- // and defer cleanup to the OS.
882+ // containers. As a workaround, we skip explicit container deletion and
883+ // defer cleanup to the OS. The corresponding shared library must remain
884+ // loaded as well: the leaked container still owns objects whose code and
885+ // process-wide state live in that library, so dlclose/FreeLibrary can
886+ // invalidate them and crash during multi-method teardown.
884887 // TODO(gasoonjia): Find a proper solution for safe container deletion.
885888 // AOTInductorModelContainerDelete(handle->container_handle);
886889
887- // Now close the shared library
888- if (handle->so_handle != nullptr ) {
889- Error err = close_library (handle->so_handle );
890- ET_CHECK_OR_LOG_ERROR (
891- err == Error::Ok,
892- " Failed to close shared library for %s" ,
893- handle->so_path .c_str ());
894- }
895-
896890 // Remove the temporary shared library file
897891 if (!handle->so_path .empty ()) {
898892 std::error_code remove_error;
You can’t perform that action at this time.
0 commit comments