From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1NfLIR-0000tA-CG for garchives@archives.gentoo.org; Wed, 10 Feb 2010 22:44:35 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 2BB3CE0904; Wed, 10 Feb 2010 22:44:34 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id E150EE0904 for ; Wed, 10 Feb 2010 22:44:33 +0000 (UTC) Received: from stork.gentoo.org (stork.gentoo.org [64.127.104.133]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTP id 8785A1B410E for ; Wed, 10 Feb 2010 22:44:33 +0000 (UTC) Received: from chainsaw by stork.gentoo.org with local (Exim 4.69) (envelope-from ) id 1NfLIP-0004Qu-2g for gentoo-commits@lists.gentoo.org; Wed, 10 Feb 2010 22:44:33 +0000 From: "Tony Vroon (chainsaw)" To: gentoo-commits@lists.gentoo.org Reply-To: gentoo-dev@lists.gentoo.org, chainsaw@gentoo.org Subject: [gentoo-commits] gentoo-x86 commit in net-misc/asterisk/files/1.6.1: asterisk-1.6.1.14-graceful-restart-segfault.patch asterisk-1.6.1.14-parallel-make.patch X-VCS-Repository: gentoo-x86 X-VCS-Files: asterisk-1.6.1.14-graceful-restart-segfault.patch asterisk-1.6.1.14-parallel-make.patch X-VCS-Directories: net-misc/asterisk/files/1.6.1 X-VCS-Committer: chainsaw X-VCS-Committer-Name: Tony Vroon Content-Type: text/plain; charset=utf8 Message-Id: Sender: Tony Vroon Date: Wed, 10 Feb 2010 22:44:33 +0000 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: 5314a2da-e647-493a-9218-ad161c9d2dee X-Archives-Hash: 2387ec46b66e876e17ba7bb45a3b0077 chainsaw 10/02/10 22:44:33 Added: asterisk-1.6.1.14-graceful-restart-segfault.patch asterisk-1.6.1.14-parallel-make.patch Log: Add nv_faxdetect as scavenged by Cory Coager in bug #298328. Trim unnec= essary parts from parallel make patch, upstream bug #16489. Stop segfault= ing on a graceful restart, upstream bugs #16062 & #16470. (Portage version: 2.2_rc62/cvs/Linux x86_64) Revision Changes Path 1.1 net-misc/asterisk/files/1.6.1/asterisk-1.6.1.14-grac= eful-restart-segfault.patch file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/asterisk/= files/1.6.1/asterisk-1.6.1.14-graceful-restart-segfault.patch?rev=3D1.1&v= iew=3Dmarkup plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/asterisk/= files/1.6.1/asterisk-1.6.1.14-graceful-restart-segfault.patch?rev=3D1.1&c= ontent-type=3Dtext/plain Index: asterisk-1.6.1.14-graceful-restart-segfault.patch =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D diff -uNr asterisk-1.6.1.14.ORIG/main/event.c asterisk-1.6.1.14/main/even= t.c --- asterisk-1.6.1.14.ORIG/main/event.c 2010-02-10 22:37:28.868432167 +00= 00 +++ asterisk-1.6.1.14/main/event.c 2010-02-10 22:38:31.532132064 +0000 @@ -841,6 +841,11 @@ struct ast_event_iterator iterator; int res =3D 0; =20 + /* Event has no IEs allocated */ + if (event->event_len < sizeof(*event) + sizeof(ie_type)) { + return NULL; + } + for (ast_event_iterator_init(&iterator, event); !res; res =3D ast_event= _iterator_next(&iterator)) { if (ast_event_iterator_get_ie_type(&iterator) =3D=3D ie_type) return ast_event_iterator_get_ie_raw(&iterator); diff -uNr asterisk-1.6.1.14.ORIG/main/loader.c asterisk-1.6.1.14/main/loa= der.c --- asterisk-1.6.1.14.ORIG/main/loader.c 2010-02-10 22:37:28.863390515 +0= 000 +++ asterisk-1.6.1.14/main/loader.c 2010-02-10 22:38:31.531140265 +0000 @@ -443,26 +443,39 @@ void ast_module_shutdown(void) { struct ast_module *mod; - AST_LIST_HEAD_NOLOCK_STATIC(local_module_list, ast_module); - - /* We have to call the unload() callbacks in reverse order that the mod= ules - * exist in the module list so it is the reverse order of how they were - * loaded. */ + int somethingchanged =3D 1, final =3D 0; =20 AST_LIST_LOCK(&module_list); - while ((mod =3D AST_LIST_REMOVE_HEAD(&module_list, entry))) - AST_LIST_INSERT_HEAD(&local_module_list, mod, entry); - AST_LIST_UNLOCK(&module_list); =20 - while ((mod =3D AST_LIST_REMOVE_HEAD(&local_module_list, entry))) { - if (mod->info->unload) - mod->info->unload(); - /* Since this should only be called when shutting down "gracefully", - * all channels should be down before we get to this point, meaning - * there will be no module users left. */ - AST_LIST_HEAD_DESTROY(&mod->users); - free(mod); - } + /*!\note Some resources, like timers, are started up dynamically, and t= hus + * may be still in use, even if all channels are dead. We must therefo= re + * check the usecount before asking modules to unload. */ + do { + if (!somethingchanged) { + /*!\note If we go through the entire list without changing + * anything, ignore the usecounts and unload, then exit. */ + final =3D 1; + } + + /* Reset flag before traversing the list */ + somethingchanged =3D 0; + + AST_LIST_TRAVERSE_SAFE_BEGIN(&module_list, mod, entry) { + if (!final && mod->usecount) { + continue; + } + AST_LIST_REMOVE_CURRENT(entry); + if (mod->info->unload) { + mod->info->unload(); + } + AST_LIST_HEAD_DESTROY(&mod->users); + free(mod); + somethingchanged =3D 1; + } + AST_LIST_TRAVERSE_SAFE_END; + } while (somethingchanged && !final); + + AST_LIST_UNLOCK(&module_list); } =20 int ast_unload_resource(const char *resource_name, enum ast_module_unloa= d_mode force) 1.1 net-misc/asterisk/files/1.6.1/asterisk-1.6.1.14-para= llel-make.patch file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/asterisk/= files/1.6.1/asterisk-1.6.1.14-parallel-make.patch?rev=3D1.1&view=3Dmarkup plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/asterisk/= files/1.6.1/asterisk-1.6.1.14-parallel-make.patch?rev=3D1.1&content-type=3D= text/plain Index: asterisk-1.6.1.14-parallel-make.patch =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D diff -uNr asterisk-1.6.1.14.ORIG/Makefile asterisk-1.6.1.14/Makefile --- asterisk-1.6.1.14.ORIG/Makefile 2010-02-10 22:33:29.357131986 +0000 +++ asterisk-1.6.1.14/Makefile 2010-02-10 22:34:26.505462558 +0000 @@ -556,7 +556,7 @@ fi =20 $(SUBDIRS_INSTALL): - @DESTDIR=3D"$(DESTDIR)" ASTSBINDIR=3D"$(ASTSBINDIR)" $(SUBMAKE) -C $(@:= -install=3D) install + +@DESTDIR=3D"$(DESTDIR)" ASTSBINDIR=3D"$(ASTSBINDIR)" $(SUBMAKE) -C $(@= :-install=3D) install =20 NEWMODS:=3D$(foreach d,$(MOD_SUBDIRS),$(notdir $(wildcard $(d)/*.so))) OLDMODS=3D$(filter-out $(NEWMODS),$(notdir $(wildcard $(DESTDIR)$(MODULE= S_DIR)/*.so))) @@ -805,7 +805,7 @@ @cmp -s .cleancount .lastclean || $(MAKE) clean =20 $(SUBDIRS_UNINSTALL): - @$(SUBMAKE) -C $(@:-uninstall=3D) uninstall + +@$(SUBMAKE) -C $(@:-uninstall=3D) uninstall =20 _uninstall: $(SUBDIRS_UNINSTALL) rm -f $(DESTDIR)$(MODULES_DIR)/*