New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

High CPU usage #1

Closed
thantoldo opened this Issue Jul 15, 2013 · 23 comments

Comments

Projects
None yet
8 participants
@thantoldo

thantoldo commented Jul 15, 2013

Hi mic,
Works as expected, but results into very high cpu usage even when no calls are active. Used with kamailio as sip proxy. High cpu usage occurs even after kamailio is started. It doesnt occur when used with rtpproxy 1.2.1.

Regards,
Thanos

@miconda

This comment has been minimized.

Show comment
Hide comment
@miconda

miconda Jul 15, 2013

Owner

Hello, to understand properly, the patch works fine with rtpproxy 1.2.1, but using rtpproxy devel results in high cpu, right?

Can you attach with gdb to running rtpproxy and get the backtrace? Like:

gdb /path/to/rtpproxy PID

Say rtpproxy is in /usr/local/bin/rtpproxy and its running pid is 1234, then do:

gdb /usr/local/bin/rtpproxy 1234

Then run 'bt full'

Get the output and paste it here. iirc, run exit to quit gdb.

Owner

miconda commented Jul 15, 2013

Hello, to understand properly, the patch works fine with rtpproxy 1.2.1, but using rtpproxy devel results in high cpu, right?

Can you attach with gdb to running rtpproxy and get the backtrace? Like:

gdb /path/to/rtpproxy PID

Say rtpproxy is in /usr/local/bin/rtpproxy and its running pid is 1234, then do:

gdb /usr/local/bin/rtpproxy 1234

Then run 'bt full'

Get the output and paste it here. iirc, run exit to quit gdb.

@thantoldo

This comment has been minimized.

Show comment
Hide comment
@thantoldo

thantoldo Jul 15, 2013

You are right, as 1.2.1 I got the source from: http://sourceforge.net/p/sippy/rtpproxy/commit_browser , commit with name: 'Fix warnings on Solaris 10', source code: http://sourceforge.net/p/sippy/rtpproxy/ci/4598b2faf95b337cc8991e6869b33b3458b69c11/tree/, patch applied (without the high cpu usage): http://opensips-open-sip-server.1449251.n2.nabble.com/attachment/5008062/0/rtpproxy_nat_address_fix.txt

Thanks,
Thanos

The output from gdb

#0 0x00007f8df9f1284d in nanosleep () from /lib/x86_64-linux-gnu/libc.so.6
No symbol table info available.
#1 0x00007f8df9f40784 in usleep () from /lib/x86_64-linux-gnu/libc.so.6
No symbol table info available.
#2 0x000000000040389c in main (argc=, argv=) at main.c:840
i =
len = -516
timeout = 1000
controlfd = 1000
alarm_tick =
sptime = 1373912302.601881
eptime = 1373912302.601881
last_tick_time = 1373912302.6018779
delay =
cf = {stable = {nodaemon = 0, dmode = 0, bmode = 0, umode = 1, port_min = 10000,
port_max = 29998, max_ttl = 60, bindaddr = {0xfe7060, 0x0}, advaddr = {
0x7fff5aca0e73 "54.229.99.242", 0x0}, tos = 184, rdir = 0x0, sdir = 0x0,
record_pcap = 0, record_all = 0, rrtcp = 1, glog = 0x7fff5ac7ec30,
nofile_limit = {rlim_cur = 1024, rlim_max = 4096}, run_uname = 0x0,
run_gname = 0x0, no_check = 1, ttl_mode = TTL_UNIFIED, run_uid = 0,
run_gid = 0, log_level = -1, log_facility = -1, port_table = {23884, 21050,
26652, 27582, 24578, 29278, 21282, 17046, 18494, 27954, 11570, 13982, 16530,
19866, 17090, 17924, 13264, 25102, 28766, 18410, 10380, 28992, 22580, 12538,
15994, 28030, 27422, 17800, 20538, 28494, 11490, 10164, 19546, 25838, 20574,
27266, 13292, 22818, 28616, 17546, 12650, 15584, 11806, 17972, 29858, 12798,
23740, 13382, 16468, 24664, 14560, 10018, 17996, 10148, 29904, 15070, 25786,
19106, 16684, 15458, 21686, 24950, 28328, 25190, 16078, 10786, 11948, 10994,
12874, 24302, 12110, 15316, 21548, 12822, 20742, 27236, 11602, 11772, 12558,
26778, 19140, 19592, 17436, 14550, 17042, 27514, 12208, 11658, 24454, 15710,
29820, 22918, 21078, 12162, 15024, 24734, 12262, 13908, 12002, 24180, 11340,
18006, 22082, 22744, 26200, 16252, 13034, 28978, 11214, 19634, 25688, 23858,
16710, 23604, 19458, 26024, 15264, 10326, 16716, 19794, 12518, 13726, 17512,
23396, 15762, 23648, 15946, 26462, 15128, 11350, 10404, 18382, 25432, 12434,
27540, 17852, 13150, 14672, 23490, 18280, 14366, 20292, 19908, 11202, 22304,
15404, 19930, 19110, 12202, 10316, 23446, 25306, 13228, 13838, 17718, 14288,
11802, 18346, 17384, 24698, 10630, 12078, 13080, 16562, 18784, 29390, 27306,
29258, 11280, 11288, 14668, 25774, 28282, 22414, 18122, 13048, 21398, 13442,
17462, 22234, 26552, 19022, 15230, 10006, 13158, 20192, 13164, 24018, 21242,
24818, 18098, 13886, 18874, 25824, 11636, 14982, 10216, 18730, 14242,
16108...}, port_table_len = 10000,
rand_table = "\270\035\264\214\b\201\266w\375,\202\243_\206\262\265y?\036\037|;\002J\373\314\021B)\307\371\342\344\256n\355/$d,P\346\320zm\202\060\346\302N\005>\212\a\210\205ә\307\375\301\337EoM2\236q\226\313\302|\233<\351\035l\317\337\273\324\035Eۦʯ?\221\254\240R\213\345\301\330\027I\255+\v)\306H\023\343\264\342\303o\267ഒ\206~A\306\020\355fbxK$Pb\204\232\017\257\245\070u\355KX\242.\033\021\345\374\306w\202D\271HT\246\256\267\037\371\333o[\tj\016\257\243\203\234\356\333>\034\367P\001\363\026yuZ2\276\257\330lf\367fAg\301\240p,\256\037\317\061\274\275\f\372\332\003J\333\366`Tl\273\206_j\226\320V\374\021\275\276\261.\352_M\271\220\tv\234\004P\240N,\226\257\200\002j\a,\324fä\274\277\265z}f\250g",
controlfd = 3}, sessinfo = {pfds = 0x7f8dfa852010, sessions = 0x7f8dfa8f0010,
nsessions = 0, lock = {data = {__lock = 0, __count = 0, __owner = 0,
__nusers = 0, __kind = 0, __spins = 0, __list = {__prev = 0x0,
__next = 0x0}}, __size = '\000' <repeats 39 times>, __align = 0}},
bindaddr_list = 0xfe7060, bindaddr_lock = {__data = {__lock = 0, __count = 0,
__owner = 0, __nusers = 0, __kind = 0, __spins = 0, __list = {__prev = 0x0,
__next = 0x0}}, __size = '\000' <repeats 39 times>, __align = 0},
rtp_servers = 0x7f8dfa8a1010, rtp_nsessions = 0, sessions_active = 0,
sessions_created = 0, nofile_limit_warned = 0, hash_table = {
0x0 <repeats 256 times>}, timeout_socket = 0x0, timeout_handler = 0x0,
port_table_idx = 9999, glock = {__data = {__lock = 0, __count = 0, __owner = 0,
__nusers = 0, __kind = 0, __spins = 0, __list = {__prev = 0x0,
__next = 0x0}}, __size = '\000' <repeats 39 times>, __align = 0}}
buf = "4835\n\000\000\000tJs\372\215\177\000\000\200\370\311Z\377\177\000\000\003\000\000\000\000\000\000\000\005\000\000\000\000\000\000\000p\025\224\372\215\177\000\000.N=\366\000\000\000\000\236Rs\372\215\177\000\000 \342\337Z\377\177\000\000.\000\000\000\215\177\000\000\300\370\311Z\377\177\000\000\377\377\377\377\000\000\000\000\264j\345\371\215\177\000\000\250l\345\371\215\177\000\000\220\370\311Z\377\177\000\000\340\370\311Z\377\177\000\000@.\346\371\215\177\000\000\b", '\000' <repeats 15 times>"\310, \025\224\372\215\177\000\000\000\020\224\372\215\177\000\000\371\017@\000\000\000\000\000\370\071\346\371\215\177\000\000\370\006@\000\000\000\000\000\000\000\000\000\001\000\000\000\021\b\000\000\001", '\000' <repeats 11 times>, " \366\224\372\215\177\000\000\000\371\311Z\377\177\000\000.N=\366\000\000\000\000\310\025\224\372\215\177\000\000 \371\311Z\377\177\000"
__FUNCTION
= "main"

