[OpenSIPS-Devel] B2BUA Segfault on opensips 1.9

jayant jay.dudhalkar at gmail.com
Fri Nov 29 10:09:25 CET 2013


Hello,

We have configured B2BUA module in opensips 1.9  rhel 6.4 (64 bit).
And configured with sample marketing example that found on document. But
getting segfault issue once the scenario invoking

Error is:

Nov 28 09:43:24 vhost kernel: opensips[6498]: segfault at 78 ip
00007f635c5ac7c4 sp 00007fff64105f30 error 4 in
b2b_logic.so[7f635c59c000+3d000]
Nov 28 09:43:27 vhost abrt[6546]: Saved core dump of pid 6498
(/usr/sbin/opensips) to /var/spool/abrt/ccpp-2013-11-28-09:43:24-6498
(1077792768 bytes)
Nov 28 09:43:27 vhost abrtd: Directory 'ccpp-2013-11-28-09:43:24-6498'
creation detected
Nov 28 09:43:27 vhost abrtd: Executable '/usr/sbin/opensips' doesn't belong
to any package
Nov 28 09:43:27 vhost abrtd: 'post-create' on
'/var/spool/abrt/ccpp-2013-11-28-09:43:24-6498' exited with 1
Nov 28 09:43:27 vhost abrtd: Corrupted or bad directory
'/var/spool/abrt/ccpp-2013-11-28-09:43:24-6498', deleting



I am using fifo command :
opensipsctl fifo b2b_trigger_scenario marketing sip:bob@<OpensipsIPAddress>
sip:322@<OpensipsIPAddress> sip:alice@<OpensipsIPAddress> 

configuration file is :

####### Global Parameters #########

debug=3
#memlog=1
log_stderror=no
log_facility=LOG_LOCAL0
fork=yes
children=4
#disable_tcp=yes
#disable_dns_blacklist = no

auto_aliases=no

check_via=no
dns=off
rev_dns=off

listen=udp:<OpensipsIPAddress>:5060

# ------------------ module loading ----------------------------------

mpath="/usr/lib64/opensips/modules/"

loadmodule "db_mysql.so"
loadmodule "textops.so"
loadmodule "maxfwd.so"
loadmodule "rr.so"
loadmodule "sl.so"
loadmodule "tm.so"
loadmodule "signaling.so"
loadmodule "b2b_entities.so"
loadmodule "b2b_logic.so"
loadmodule "usrloc.so"
loadmodule "registrar.so"
loadmodule "mi_fifo.so"
loadmodule "sipmsgops.so"
loadmodule "uac_auth.so"
loadmodule "mi_xmlrpc.so"


# ----------------- setting module-specific parameters ---------------
modparam("mi_fifo", "fifo_name", "/tmp/opensips_fifo")
modparam("mi_fifo", "fifo_mode", 0600)


#modparam("usrloc|b2b_entities|b2b_logic", "db_url",
"mysql://opensips:opensipsrw@localhost/opensips")
modparam("usrloc", "db_url",
"mysql://opensips:opensipsrw@localhost/opensips")
modparam("usrloc", "db_mode", 2)

modparam("tm", "pass_provisional_replies", 1)

modparam("mi_xmlrpc", "port", 8080)
modparam("mi_xmlrpc", "log_file", "/var/log/abyss.log")


modparam("b2b_entities", "server_hsize", 10)
modparam("b2b_entities", "client_hsize", 10)

modparam("b2b_logic", "hash_size", 10)

modparam("b2b_logic", "extern_scenario", "/usr/etc/opensips/marketing.xml")
modparam("b2b_logic", "server_address", "sip:sa@<OpensipsIPAddress>:5060")
modparam("b2b_entities", "script_req_route", "b2b_request")
modparam("b2b_entities", "script_reply_route", "b2b_reply")





route[b2b_request] {
  xlog("b2b_request ($ci)\n");
}


route[b2b_reply] {
  xlog("b2b_reply ($ci)\n");
}


route {
  if (!mf_process_maxfwd_header("10")) {
    sl_send_reply("483","Too Many Hops");
    exit;
  };

  if (msg:len >= 2380 ) {
    sl_send_reply("513", "Message too big");
    exit;
  };

  if (!method=="REGISTER")
    record_route();

  # subsequent messages withing a dialog should take the
  # path determined by record-routing
  if (loose_route()) {
    # mark routing logic in request
    append_hf("P-hint: rr-enforced\r\n"); 
    route(1);
  };

#  if(is_method("INVITE") && ($fU=="bob") &&   /* only for Invite messages
from bob*/
#          !(src_ip == "<OpensipsIPAddress>" && src_port ==5060)) /* skip
Invite messages generated by the server*/
#  {
#    # DO NOT call t_newtran() on this request -> it will result in the
transaction never being deleted
#    b2b_init_request("marketing", "sip:320@<OpensipsIPAddress>:5060",
"sip:321@<OpensipsIPAddress>:5060");
#    exit; # do not forward this request, another one will be generated
#  };

  if (!uri==myself) {
    # mark routing logic in request
    append_hf("P-hint: outbound\r\n"); 
    route(1);
  };


  if (uri==myself) {

    if (method=="REGISTER") {
      save("location");
      exit;
    };

    # native SIP destinations are handled using our USRLOC DB
    if (!lookup("location")) {
      sl_send_reply("404", "Not Found");
      exit;
    };
    append_hf("P-hint: usrloc applied\r\n"); 
  };

  route(1);
}


route[1] {
  # send it out now; use stateful forwarding as it works reliably
  # even for UDP2TCP

  if (!t_relay()) {
    sl_reply_error();
  };
  exit;
}



and marketing.xml 


