Skip to content
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

New Tumbleweed's glibc makes recursion.py test fail #128

Open
giulianobelinassi opened this issue May 12, 2022 · 0 comments
Open

New Tumbleweed's glibc makes recursion.py test fail #128

giulianobelinassi opened this issue May 12, 2022 · 0 comments

Comments

@giulianobelinassi
Copy link
Collaborator

When a livepatch is scheduled to be applied, the ulp trigger tool loads the .so in order to check if all symbols declared in the metadata is present there. However, if the .so file references symbols in any library that is expected to be loaded in target process but not loaded on the ulp tool, dlopen now fails to load it.

This new dlopen behavior was introduced in newest versions of glibc.

The following patch was applied to recursion testcase for it to pass with the newest glibc:

--- a/tests/librecursion_livepatch1.c
+++ b/tests/librecursion_livepatch1.c
@@ -19,10 +19,10 @@
  *  along with libpulp.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#include <librecursion.h>
+int (*lucas_ptr)(int) = (void *) 0L;
 
 long long int
 new_recursion(long long int n)
 {
-  return lucas(n);
+  return lucas_ptr(n);
 }
diff --git a/tests/librecursion_livepatch1.in b/tests/librecursion_livepatch1.in
index afe2c92..0ffe5a5 100644
--- a/tests/librecursion_livepatch1.in
+++ b/tests/librecursion_livepatch1.in
@@ -1,3 +1,4 @@
 __ABS_BUILDDIR__/.libs/librecursion_livepatch1.so
 @__ABS_BUILDDIR__/.libs/librecursion.so.0
 recursion:new_recursion
+#lucas:lucas_ptr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant