[SR-Users] Help on how to debug cfg_get variable having unexpected value?

Malcolm O'Hare sac_malcolm at msn.com
Mon May 14 19:43:51 CEST 2018

I'm trying to debug an issue I've encountered where a variable that I've set using kamcmd cfg.set has an unexpected value when used in kamailio.  The variable should be 0 or 1, but it looks like its getting set accidently somehow.

2018-05-11T22:02:58.344260+00:00 ip-172-31-129-45 kamailio[5253]: DEBUG: <core> [select.c:263]: resolve_select(): 'with_dynamodb_user_data'

2018-05-11T22:02:58.344264+00:00 ip-172-31-129-45 kamailio[5253]: DEBUG: <core> [cfg/cfg_select.c:174]: select_cfg_var(): DEBUG: select_cfg_var(): select fixup is postponed: features.with_dynamodb_user_data

2018-05-11T22:05:03.467110+00:00 ip-172-31-129-45 kamailio[5551]: INFO: <core> [cfg/cfg_ctx.c:608]: cfg_set_now(): INFO: cfg_set_now(): features.with_dynamodb_user_data has been changed to 1

2018-05-11T22:15:51.695118+00:00 ip-172-31-129-45 kamailio[5574]: [2c03c333-1705-41b1-aa26-6f10492a5a6f] DEBUG: with_dynamodb_user_data is 1157627905

I've tried to debug using gdb using breaks and set a watch on the memory address of the var, but it looks like it keeps using different memory locations.  The value in the address pointed at by group.handle seems to change for each invocation of set_cfg_now, so when I try and put a watch on the address of *group.handle + var.offset it never gets hit.

(gdb) print *group
$36 = {num = 25, mapping = 0x7f56ee4474f0, vars = 0x0, add_var = 0x0, size = 164, meta_offset = 968, var_offset = 984, handle = 0x7f56edf92fd0, orig_handle = 0x0,
  dynamic = 1 '\001', next = 0x0, name_len = 8, name = "f"}

(gdb) print *var
$62 = {def = 0x7f56ee471668, name_len = 23, pos = 24, offset = 164, flag = 0}

Any ideas?


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20180514/374dce9e/attachment.html>

More information about the sr-users mailing list