{"record":{"id":"adf21280caa81764","repo":"wasmerio/wasmer","slug":"internal-error-module-resolved-from-not-loade","errorCode":null,"errorMessage":"Internal error: module {resolved_from:?} not loaded by this group","messagePattern":"Internal error: module (.+?) not loaded by this group","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"lib/wasix/src/state/linker/instance_group/table.rs","lineNumber":147,"sourceCode":"        Ok(())\n    }\n\n    pub(super) fn apply_resolved_function(\n        &self,\n        store: &mut impl AsStoreMut,\n        name: &str,\n        resolved_from: ModuleHandle,\n        function_table_index: u32,\n    ) -> Result<(), LinkError> {\n        trace!(\n            ?name,\n            ?resolved_from,\n            function_table_index,\n            \"Applying resolved function\"\n        );\n\n        let instance = &self.try_instance(resolved_from).unwrap_or_else(|| {\n            panic!(\"Internal error: module {resolved_from:?} not loaded by this group\")\n        });\n\n        let func = instance.exports.get_function(name).unwrap_or_else(|e| {\n            panic!(\"Internal error: failed to resolve exported function {name}: {e:?}\")\n        });\n\n        self.place_in_function_table_at(store, func.clone(), function_table_index)\n            .map_err(LinkError::TableAllocationError)?;\n\n        Ok(())\n    }\n\n    pub(super) fn apply_function_table_allocation(\n        &mut self,\n        store: &mut impl AsStoreMut,\n        index: u32,\n        size: u32,\n    ) -> Result<(), LinkError> {","sourceCodeStart":129,"sourceCodeEnd":165,"githubUrl":"https://github.com/wasmerio/wasmer/blob/8c4b9ee9d33fb2068863fbb3d328683e7e6ff7f5/lib/wasix/src/state/linker/instance_group/table.rs#L129-L165","documentation":"apply_resolved_function looks up the instance for the module a symbol was resolved from (try_instance) and panics if the group has no such instance. A resolution record says a symbol comes from module X, but module X was never instantiated (or was dropped) in this instance group, so its exports cannot be read to place the function in the table.","triggerScenarios":"apply_requested_symbols_from_linker or apply_dl_operation applying resolutions where resolved_from names a module not present in the group's instances/side_instances; the producing module failed to instantiate earlier but its symbols were still recorded as resolutions.","commonSituations":"dlopen of module B whose symbols resolve into module A that was never loaded; removing/unloading a module while resolutions pointing to it are still pending; resolution records shared from a different instance group.","solutions":["Load (instantiate) the module that provides the symbol before applying requested symbols from the linker","Check the load order in your dynamic-loading flow so dependency modules are instantiated first","Rebuild LinkerState resolutions in the same instance group that owns the producing instances","Verify no unload/remove operation ran before apply_dl_operation finished"],"exampleFix":"// before: applying symbols resolved from a module never loaded\ngroup.apply_requested_symbols_from_linker(store, &linker_state)?;\n// after: ensure the provider module is instantiated first\ngroup.apply_dl_operation(store, &linker_state, DlOperation::Load { handle: provider, .. })?;\ngroup.apply_requested_symbols_from_linker(store, &linker_state)?;","handlingStrategy":"validation","validationCode":"fn provider_loaded(group: &InstanceGroup, from: &ModuleHandle) -> bool {\n    group.try_instance(from).is_some()\n}\n// before apply_requested_symbols_from_linker:\n// ensure every resolution's resolved_from is in the group\nfor r in state.resolutions() {\n    assert!(provider_loaded(&group, r.resolved_from()), \"load provider first\");\n}","typeGuard":"fn has_instance(group: &InstanceGroup, h: &ModuleHandle) -> bool {\n    group.try_instance(h).is_some()\n}","tryCatchPattern":null,"preventionTips":["Instantiate dependency (provider) modules before applying requested symbols","Never unload a module while resolutions pointing to it are pending","Build resolutions in the same group that owns the instances","Log load order and verify dependency closure before linking"],"tags":["linker","missing-module","internal-invariant","panic"],"backgroundTag":"linker-module-not-loaded","analyzedSha":"8c4b9ee9d33fb2068863fbb3d328683e7e6ff7f5","analyzedAt":"2026-09-01T23:06:31.009Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T06:17:21.866Z"}