[Home]

Summary:ASTERISK-02621: The version 1.29 of loader.c crash on the apllication app_qcall and makr undefined symbol
Reporter:Fernando Romo (el_pop)Labels:
Date Opened:2004-10-17 20:41:47Date Closed:2011-06-07 14:00:57
Priority:CriticalRegression?No
Status:Closed/CompleteComponents:Core/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
Description:Whe i update to last version available of loader.c (ver 1.29) the asterisk crash when intent to load app_qcall.so

The problem is not the applicaction qcall. in fact this source has no modifys. The source of app_qcall.c has the version 1.13 of Aug 8 2004.

The problem is pointed in "loader.c"

****** ADDITIONAL INFORMATION ******

This is the error when run asterisk:
----------

[app_qcall.so]Oct 17 20:34:47 WARNING[-151142272]: loader.c:299 ast_load_resource: /usr/lib/asterisk/modules/app_qcall.so: undefined symbol: ast_pthread_create
Oct 17 20:34:47 WARNING[-151142272]: loader.c:480 load_modules: Loading module app_qcall.so failed!

--------

The diff of loader.c:

---------
cvs diff -r 1.28 loader.c
Index: loader.c
===================================================================
RCS file: /usr/cvsroot/asterisk/loader.c,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -d -b -w -r1.28 -r1.29
--- loader.c    14 Oct 2004 04:38:29 -0000      1.28
+++ loader.c    16 Oct 2004 21:14:05 -0000      1.29
@@ -147,31 +147,81 @@
       return res;
}

-void ast_module_reload(const char *name)
+char *ast_module_helper(char *line, char *word, int pos, int state, int rpos, int needsreload)
{
       struct module *m;
+       int which=0;
+       char *ret;
+       if (pos != rpos)
+               return NULL;
+       ast_mutex_lock(&modlock);
+       m = module_list;
+       while(m) {
+               if (!strncasecmp(word, m->resource, strlen(word)) && (m->reload || !needsreload)) {
+                       if (++which > state)
+                               break;
+               }
+               m = m->next;
+       }
+       if (m) {
+               ret = strdup(m->resource);
+       } else {
+               ret = NULL;
+               if (!strncasecmp(word, "astconfig", strlen(word))) {
+                       if (++which > state)
+                               ret = strdup("astconfig");
+               } else if (!strncasecmp(word, "manager", strlen(word))) {
+                       if (++which > state)
+                               ret = strdup("manager");
+               } else if (!strncasecmp(word, "enum", strlen(word))) {
+                       if (++which > state)
+                               ret = strdup("enum");
+               } else if (!strncasecmp(word, "rtp", strlen(word))) {
+                       if (++which > state)
+                               ret = strdup("rtp");
+               }

+       }
+       ast_mutex_unlock(&modlock);
+       return ret;
+}
+
+int ast_module_reload(const char *name)
+{
+       struct module *m;
+       int reloaded = 0;
       /* We'll do the logger and manager the favor of calling its reload here first */

       if (ast_mutex_trylock(&reloadlock)) {
               ast_verbose("The previous reload command didn't finish yet\n");
-               return;
+               return -1;
       }
-       if (!name || !strcasecmp(name, "astconfig"))
+       if (!name || !strcasecmp(name, "astconfig")) {
               read_ast_cust_config();
-       if (!name || !strcasecmp(name, "manager"))
+               reloaded = 2;
+       }
+       if (!name || !strcasecmp(name, "manager")) {
               reload_manager();
-       if (!name || !strcasecmp(name, "enum"))
+               reloaded = 2;
+       }
+       if (!name || !strcasecmp(name, "enum")) {
               ast_enum_reload();
-       if (!name || !strcasecmp(name, "rtp"))
+               reloaded = 2;
+       }
+       if (!name || !strcasecmp(name, "rtp")) {
               ast_rtp_reload();
+               reloaded = 2;
+       }
       time(&ast_lastreloadtime);

       ast_mutex_lock(&modlock);
       m = module_list;
       while(m) {
               if (!name || !strcasecmp(name, m->resource)) {
+                       if (reloaded < 1)
+                               reloaded = 1;
                       if (m->reload) {
+                               reloaded = 2;
                               if (option_verbose > 2)
                                       ast_verbose(VERBOSE_PREFIX_3 "Reloading module '%s' (%s)\n", m->resource, m->description());
                               m->reload();
@@ -181,6 +231,7 @@
       }
       ast_mutex_unlock(&modlock);
       ast_mutex_unlock(&reloadlock);
+       return reloaded;
}

int ast_load_resource(char *resource_name)
Comments:By: Brian West (bkw918) 2004-10-17 20:48:12

This is not a bug.  You need to remove app_qcall.so as it has been removed from the apps/Makefile (aka commented out)

Thanks,
Brian