[sr-dev] current master fails to start

Juha Heinanen jh at tutpro.com
Sat Jan 21 06:57:09 CET 2012


i wrote a new version of local module (below) that is just a skeleton.
when i start sip router, i get to console:

Not starting sip-proxy: invalid configuration file!

but i don't get anything about what is wrong with it.

gdb shows:

gdb) where
#0  0xb7740424 in __kernel_vsyscall ()
#1  0xb75f2751 in *__GI_raise (sig=6)p
    at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#2  0xb75f5b82 in *__GI_abort () at abort.c:92
#3  0xb7633484 in __malloc_assert (assertion=<value optimized out>, 
    file=<value optimized out>, line=4636, function=0xb76ea490 "_int_malloc")
    at malloc.c:352
#4  0xb7635ed4 in _int_malloc (av=<value optimized out>, 
    bytes=<value optimized out>) at malloc.c:4636
#5  0xb7637c8c in *__GI___libc_malloc (bytes=0) at malloc.c:3661
#6  0xb767e2cc in analyze (preg=<value optimized out>, 
    pattern=<value optimized out>, length=73, syntax=4436732)
    at regcomp.c:1135
#7  re_compile_internal (preg=<value optimized out>, 
    pattern=<value optimized out>, length=73, syntax=4436732) at regcomp.c:804
#8  0xb767ee5e in __regcomp (preg=0xbf963844, 
    pattern=0xb6ddb800 "^auth_db|dialplan|domain|htable|lcr|local|msilo|mtree|permissions|usrloc$", cflags=11) at regcomp.c:506
#9  0x0809a500 in set_mod_param_regex (
    regex=0xb6ddb668 "auth_db|dialplan|domain|htable|lcr|local|msilo|mtree|permissions|usrloc", name=0xb6ddb6f0 "db_url", type=1, val=0xb6ddb778)
    at modparam.c:86
#10 0x0817e4fd in yyparse () at cfg.y:1733
#11 0x08095a1f in main (argc=18, argv=0xbf963f24) at main.c:2084

from that i see that the problem is that my new local module does not
have db_url module param, but that does not explain why malloc causes
the crash.  this is with export MALLOC_CHECK_=2.  if i do not define
MALLOC_CHECK_=2, i still don't get any more stuff to console about the
problem in config.

-- juha

---------------------------------------------------------------------------

/*
 * Local module
 */

#include "../../mod_fix.h"

MODULE_VERSION

int f1(struct sip_msg* _m, char* _uri_user_sp, char* _uri_host_sp)
{
    return 1;
}

int f2(struct sip_msg* _msg, char* _s1, char* _s2)
{
    return 1;
}

int f3(struct sip_msg* _msg, char* _sp, char* _s2)
{
    return 1;
}

int f4(struct sip_msg* _m, char* _condition, char* _s2)
{
    return 1;
}

int f5(struct sip_msg* _m, char* _condition, char* _str2)
{
    return 1;
}

int f6(struct sip_msg* _m, char* _condition, char* _str2)
{
    return 1;
}

/* Exported functions */
static cmd_export_t cmds[] = {
    {"f1", (cmd_function)f1, 2, fixup_pvar_pvar,
     fixup_free_pvar_pvar, REQUEST_ROUTE},
    {"f2", (cmd_function)f2, 0, 0, 0, REQUEST_ROUTE},
    {"f3", (cmd_function)f3, 1, fixup_pvar_null,
     fixup_free_pvar_null, REQUEST_ROUTE|FAILURE_ROUTE|BRANCH_ROUTE},
    {"f4", (cmd_function)f4, 1, 0, 0,
     REQUEST_ROUTE | FAILURE_ROUTE},
    {"f5", (cmd_function)f5, 1, 0, 0,
     REQUEST_ROUTE | FAILURE_ROUTE},
    {"f6", (cmd_function)f6, 1, 0, 0,
     REQUEST_ROUTE | FAILURE_ROUTE},
    {0, 0, 0, 0, 0, 0}
};

static int mod_init(void)
{
	return 0;
}

/* Exported parameters */

/* Module interface */
struct module_exports exports = {
    "local",
    DEFAULT_DLFLAGS, /* dlopen flags */
    cmds,      /* Exported functions */
    0,    /* Exported parameters */
    0,         /* exported statistics */
    0,   /* exported MI functions */
    0,         /* exported pseudo-variables */
    0,         /* extra processes */
    mod_init,  /* module initialization function */
    0,         /* response function*/
    0,   /* destroy function */
    0 /* child initialization function */
};



More information about the sr-dev mailing list