[PATCH] nebmods: log failure to dlclose() neb modules

Anton Löfgren alofgren at op5.com
Thu Sep 26 08:58:22 CEST 2013


We recently had a problem with a buggy glibc implementation of dlclose
causing module unloading to misbehave. Chances are having been
informed of the result of the dlclose() call would've been helpful in
debugging that.

Signed-off-by: Anton Lofgren <alofgren at op5.com>
---
 base/nebmods.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/base/nebmods.c b/base/nebmods.c
index f6489f8..d98e412 100644
--- a/base/nebmods.c
+++ b/base/nebmods.c
@@ -303,6 +303,11 @@ int neb_unload_module(nebmodule *mod, int flags,
int reason) {

  /* unload the module */
  result = dlclose(mod->module_handle);
+
+ if (result != 0) {
+ logit(NSLOG_RUNTIME_ERROR, TRUE, "Error: Could not unload module
'%s' -> %s\n", mod->filename, dlerror());
+ return ERROR;
+ }
  }

  /* mark the module as being unloaded */
-- 
1.8.4

------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60133471&iu=/4140/ostg.clktrk




More information about the Developers mailing list