summaryrefslogtreecommitdiff
path: root/comms
diff options
context:
space:
mode:
authormanu <manu@pkgsrc.org>2015-04-28 08:48:11 +0000
committermanu <manu@pkgsrc.org>2015-04-28 08:48:11 +0000
commit385792a5c75aacf1d1a01339d9b8226feff04fdd (patch)
tree4db1cf54f89b9f2e3cf402a657a5664b2ab7ea69 /comms
parent5ae9a96e7fae2a380ca8db5bc774572c60a0c7f2 (diff)
downloadpkgsrc-385792a5c75aacf1d1a01339d9b8226feff04fdd.tar.gz
Fix crash in asterisk18 startup
The added patch fixes startup crash and was submitted upstream. While there also remove the ban on i386, as it was tested to run fine.
Diffstat (limited to 'comms')
-rw-r--r--comms/asterisk18/Makefile7
-rw-r--r--comms/asterisk18/distinfo3
-rw-r--r--comms/asterisk18/patches/patch-main_loader.c45
3 files changed, 49 insertions, 6 deletions
diff --git a/comms/asterisk18/Makefile b/comms/asterisk18/Makefile
index 8b6572984d2..44dd3935a0a 100644
--- a/comms/asterisk18/Makefile
+++ b/comms/asterisk18/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.96 2015/04/26 11:52:18 ryoon Exp $
+# $NetBSD: Makefile,v 1.97 2015/04/28 08:48:11 manu Exp $
#
# NOTE: when updating this package, there are two places that sound
# tarballs need to be checked
@@ -7,7 +7,7 @@ DISTNAME= asterisk-1.8.32.3
DIST_SUBDIR= ${PKGNAME_NOREV}
DISTFILES= ${DEFAULT_DISTFILES}
EXTRACT_ONLY= ${DISTNAME}.tar.gz
-PKGREVISION= 2
+PKGREVISION= 3
CATEGORIES= comms net audio
MASTER_SITES= http://downloads.asterisk.org/pub/telephony/asterisk/ \
http://downloads.asterisk.org/pub/telephony/asterisk/old-releases/ \
@@ -18,9 +18,6 @@ HOMEPAGE= http://www.asterisk.org/
COMMENT= The Asterisk Software PBX
LICENSE= gnu-gpl-v2
-# known to have issues on i386, block the package until the bug is fixed
-BROKEN_ON_PLATFORM= NetBSD-*-i386
-
CONFLICTS+= asterisk-sounds-extra-[0-9]*
.include "../../mk/bsd.prefs.mk"
diff --git a/comms/asterisk18/distinfo b/comms/asterisk18/distinfo
index 20a36d32901..fdace6a23cf 100644
--- a/comms/asterisk18/distinfo
+++ b/comms/asterisk18/distinfo
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.60 2015/04/12 03:35:38 jnemeth Exp $
+$NetBSD: distinfo,v 1.61 2015/04/28 08:48:11 manu Exp $
SHA1 (asterisk-1.8.32.3/asterisk-1.8.32.3.tar.gz) = ba0fd90fd744e423950d66c5d3e777419050d62e
RMD160 (asterisk-1.8.32.3/asterisk-1.8.32.3.tar.gz) = 431785ace9f8a516ed6def6cf193fc8cd06b2967
@@ -39,3 +39,4 @@ SHA1 (patch-bm) = 284b34e20091b3427cd67b835fc7aa62c9d92a6c
SHA1 (patch-bn) = 51d14bde5591bd4a68c8074838196e05ac86f2f2
SHA1 (patch-bo) = ff43d14e2608dd08d7d03799dfe9847f9f7f5666
SHA1 (patch-bp) = 44c903536522e61790588680383b0ab2879edd65
+SHA1 (patch-main_loader.c) = a4cc248a7767eca712618fadf3a1ddc7f4977921
diff --git a/comms/asterisk18/patches/patch-main_loader.c b/comms/asterisk18/patches/patch-main_loader.c
new file mode 100644
index 00000000000..990d265bd0e
--- /dev/null
+++ b/comms/asterisk18/patches/patch-main_loader.c
@@ -0,0 +1,45 @@
+$NetBSD: patch-main_loader.c,v 1.1 2015/04/28 08:48:11 manu Exp $
+
+Fix unloaded module DSO usage
+
+If a module once failed to load with globaly exposed symbols, the DSO
+is unloaded while the struct ast_module remains valid and referenced,
+with just mod->lib being NULL.
+
+If the module is later attempted to be loaded again, make sure the DSO
+is loaded again to avoid an unpleasant crash.
+
+Also add a test to catch the situation where something went wrong and
+loading failed again.
+
+Submitted upstream in
+https://issues.asterisk.org/jira/browse/ASTERISK-25021
+
+--- main/loader.c.orig 2015-04-27 17:33:30.000000000 +0200
++++ main/loader.c 2015-04-27 18:01:28.000000000 +0200
+@@ -894,9 +894,9 @@
+ {
+ struct ast_module *mod;
+ enum ast_module_load_result res = AST_MODULE_LOAD_SUCCESS;
+
+- if ((mod = find_resource(resource_name, 0))) {
++ if ((mod = find_resource(resource_name, 0)) && (mod->lib != NULL)) {
+ if (mod->flags.running) {
+ ast_log(LOG_WARNING, "Module '%s' already exists.\n", resource_name);
+ return AST_MODULE_LOAD_DECLINE;
+ }
+@@ -918,8 +918,14 @@
+ return required ? AST_MODULE_LOAD_FAILURE : AST_MODULE_LOAD_DECLINE;
+ #endif
+ }
+
++ if (mod->lib == NULL) {
++ ast_log(LOG_ERROR, "Module '%s' was unloaded.\n", resource_name);
++ return required ? AST_MODULE_LOAD_FAILURE : AST_MODULE_LOAD_DECLINE;
++ }
++
++
+ if (inspect_module(mod)) {
+ ast_log(LOG_WARNING, "Module '%s' could not be loaded.\n", resource_name);
+ #ifdef LOADABLE_MODULES
+ unload_dynamic_module(mod);