thantoldo commented Jul 15, 2013

You are right, as 1.2.1 I got the source from: http://sourceforge.net/p/sippy/rtpproxy/commit_browser , commit with name: 'Fix warnings on Solaris 10', source code: http://sourceforge.net/p/sippy/rtpproxy/ci/4598b2faf95b337cc8991e6869b33b3458b69c11/tree/, patch applied (without the high cpu usage): http://opensips-open-sip-server.1449251.n2.nabble.com/attachment/5008062/0/rtpproxy_nat_address_fix.txt

Thanks,
Thanos

The output from gdb

#0 0x00007f8df9f1284d in nanosleep () from /lib/x86_64-linux-gnu/libc.so.6
No symbol table info available.
#1 0x00007f8df9f40784 in usleep () from /lib/x86_64-linux-gnu/libc.so.6
No symbol table info available.
#2 0x000000000040389c in main (argc=, argv=) at main.c:840
i =
len = -516
timeout = 1000
controlfd = 1000
alarm_tick =
sptime = 1373912302.601881
eptime = 1373912302.601881
last_tick_time = 1373912302.6018779
delay =
cf = {stable = {nodaemon = 0, dmode = 0, bmode = 0, umode = 1, port_min = 10000,
port_max = 29998, max_ttl = 60, bindaddr = {0xfe7060, 0x0}, advaddr = {
0x7fff5aca0e73 "54.229.99.242", 0x0}, tos = 184, rdir = 0x0, sdir = 0x0,
record_pcap = 0, record_all = 0, rrtcp = 1, glog = 0x7fff5ac7ec30,
nofile_limit = {rlim_cur = 1024, rlim_max = 4096}, run_uname = 0x0,
run_gname = 0x0, no_check = 1, ttl_mode = TTL_UNIFIED, run_uid = 0,
run_gid = 0, log_level = -1, log_facility = -1, port_table = {23884, 21050,
26652, 27582, 24578, 29278, 21282, 17046, 18494, 27954, 11570, 13982, 16530,
19866, 17090, 17924, 13264, 25102, 28766, 18410, 10380, 28992, 22580, 12538,
15994, 28030, 27422, 17800, 20538, 28494, 11490, 10164, 19546, 25838, 20574,
27266, 13292, 22818, 28616, 17546, 12650, 15584, 11806, 17972, 29858, 12798,
23740, 13382, 16468, 24664, 14560, 10018, 17996, 10148, 29904, 15070, 25786,
19106, 16684, 15458, 21686, 24950, 28328, 25190, 16078, 10786, 11948, 10994,
12874, 24302, 12110, 15316, 21548, 12822, 20742, 27236, 11602, 11772, 12558,
26778, 19140, 19592, 17436, 14550, 17042, 27514, 12208, 11658, 24454, 15710,
29820, 22918, 21078, 12162, 15024, 24734, 12262, 13908, 12002, 24180, 11340,
18006, 22082, 22744, 26200, 16252, 13034, 28978, 11214, 19634, 25688, 23858,
16710, 23604, 19458, 26024, 15264, 10326, 16716, 19794, 12518, 13726, 17512,
23396, 15762, 23648, 15946, 26462, 15128, 11350, 10404, 18382, 25432, 12434,
27540, 17852, 13150, 14672, 23490, 18280, 14366, 20292, 19908, 11202, 22304,
15404, 19930, 19110, 12202, 10316, 23446, 25306, 13228, 13838, 17718, 14288,
11802, 18346, 17384, 24698, 10630, 12078, 13080, 16562, 18784, 29390, 27306,
29258, 11280, 11288, 14668, 25774, 28282, 22414, 18122, 13048, 21398, 13442,
17462, 22234, 26552, 19022, 15230, 10006, 13158, 20192, 13164, 24018, 21242,
24818, 18098, 13886, 18874, 25824, 11636, 14982, 10216, 18730, 14242,
16108...}, port_table_len = 10000,
rand_table = "\270\035\264\214\b\201\266w\375,\202\243_\206\262\265y?\036\037|;\002J\373\314\021B)\307\371\342\344\256n\355/$d,P\346\320zm\202\060\346\302N\005>\212\a\210\205ә\307\375\301\337EoM2\236q\226\313\302|\233<\351\035l\317\337\273\324\035Eۦʯ?\221\254\240R\213\345\301\330\027I\255+\v)\306H\023\343\264\342\303o\267ഒ\206~A\306\020\355fbxK$Pb\204\232\017\257\245\070u\355KX\242.\033\021\345\374\306w\202D\271HT\246\256\267\037\371\333o[\tj\016\257\243\203\234\356\333>\034\367P\001\363\026yuZ2\276\257\330lf\367fAg\301\240p,\256\037\317\061\274\275\f\372\332\003J\333\366`Tl\273\206_j\226\320V\374\021\275\276\261.\352_M\271\220\tv\234\004P\240N,\226\257\200\002j\a,\324fä\274\277\265z}f\250g",
controlfd = 3}, sessinfo = {pfds = 0x7f8dfa852010, sessions = 0x7f8dfa8f0010,
nsessions = 0, lock = {data = {__lock = 0, __count = 0, __owner = 0,
__nusers = 0, __kind = 0, __spins = 0, __list = {__prev = 0x0,
__next = 0x0}}, __size = '\000' <repeats 39 times>, __align = 0}},
bindaddr_list = 0xfe7060, bindaddr_lock = {__data = {__lock = 0, __count = 0,
__owner = 0, __nusers = 0, __kind = 0, __spins = 0, __list = {__prev = 0x0,
__next = 0x0}}, __size = '\000' <repeats 39 times>, __align = 0},
rtp_servers = 0x7f8dfa8a1010, rtp_nsessions = 0, sessions_active = 0,
sessions_created = 0, nofile_limit_warned = 0, hash_table = {
0x0 <repeats 256 times>}, timeout_socket = 0x0, timeout_handler = 0x0,
port_table_idx = 9999, glock = {__data = {__lock = 0, __count = 0, __owner = 0,
__nusers = 0, __kind = 0, __spins = 0, __list = {__prev = 0x0,
__next = 0x0}}, __size = '\000' <repeats 39 times>, __align = 0}}
buf = "4835\n\000\000\000tJs\372\215\177\000\000\200\370\311Z\377\177\000\000\003\000\000\000\000\000\000\000\005\000\000\000\000\000\000\000p\025\224\372\215\177\000\000.N=\366\000\000\000\000\236Rs\372\215\177\000\000 \342\337Z\377\177\000\000.\000\000\000\215\177\000\000\300\370\311Z\377\177\000\000\377\377\377\377\000\000\000\000\264j\345\371\215\177\000\000\250l\345\371\215\177\000\000\220\370\311Z\377\177\000\000\340\370\311Z\377\177\000\000@.\346\371\215\177\000\000\b", '\000' <repeats 15 times>"\310, \025\224\372\215\177\000\000\000\020\224\372\215\177\000\000\371\017@\000\000\000\000\000\370\071\346\371\215\177\000\000\370\006@\000\000\000\000\000\000\000\000\000\001\000\000\000\021\b\000\000\001", '\000' <repeats 11 times>, " \366\224\372\215\177\000\000\000\371\311Z\377\177\000\000.N=\366\000\000\000\000\310\025\224\372\215\177\000\000 \371\311Z\377\177\000"
__FUNCTION
= "main"

@miconda

This comment has been minimized.

Show comment
Hide comment
@miconda

miconda Jul 15, 2013

Owner

Can you try 1.2.1 with patch:

41f6d9d

It is a different patch that allows advertising address even when doing bridging between networks. Just to see if works fine with 1.2.1.

Owner

miconda commented Jul 15, 2013

Can you try 1.2.1 with patch:

41f6d9d

It is a different patch that allows advertising address even when doing bridging between networks. Just to see if works fine with 1.2.1.

@thantoldo

This comment has been minimized.

Show comment
Hide comment
@thantoldo

thantoldo Jul 15, 2013

Same problem. Im not bridging, just behind nat.

dbg output

