Gentoo Archives: gentoo-commits

From: "Tony Vroon (chainsaw)" <chainsaw@g.o>
To: gentoo-commits@l.g.o
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
Date: Wed, 10 Feb 2010 22:44:35
Message-Id: E1NfLIP-0004Qu-2g@stork.gentoo.org
1 chainsaw 10/02/10 22:44:33
2
3 Added: asterisk-1.6.1.14-graceful-restart-segfault.patch
4 asterisk-1.6.1.14-parallel-make.patch
5 Log:
6 Add nv_faxdetect as scavenged by Cory Coager in bug #298328. Trim unnecessary parts from parallel make patch, upstream bug #16489. Stop segfaulting on a graceful restart, upstream bugs #16062 & #16470.
7 (Portage version: 2.2_rc62/cvs/Linux x86_64)
8
9 Revision Changes Path
10 1.1 net-misc/asterisk/files/1.6.1/asterisk-1.6.1.14-graceful-restart-segfault.patch
11
12 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=1.1&view=markup
13 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=1.1&content-type=text/plain
14
15 Index: asterisk-1.6.1.14-graceful-restart-segfault.patch
16 ===================================================================
17 diff -uNr asterisk-1.6.1.14.ORIG/main/event.c asterisk-1.6.1.14/main/event.c
18 --- asterisk-1.6.1.14.ORIG/main/event.c 2010-02-10 22:37:28.868432167 +0000
19 +++ asterisk-1.6.1.14/main/event.c 2010-02-10 22:38:31.532132064 +0000
20 @@ -841,6 +841,11 @@
21 struct ast_event_iterator iterator;
22 int res = 0;
23
24 + /* Event has no IEs allocated */
25 + if (event->event_len < sizeof(*event) + sizeof(ie_type)) {
26 + return NULL;
27 + }
28 +
29 for (ast_event_iterator_init(&iterator, event); !res; res = ast_event_iterator_next(&iterator)) {
30 if (ast_event_iterator_get_ie_type(&iterator) == ie_type)
31 return ast_event_iterator_get_ie_raw(&iterator);
32 diff -uNr asterisk-1.6.1.14.ORIG/main/loader.c asterisk-1.6.1.14/main/loader.c
33 --- asterisk-1.6.1.14.ORIG/main/loader.c 2010-02-10 22:37:28.863390515 +0000
34 +++ asterisk-1.6.1.14/main/loader.c 2010-02-10 22:38:31.531140265 +0000
35 @@ -443,26 +443,39 @@
36 void ast_module_shutdown(void)
37 {
38 struct ast_module *mod;
39 - AST_LIST_HEAD_NOLOCK_STATIC(local_module_list, ast_module);
40 -
41 - /* We have to call the unload() callbacks in reverse order that the modules
42 - * exist in the module list so it is the reverse order of how they were
43 - * loaded. */
44 + int somethingchanged = 1, final = 0;
45
46 AST_LIST_LOCK(&module_list);
47 - while ((mod = AST_LIST_REMOVE_HEAD(&module_list, entry)))
48 - AST_LIST_INSERT_HEAD(&local_module_list, mod, entry);
49 - AST_LIST_UNLOCK(&module_list);
50
51 - while ((mod = AST_LIST_REMOVE_HEAD(&local_module_list, entry))) {
52 - if (mod->info->unload)
53 - mod->info->unload();
54 - /* Since this should only be called when shutting down "gracefully",
55 - * all channels should be down before we get to this point, meaning
56 - * there will be no module users left. */
57 - AST_LIST_HEAD_DESTROY(&mod->users);
58 - free(mod);
59 - }
60 + /*!\note Some resources, like timers, are started up dynamically, and thus
61 + * may be still in use, even if all channels are dead. We must therefore
62 + * check the usecount before asking modules to unload. */
63 + do {
64 + if (!somethingchanged) {
65 + /*!\note If we go through the entire list without changing
66 + * anything, ignore the usecounts and unload, then exit. */
67 + final = 1;
68 + }
69 +
70 + /* Reset flag before traversing the list */
71 + somethingchanged = 0;
72 +
73 + AST_LIST_TRAVERSE_SAFE_BEGIN(&module_list, mod, entry) {
74 + if (!final && mod->usecount) {
75 + continue;
76 + }
77 + AST_LIST_REMOVE_CURRENT(entry);
78 + if (mod->info->unload) {
79 + mod->info->unload();
80 + }
81 + AST_LIST_HEAD_DESTROY(&mod->users);
82 + free(mod);
83 + somethingchanged = 1;
84 + }
85 + AST_LIST_TRAVERSE_SAFE_END;
86 + } while (somethingchanged && !final);
87 +
88 + AST_LIST_UNLOCK(&module_list);
89 }
90
91 int ast_unload_resource(const char *resource_name, enum ast_module_unload_mode force)
92
93
94
95 1.1 net-misc/asterisk/files/1.6.1/asterisk-1.6.1.14-parallel-make.patch
96
97 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=1.1&view=markup
98 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=1.1&content-type=text/plain
99
100 Index: asterisk-1.6.1.14-parallel-make.patch
101 ===================================================================
102 diff -uNr asterisk-1.6.1.14.ORIG/Makefile asterisk-1.6.1.14/Makefile
103 --- asterisk-1.6.1.14.ORIG/Makefile 2010-02-10 22:33:29.357131986 +0000
104 +++ asterisk-1.6.1.14/Makefile 2010-02-10 22:34:26.505462558 +0000
105 @@ -556,7 +556,7 @@
106 fi
107
108 $(SUBDIRS_INSTALL):
109 - @DESTDIR="$(DESTDIR)" ASTSBINDIR="$(ASTSBINDIR)" $(SUBMAKE) -C $(@:-install=) install
110 + +@DESTDIR="$(DESTDIR)" ASTSBINDIR="$(ASTSBINDIR)" $(SUBMAKE) -C $(@:-install=) install
111
112 NEWMODS:=$(foreach d,$(MOD_SUBDIRS),$(notdir $(wildcard $(d)/*.so)))
113 OLDMODS=$(filter-out $(NEWMODS),$(notdir $(wildcard $(DESTDIR)$(MODULES_DIR)/*.so)))
114 @@ -805,7 +805,7 @@
115 @cmp -s .cleancount .lastclean || $(MAKE) clean
116
117 $(SUBDIRS_UNINSTALL):
118 - @$(SUBMAKE) -C $(@:-uninstall=) uninstall
119 + +@$(SUBMAKE) -C $(@:-uninstall=) uninstall
120
121 _uninstall: $(SUBDIRS_UNINSTALL)
122 rm -f $(DESTDIR)$(MODULES_DIR)/*