New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
'box.schema.func.drop' doesn't unload module #4648
Comments
Gerold103
added a commit
that referenced
this issue
Nov 26, 2019
Error injections are used to simulate an error. They are represented as a flag, or a number, and are used in Lua tests. But they don't have any feedback. That makes impossible to use the injections to check that something has happened. Something very needed to be checked, and impossible to check in a different way. More certainly, the patch is motivated by a necessity to count loaded dynamic libraries to ensure, that they are loaded and unloaded when expected. This is impossible to do in a platform independent way. But an error injection as a debug-only counter would solve the problem. Needed for #4648
Gerold103
added a commit
that referenced
this issue
Nov 26, 2019
C functions are loaded from .so/.dylib dynamic libraries. A library is loaded when any function from there is called first time. And was supposed to be unloaded, when all its functions are dropped from the schema (box.schema.func.drop()), and none of them is still in a call. But the unloading part was broken. In fact, box.schema.func.drop() never unloaded anything. Moreover, when functions from the module were added again without a restart, it led to a second mmap of the same module. And so on, the same library could be loaded any number of times. The problem was in a useless flag in struct module preventing its unloading even when it is totally unused. It is dropped. Closes #4648
Gerold103
added a commit
that referenced
this issue
Nov 27, 2019
C functions are loaded from .so/.dylib dynamic libraries. A library is loaded when any function from there is called first time. And was supposed to be unloaded, when all its functions are dropped from the schema (box.schema.func.drop()), and none of them is still in a call. But the unloading part was broken. In fact, box.schema.func.drop() never unloaded anything. Moreover, when functions from the module were added again without a restart, it led to a second mmap of the same module. And so on, the same library could be loaded any number of times. The problem was in a useless flag in struct module preventing its unloading even when it is totally unused. It is dropped. Closes #4648
kyukhin
pushed a commit
that referenced
this issue
Dec 10, 2019
Error injections are used to simulate an error. They are represented as a flag, or a number, and are used in Lua tests. But they don't have any feedback. That makes impossible to use the injections to check that something has happened. Something very needed to be checked, and impossible to check in a different way. More certainly, the patch is motivated by a necessity to count loaded dynamic libraries to ensure, that they are loaded and unloaded when expected. This is impossible to do in a platform independent way. But an error injection as a debug-only counter would solve the problem. Needed for #4648
kyukhin
pushed a commit
that referenced
this issue
Dec 10, 2019
C functions are loaded from .so/.dylib dynamic libraries. A library is loaded when any function from there is called first time. And was supposed to be unloaded, when all its functions are dropped from the schema (box.schema.func.drop()), and none of them is still in a call. But the unloading part was broken. In fact, box.schema.func.drop() never unloaded anything. Moreover, when functions from the module were added again without a restart, it led to a second mmap of the same module. And so on, the same library could be loaded any number of times. The problem was in a useless flag in struct module preventing its unloading even when it is totally unused. It is dropped. Closes #4648
kyukhin
pushed a commit
that referenced
this issue
Dec 10, 2019
Error injections are used to simulate an error. They are represented as a flag, or a number, and are used in Lua tests. But they don't have any feedback. That makes impossible to use the injections to check that something has happened. Something very needed to be checked, and impossible to check in a different way. More certainly, the patch is motivated by a necessity to count loaded dynamic libraries to ensure, that they are loaded and unloaded when expected. This is impossible to do in a platform independent way. But an error injection as a debug-only counter would solve the problem. Needed for #4648
Gerold103
added a commit
that referenced
this issue
Dec 11, 2019
Error injections are used to simulate an error. They are represented as a flag, or a number, and are used in Lua tests. But they don't have any feedback. That makes impossible to use the injections to check that something has happened. Something very needed to be checked, and impossible to check in a different way. More certainly, the patch is motivated by a necessity to count loaded dynamic libraries to ensure, that they are loaded and unloaded when expected. This is impossible to do in a platform independent way. But an error injection as a debug-only counter would solve the problem. Needed for #4648 (cherry picked from commit c3c6d3f)
Gerold103
added a commit
that referenced
this issue
Dec 11, 2019
C functions are loaded from .so/.dylib dynamic libraries. A library is loaded when any function from there is called first time. And was supposed to be unloaded, when all its functions are dropped from the schema (box.schema.func.drop()), and none of them is still in a call. But the unloading part was broken. In fact, box.schema.func.drop() never unloaded anything. Moreover, when functions from the module were added again without a restart, it led to a second mmap of the same module. And so on, the same library could be loaded any number of times. The problem was in a useless flag in struct module preventing its unloading even when it is totally unused. It is dropped. Closes #4648 (cherry picked from commit ca07088)
kyukhin
pushed a commit
that referenced
this issue
Dec 19, 2019
Error injections are used to simulate an error. They are represented as a flag, or a number, and are used in Lua tests. But they don't have any feedback. That makes impossible to use the injections to check that something has happened. Something very needed to be checked, and impossible to check in a different way. More certainly, the patch is motivated by a necessity to count loaded dynamic libraries to ensure, that they are loaded and unloaded when expected. This is impossible to do in a platform independent way. But an error injection as a debug-only counter would solve the problem. Needed for #4648 (cherry picked from commit c3c6d3f)
kyukhin
pushed a commit
that referenced
this issue
Dec 19, 2019
C functions are loaded from .so/.dylib dynamic libraries. A library is loaded when any function from there is called first time. And was supposed to be unloaded, when all its functions are dropped from the schema (box.schema.func.drop()), and none of them is still in a call. But the unloading part was broken. In fact, box.schema.func.drop() never unloaded anything. Moreover, when functions from the module were added again without a restart, it led to a second mmap of the same module. And so on, the same library could be loaded any number of times. The problem was in a useless flag in struct module preventing its unloading even when it is totally unused. It is dropped. Closes #4648 (cherry picked from commit ca07088)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Tarantool version: 1.10.3-121-g7721d26
OS version: CentOS 6
Bug description:
Tarantool doesn't unload a shared library after all functions from it are dropped through
box.schema.func.drop
. Moreover, if you create a new function from such a library it will load it again.Steps to reproduce:
box.schema.func.create
.box.schema.func.drop
.The text was updated successfully, but these errors were encountered: