[OpenWrt-Devel] memory leak in procd

Kenneth Johansson kenneth at southpole.se
Thu Jan 28 09:39:54 EST 2016


when using rpcd and updating config files using the ubus interface there 
is a memory leak in procd.

here is a script that shows the error.


------------
#!/bin/sh

touch /etc/config/playapp

while true
do
     ubus call uci add '{"config":"playapp","type":"blabla"}'
     ubus call uci commit '{"config":"playapp"}'
     ps | grep procd|grep -v grep
done
------------

the issue happens in libubusbox function json_script_get_file() that 
recreates a new json_script_file all the time.

json_script_get_file() end up calling rule_load_script() in procd 
(system/trigger.c) and that do the allocation.
then json_script_get_file adds it to a avl tree.

but its done over and over every call.

not sure what the solution is here. where is the deallocation supposed 
to happen?
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list