Memory leak in Asterisk v18.11.3 and latest v18.15.1

Hi all!

We’re using Asterisk v18.11.3 with RedHat 8.5 and we’re seeing a memory leak.

To make calls, we use ARI requests with Content-Type: application/json

Memory leaks when creating a channel with variables

[Dec 8 14:03:38] DEBUG[664032] http.c: HTTP Request URI is /ari/channels/create?endpoint=PJSIP%2F8707XXXYYYY%40outbound_trunk&app=test&channelId=20&api_key=asterisk:asterisk
[Dec 8 14:03:38] VERBOSE[664032] res_ari.c: <— ARI request received from: 10...*:52154 —>
Content-Type: application/json
User-Agent: PostmanRuntime/7.28.0
Accept: /
Cache-Control: no-cache
Postman-Token: 4a2451e3-867a-4404-a200-394d4115fa23
Host: hostname:8088
Accept-Encoding: gzip, deflate, br
Connection: keep-alive
Content-Length: 390
endpoint: PJSIP/8707XXXYYYY@outbound_trunk
app: test
channelId: 20
api_key: asterisk:asterisk
body:
{“variables”:{“CHANNEL(hangup_handler_push)”:“hdlr1,s,1”,“callid”:“38”,“callbackdatetime”:“2022-12-07 17:19:00”,“priority”:“priority”,“phone”:“8707XXXYYYY”,“clientid”:“clientid”,“agreementid”:“agreementid”,“CONNECTEDLINE(num)”:“XXXYYYY”,“linetype”:“Outbound”,“skillgroupnumber”:“skillgroupnumber”,“sourcesystem”:" ",“mode”:“auto”,“camptype”:“auto”}}

I re-built Asterix with the MALLOC_DEBUG flag and see that the memory is leaking to json.c

asterisk -rx “memory show summary” | grep json
2056 bytes in 18 allocations in file json.c

asterisk -rx “memory show summary” | grep json
3800 bytes in 31 allocations in file json.c

Our issue is similar to [ASTERISK-27305] res_ari: Memory leaks in ARI when using Content-Type: application/json - Digium/Asterisk JIRA

The patch provided in ASTERISK-27305 is already contained in the v18.11.3 version code. But the memory is still leaking.

If make an ARI request with with Content-Type: text/plain, the memory does not leak.

We call intensively and have to restart the asterisk service every night.

Is there a asterisk version that won’t leak memory? Or is there a patch for version 18.11.3?

We are seeing the same issue in version 18.15.1

I would appreciate any help with this issue

1 Like

If it exists in the latest version of Asterisk, then a new issue should be filed with an ARI application that reproduces the issue.

Created an issue in jira
https://issues.asterisk.org/jira/browse/ASTERISK-30344

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.