[OpenWrt-Devel] memory leak in procd

Felix Fietkau nbd at openwrt.org
Thu Jan 28 11:32:19 EST 2016


On 2016-01-28 15:39, Kenneth Johansson wrote:
> 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?
Please try this patch: http://nbd.name/procd-trigger.patch

Thanks,

- Felix
_______________________________________________
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