ABI-incompatible language bindings are loaded unconditionally
mvidner opened this issue · 4 comments
To facilitate implementing YaST modules in various languages, yast2-core loads the optional language binding libraries, /usr/lib*/YaST2/plugin/libpy2lang_*.so
, packaged in yast2-*-bindings.rpm
.
But these are loaded even when we have compiled an incompatible core (eg. lexer_comments, because of adding comment members to YCode
) and want to run that from the working copy. This is the cause of @dmajda's crash. We've worked around it by using ./configure --prefix=/nosuchpath
in his WC. (Another workaround is to uninstall the bindings)
Also, IIUC, this was the cause of the crashes in Jenkins last week. @jreidinger can you confirm that and comment on my proposed solution?:
I think we should have a switch to enable/disable the language plugin loading. It should stay enabled by default for compatibility. I propose an environment variable, Y2DISABLELANGUAGEPLUGINS=...
, to be checked in Y2LanguageLoader::Y2LanguageLoader ().
In some way that was the problem on Jenkins but it applies to all plugins, not only language bindings.
I have realized that this is actually two problems:
- Incompatible plugins, which I experienced with language plugins but others with different plugins.
- Loading the language plugins at all. This breaks the yast2-core tests if the rubified yast rpms are installed. Because one language is searched completely before the other, the
/usr
installed Ruby file gets priority over the./testsuite/tests
YCP file.
My fix in #24 so far addresses only (2) and I need to trigger the breakage with other plugins to understand it and fix it.
Yes, it is valid, but not a problem in practice because we seldom touch the yast2-core API. The same problem is much more frequent in libyui so we should solve it there.