#0 0x00007f6ee233384d in nanosleep () from /lib/x86_64-linux-gnu/libc.so.6
No symbol table info available.
#1 0x00007f6ee2361784 in usleep () from /lib/x86_64-linux-gnu/libc.so.6
No symbol table info available.
#2 0x000000000040389c in main (argc=, argv=) at main.c:840
i =
len = -516
timeout = 1000
controlfd = 1000
alarm_tick =
sptime = 1373918009.9152379
eptime = 1373918009.9152379
last_tick_time = 1373918009.9152341
delay =
cf = {stable = {nodaemon = 0, dmode = 0, bmode = 0, umode = 1, port_min = 10000,
port_max = 29998, max_ttl = 60, bindaddr = {0x1922060, 0x0}, advaddr = {
0x7fffd3ffae4a "54.229.99.242", 0x0}, tos = 184, rdir = 0x0, sdir = 0x0,
record_pcap = 0, record_all = 0, rrtcp = 1, glog = 0x7fffd3fd9320,
nofile_limit = {rlim_cur = 1024, rlim_max = 4096}, run_uname = 0x0,
run_gname = 0x0, no_check = 1, ttl_mode = TTL_UNIFIED, run_uid = 0,
run_gid = 0, log_level = -1, log_facility = -1, port_table = {21176, 16960,
25896, 12770, 21228, 25914, 15954, 17038, 16914, 23584, 16474, 19698, 10710,
19800, 13576, 11268, 25266, 15890, 11062, 20146, 20352, 28812, 25546, 22008,
10814, 29312, 10268, 28496, 22310, 27736, 28688, 23246, 27364, 17288, 23172,
13374, 24108, 12708, 12854, 11592, 23832, 29468, 14460, 20064, 19268, 21994,
13092, 18556, 14728, 12282, 24634, 28296, 19332, 10448, 10160, 29896, 26084,
15332, 24606, 26344, 16818, 17846, 10492, 10274, 16154, 17410, 12578, 27572,
20118, 12616, 16096, 23130, 15644, 12120, 22412, 17012, 12728, 21930, 11164,
11476, 29510, 14724, 23484, 11078, 14186, 21074, 23714, 16508, 18932, 24454,
11602, 15108, 23012, 29190, 25524, 18638, 13454, 29240, 14482, 22742, 27328,
15612, 12100, 22294, 20726, 28706, 22580, 14642, 10368, 11106, 19428, 10026,
28636, 21980, 15984, 16088, 16354, 16234, 18496, 20172, 14124, 21392, 22944,
10516, 15728, 23412, 12710, 18352, 25312, 16752, 21382, 11968, 10294, 25898,
13906, 25648, 18194, 23078, 11142, 16484, 20212, 28630, 28596, 11554, 23910,
20086, 12166, 19894, 26320, 15576, 28796, 21906, 18794, 23438, 12842, 20374,
13320, 19712, 12874, 18122, 21444, 20230, 15376, 19718, 19388, 23620, 28070,
22586, 26134, 17608, 15416, 18372, 13540, 27726, 10942, 22852, 26410, 27388,
12672, 29544, 26304, 28450, 26368, 17832, 22026, 16998, 24028, 25476, 19414,
25202, 12688, 19238, 14578, 17628, 28956, 19854, 21270, 27026, 10416,
17742...}, port_table_len = 10000,
rand_table = "\243\240\357\230\314-&\356\032W!\220\355\016\374ɮ\310\002!G\371\360o\343B\360\261吡}\177;\036KiD:\203\234[\023\211j\017R\030\330T9\037M*\216\060l~\342R\016\203ώ\276\355\331'2\023\253\316o\276W\331Ω\361\246\376+\305KUS|\301\322^\023\340\341\343n\237\320H\307\002[r\320\312\060'\243\376ѕ\244\317\300i\032\025\275\226\326\217\364\352o\325\315\336u\235&<\240\201\256pLޘ\357\335i\204\201\070D\353RY\250\351\060\067\335\032\246\263\347\204(\204\252d$,\022\225x\360-g͖\354O\316\060: \212\342\t\272\031\347Կ\232\273D\302?\356&d\032\070\371\222(&\372\366\274\346E\212\026\177\252\240a\264Zz\233.95\351}\367)l\035\215\206U\206\031}\254\023sh\371\270\362\017\067\234\260\230P\n\022\353\071L "\311\027K5",
controlfd = 3}, sessinfo = {pfds = 0x7f6ee2c73010, sessions = 0x7f6ee2d11010,
nsessions = 0, lock = {data = {__lock = 0, __count = 0, __owner = 0,
__nusers = 0, __kind = 0, __spins = 0, __list = {__prev = 0x0,
__next = 0x0}}, __size = '\000' <repeats 39 times>, __align = 0}},
bindaddr_list = 0x1922060, bindaddr_lock = {__data = {__lock = 0, __count = 0,
__owner = 0, __nusers = 0, __kind = 0, __spins = 0, __list = {__prev = 0x0,
__next = 0x0}}, __size = '\000' <repeats 39 times>, __align = 0},
rtp_servers = 0x7f6ee2cc2010, rtp_nsessions = 0, sessions_active = 0,
sessions_created = 0, nofile_limit_warned = 0, hash_table = {
0x0 <repeats 256 times>}, timeout_socket = 0x0, timeout_handler = 0x0,
port_table_idx = 9999, glock = {__data = {__lock = 0, __count = 0, __owner = 0,
__nusers = 0, __kind = 0, __spins = 0, __list = {__prev = 0x0,
__next = 0x0}}, __size = '\000' <repeats 39 times>, __align = 0}}
buf = "7418\n\000\000\000tZ\265\342n\177\000\000p\237\377\323\377\177\000\000\003\000\000\000\000\000\000\000\005\000\000\000\000\000\000\000p%\326\342n\177\000\000.N=\366\000\000\000\000\236b\265\342n\177\000\000 \362\377\323\377\177\000\000.\000\000\000n\177\000\000\260\237\377\323\377\177\000\000\377\377\377\377\000\000\000\000\264z'\342n\177\000\000\250|'\342n\177\000\000\200\237\377\323\377\177\000\000П\377\323\377\177\000\000@>(\342n\177\000\000\b", '\000' <repeats 15 times>"\310, %\326\342n\177\000\000\000 \326\342n\177\000\000\371\017@\000\000\000\000\000\370I(\342n\177\000\000\370\006@\000\000\000\000\000\000\000\000\000\001\000\000\000\021\b\000\000\001", '\000' <repeats 11 times>, " \006\327\342n\177\000\000\360\237\377\323\377\177\000\000.N=\366\000\000\000\000\310%\326\342n\177\000\000\020\240\377\323\377\177\000"
__FUNCTION
= "main"

thantoldo commented Jul 15, 2013

Same problem. Im not bridging, just behind nat.

dbg output

