<p>I was able to reproduce this using a sample cfg:</p>
<pre><code>#!KAMAILIO


sample_group.a = 0

sample_group.b = 0

sample_group.c = 0

sample_group.d = 0

sample_group.e = 0

sample_group.f = 0

sample_group.g = 0

sample_group.h = 0

sample_group.i = 0

sample_group.j = 0

sample_group.k = 0

sample_group.l = 0

sample_group.m = 0

sample_group.n = 0

sample_group.o = ""

sample_group.p = 0

sample_group.q = 0

sample_group.r = 4000

sample_group.s = "null"

sample_group.t = "null"

sample_group.u = "null"

sample_group.v = "null"

sample_group.w = 0

sample_group.x = 0

sample_group.y = 0

sample_group.z = 0

sample_group.a1 = 0
</code></pre>
<p>The memory mapping is as follows:</p>
<pre><code>START
block address: 0x7f43ed1484d8
vars address: 0x7f43ed1484dc
Total allocated size: 1352
Group number: 1
Group location from start 20
Group size: 248
Group number: 2
Group location from start 284
Group size: 56
Group number: 3
Group location from start 356
Group size: 4
Group number: 4
Group location from start 380
Group size: 4
Group number: 5
Group location from start 404
Group size: 4
Group number: 6
Group location from start 428
Group size: 176
Group number: 7
Group location from start 620
Group size: 104
Group number: 8
Group location from start 740
Group size: 200
Group number: 9
Group location from start 956
Group size: 16
Group number: 10
Group location from start 988
Group size: 172
Group number: 11
Group location from start 1180
Group size: 172
</code></pre>
<p>As you can see that group 10 and 11(created using cfg above) have the same size.</p>
<p>Now, if you try to get the value of sample_group.a and put a breakpoint here:</p>
<p><a href="https://github.com/kamailio/kamailio/blob/master/src/core/cfg/cfg_ctx.c#L1319">https://github.com/kamailio/kamailio/blob/master/src/core/cfg/cfg_ctx.c#L1319</a></p>
<p>i.e. run the following command</p>
<p><code>sudo kamctl kamcmd cfg.get sample_group a</code></p>
<p>The offsets in gdb are as follows:</p>
<pre><code>(gdb) print var->offset
$1 = 172
(gdb) print group->var_offset
$2 = 1176
</code></pre>
<p>Also the value is getting corrupted:</p>
<pre><code>sudo kamctl kamcmd cfg.get sample_group a
694019999
</code></pre>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/kamailio/kamailio/issues/1583#issuecomment-404266806">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AF36ZbDPLTqpajoGfvQ1zjTup9Uyl51gks5uFkPUgaJpZM4VDDlj">mute the thread</a>.<img src="https://github.com/notifications/beacon/AF36ZTbBMvP3prx42LOTlg1T6HxeGU6eks5uFkPUgaJpZM4VDDlj.gif" height="1" width="1" alt="" /></p>
<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/kamailio/kamailio","title":"kamailio/kamailio","subtitle":"GitHub repository","main_image_url":"https://assets-cdn.github.com/images/email/message_cards/header.png","avatar_image_url":"https://assets-cdn.github.com/images/email/message_cards/avatar.png","action":{"name":"Open in GitHub","url":"https://github.com/kamailio/kamailio"}},"updates":{"snippets":[{"icon":"PERSON","message":"@vinesinha in #1583: I was able to reproduce this using a sample cfg:\r\n\r\n```\r\n#!KAMAILIO\r\n\r\n\r\nsample_group.a = 0\r\n\r\nsample_group.b = 0\r\n\r\nsample_group.c = 0\r\n\r\nsample_group.d = 0\r\n\r\nsample_group.e = 0\r\n\r\nsample_group.f = 0\r\n\r\nsample_group.g = 0\r\n\r\nsample_group.h = 0\r\n\r\nsample_group.i = 0\r\n\r\nsample_group.j = 0\r\n\r\nsample_group.k = 0\r\n\r\nsample_group.l = 0\r\n\r\nsample_group.m = 0\r\n\r\nsample_group.n = 0\r\n\r\nsample_group.o = \"\"\r\n\r\nsample_group.p = 0\r\n\r\nsample_group.q = 0\r\n\r\nsample_group.r = 4000\r\n\r\nsample_group.s = \"null\"\r\n\r\nsample_group.t = \"null\"\r\n\r\nsample_group.u = \"null\"\r\n\r\nsample_group.v = \"null\"\r\n\r\nsample_group.w = 0\r\n\r\nsample_group.x = 0\r\n\r\nsample_group.y = 0\r\n\r\nsample_group.z = 0\r\n\r\nsample_group.a1 = 0\r\n```\r\n\r\nThe memory mapping is as follows:\r\n\r\n```\r\nSTART\r\nblock address: 0x7f43ed1484d8\r\nvars address: 0x7f43ed1484dc\r\nTotal allocated size: 1352\r\nGroup number: 1\r\nGroup location from start 20\r\nGroup size: 248\r\nGroup number: 2\r\nGroup location from start 284\r\nGroup size: 56\r\nGroup number: 3\r\nGroup location from start 356\r\nGroup size: 4\r\nGroup number: 4\r\nGroup location from start 380\r\nGroup size: 4\r\nGroup number: 5\r\nGroup location from start 404\r\nGroup size: 4\r\nGroup number: 6\r\nGroup location from start 428\r\nGroup size: 176\r\nGroup number: 7\r\nGroup location from start 620\r\nGroup size: 104\r\nGroup number: 8\r\nGroup location from start 740\r\nGroup size: 200\r\nGroup number: 9\r\nGroup location from start 956\r\nGroup size: 16\r\nGroup number: 10\r\nGroup location from start 988\r\nGroup size: 172\r\nGroup number: 11\r\nGroup location from start 1180\r\nGroup size: 172\r\n```\r\n\r\nAs you can see that group 10 and 11(created using cfg above) have the same size.\r\n\r\nNow, if you try to get the value of sample_group.a and put a breakpoint here:\r\n\r\nhttps://github.com/kamailio/kamailio/blob/master/src/core/cfg/cfg_ctx.c#L1319\r\n\r\ni.e. run the following command \r\n\r\n`sudo kamctl kamcmd cfg.get sample_group a`\r\n\r\nThe offsets in gdb are as follows:\r\n\r\n```\r\n(gdb) print var-\u003eoffset\r\n$1 = 172\r\n(gdb) print group-\u003evar_offset\r\n$2 = 1176\r\n```\r\n\r\nAlso the value is getting corrupted:\r\n\r\n```\r\nsudo kamctl kamcmd cfg.get sample_group a\r\n694019999\r\n```\r\n"}],"action":{"name":"View Issue","url":"https://github.com/kamailio/kamailio/issues/1583#issuecomment-404266806"}}}</script>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/kamailio/kamailio/issues/1583#issuecomment-404266806",
"url": "https://github.com/kamailio/kamailio/issues/1583#issuecomment-404266806",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
},
{
"@type": "MessageCard",
"@context": "http://schema.org/extensions",
"hideOriginalBody": "false",
"originator": "AF6C5A86-E920-430C-9C59-A73278B5EFEB",
"title": "Re: [kamailio/kamailio] cfg_rpc updates changing variable values to large random numbers  (#1583)",
"sections": [
{
"text": "",
"activityTitle": "**vinesinha**",
"activityImage": "https://assets-cdn.github.com/images/email/message_cards/avatar.png",
"activitySubtitle": "@vinesinha",
"facts": [

]
}
],
"potentialAction": [
{
"name": "Add a comment",
"@type": "ActionCard",
"inputs": [
{
"isMultiLine": true,
"@type": "TextInput",
"id": "IssueComment",
"isRequired": false
}
],
"actions": [
{
"name": "Comment",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n\"commandName\": \"IssueComment\",\n\"repositoryFullName\": \"kamailio/kamailio\",\n\"issueId\": 1583,\n\"IssueComment\": \"{{IssueComment.value}}\"\n}"
}
]
},
{
"name": "Close issue",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n\"commandName\": \"IssueClose\",\n\"repositoryFullName\": \"kamailio/kamailio\",\n\"issueId\": 1583\n}"
},
{
"targets": [
{
"os": "default",
"uri": "https://github.com/kamailio/kamailio/issues/1583#issuecomment-404266806"
}
],
"@type": "OpenUri",
"name": "View on GitHub"
},
{
"name": "Unsubscribe",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n\"commandName\": \"MuteNotification\",\n\"threadId\": 353122659\n}"
}
],
"themeColor": "26292E"
}
]</script>