<h3>Description</h3>
<p>ul.dump can't work with huge amount of aor  (~40K), it fail with 500, "Internal error creating aor struct". And seems it get and not free'd memory, after some calls kamcmd ul.dump / kamcmd ul.dump brief kamailio stop service with messages:</p>
<pre><code>Apr 28 13:36:11 kamailio-c2 kamailio2[49808]: ERROR: <core> [sip_msg_clone.c:498]: sip_msg_shm_clone(): cannot allocate memory
Apr 28 13:36:11 kamailio-c2 kamailio2[49808]: ERROR: dmq [worker.c:164]: add_dmq_job(): error cloning sip message
Apr 28 13:36:11 kamailio-c2 kamailio2[49808]: ERROR: dmq [message.c:67]: dmq_handle_message(): failed to add dmq job
Apr 28 13:36:11 kamailio-c2 kamailio2[49808]: ERROR: <core> [mem/q_malloc.c:292]: qm_find_free(): qm_find_free(0x809132000, 3976); Free fragment not found!
Apr 28 13:36:11 kamailio-c2 kamailio2[49808]: ERROR: <core> [mem/q_malloc.c:425]: qm_malloc(): qm_malloc(0x809132000, 3976) called from core: sip_msg_clone.c: sip_msg_shm_clone(495), module: core; Free fragment not found!
</code></pre>
<h3>Possible Solutions</h3>
<p>Need rewrite ul_rpc_dump() in modules/usrloc/ul_rpc.c to aor-by-aor print.</p>
<h3>Additional Information</h3>
<ul>
<li><strong>Kamailio Version</strong> - output of <code>kamailio -v</code></li>
</ul>
<pre><code>version: kamailio 5.0.0-dev6 (x86_64/freebsd) 9fe51e-dirty
flags: STATS: Off, USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, SHM_MMAP, PKG_MALLOC, Q_MALLOC, F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY, FAST_LOCK-ADAPTIVE_WAIT, USE_POSIX_SEM, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLACKLIST, HAVE_RESOLV_RES
ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16, MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB
poll method support: poll, select, kqueue.
id: 9fe51e -dirty
compiled on 10:49:57 Nov 18 2016 with cc 3.4

</code></pre>
<ul>
<li><strong>Operating System</strong>:</li>
</ul>
<pre><code>FreeBSD kamailio-c2 10.3-STABLE FreeBSD 10.3-STABLE #0 r306194
</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/1513">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AF36ZehPvnkemofBea5XdipJJiVq3Athks5ttE_KgaJpZM4TrXlU">mute the thread</a>.<img src="https://github.com/notifications/beacon/AF36ZVlb2FO9YsFs_qOvK0kqlF59Fi2sks5ttE_KgaJpZM4TrXlU.gif" height="1" width="1" alt="" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/kamailio/kamailio/issues/1513"></link>
  <meta itemprop="name" content="View Issue"></meta>
</div>
<meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>

<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://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/kamailio/kamailio"}},"updates":{"snippets":[{"icon":"DESCRIPTION","message":"ul.dump with huge amount of AoR's (#1513)"}],"action":{"name":"View Issue","url":"https://github.com/kamailio/kamailio/issues/1513"}}}</script>