#0 0x00007f6ee233384d in nanosleep () from /lib/x86_64-linux-gnu/libc.so.6
No symbol table info available.
#1 0x00007f6ee2361784 in usleep () from /lib/x86_64-linux-gnu/libc.so.6
No symbol table info available.
#2 0x000000000040389c in main (argc=, argv=) at main.c:840
i =
len = -516
timeout = 1000
controlfd = 1000
alarm_tick =
sptime = 1373918009.9152379
eptime = 1373918009.9152379
last_tick_time = 1373918009.9152341
delay =
cf = {stable = {nodaemon = 0, dmode = 0, bmode = 0, umode = 1, port_min = 10000,
port_max = 29998, max_ttl = 60, bindaddr = {0x1922060, 0x0}, advaddr = {
0x7fffd3ffae4a "54.229.99.242", 0x0}, tos = 184, rdir = 0x0, sdir = 0x0,
record_pcap = 0, record_all = 0, rrtcp = 1, glog = 0x7fffd3fd9320,
nofile_limit = {rlim_cur = 1024, rlim_max = 4096}, run_uname = 0x0,
run_gname = 0x0, no_check = 1, ttl_mode = TTL_UNIFIED, run_uid = 0,
run_gid = 0, log_level = -1, log_facility = -1, port_table = {21176, 16960,
25896, 12770, 21228, 25914, 15954, 17038, 16914, 23584, 16474, 19698, 10710,
19800, 13576, 11268, 25266, 15890, 11062, 20146, 20352, 28812, 25546, 22008,
10814, 29312, 10268, 28496, 22310, 27736, 28688, 23246, 27364, 17288, 23172,
13374, 24108, 12708, 12854, 11592, 23832, 29468, 14460, 20064, 19268, 21994,
13092, 18556, 14728, 12282, 24634, 28296, 19332, 10448, 10160, 29896, 26084,
15332, 24606, 26344, 16818, 17846, 10492, 10274, 16154, 17410, 12578, 27572,
20118, 12616, 16096, 23130, 15644, 12120, 22412, 17012, 12728, 21930, 11164,
11476, 29510, 14724, 23484, 11078, 14186, 21074, 23714, 16508, 18932, 24454,
11602, 15108, 23012, 29190, 25524, 18638, 13454, 29240, 14482, 22742, 27328,
15612, 12100, 22294, 20726, 28706, 22580, 14642, 10368, 11106, 19428, 10026,
28636, 21980, 15984, 16088, 16354, 16234, 18496, 20172, 14124, 21392, 22944,
10516, 15728, 23412, 12710, 18352, 25312, 16752, 21382, 11968, 10294, 25898,
13906, 25648, 18194, 23078, 11142, 16484, 20212, 28630, 28596, 11554, 23910,
20086, 12166, 19894, 26320, 15576, 28796, 21906, 18794, 23438, 12842, 20374,
13320, 19712, 12874, 18122, 21444, 20230, 15376, 19718, 19388, 23620, 28070,
22586, 26134, 17608, 15416, 18372, 13540, 27726, 10942, 22852, 26410, 27388,
12672, 29544, 26304, 28450, 26368, 17832, 22026, 16998, 24028, 25476, 19414,
25202, 12688, 19238, 14578, 17628, 28956, 19854, 21270, 27026, 10416,
17742...}, port_table_len = 10000,
rand_table = "\243\240\357\230\314-&\356\032W!\220\355\016\374ɮ\310\002!G\371\360o\343B\360\261吡}\177;\036KiD:\203\234[\023\211j\017R\030\330T9\037M*\216\060l~\342R\016\203ώ\276\355\331'2\023\253\316o\276W\331Ω\361\246\376+\305KUS|\301\322^\023\340\341\343n\237\320H\307\002[r\320\312\060'\243\376ѕ\244\317\300i\032\025\275\226\326\217\364\352o\325\315\336u\235&<\240\201\256pLޘ\357\335i\204\201\070D\353RY\250\351\060\067\335\032\246\263\347\204(\204\252d$,\022\225x\360-g͖\354O\316\060: \212\342\t\272\031\347Կ\232\273D\302?\356&d\032\070\371\222(&\372\366\274\346E\212\026\177\252\240a\264Zz\233.95\351}\367)l\035\215\206U\206\031}\254\023sh\371\270\362\017\067\234\260\230P\n\022\353\071L "\311\027K5",
controlfd = 3}, sessinfo = {pfds = 0x7f6ee2c73010, sessions = 0x7f6ee2d11010,
nsessions = 0, lock = {data = {__lock = 0, __count = 0, __owner = 0,
__nusers = 0, __kind = 0, __spins = 0, __list = {__prev = 0x0,
__next = 0x0}}, __size = '\000' <repeats 39 times>, __align = 0}},
bindaddr_list = 0x1922060, bindaddr_lock = {__data = {__lock = 0, __count = 0,
__owner = 0, __nusers = 0, __kind = 0, __spins = 0, __list = {__prev = 0x0,
__next = 0x0}}, __size = '\000' <repeats 39 times>, __align = 0},
rtp_servers = 0x7f6ee2cc2010, rtp_nsessions = 0, sessions_active = 0,
sessions_created = 0, nofile_limit_warned = 0, hash_table = {
0x0 <repeats 256 times>}, timeout_socket = 0x0, timeout_handler = 0x0,
port_table_idx = 9999, glock = {__data = {__lock = 0, __count = 0, __owner = 0,
__nusers = 0, __kind = 0, __spins = 0, __list = {__prev = 0x0,
__next = 0x0}}, __size = '\000' <repeats 39 times>, __align = 0}}
buf = "7418\n\000\000\000tZ\265\342n\177\000\000p\237\377\323\377\177\000\000\003\000\000\000\000\000\000\000\005\000\000\000\000\000\000\000p%\326\342n\177\000\000.N=\366\000\000\000\000\236b\265\342n\177\000\000 \362\377\323\377\177\000\000.\000\000\000n\177\000\000\260\237\377\323\377\177\000\000\377\377\377\377\000\000\000\000\264z'\342n\177\000\000\250|'\342n\177\000\000\200\237\377\323\377\177\000\000П\377\323\377\177\000\000@>(\342n\177\000\000\b", '\000' <repeats 15 times>"\310, %\326\342n\177\000\000\000 \326\342n\177\000\000\371\017@\000\000\000\000\000\370I(\342n\177\000\000\370\006@\000\000\000\000\000\000\000\000\000\001\000\000\000\021\b\000\000\001", '\000' <repeats 11 times>, " \006\327\342n\177\000\000\360\237\377\323\377\177\000\000.N=\366\000\000\000\000\310%\326\342n\177\000\000\020\240\377\323\377\177\000"
__FUNCTION
= "main"

@miconda

This comment has been minimized.

Show comment
Hide comment
@miconda

miconda Jul 17, 2013

Owner

I run it like:

rtpproxy -s udp:127.0.0.1:7222 -l 192.168.0.1 -A 1.2.3.4 -F

and no high cpu. You said the cpu usage is high from the start, right?

The function shown in backtrace is usleep(), which should not use cpu. What operating system are you using? Is it installed in a virtual machine? What is the command/parameters used to run rtpproxy?

I run it on mac os x behind nat.

Owner

miconda commented Jul 17, 2013

I run it like:

rtpproxy -s udp:127.0.0.1:7222 -l 192.168.0.1 -A 1.2.3.4 -F

and no high cpu. You said the cpu usage is high from the start, right?

The function shown in backtrace is usleep(), which should not use cpu. What operating system are you using? Is it installed in a virtual machine? What is the command/parameters used to run rtpproxy?

I run it on mac os x behind nat.

@thantoldo

This comment has been minimized.

Show comment
Hide comment
@thantoldo

thantoldo Jul 18, 2013

rtpproxy -A -l -m 10000 -M 30000 -s udp:127.0.0.1:7722 -F

When it starts everything is fine, but when it should take action (via kamailio sip proxy) high cpu usage occurs. High cpu occurs even when kamailio just starts without any calls open. OS is ubuntu 12.04 x64, deployed@ amazon aws (tried on both micro and large instances).

Have you tested it with any sip proxy?

thantoldo commented Jul 18, 2013

rtpproxy -A -l -m 10000 -M 30000 -s udp:127.0.0.1:7722 -F

When it starts everything is fine, but when it should take action (via kamailio sip proxy) high cpu usage occurs. High cpu occurs even when kamailio just starts without any calls open. OS is ubuntu 12.04 x64, deployed@ amazon aws (tried on both micro and large instances).

Have you tested it with any sip proxy?

@miconda

This comment has been minimized.

Show comment
Hide comment
@miconda

miconda Jul 18, 2013

Owner

That seems related to command processing in rtpproxy, could be an issue introduced in devel version of rtpproxy.

Can you try following patch with rtpproxy-1.2.1?

diff -u rtpproxy-1.2.1/main.c rtpproxy-1.2.1-adv2/main.c
--- rtpproxy-1.2.1/main.c   2012-10-04 22:09:35.000000000 +0200
+++ rtpproxy-1.2.1-adv2/main.c  2013-07-18 10:54:02.000000000 +0200
@@ -98,7 +98,8 @@
     fprintf(stderr, "usage: rtpproxy [-2fvFiPa] [-l addr1[/addr2]] "
       "[-6 addr1[/addr2]] [-s path]\n\t[-t tos] [-r rdir [-S sdir]] [-T ttl] "
       "[-L nfiles] [-m port_min]\n\t[-M port_max] [-u uname[:gname]] "
-      "[-n timeout_socket] [-d log_level[:log_facility]]\n");
+      "[-n timeout_socket] [-d log_level[:log_facility]] "
+      "[-A addr1[/addr2]]\n");
     exit(1);
 }

@@ -133,6 +134,9 @@
     cf->port_min = PORT_MIN;
     cf->port_max = PORT_MAX;

+    cf->advaddr[0] = NULL;
+    cf->advaddr[1] = NULL;
+
     cf->max_ttl = SESSION_TIMEOUT;
     cf->tos = TOS;
     cf->rrtcp = 1;
@@ -147,7 +151,7 @@
     if (getrlimit(RLIMIT_NOFILE, &(cf->nofile_limit)) != 0)
    err(1, "getrlimit");

-    while ((ch = getopt(argc, argv, "vf2Rl:6:s:S:t:r:p:T:L:m:M:u:Fin:Pad:")) != -1)
+    while ((ch = getopt(argc, argv, "vf2Rl:6:s:S:t:r:p:T:L:m:M:u:Fin:Pad:A:")) != -1)
    switch (ch) {
    case 'f':
        cf->nodaemon = 1;
@@ -173,6 +177,23 @@
        }
        break;

+   case 'A':
+      cf->advaddr[0] = optarg;
+      cf->advaddr[1] = strchr(cf->advaddr[0], '/');
+      if (cf->advaddr[1] != NULL) {
+        *cf->advaddr[1] = '\0';
+        cf->advaddr[1]++;
+        if(*cf->advaddr[0]==0) {
+          errx(1, "first advertised address is invalid");
+          exit(0);
+        }
+        if(*cf->advaddr[1]==0) {
+          errx(1, "second advertised address is invalid");
+          exit(0);
+        }
+      }
+      break;
+
    case 's':
        if (strncmp("udp:", optarg, 4) == 0) {
        cf->umode = 1;
Common subdirectories: rtpproxy-1.2.1/rpm and rtpproxy-1.2.1-adv2/rpm
diff -u rtpproxy-1.2.1/rtpp_command.c rtpproxy-1.2.1-adv2/rtpp_command.c
--- rtpproxy-1.2.1/rtpp_command.c   2012-10-04 22:09:35.000000000 +0200
+++ rtpproxy-1.2.1-adv2/rtpp_command.c  2013-07-18 10:47:35.000000000 +0200
@@ -201,9 +201,21 @@
     }
     if (lia[0] == NULL || ishostnull(lia[0]))
    len += sprintf(cp, "%d\n", lport);