<?xml version="1.0"?>
<scenario id="marketing" name="MS start conditional" param="3"
type="extern">
  <init>
    <bridge>
    <client>
        <id>client1</id>
        <destination>
           <value type="param">1</value>
        </destination>
    </client>
    <client>
        <id>client2</id>
        <destination>
           <value type="param">2</value>
        </destination>
    </client>
    </bridge>
    <state>1</state>
  </init>

  <rules>
    <request>
       <bye>
          <rule id="1">
             <condition>
                <state>1</state>
                <sender>
                   <type>client</type>
                   <id>client2</id>
                </sender>
             </condition>
             <action>
             <send_reply>
                <code>200</code>
                <reason>OK</reason>
             </send_reply>
             <delete_entity/>
             <bridge>
                <client>
                   <id>client1</id>
                </client>
                <client>
                   <id>client3</id>
                   <destination>
                      <value type="param">3</value>
                   </destination>
                </client>
             </bridge>
            <state>2</state>
             </action>
             </rule>
         </bye>
      </request>
   </rules>
</scenario>




I found on forum to To troubleshoot such issues we have to compile-in the
memory debugger
(http://www.opensips.org/Documentation/TroubleShooting-OutOfMem)

So I have did that and got the log I'm not really sure how to diagnose this
one. Any fixes would be very appreciated attached log here 


Nov 29 08:18:25 vhost kernel: opensips[25095]: segfault at 78 ip
00007fb78f67f7c4 sp 00007ffff1d6a1e0 error 4 in
b2b_logic.so[7fb78f66f000+3d000]
Nov 29 08:18:28 vhost abrt[25137]: Saved core dump of pid 25095
(/usr/sbin/opensips) to /var/spool/abrt/ccpp-2013-11-29-08:18:25-25095
(1077792768 bytes)
Nov 29 08:18:28 vhost abrtd: Directory 'ccpp-2013-11-29-08:18:25-25095'
creation detected
Nov 29 08:18:28 vhost abrtd: Executable '/usr/sbin/opensips' doesn't belong
to any package
Nov 29 08:18:28 vhost abrtd: 'post-create' on
'/var/spool/abrt/ccpp-2013-11-29-08:18:25-25095' exited with 1
Nov 29 08:18:28 vhost abrtd: Corrupted or bad directory
'/var/spool/abrt/ccpp-2013-11-29-08:18:25-25095', deleting
Nov 29 08:18:28 vhost /usr/sbin/opensips[25109]: CRITICAL:core:receive_fd:
EOF on 8
Nov 29 08:18:28 vhost /usr/sbin/opensips[25092]: INFO:core:handle_sigs:
child process 25095 exited by a signal 11
Nov 29 08:18:28 vhost /usr/sbin/opensips[25092]: INFO:core:handle_sigs: core
was generated
Nov 29 08:18:28 vhost /usr/sbin/opensips[25092]: INFO:core:handle_sigs:
terminating due to SIGCHLD
Nov 29 08:18:28 vhost /usr/sbin/opensips[25108]: INFO:core:sig_usr: signal
15 received
Nov 29 08:18:28 vhost /usr/sbin/opensips[25108]: Memory status (pkg):
Nov 29 08:18:28 vhost /usr/sbin/opensips[25108]: fm_status (0x7fb790985010):
Nov 29 08:18:28 vhost /usr/sbin/opensips[25100]: INFO:core:sig_usr: signal
15 received
Nov 29 08:18:28 vhost /usr/sbin/opensips[25108]:  heap size= 2097152
Nov 29 08:18:28 vhost /usr/sbin/opensips[25108]:  used= 89496,
used+overhead=135408, free=2007656
Nov 29 08:18:28 vhost /usr/sbin/opensips[25100]: Memory status (pkg):
Nov 29 08:18:28 vhost /usr/sbin/opensips[25108]:  max used (+overhead)=
135408
Nov 29 08:18:28 vhost /usr/sbin/opensips[25094]: INFO:core:sig_usr: signal
15 received
Nov 29 08:18:28 vhost /usr/sbin/opensips[25094]: Memory status (pkg):
Nov 29 08:18:28 vhost /usr/sbin/opensips[25094]: fm_status (0x7fb790985010):
Nov 29 08:18:28 vhost /usr/sbin/opensips[25094]:  heap size= 2097152
Nov 29 08:18:28 vhost /usr/sbin/opensips[25094]:  used= 32944,
used+overhead=78856, free=2064208
Nov 29 08:18:28 vhost /usr/sbin/opensips[25094]:  max used (+overhead)=
78856
Nov 29 08:18:28 vhost /usr/sbin/opensips[25094]: dumping free list:
Nov 29 08:18:28 vhost /usr/sbin/opensips[25094]: hash =   6 fragments no.:    
1, unused:     0#012#011#011 bucket size:        48 -        48 (first       
48)
Nov 29 08:18:28 vhost /usr/sbin/opensips[25094]: hash = 111 fragments no.:    
1, unused:     0#012#011#011 bucket size:       888 -       888 (first      
888)
Nov 29 08:18:28 vhost /usr/sbin/opensips[25094]: hash = 442 fragments no.:    
1, unused:     0#012#011#011 bucket size:      3536 -      3536 (first     
3536)
Nov 29 08:18:28 vhost /usr/sbin/opensips[25094]: hash = 2055 fragments no.:    
1, unused:     0#012#011#011 bucket size:   1048576 -   2097152 (first  
2012088)






Thank You,

Regards,
Jayant 





--
View this message in context: http://opensips-open-sip-server.1449251.n2.nabble.com/B2BUA-Segfault-on-opensips-1-9-tp7588766.html
Sent from the OpenSIPS - Devel mailing list archive at Nabble.com.



More information about the Devel mailing list