Hello,

thanks reporting and for laborious troubleshooting.

I just did a commit for it, seems nobody was using profiles with no value for long time. Can you try the patch from commit 028e3cc1a34f1e682d604a7c0e3fb1a7da03a211 done on GIT master?

If all ok, I will backport.

Cheers,
Daniel


On 10/27/10 7:25 PM, Eugene Oden wrote:
no segfault if i use the 3 parameter invocation of get_profile_size(),  flagging the profile as "with value" and passing a static value to get_profile_size() and set_dlg_profile()

On Wed, Oct 27, 2010 at 12:07 PM, Eugene Oden <eugeneoden+list@gmail.com> wrote:
one more clue:

767             if(sp_dest->setf(msg, &sp_dest->pvp, (int)EQ_T, &val)<0)
(gdb) p sp_dest->setf
$1 = (pv_setf_t) 0xffffffff


On Wed, Oct 27, 2010 at 11:38 AM, Eugene Oden <eugeneoden+list@gmail.com> wrote:
hello,

just started using the dialog module with kamailio 3.1.0 and getting segfaults whenever get_profile_size() is executed.  here's a stack trace:

Core was generated by `kamailio'.
Program terminated with signal 11, Segmentation fault.
#0  0x003c729e in w_get_profile_size (msg=0x834d8b4, profile=0xb60823f8 "\224$\b\266\t", value=0x831cb40 "\004", 
    result=0x8340900 "\001") at dialog.c:767
767             if(sp_dest->setf(msg, &sp_dest->pvp, (int)EQ_T, &val)<0)
(gdb) bt
#0  0x003c729e in w_get_profile_size (msg=0x834d8b4, profile=0xb60823f8 "\224$\b\266\t", value=0x831cb40 "\004", 
    result=0x8340900 "\001") at dialog.c:767
#1  0x08057770 in do_action (h=0xbff5fcb8, a=0x8328f2c, msg=0x834d8b4) at action.c:1105
#2  0x0805ea3c in run_actions (h=0xbff5fcb8, a=0x8328f2c, msg=0x834d8b4) at action.c:1553
#3  0x080576c0 in do_action (h=0xbff5fcb8, a=0x832c794, msg=0x834d8b4) at action.c:711
#4  0x0805ea3c in run_actions (h=0xbff5fcb8, a=0x832c794, msg=0x834d8b4) at action.c:1553
#5  0x0805ed71 in run_actions_safe (h=0xbff606e8, a=0x832c794, msg=0x834d8b4) at action.c:1605
#6  0x080f5d44 in rval_get_int (h=0xbff606e8, msg=0x0, i=0xbff600d8, rv=0xbff5f694, cache=0x0) at rvalue.c:904
#7  0x080fb4fb in rval_expr_eval_int (h=0xbff606e8, msg=0x834d8b4, res=0xbff600d8, rve=0x832c9c4) at rvalue.c:1866
#8  0x080fb5d0 in rval_expr_eval_int (h=0xbff606e8, msg=0x834d8b4, res=0xbff60394, rve=0x832cdac) at rvalue.c:1873
#9  0x08057511 in do_action (h=0xbff606e8, a=0x832db7c, msg=0x834d8b4) at action.c:1069
#10 0x0805ea3c in run_actions (h=0xbff606e8, a=0x832be40, msg=0x834d8b4) at action.c:1553
#11 0x080576c0 in do_action (h=0xbff606e8, a=0x8313b88, msg=0x834d8b4) at action.c:711
#12 0x0805ea3c in run_actions (h=0xbff606e8, a=0x83003cc, msg=0x834d8b4) at action.c:1553
#13 0x0805ecf4 in run_top_route (a=0x83003cc, msg=0x834d8b4, c=0x0) at action.c:1626
#14 0x080dceab in receive_msg (
    buf=0x82a7740 "INVITE sip:*98@pipeline.bbpsphone.net SIP/2.0\r\nCall-ID: 6fb1466b73075c7ad55f278f86ff6b27@0:0:0:0:0:0:0:0\r\nCSeq: 2 INVITE\r\nFrom: \"Eugene Oden\" <sip:goden.atl1@pipeline.bbpsphone.net>;tag=56dc2460\r\nTo: "..., len=1538, rcv_info=0xbff608f8)
    at receive.c:205
#15 0x0816eef7 in udp_rcv_loop () at udp_server.c:532
#16 0x080ad9e1 in main_loop () at main.c:1554
#17 0x080b1126 in main (argc=1, argv=0xbff60bd4) at main.c:2398

and the relevant bits of configuration - not sure if its correct:

...

loadmodule "dialog.so"
modparam("dialog", "dlg_flag", 4);
modparam("dialog", "profiles_no_value", "voicemail");

...

route {
   ...

   if (is_method("INVITE")) {
      dlg_manage();
      setflag(4);
   }

   ...

   if (! route(LIMIT_VOICEMAIL)) {
      xdbg("   SCRIPT: Voicemail limit exceeded\n");
      sl_send_reply("503", "Service Unavailable");
      exit;
   }

   ...
}

...

route[LIMIT_VOICEMAIL] {
   get_profile_size("voicemail", "$avp(size)");
   if ($avp(size) >= 1) {
      return -1;
   }

   set_dlg_profile("voicemail");

   return 1;
}


any thoughts?

gene


_______________________________________________ sr-dev mailing list sr-dev@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev

-- 
Daniel-Constantin Mierla
http://www.asipto.com