pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/comms/asterisk18 Fix crash in asterisk18 startup



details:   https://anonhg.NetBSD.org/pkgsrc/rev/7cea61a27762
branches:  trunk
changeset: 650914:7cea61a27762
user:      manu <manu%pkgsrc.org@localhost>
date:      Tue Apr 28 08:48:11 2015 +0000

description:
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:

 comms/asterisk18/Makefile                    |   7 +---
 comms/asterisk18/distinfo                    |   3 +-
 comms/asterisk18/patches/patch-main_loader.c |  45 ++++++++++++++++++++++++++++
 3 files changed, 49 insertions(+), 6 deletions(-)

diffs (91 lines):

diff -r 3781f3ada936 -r 7cea61a27762 comms/asterisk18/Makefile
--- a/comms/asterisk18/Makefile Tue Apr 28 07:27:02 2015 +0000
+++ b/comms/asterisk18/Makefile Tue Apr 28 08:48:11 2015 +0000
@@ -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 @@
 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 @@
 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 -r 3781f3ada936 -r 7cea61a27762 comms/asterisk18/distinfo
--- a/comms/asterisk18/distinfo Tue Apr 28 07:27:02 2015 +0000
+++ b/comms/asterisk18/distinfo Tue Apr 28 08:48:11 2015 +0000
@@ -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-bn) = 51d14bde5591bd4a68c8074838196e05ac86f2f2
 SHA1 (patch-bo) = ff43d14e2608dd08d7d03799dfe9847f9f7f5666
 SHA1 (patch-bp) = 44c903536522e61790588680383b0ab2879edd65
+SHA1 (patch-main_loader.c) = a4cc248a7767eca712618fadf3a1ddc7f4977921
diff -r 3781f3ada936 -r 7cea61a27762 comms/asterisk18/patches/patch-main_loader.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/comms/asterisk18/patches/patch-main_loader.c      Tue Apr 28 08:48:11 2015 +0000
@@ -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);



Home | Main Index | Thread Index | Old Index