[education/rkward] rkward/rbackend: Do not use dlmopen after all: It causes library(tlctk) to crash, for some reason

Thomas Friedrichsmeier null at kde.org
Mon Jun 24 21:04:05 BST 2024


Git commit 33eda89bdde272b6da4d227cab8946036cf6216c by Thomas Friedrichsmeier.
Committed on 24/06/2024 at 20:03.
Pushed by tfry into branch 'master'.

Do not use dlmopen after all: It causes library(tlctk) to crash, for some reason

M  +4    -2    rkward/rbackend/rkrbackend_dlopen.cpp

https://invent.kde.org/education/rkward/-/commit/33eda89bdde272b6da4d227cab8946036cf6216c

diff --git a/rkward/rbackend/rkrbackend_dlopen.cpp b/rkward/rbackend/rkrbackend_dlopen.cpp
index 643e40e4e..075c9800c 100644
--- a/rkward/rbackend/rkrbackend_dlopen.cpp
+++ b/rkward/rbackend/rkrbackend_dlopen.cpp
@@ -39,12 +39,14 @@ void *resolve_symb(void* dllinfo, const char* name) {
 auto loadlib(const char* name) {
 #if defined(Win32)
 	auto ret = LoadLibraryA(name);
-#elif defined(LM_ID_NEWLM) && !defined(__SANITIZE_ADDRESS__)
+#elif 0 && defined(LM_ID_NEWLM) && !defined(__SANITIZE_ADDRESS__)
+	// NOTE / TODO: with this, we get Cstack use too close to the limit when loading library(tcltk)
 	auto ret = dlmopen(LM_ID_NEWLM, name, RTLD_NOW | RTLD_LOCAL);
+#elif defined(RTLD_DEEPBIND) && !defined(__SANITIZE_ADDRESS__)
+	auto ret = dlopen(name, RTLD_NOW | RTLD_LOCAL | RTLD_DEEPBIND);
 #else
 	auto ret = dlopen(name, RTLD_NOW | RTLD_LOCAL);  // NOTE: RTLD_DEEPBIND causes undiagnosed runtime failure on Suse Tumbleweed around 05/24 (while it works, elsewhere)
 	                                                 //       possibly again due to address sanitization on the gitlab job?
-#warning dlmopen is not available on this platform, or disabled due to compiling with address_sanitizer
 #endif
 	if (!ret) {
 #ifdef Win32


More information about the rkward-tracker mailing list