-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Hello,
I have "seg-fault" with carrierroute module:
openser: svnrevision: 2:4013M on a 64 bit machine running CENTOS5
- -------------------------------------------------- openser-config:
[..] loadmodule "carrierroute.so" modparam("carrierroute", "config_file", "/opt/app/voip/openser/etc/openser/carrierroute.conf2") [..]
if(!cr_route("default", "0", "$rU", "$rU", "call_id")) { ... }
- ----------------------------------------------------- carrierroute.conf2:
domain 0 { ~ prefix +49441 ~ { ~ max_targets = 1 ~ target y.y.z ~ { ~ prob = 0.500000 ~ hash_index = 1 ~ status = 1 ~ comment = "GK-Proxy" ~ } ~ } }
- ----------------------------------------------------
openser console:
[...] Apr 17 10:54:50 [27937] INFO:carrierroute:add_carrier_tree: carrier default not found, add it Apr 17 10:54:50 [27937] INFO:carrierroute:add_tree: tree default has internal id 0 Apr 17 10:54:50 [27937] INFO:carrierroute:add_carrier_tree: created carrier tree: default, with id 1 and 1 trees Apr 17 10:54:50 [27937] INFO:carrierroute:load_config: loading domain 0 Apr 17 10:54:50 [27937] INFO:carrierroute:load_config: loading prefix 49441 Apr 17 10:54:50 [27937] INFO:carrierroute:load_config: loading target y.y.z Apr 17 10:54:50 [27937] INFO:carrierroute:load_config: adding route for prefix 49441, to host y.y.z, prob 0.500000, backed up: 0, backup: -1 Apr 17 10:54:50 [27937] INFO:carrierroute:add_route: adding prefix 49441, prob 0.500000 Apr 17 10:54:50 [27937] INFO:carrierroute:get_route_tree: domain 0 not found, add it Apr 17 10:54:50 [27937] INFO:carrierroute:add_domain: domain 0 has id 0 Apr 17 10:54:50 [27937] INFO:carrierroute:add_route_tree: tree default has 1 trees Apr 17 10:54:50 [27937] INFO:carrierroute:get_route_tree: created route tree: 0, with id 0 Apr 17 10:54:50 [27937] INFO:carrierroute:add_route: found route, now adding Apr 17 10:54:50 [27937] INFO:carrierroute:add_route_rule: no backed up rules Apr 17 10:54:50 [27937] INFO:carrierroute:rule_fixup: fixing tree 0 Apr 17 10:54:50 [27937] INFO:carrierroute:rule_fixup_recursor: rule with host y.y.z hash has hashindex 1. Apr 17 10:54:50 [27937] INFO:carrierroute:mod_init: module initialized, pid [27937] Apr 17 10:54:50 [27937] ERROR:core:pv_parse_spec: bad parameters Apr 17 10:54:50 [27937] INFO:carrierroute:carrier_fixup: carrier tree default has id 1 Apr 17 10:54:50 [27937] ERROR:core:pv_parse_spec: bad parameters [...]
- ---------------------------------------------
The seg-fault:
Apr 17 10:57:20 [28437] DBG:carrierroute:get_route_tree_by_id: searching in carrier default, id 1 Apr 17 10:57:20 [28437] DBG:carrierroute:get_route_tree_by_id: tree default, domain 0 : 0 Segmentation fault (core dumped)
Number in $rU was "+49441234"
Any ideas?
Helmut
On Thursday 17 April 2008, Helmut Kuper wrote:
I have "seg-fault" with carrierroute module:
openser: svnrevision: 2:4013M on a 64 bit machine running CENTOS5
Hi Helmut,
thank you for the report.
openser console:
[...] Apr 17 10:54:50 [27937] INFO:carrierroute:carrier_fixup: carrier tree default has id 1 Apr 17 10:54:50 [27937] ERROR:core:pv_parse_spec: bad parameters [...]
The error quoted above is "normal", its produced from the pseudovariable parsing. Should be fixed, as its misleading, i know..
The seg-fault:
Apr 17 10:57:20 [28437] DBG:carrierroute:get_route_tree_by_id: searching in carrier default, id 1 Apr 17 10:57:20 [28437] DBG:carrierroute:get_route_tree_by_id: tree default, domain 0 : 0 Segmentation fault (core dumped)
Number in $rU was "+49441234"
Did the module crashes during the first execution of the cr_route? Or does the segfault occur only after some time/ traffic? If you have a core dump of the crash it would be great if you could send me the backtrace from gdb.
Cheers,
Henning
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Hi Henning,
|> The seg-fault: |> |> Apr 17 10:57:20 [28437] DBG:carrierroute:get_route_tree_by_id: searching |> in carrier default, id 1 |> Apr 17 10:57:20 [28437] DBG:carrierroute:get_route_tree_by_id: tree |> default, domain 0 : 0 |> Segmentation fault (core dumped) |> |> |> Number in $rU was "+49441234" | | Did the module crashes during the first execution of the cr_route? Or does the | segfault occur only after some time/ traffic? If you have a core dump of the | crash it would be great if you could send me the backtrace from gdb. | | Cheers, | | Henning | |
it crashes during first execution of cr_route()
gdb-Backtrace:
Program terminated with signal 11, Segmentation fault. #0 0x00002aaaad83dd2a in rewrite_uri_recursor (route_tree=0x8, pm=0x7fffac501ed0, flags=2281701376, dest=0x7fffac502080, msg=0x7a5a78, ~ user=0x7fffac5020a0, hash_source=shs_call_id, alg=alg_crc32, dstavp=0x0) at route_func.c:522 522 if (re_pm.len == 0 || route_tree->nodes[*re_pm.s - '0'] == NULL) { (gdb) bt #0 0x00002aaaad83dd2a in rewrite_uri_recursor (route_tree=0x8, pm=0x7fffac501ed0, flags=2281701376, dest=0x7fffac502080, msg=0x7a5a78, ~ user=0x7fffac5020a0, hash_source=shs_call_id, alg=alg_crc32, dstavp=0x0) at route_func.c:522 #1 0x00002aaaad83dd92 in rewrite_uri_recursor (route_tree=0x2aaaae305b50, pm=0x7fffac502090, flags=2281701376, dest=0x7fffac502080, ~ msg=0x7a5a78, user=0x7fffac5020a0, hash_source=shs_call_id, alg=alg_crc32, dstavp=0x0) at route_func.c:534 #2 0x00002aaaad83f721 in cr_do_route (_msg=0x7a5a78, _carrier=<value optimized out>, _domain=0x799d78, ~ _prefix_matching=<value optimized out>, _rewrite_user=<value optimized out>, _hsrc=shs_call_id, _halg=alg_crc32, _dstavp=0x0) ~ at route_func.c:637 #3 0x00002aaaad83fed7 in cr_route (_msg=0x2aaab0098978, _carrier=0x39, _domain=0x722962, _prefix_matching=0x3, _rewrite_user=0x7a5a78, ~ _hsrc=2890932384, _dstavp=0x0) at route_func.c:680 #4 0x000000000040ce91 in do_action (a=0x7702d0, msg=0x7a5a78) at action.c:838 #5 0x000000000040f47e in run_action_list (a=<value optimized out>, msg=0x7a5a78) at action.c:132 #6 0x000000000045b544 in eval_expr (e=0x7703a0, msg=0x7a5a78, val=0x0) at route.c:1072 #7 0x000000000045afbd in eval_expr (e=0x7703e8, msg=0x7a5a78, val=0x0) at route.c:1379 #8 0x000000000045af65 in eval_expr (e=0x770430, msg=0x7a5a78, val=0x0) at route.c:1384 #9 0x000000000040c9ca in do_action (a=0x771128, msg=0x7a5a78) at action.c:693 #10 0x000000000040f47e in run_action_list (a=<value optimized out>, msg=0x7a5a78) at action.c:132 #11 0x000000000040e2f2 in do_action (a=0x772be0, msg=0x7a5a78) at action.c:710 #12 0x000000000040f47e in run_action_list (a=<value optimized out>, msg=0x7a5a78) at action.c:132 #13 0x000000000040e2f2 in do_action (a=0x773e90, msg=0x7a5a78) at action.c:710 #14 0x000000000040f47e in run_action_list (a=<value optimized out>, msg=0x7a5a78) at action.c:132 #15 0x000000000040e2f2 in do_action (a=0x77a180, msg=0x7a5a78) at action.c:710 #16 0x000000000040f47e in run_action_list (a=<value optimized out>, msg=0x7a5a78) at action.c:132 #17 0x000000000040eda7 in do_action (a=0x77a250, msg=0x7a5a78) at action.c:716 #18 0x000000000040f47e in run_action_list (a=<value optimized out>, msg=0x7a5a78) at action.c:132 #19 0x000000000040f7db in run_top_route (a=0x767fc0, msg=0x7a5a78) at action.c:112 #20 0x000000000044c93f in receive_msg (buf=0x6f15 <Address 0x6f15 out of bounds>, len=2890939456, rcv_info=0x7fffac503c40) ~ at receive.c:156 #21 0x000000000048971e in udp_rcv_loop () at udp_server.c:438 #22 0x00000000004264c7 in main (argc=28437, argv=0x20) at main.c:692 (gdb)
regards Helmut
On Thursday 17 April 2008, Helmut Kuper wrote:
[..] ~ prefix +49441
Hi Helmut,
this is not a valid statement for the prefix. Only numbers are allowed. But it should not crash, better would be to check during the startup. I'll try to reproduce, and fix this bug. Thank you for the backtrace.
Could you please try without the '+' sign?
Cheers,
Henning
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Hi Henning,
ok, I did some tests:
1. carrierroute.conf2 accepts '+' sign and can work with it. In fact it seems that it doesn't matter for carrierroute at all.
2. cr_route crashes if first 2 characters of 3rd argument are no numbers ~ . Alphanumeric characters on other places in 3rd argument doesn't cause a crash.
- - crash: cr_route("default", "0", "x494411234", "$rU", "call_id") - - crash: cr_route("default", "0", "4x94411234", "$rU", "call_id") - - no crash: cr_route("default", "0", "49x4411234", "$rU", "call_id")
3. Documentation about 6th optional argument is not clear. It seems it must be an avp and not one of those "crc32" or "prime" ..
cheers and thx Helmut
Henning Westerholt schrieb: | On Thursday 17 April 2008, Helmut Kuper wrote: |> [..] |> ~ prefix +49441 | | Hi Helmut, | | this is not a valid statement for the prefix. Only numbers are allowed. But it | should not crash, better would be to check during the startup. I'll try to | reproduce, and fix this bug. Thank you for the backtrace. | | Could you please try without the '+' sign? | | Cheers, | | Henning | |
On Thursday 17 April 2008, Helmut Kuper wrote:
ok, I did some tests:
- carrierroute.conf2 accepts '+' sign and can work with it. In fact it
seems that it doesn't matter for carrierroute at all.
Yes,
this must be fixed.
- cr_route crashes if first 2 characters of 3rd argument are no numbers
~ . Alphanumeric characters on other places in 3rd argument doesn't cause a crash.
- crash: cr_route("default", "0", "x494411234", "$rU", "call_id")
- crash: cr_route("default", "0", "4x94411234", "$rU", "call_id")
- no crash: cr_route("default", "0", "49x4411234", "$rU", "call_id")
- Documentation about 6th optional argument is not clear. It seems it
must be an avp and not one of those "crc32" or "prime" ..
Yes, the documentation was not completly updated during some interface reworks. Should be fixed now.
Cheers,
Henning
On Thursday 17 April 2008, Helmut Kuper wrote:
ok, I did some tests:
- carrierroute.conf2 accepts '+' sign and can work with it. In fact it
seems that it doesn't matter for carrierroute at all.
Hi Helmut,
i can confirm this, there ignored during the config file loading. Prefixes like this '49+33' are even detected during startup.
- cr_route crashes if first 2 characters of 3rd argument are no numbers
~ . Alphanumeric characters on other places in 3rd argument doesn't cause a crash.
- crash: cr_route("default", "0", "x494411234", "$rU", "call_id")
- crash: cr_route("default", "0", "4x94411234", "$rU", "call_id")
- no crash: cr_route("default", "0", "49x4411234", "$rU", "call_id")
I found the bug, its fixed in trunk. The 1.3 branch should be not affected.
Thanks,
Henning
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Hi Henning,
works nicely now! Thx
regards helmut
Henning Westerholt schrieb: | | I found the bug, its fixed in trunk. The 1.3 branch should be not affected. | | Thanks, | | Henning | |