-    else
-   len += sprintf(cp, "%d %s%s\n", lport, addr2char(lia[0]),
-     (lia[0]->sa_family == AF_INET) ? "" : " 6");
+    else {
+    if(cf->advaddr[0] != NULL) {
+      if(cf->bmode!=0 && cf->advaddr[1]!=NULL
+          && lia[0]==cf->bindaddr[1]) {
+        len += sprintf(cp, "%d %s%s\n", lport, cf->advaddr[1],
+                (lia[0]->sa_family == AF_INET) ? "" : " 6");
+      } else {
+        len += sprintf(cp, "%d %s%s\n", lport, cf->advaddr[0],
+                (lia[0]->sa_family == AF_INET) ? "" : " 6");
+      }
+    } else {
+      len += sprintf(cp, "%d %s%s\n", lport, addr2char(lia[0]),
+        (lia[0]->sa_family == AF_INET) ? "" : " 6");
+    }
+  }
     doreply(cf, fd, buf, len, raddr, rlen);
 }

diff -u rtpproxy-1.2.1/rtpp_defines.h rtpproxy-1.2.1-adv2/rtpp_defines.h
--- rtpproxy-1.2.1/rtpp_defines.h   2012-10-04 22:09:35.000000000 +0200
+++ rtpproxy-1.2.1-adv2/rtpp_defines.h  2013-07-18 10:36:32.000000000 +0200
@@ -103,6 +103,7 @@
      * mode enabled.
      */
     struct sockaddr *bindaddr[2];  /* RTP socket(s) addresses */
+    char *advaddr[2]; /* advertised addresses */
     int tos;

     const char *rdir;
Owner

miconda commented Jul 18, 2013

That seems related to command processing in rtpproxy, could be an issue introduced in devel version of rtpproxy.

Can you try following patch with rtpproxy-1.2.1?

diff -u rtpproxy-1.2.1/main.c rtpproxy-1.2.1-adv2/main.c
--- rtpproxy-1.2.1/main.c   2012-10-04 22:09:35.000000000 +0200
+++ rtpproxy-1.2.1-adv2/main.c  2013-07-18 10:54:02.000000000 +0200
@@ -98,7 +98,8 @@
     fprintf(stderr, "usage: rtpproxy [-2fvFiPa] [-l addr1[/addr2]] "
       "[-6 addr1[/addr2]] [-s path]\n\t[-t tos] [-r rdir [-S sdir]] [-T ttl] "
       "[-L nfiles] [-m port_min]\n\t[-M port_max] [-u uname[:gname]] "
-      "[-n timeout_socket] [-d log_level[:log_facility]]\n");
+      "[-n timeout_socket] [-d log_level[:log_facility]] "
+      "[-A addr1[/addr2]]\n");
     exit(1);
 }

@@ -133,6 +134,9 @@
     cf->port_min = PORT_MIN;
     cf->port_max = PORT_MAX;

+    cf->advaddr[0] = NULL;
+    cf->advaddr[1] = NULL;
+
     cf->max_ttl = SESSION_TIMEOUT;
     cf->tos = TOS;
     cf->rrtcp = 1;
@@ -147,7 +151,7 @@
     if (getrlimit(RLIMIT_NOFILE, &(cf->nofile_limit)) != 0)
    err(1, "getrlimit");

-    while ((ch = getopt(argc, argv, "vf2Rl:6:s:S:t:r:p:T:L:m:M:u:Fin:Pad:")) != -1)
+    while ((ch = getopt(argc, argv, "vf2Rl:6:s:S:t:r:p:T:L:m:M:u:Fin:Pad:A:")) != -1)
    switch (ch) {
    case 'f':
        cf->nodaemon = 1;
@@ -173,6 +177,23 @@
        }
        break;

+   case 'A':
+      cf->advaddr[0] = optarg;
+      cf->advaddr[1] = strchr(cf->advaddr[0], '/');
+      if (cf->advaddr[1] != NULL) {
+        *cf->advaddr[1] = '\0';
+        cf->advaddr[1]++;
+        if(*cf->advaddr[0]==0) {
+          errx(1, "first advertised address is invalid");
+          exit(0);
+        }
+        if(*cf->advaddr[1]==0) {
+          errx(1, "second advertised address is invalid");
+          exit(0);
+        }
+      }
+      break;
+
    case 's':
        if (strncmp("udp:", optarg, 4) == 0) {
        cf->umode = 1;
Common subdirectories: rtpproxy-1.2.1/rpm and rtpproxy-1.2.1-adv2/rpm
diff -u rtpproxy-1.2.1/rtpp_command.c rtpproxy-1.2.1-adv2/rtpp_command.c
--- rtpproxy-1.2.1/rtpp_command.c   2012-10-04 22:09:35.000000000 +0200
+++ rtpproxy-1.2.1-adv2/rtpp_command.c  2013-07-18 10:47:35.000000000 +0200
@@ -201,9 +201,21 @@
     }
     if (lia[0] == NULL || ishostnull(lia[0]))
    len += sprintf(cp, "%d\n", lport);
-    else
-   len += sprintf(cp, "%d %s%s\n", lport, addr2char(lia[0]),
-     (lia[0]->sa_family == AF_INET) ? "" : " 6");
+    else {
+    if(cf->advaddr[0] != NULL) {
+      if(cf->bmode!=0 && cf->advaddr[1]!=NULL
+          && lia[0]==cf->bindaddr[1]) {
+        len += sprintf(cp, "%d %s%s\n", lport, cf->advaddr[1],
+                (lia[0]->sa_family == AF_INET) ? "" : " 6");
+      } else {
+        len += sprintf(cp, "%d %s%s\n", lport, cf->advaddr[0],
+                (lia[0]->sa_family == AF_INET) ? "" : " 6");
+      }
+    } else {
+      len += sprintf(cp, "%d %s%s\n", lport, addr2char(lia[0]),
+        (lia[0]->sa_family == AF_INET) ? "" : " 6");
+    }
+  }
     doreply(cf, fd, buf, len, raddr, rlen);
 }

diff -u rtpproxy-1.2.1/rtpp_defines.h rtpproxy-1.2.1-adv2/rtpp_defines.h
--- rtpproxy-1.2.1/rtpp_defines.h   2012-10-04 22:09:35.000000000 +0200
+++ rtpproxy-1.2.1-adv2/rtpp_defines.h  2013-07-18 10:36:32.000000000 +0200
@@ -103,6 +103,7 @@
      * mode enabled.
      */
     struct sockaddr *bindaddr[2];  /* RTP socket(s) addresses */
+    char *advaddr[2]; /* advertised addresses */
     int tos;

     const char *rdir;
@thantoldo

This comment has been minimized.

Show comment
Hide comment
@thantoldo

thantoldo Jul 26, 2013

Hi miconda,

Sorry for late reply, just applied your patch @ rtpproxy 1.2.1, problem is solved. Whenever you'd like I could try any other patch you provide at the latest rtpproxy.

Thanks,
Thanos

thantoldo commented Jul 26, 2013

Hi miconda,

Sorry for late reply, just applied your patch @ rtpproxy 1.2.1, problem is solved. Whenever you'd like I could try any other patch you provide at the latest rtpproxy.

Thanks,
Thanos

@seabra

This comment has been minimized.

Show comment
Hide comment
@seabra

seabra Aug 28, 2013

Hi miconda

I can't apply your patch with rtpproxy 1.2.1 from http://b2bua.org/chrome/site/rtpproxy-1.2.1.tar.gz, can you tell me please where i can download the right version for apply your last patch?

Thanks

seabra commented Aug 28, 2013

Hi miconda

I can't apply your patch with rtpproxy 1.2.1 from http://b2bua.org/chrome/site/rtpproxy-1.2.1.tar.gz, can you tell me please where i can download the right version for apply your last patch?

Thanks

@miconda

This comment has been minimized.

Show comment
Hide comment
@miconda

miconda Aug 28, 2013

Owner

Hi seabra, the patch in comment #1 (comment) should be on rtpproxy-1.2.1.tar.gz. What errors do you get when applying the patch?

Owner

miconda commented Aug 28, 2013

Hi seabra, the patch in comment #1 (comment) should be on rtpproxy-1.2.1.tar.gz. What errors do you get when applying the patch?

@seabra

This comment has been minimized.

Show comment
Hide comment
@seabra

seabra Aug 28, 2013

Hi Miconda,
when i apply the patch i got the following output:

patch -p1 < rtpproxy.patch
patching file main.c
Hunk #3 FAILED at 151.
Hunk #4 FAILED at 177.
2 out of 4 hunks FAILED -- saving rejects to file main.c.rej
patching file rtpp_command.c
Hunk #1 FAILED at 201.
1 out of 1 hunk FAILED -- saving rejects to file rtpp_command.c.rej
patching file rtpp_defines.h
Hunk #1 FAILED at 103.
1 out of 1 hunk FAILED -- saving rejects to file rtpp_defines.h.rej

and after that if i try run "./configure" and then "make" i got the following output:

