From 795edca9215391f7c8f646895c083f8ac8853341 Mon Sep 17 00:00:00 2001 From: Daniel-Constantin Mierla Date: Mon, 5 Mar 2018 21:56:04 +0100 Subject: [PATCH] app_perl: do dlerror() after dlsym() fails to find exports - some OSes do not reset dlerror after a successful dlsym(), pointing to an older error case - reported by GH #1465 --- src/core/sr_module.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/core/sr_module.c b/src/core/sr_module.c index 8a195fc12d6..f04d4869086 100644 --- a/src/core/sr_module.c +++ b/src/core/sr_module.c @@ -619,6 +619,9 @@ int load_module(char* mod_path) } exp = (union module_exports_u*)dlsym(handle, "exports"); if(exp==NULL) { + error =(char*)dlerror(); + LM_DBG("attempt to lookup exports structure failed - dlerror: %s\n", + (error)?error:"none"); /* 'exports' structure not found, look up for '_modulename_exports' */ mdir = strrchr(mod_path, '/'); if (!mdir) {