Index: include/asterisk/utils.h =================================================================== --- include/asterisk/utils.h (revision 375992) +++ include/asterisk/utils.h (working copy) @@ -630,7 +630,13 @@ This macro will attempt to allocate memory from the stack. If it fails you won't get a NULL returned, but a SEGFAULT if you're lucky. */ -#define ast_alloca(size) __builtin_alloca(size) +#define ast_alloca(size) \ + (__extension__ \ + ({ \ + ast_log(LOG_NOTICE, "STACK: ast_alloca(%d) at %s:%d: %s\n", (int)(size), __FILE__, __LINE__, __PRETTY_FUNCTION__); \ + usleep(1); \ + __builtin_alloca(size); \ + })) #if !defined(ast_strdupa) && defined(__GNUC__) /*! @@ -646,6 +652,8 @@ const char *__old = (s); \ size_t __len = strlen(__old) + 1; \ char *__new = __builtin_alloca(__len); \ + ast_log(LOG_NOTICE, "STACK: ast_strdupa(%d) at %s:%d: %s: %.32s...\n", (int)(__len), __FILE__, __LINE__, __PRETTY_FUNCTION__, __old); \ + usleep(1); \ memcpy (__new, __old, __len); \ __new; \ })) Index: main/loader.c =================================================================== --- main/loader.c (revision 375992) +++ main/loader.c (working copy) @@ -328,20 +328,27 @@ static int resource_name_match(const char *name1_in, const char *name2_in) { - char *name1 = (char *) name1_in; - char *name2 = (char *) name2_in; + int hasso1 = !strcasecmp(name1_in + strlen(name1_in) - 3, ".so"); + int hasso2 = !strcasecmp(name2_in + strlen(name2_in) - 3, ".so"); - /* trim off any .so extensions */ - if (!strcasecmp(name1 + strlen(name1) - 3, ".so")) { - name1 = ast_strdupa(name1); - name1[strlen(name1) - 3] = '\0'; + if (hasso1 != hasso2) { + char *name1 = (char *) name1_in; + char *name2 = (char *) name2_in; + + /* trim off any .so extensions */ + if (hasso1) { + name1 = ast_strdupa(name1); + name1[strlen(name1) - 3] = '\0'; + } + if (hasso2) { + name2 = ast_strdupa(name2); + name2[strlen(name2) - 3] = '\0'; + } + + return strcasecmp(name1, name2); } - if (!strcasecmp(name2 + strlen(name2) - 3, ".so")) { - name2 = ast_strdupa(name2); - name2[strlen(name2) - 3] = '\0'; - } - return strcasecmp(name1, name2); + return strcasecmp(name1_in, name2_in); } static struct ast_module *find_resource(const char *resource, int do_lock) Index: main/logger.c =================================================================== --- main/logger.c (revision 375992) +++ main/logger.c (working copy) @@ -975,13 +975,14 @@ struct verb *v = NULL; if (logmsg->level == __LOG_VERBOSE) { - char *tmpmsg = ast_strdupa(logmsg->message + 1); + char tmpmsg[strlen(logmsg->message)]; /* length - 1 + nul */ + memcpy(tmpmsg, logmsg->message + 1, strlen(logmsg->message)); /* Iterate through the list of verbosers and pass them the log message string */ AST_RWLIST_RDLOCK(&verbosers); AST_RWLIST_TRAVERSE(&verbosers, v, list) v->verboser(logmsg->message); AST_RWLIST_UNLOCK(&verbosers); - ast_string_field_set(logmsg, message, tmpmsg); + ast_string_field_set(logmsg, message, tmpmsg); /* dropped the first byte */ } AST_RWLIST_RDLOCK(&logchannels);