./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking gsm.h usability... no
checking gsm.h presence... no
checking for gsm.h... no
checking g729_encoder.h usability... no
checking g729_encoder.h presence... no
checking for g729_encoder.h... no
checking for ANSI C header files... (cached) yes
checking arpa/inet.h usability... yes
checking arpa/inet.h presence... yes
checking for arpa/inet.h... yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking netdb.h usability... yes
checking netdb.h presence... yes
checking for netdb.h... yes
checking netinet/in.h usability... yes
checking netinet/in.h presence... yes
checking for netinet/in.h... yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking for strings.h... (cached) yes
checking sys/socket.h usability... yes
checking sys/socket.h presence... yes
checking for sys/socket.h... yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking for unistd.h... (cached) yes
checking err.h usability... yes
checking err.h presence... yes
checking for err.h... yes
checking for an ANSI C-conforming const... yes
checking whether time.h and sys/time.h may both be included... yes
checking for struct sockaddr_un.sun_len... no
checking for working alloca.h... yes
checking for alloca... yes
checking for stdlib.h... (cached) yes
checking for GNU libc compatible malloc... yes
checking for working memcmp... yes
checking return type of signal handlers... void
checking for atexit... yes
checking for gettimeofday... yes
checking for memset... yes
checking for mkdir... yes
checking for socket... yes
checking for strchr... yes
checking for strdup... yes
checking for strerror... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating config.h
config.status: executing depfiles commands
[root@vx00-mds01 rtpproxy-1.2.1]# make
make all-am
make[1]: Entering directory /usr/src/rtpproxy-1.2.1' if gcc -DHAVE_CONFIG_H -I. -I. -I. -D_BSD_SOURCE -std=gnu99 -Wall -Wno-uninitialized -g -O2 -MT main.o -MD -MP -MF ".deps/main.Tpo" -c -o main.o main.c; \ then mv -f ".deps/main.Tpo" ".deps/main.Po"; else rm -f ".deps/main.Tpo"; exit 1; fi main.c: In function ‘init_config’: main.c:137: error: ‘struct cfg’ has no member named ‘advaddr’ main.c:138: error: ‘struct cfg’ has no member named ‘advaddr’ make[1]: *** [main.o] Error 1 make[1]: Leaving directory/usr/src/rtpproxy-1.2.1'
make: *** [all] Error 2

seabra commented Aug 28, 2013

Hi Miconda,
when i apply the patch i got the following output:

patch -p1 < rtpproxy.patch
patching file main.c
Hunk #3 FAILED at 151.
Hunk #4 FAILED at 177.
2 out of 4 hunks FAILED -- saving rejects to file main.c.rej
patching file rtpp_command.c
Hunk #1 FAILED at 201.
1 out of 1 hunk FAILED -- saving rejects to file rtpp_command.c.rej
patching file rtpp_defines.h
Hunk #1 FAILED at 103.
1 out of 1 hunk FAILED -- saving rejects to file rtpp_defines.h.rej

and after that if i try run "./configure" and then "make" i got the following output:

./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking gsm.h usability... no
checking gsm.h presence... no
checking for gsm.h... no
checking g729_encoder.h usability... no
checking g729_encoder.h presence... no
checking for g729_encoder.h... no
checking for ANSI C header files... (cached) yes
checking arpa/inet.h usability... yes
checking arpa/inet.h presence... yes
checking for arpa/inet.h... yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking netdb.h usability... yes
checking netdb.h presence... yes
checking for netdb.h... yes
checking netinet/in.h usability... yes
checking netinet/in.h presence... yes
checking for netinet/in.h... yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking for strings.h... (cached) yes
checking sys/socket.h usability... yes
checking sys/socket.h presence... yes
checking for sys/socket.h... yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking for unistd.h... (cached) yes
checking err.h usability... yes
checking err.h presence... yes
checking for err.h... yes
checking for an ANSI C-conforming const... yes
checking whether time.h and sys/time.h may both be included... yes
checking for struct sockaddr_un.sun_len... no
checking for working alloca.h... yes
checking for alloca... yes
checking for stdlib.h... (cached) yes
checking for GNU libc compatible malloc... yes
checking for working memcmp... yes
checking return type of signal handlers... void
checking for atexit... yes
checking for gettimeofday... yes
checking for memset... yes
checking for mkdir... yes
checking for socket... yes
checking for strchr... yes
checking for strdup... yes
checking for strerror... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating config.h
config.status: executing depfiles commands
[root@vx00-mds01 rtpproxy-1.2.1]# make
make all-am
make[1]: Entering directory /usr/src/rtpproxy-1.2.1' if gcc -DHAVE_CONFIG_H -I. -I. -I. -D_BSD_SOURCE -std=gnu99 -Wall -Wno-uninitialized -g -O2 -MT main.o -MD -MP -MF ".deps/main.Tpo" -c -o main.o main.c; \ then mv -f ".deps/main.Tpo" ".deps/main.Po"; else rm -f ".deps/main.Tpo"; exit 1; fi main.c: In function ‘init_config’: main.c:137: error: ‘struct cfg’ has no member named ‘advaddr’ main.c:138: error: ‘struct cfg’ has no member named ‘advaddr’ make[1]: *** [main.o] Error 1 make[1]: Leaving directory/usr/src/rtpproxy-1.2.1'
make: *** [all] Error 2

@miconda

This comment has been minimized.

Show comment
Hide comment
@miconda

miconda Aug 28, 2013

Owner

Look into .rej files to see what the problems are. Maybe you copied the patch with wrong whitespacing.

Owner

miconda commented Aug 28, 2013

Look into .rej files to see what the problems are. Maybe you copied the patch with wrong whitespacing.

@seabra

This comment has been minimized.

Show comment
Hide comment
@seabra

seabra Aug 28, 2013

Hi Miconda,
it is working now,
thank you for advice,

seabra commented Aug 28, 2013

Hi Miconda,
it is working now,
thank you for advice,

@mpicher

This comment has been minimized.

Show comment
Hide comment
@mpicher

mpicher Feb 15, 2014

I'm having a similar problem applying this patch... Would it be possible to publish a new zip?

patching file main.c
Hunk #1 FAILED at 98.
Hunk #2 FAILED at 133.
Hunk #3 FAILED at 147.
Hunk #4 FAILED at 173.
4 out of 4 hunks FAILED -- saving rejects to file main.c.rej
patching file rtpp_command.c
Hunk #1 FAILED at 201.
1 out of 1 hunk FAILED -- saving rejects to file rtpp_command.c.rej
patching file rtpp_defines.h
Hunk #1 FAILED at 103.
1 out of 1 hunk FAILED -- saving rejects to file rtpp_defines.h.rej

I'm not sure how to deal with the whitespace problem... additional notes wrt this might help.

thanks in advance.

mpicher commented Feb 15, 2014

I'm having a similar problem applying this patch... Would it be possible to publish a new zip?

patching file main.c
Hunk #1 FAILED at 98.
Hunk #2 FAILED at 133.
Hunk #3 FAILED at 147.
Hunk #4 FAILED at 173.
4 out of 4 hunks FAILED -- saving rejects to file main.c.rej
patching file rtpp_command.c
Hunk #1 FAILED at 201.
1 out of 1 hunk FAILED -- saving rejects to file rtpp_command.c.rej
patching file rtpp_defines.h
Hunk #1 FAILED at 103.
1 out of 1 hunk FAILED -- saving rejects to file rtpp_defines.h.rej

I'm not sure how to deal with the whitespace problem... additional notes wrt this might help.

thanks in advance.

@mpicher

This comment has been minimized.

Show comment
Hide comment
@mpicher

mpicher Feb 15, 2014

lol... got the patch applied (use -l as an option for patch command) and now I'm missing the '-A' option on rtpproxy...

mpicher commented Feb 15, 2014

lol... got the patch applied (use -l as an option for patch command) and now I'm missing the '-A' option on rtpproxy...

@viware

This comment has been minimized.

Show comment
Hide comment
@viware

viware Apr 8, 2014

Hello

Well i run into same problem here with high CPU load even ssh terminal acts very slow.

I am using latest version from download here -> 99.9% load on rtpproxy when kamailio is running
Applied your posted changes to source -> still 99.9% load

I really need this thing working with advertise feature. Any suggestions?

viware commented Apr 8, 2014

Hello

Well i run into same problem here with high CPU load even ssh terminal acts very slow.

I am using latest version from download here -> 99.9% load on rtpproxy when kamailio is running
Applied your posted changes to source -> still 99.9% load

I really need this thing working with advertise feature. Any suggestions?

@miconda

This comment has been minimized.

Show comment
Hide comment
@miconda

miconda Apr 24, 2014

Owner

Try to use stable version http://b2bua.org/chrome/site/rtpproxy-1.2.1.tar.gz with the patch from #1 (comment)

Owner

miconda commented Apr 24, 2014

Try to use stable version http://b2bua.org/chrome/site/rtpproxy-1.2.1.tar.gz with the patch from #1 (comment)

@mrdave996

This comment has been minimized.

Show comment
Hide comment
@mrdave996

mrdave996 May 15, 2014

