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 a module is loaded to the runtime, we may get an error when handling module links. The loaded module has to be freed in such case, and thus another error may occur when the whole runtime is being freed: the module is freed before may be freed for the second time.
For example, somethings wrong happened after this statement in platforms/app/main.c:
result = link_all (module);
if (result) goto on_error;
if (wasm_bins_qty < MAX_MODULES) {
wasm_bins[wasm_bins_qty++] = wasm;
}
return result;
on_error:
m3_FreeModule(module);
if (wasm) free(wasm);
if (f) fclose(f);
return result;
and then m3_FreeModule is called.
However, at the end of the whole process, we do this:
m3_FreeRuntime (runtime);
m3_FreeEnvironment (env);
return result ? 1 : 0;
The formerly freed module will be freed twice and thus make a segment fault occur.
The text was updated successfully, but these errors were encountered:
A module maybe freed after it is loaded to the runtime and before
the runtime is released. Hence, it is necessary to remove the module
from the runtime's module list to avoid one module be freed twice.
Fixwasm3#389
After a module is loaded to the runtime, we may get an error when handling module links. The loaded module has to be freed in such case, and thus another error may occur when the whole runtime is being freed: the module is freed before may be freed for the second time.
For example, somethings wrong happened after this statement in
platforms/app/main.c
:and then
m3_FreeModule
is called.However, at the end of the whole process, we do this:
The formerly freed module will be freed twice and thus make a segment fault occur.
The text was updated successfully, but these errors were encountered: