[icinga-checkins] icinga.org: icinga-core/tdressler/sqlite: idoutils: fix segfaults on reload with multiple neb modules of the same binary

git at icinga.org git at icinga.org
Wed May 22 20:54:52 CEST 2013


Module: icinga-core
Branch: tdressler/sqlite
Commit: 0eb96714dc100ec26a17b626378fd41f042221d1
URL:    https://git.icinga.org/?p=icinga-core.git;a=commit;h=0eb96714dc100ec26a17b626378fd41f042221d1

Author: Michael Friedrich <michael.friedrich at netways.de>
Date:   Sat May 18 19:30:31 2013 +0200

idoutils: fix segfaults on reload with multiple neb modules of the same binary

my bad, the loop did not fetch the correct next address pointer for
free'ing the module list items, resulting in a SIGSEGV.

fixed, but unveils a different problem - multiple handles of a binary
loaded via dlopen() share the same global symbol space which means that
the registered callback functions only work for the first match.

fixes #4033

---

 Changelog      |    5 +++++
 base/nebmods.c |    3 +--
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/Changelog b/Changelog
index e562a6b..ff009b7 100644
--- a/Changelog
+++ b/Changelog
@@ -13,6 +13,11 @@ UPGRADE NOTES
 	- idoutils: ${source}/module/idoutils/config/updates
 * package locations may differ!
 
+1.9.1 - XX/XX/2013
+
+FIXES
+* idoutils: fix segfaults on reload with multiple neb modules of the same binary #4033 - MF
+
 1.9.0 - 07/05/2013
 
 NOTES
diff --git a/base/nebmods.c b/base/nebmods.c
index 3395a54..5264ebc 100644
--- a/base/nebmods.c
+++ b/base/nebmods.c
@@ -124,14 +124,13 @@ int neb_free_module_list(void) {
 	nebmodule *next_module = NULL;
 	int x = OK;
 
-	for (temp_module = neb_module_list; temp_module;) {
+	for (temp_module = neb_module_list; temp_module; temp_module = next_module) {
 		next_module = temp_module->next;
 		my_free(temp_module->filename);
 		my_free(temp_module->args);
 		for (x = 0; x < NEBMODULE_MODINFO_NUMITEMS; x++)
 			my_free(temp_module->info[x]);
 		my_free(temp_module);
-		temp_module = next_module;
 	}
 
 	neb_module_list = NULL;





More information about the icinga-checkins mailing list