Hey miconda,
I've got the same issue. Tried stable 1.2.1, with patch, no change.
Initial call, CPU goes to 100%
Tried source directly from git, and I have difference results CPU goes to 100% without even initiating call.
Let me know what you need to help debug

mrdave996 commented May 15, 2014

Hey miconda,
I've got the same issue. Tried stable 1.2.1, with patch, no change.
Initial call, CPU goes to 100%
Tried source directly from git, and I have difference results CPU goes to 100% without even initiating call.
Let me know what you need to help debug

@mrdave996

This comment has been minimized.

Show comment
Hide comment
@mrdave996

mrdave996 May 15, 2014

Also, not sure if this is helpful but, when I restart rtpproxy, then restart kamailio, i get the following errors:

May 15 15:41:22 localhost /usr/local/sbin/kamailio[1708]: ERROR: rtpproxy [rtpproxy.c:1680]: send_rtpp_command(): can't send command to a RTP proxy
May 15 15:41:22 localhost /usr/local/sbin/kamailio[1708]: ERROR: rtpproxy [rtpproxy.c:1715]: send_rtpp_command(): proxy <udp:localhost:7722> does not respond, disable it
May 15 15:41:22 localhost /usr/local/sbin/kamailio[1708]: WARNING: rtpproxy [rtpproxy.c:1572]: rtpp_test(): can't get version of the RTP proxy
May 15 15:41:22 localhost /usr/local/sbin/kamailio[1708]: WARNING: rtpproxy [rtpproxy.c:1609]: rtpp_test(): support for RTP proxy <udp:localhost:7722> has been disabled temporarily

mrdave996 commented May 15, 2014

Also, not sure if this is helpful but, when I restart rtpproxy, then restart kamailio, i get the following errors:

May 15 15:41:22 localhost /usr/local/sbin/kamailio[1708]: ERROR: rtpproxy [rtpproxy.c:1680]: send_rtpp_command(): can't send command to a RTP proxy
May 15 15:41:22 localhost /usr/local/sbin/kamailio[1708]: ERROR: rtpproxy [rtpproxy.c:1715]: send_rtpp_command(): proxy <udp:localhost:7722> does not respond, disable it
May 15 15:41:22 localhost /usr/local/sbin/kamailio[1708]: WARNING: rtpproxy [rtpproxy.c:1572]: rtpp_test(): can't get version of the RTP proxy
May 15 15:41:22 localhost /usr/local/sbin/kamailio[1708]: WARNING: rtpproxy [rtpproxy.c:1609]: rtpp_test(): support for RTP proxy <udp:localhost:7722> has been disabled temporarily
@luismr

This comment has been minimized.

Show comment
Hide comment
@luismr

luismr Jun 8, 2014

Hello guys!

I had exactly the same problem but I follow @miconda tips:

  1. I downloaded RTP Proxy 1.2.1 original from SourceForge
  2. I applied batch 41f6d9d

And it is working very fine on my 4 instances on AWS.

If do you want download my stable release, please go to my GitHub Profile.

Regards

Luis

luismr commented Jun 8, 2014

Hello guys!

I had exactly the same problem but I follow @miconda tips:

  1. I downloaded RTP Proxy 1.2.1 original from SourceForge
  2. I applied batch 41f6d9d

And it is working very fine on my 4 instances on AWS.

If do you want download my stable release, please go to my GitHub Profile.

Regards

Luis

@miconda

This comment has been minimized.

Show comment
Hide comment
@miconda

miconda Sep 18, 2014

Owner

I pushed the patch to branch for rtpproxy 1.2 release series, next is the link to it:

To get the raw diff:

Owner

miconda commented Sep 18, 2014

I pushed the patch to branch for rtpproxy 1.2 release series, next is the link to it:

To get the raw diff:

@Freenex

This comment has been minimized.

Show comment
Hide comment
@Freenex

Freenex Feb 22, 2015

Hi Daniel,

I'm facing with 100% CPU problem with rtpproxy running with bridge and advertise flags, here is the gdb output. I'm running the master version with patch for advertised address. Is there any patch I can apply to solve this issue? thanks in advance

#0 0x00000036d66aca3d in nanosleep () from /lib64/libc.so.6
No symbol table info available.
#1 0x00000036d66e1be4 in usleep () from /lib64/libc.so.6
No symbol table info available.
#2 0x0000000000403c27 in main (argc=961242861, argv=0x7fff90442c48) at main.c:840
i =
len =
timeout = 1000
controlfd = -1874583464
alarm_tick =
sptime = 1424616677.178158
eptime = 1424616677.178158
last_tick_time = 1424616677.1781571
delay =
cf = {stable = {nodaemon = 0, dmode = 0, bmode = 0, umode = 1, port_min = 10000, port_max = 19998, max_ttl = 60, bindaddr = {0x15302d0, 0x0}, advaddr = {0x7fff90444940 "188.165.134.204", 0x0}, tos = 184, rdir = 0x0, sdir = 0x0,
record_pcap = 0, record_all = 0, rrtcp = 1, glog = 0x7fff90421e90, nofile_limit = {rlim_cur = 1024, rlim_max = 4096}, run_uname = 0x7fff904448f4 "rtpproxy", run_gname = 0x0, no_check = 0, ttl_mode = TTL_UNIFIED,
run_uid = 497, run_gid = 497, log_level = -1, log_facility = -1, port_table = {12536, 13762, 10192, 14312, 12600, 15002, 11808, 10564, 17840, 13288, 15798, 17934, 10416, 10108, 12664, 14864, 18036, 11820, 13440, 12698,
16858, 12900, 10230, 17862, 11692, 14610, 14984, 12388, 10194, 10866, 12922, 11058, 15706, 14722, 15370, 16624, 11524, 15644, 19926, 12446, 11636, 13586, 18636, 14072, 11740, 17728, 16394, 18076, 16894, 12538, 12724,
18236, 18142, 16404, 13098, 13810, 18220, 10414, 13664, 16740, 11670, 13242, 12368, 11154, 13088, 15874, 19792, 10454, 11518, 12382, 13692, 16248, 17246, 15360, 17640, 10386, 16524, 16738, 10046, 17902, 18608, 17730,
11328, 13336, 18428, 11656, 17060, 19826, 12108, 12972, 16566, 17930, 14416, 15980, 10944, 14736, 12944, 13178, 10792, 12808, 18744, 15692, 13262, 16784, 15020, 10664, 12064, 18334, 10906, 12370, 15236, 12016, 18438,
16352, 11610, 17062, 10528, 17082, 17146, 15340, 10550, 12012, 14898, 15630, 18086, 17570, 16148, 14562, 10342, 15282, 11728, 15682, 19052, 16294, 13344, 10120, 15416, 17652, 10538, 13702, 14826, 19302, 11910, 19256,
11130, 12524, 16576, 11906, 11956, 10646, 10090, 17074, 15816, 13406, 18918, 13734, 11490, 12294, 14472, 14020, 14594, 16202, 16734, 19276, 12522, 11574, 18270, 19076, 12162, 15072, 17302, 17214, 15410, 17616, 14084,
19740, 12846, 13364, 16696, 11180, 13408, 10856, 16088, 12830, 10710, 17764, 15422, 14818, 14440, 15188, 17988, 19742, 11210, 10790, 17994, 15050, 15588, 10824, 11628, 17750...}, port_table_len = 5000,
rand_table = "\376\061H\300KP\005\365\353\221\361\235 0\353F\203\344cL\367\036\233o\177\222\264_n/\317l\027-\253g2\240SÑ\360\344\301\333*D\277\215\220\266\253+&*\276ډ,\nX\230jo\305\026\327\370\266*\273H\032\237\t\366\311N\265V\336l\001\n\222+\310l\265\364v\r\214\341}R\367TJ\255~\005\365\230\245\377\216nMD\305+\260\306\065B\362\375\256\247\361%\264~\006\061\320\375\205\032\252\003\037\240\234ğ*3\354n\370\027\036\276M\260J\017W<4\f\272:=\212\067ä\341\306Áb\210 \215\273\f\373\263$\032qqz"\273\211y\367\275\205\261\367\303;.\206\337\020L\243\221\257+\262<\346\276\067\231\342Q\nS\314,\017U\246\006\023+\270\n\356\363\071t\323I\301v\332p\241\214\254\207K\343 -5*\201\001W\220V\375\226i(Nt\027B\255\213\025", <incomplete sequence \366>, controlfd = 3}, sessinfo = {pfds = 0x7f94f6756010, sessions = 0x7f94f67a6010, nsessions = 0, lock = {data = {__lock = 0, __count = 0, __owner = 0, __nusers = 0, __kind = 0, __spins = 0,
__list = {__prev = 0x0, __next = 0x0}}, __size = '\000' <repeats 39 times>, __align = 0}}, bindaddr_list = 0x15302d0, bindaddr_lock = {__data = {__lock = 0, __count = 0, __owner = 0, __nusers = 0, __kind = 0,
__spins = 0, __list = {__prev = 0x0, __next = 0x0}}, __size = '\000' <repeats 39 times>, __align = 0}, rtp_servers = 0x7f94f677e010, rtp_nsessions = 0, sessions_active = 0, sessions_created = 79, nofile_limit_warned = 0,
hash_table = {0x0 <repeats 256 times>}, timeout_socket = 0x0, timeout_handler = 0x0, port_table_idx = 115, glock = {__data = {__lock = 0, __count = 0, __owner = 0, __nusers = 0, __kind = 0, __spins = 0, __list = {
__prev = 0x0, __next = 0x0}}, __size = '\000' <repeats 39 times>, __align = 0}}
buf = "16003\n\000\000\000\000\000\000\000\000\000\000\004\000\000\000\001\000\000\000\360*D\220\377\177\000\000XqT\220\377\177\000\000\210qT\220\377\177\000\000\320(D\220\377\177\000\000\000\000\000\000\002", '\000' <repeats 11 times>, "@(D\220\377\177\000\000\210\021B\326\066\000\000\000\000'D\220\377\177\000\000\030\027B\326\066", '\000' <repeats 11 times>"\220, +D\220\377\177\000\000\030\027B\326\066\000\000\000\337Uu\326\066\000\000\000\060rT\220\377\177\000\000`+D\220\377\177\000\000\000\000\000\000\000\000\000\000\002\000\000\000\000\000\000\000\060+D\220\377\177\000\000\200\026 \326\066\000\000\000\240\032B\326\066\000\000\000@+D\220\377\177\000\000x+D\220\377\177\000\000\030\027B\326\066\000\000\000\220+D\220\377\177\000\000\177U\335q\000\000\000\000\n\237 \326\066", '\000' <repeats 11 times>"\220"...
__FUNCTION
= "main"

Freenex commented Feb 22, 2015

Hi Daniel,

I'm facing with 100% CPU problem with rtpproxy running with bridge and advertise flags, here is the gdb output. I'm running the master version with patch for advertised address. Is there any patch I can apply to solve this issue? thanks in advance

#0 0x00000036d66aca3d in nanosleep () from /lib64/libc.so.6
No symbol table info available.
#1 0x00000036d66e1be4 in usleep () from /lib64/libc.so.6
No symbol table info available.
#2 0x0000000000403c27 in main (argc=961242861, argv=0x7fff90442c48) at main.c:840
i =
len =
timeout = 1000
controlfd = -1874583464
alarm_tick =
sptime = 1424616677.178158
eptime = 1424616677.178158
last_tick_time = 1424616677.1781571
delay =
cf = {stable = {nodaemon = 0, dmode = 0, bmode = 0, umode = 1, port_min = 10000, port_max = 19998, max_ttl = 60, bindaddr = {0x15302d0, 0x0}, advaddr = {0x7fff90444940 "188.165.134.204", 0x0}, tos = 184, rdir = 0x0, sdir = 0x0,
record_pcap = 0, record_all = 0, rrtcp = 1, glog = 0x7fff90421e90, nofile_limit = {rlim_cur = 1024, rlim_max = 4096}, run_uname = 0x7fff904448f4 "rtpproxy", run_gname = 0x0, no_check = 0, ttl_mode = TTL_UNIFIED,
run_uid = 497, run_gid = 497, log_level = -1, log_facility = -1, port_table = {12536, 13762, 10192, 14312, 12600, 15002, 11808, 10564, 17840, 13288, 15798, 17934, 10416, 10108, 12664, 14864, 18036, 11820, 13440, 12698,
16858, 12900, 10230, 17862, 11692, 14610, 14984, 12388, 10194, 10866, 12922, 11058, 15706, 14722, 15370, 16624, 11524, 15644, 19926, 12446, 11636, 13586, 18636, 14072, 11740, 17728, 16394, 18076, 16894, 12538, 12724,
18236, 18142, 16404, 13098, 13810, 18220, 10414, 13664, 16740, 11670, 13242, 12368, 11154, 13088, 15874, 19792, 10454, 11518, 12382, 13692, 16248, 17246, 15360, 17640, 10386, 16524, 16738, 10046, 17902, 18608, 17730,
11328, 13336, 18428, 11656, 17060, 19826, 12108, 12972, 16566, 17930, 14416, 15980, 10944, 14736, 12944, 13178, 10792, 12808, 18744, 15692, 13262, 16784, 15020, 10664, 12064, 18334, 10906, 12370, 15236, 12016, 18438,
16352, 11610, 17062, 10528, 17082, 17146, 15340, 10550, 12012, 14898, 15630, 18086, 17570, 16148, 14562, 10342, 15282, 11728, 15682, 19052, 16294, 13344, 10120, 15416, 17652, 10538, 13702, 14826, 19302, 11910, 19256,
11130, 12524, 16576, 11906, 11956, 10646, 10090, 17074, 15816, 13406, 18918, 13734, 11490, 12294, 14472, 14020, 14594, 16202, 16734, 19276, 12522, 11574, 18270, 19076, 12162, 15072, 17302, 17214, 15410, 17616, 14084,
19740, 12846, 13364, 16696, 11180, 13408, 10856, 16088, 12830, 10710, 17764, 15422, 14818, 14440, 15188, 17988, 19742, 11210, 10790, 17994, 15050, 15588, 10824, 11628, 17750...}, port_table_len = 5000,
rand_table = "\376\061H\300KP\005\365\353\221\361\235 0\353F\203\344cL\367\036\233o\177\222\264_n/\317l\027-\253g2\240SÑ\360\344\301\333*D\277\215\220\266\253+&*\276ډ,\nX\230jo\305\026\327\370\266*\273H\032\237\t\366\311N\265V\336l\001\n\222+\310l\265\364v\r\214\341}R\367TJ\255~\005\365\230\245\377\216nMD\305+\260\306\065B\362\375\256\247\361%\264~\006\061\320\375\205\032\252\003\037\240\234ğ*3\354n\370\027\036\276M\260J\017W<4\f\272:=\212\067ä\341\306Áb\210 \215\273\f\373\263$\032qqz"\273\211y\367\275\205\261\367\303;.\206\337\020L\243\221\257+\262<\346\276\067\231\342Q\nS\314,\017U\246\006\023+\270\n\356\363\071t\323I\301v\332p\241\214\254\207K\343 -5*\201\001W\220V\375\226i(Nt\027B\255\213\025", <incomplete sequence \366>, controlfd = 3}, sessinfo = {pfds = 0x7f94f6756010, sessions = 0x7f94f67a6010, nsessions = 0, lock = {data = {__lock = 0, __count = 0, __owner = 0, __nusers = 0, __kind = 0, __spins = 0,
__list = {__prev = 0x0, __next = 0x0}}, __size = '\000' <repeats 39 times>, __align = 0}}, bindaddr_list = 0x15302d0, bindaddr_lock = {__data = {__lock = 0, __count = 0, __owner = 0, __nusers = 0, __kind = 0,
__spins = 0, __list = {__prev = 0x0, __next = 0x0}}, __size = '\000' <repeats 39 times>, __align = 0}, rtp_servers = 0x7f94f677e010, rtp_nsessions = 0, sessions_active = 0, sessions_created = 79, nofile_limit_warned = 0,
hash_table = {0x0 <repeats 256 times>}, timeout_socket = 0x0, timeout_handler = 0x0, port_table_idx = 115, glock = {__data = {__lock = 0, __count = 0, __owner = 0, __nusers = 0, __kind = 0, __spins = 0, __list = {
__prev = 0x0, __next = 0x0}}, __size = '\000' <repeats 39 times>, __align = 0}}
buf = "16003\n\000\000\000\000\000\000\000\000\000\000\004\000\000\000\001\000\000\000\360*D\220\377\177\000\000XqT\220\377\177\000\000\210qT\220\377\177\000\000\320(D\220\377\177\000\000\000\000\000\000\002", '\000' <repeats 11 times>, "@(D\220\377\177\000\000\210\021B\326\066\000\000\000\000'D\220\377\177\000\000\030\027B\326\066", '\000' <repeats 11 times>"\220, +D\220\377\177\000\000\030\027B\326\066\000\000\000\337Uu\326\066\000\000\000\060rT\220\377\177\000\000`+D\220\377\177\000\000\000\000\000\000\000\000\000\000\002\000\000\000\000\000\000\000\060+D\220\377\177\000\000\200\026 \326\066\000\000\000\240\032B\326\066\000\000\000@+D\220\377\177\000\000x+D\220\377\177\000\000\030\027B\326\066\000\000\000\220+D\220\377\177\000\000\177U\335q\000\000\000\000\n\237 \326\066", '\000' <repeats 11 times>"\220"...
__FUNCTION
= "main"

@miconda

This comment has been minimized.

Show comment
Hide comment
@miconda

miconda Nov 4, 2016

Owner

Closing, this fork was merged into mainstream rtpproxy 2.0, any issue should be reported there.

Owner

miconda commented Nov 4, 2016

Closing, this fork was merged into mainstream rtpproxy 2.0, any issue should be reported there.

@miconda miconda closed this Nov 4, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment