[isf-wifidog] (fw_iptables.c:526) popen(): Cannot allocate memory - where is pclose()?

Kazuki Shimada zukky at ninjin-net.com
Ven 5 Nov 01:28:56 EDT 2010


Hi, all.

I met this error a couple of wifidog nodes,

.........
Apr 18 17:50:55 Ninjin-Oogoe-monit user.info sysinit: [3][Sat Apr 18
17:50:55 1970][1080](fw_iptables.c:526) popen(): Cannot allocate memory
Apr 18 17:50:55 Ninjin-Oogoe-monit user.info sysinit: [3][Sat Apr 18
17:50:55 1970][1080](firewall.c:233) Could not get counters from firewall!
Apr 18 17:51:55 Ninjin-Oogoe-monit user.info sysinit: [3][Sat Apr 18
17:51:55 1970][1080](fw_iptables.c:526) popen(): Cannot allocate memory
Apr 18 17:51:55 Ninjin-Oogoe-monit user.info sysinit: [3][Sat Apr 18
17:51:55 1970][1080](firewall.c:233) Could not get counters from firewall!
Apr 18 17:52:55 Ninjin-Oogoe-monit user.info sysinit: [3][Sat Apr 18
17:52:55 1970][1080](fw_iptables.c:526) popen(): Cannot allocate memory
Apr 18 17:52:55 Ninjin-Oogoe-monit user.info sysinit: [3][Sat Apr 18
17:52:55 1970][1080](firewall.c:233) Could not get counters from firewall!
Apr 18 17:53:55 Ninjin-Oogoe-monit user.info sysinit: [3][Sat Apr 18
17:53:55 1970][1080](fw_iptables.c:526) popen(): Cannot allocate memory
Apr 18 17:53:55 Ninjin-Oogoe-monit user.info sysinit: [3][Sat Apr 18
17:53:55 1970][1080](firewall.c:233) Could not get counters from firewall!
Apr 18 17:54:55 Ninjin-Oogoe-monit user.info sysinit: [3][Sat Apr 18
17:54:55 1970][1080](fw_iptables.c:526) popen(): Cannot allocate memory
Apr 18 17:54:55 Ninjin-Oogoe-monit user.info sysinit: [3][Sat Apr 18
17:54:55 1970][1080](firewall.c:233) Could not get counters from firewall!
Apr 18 17:55:55 Ninjin-Oogoe-monit user.info sysinit: [3][Sat Apr 18
17:55:55 1970][1080](fw_iptables.c:526) popen(): Cannot allocate memory
Apr 18 17:55:55 Ninjin-Oogoe-monit user.info sysinit: [3][Sat Apr 18
17:55:55 1970][1080](firewall.c:233) Could not get counters from firewall!
Apr 18 17:56:48 Ninjin-Oogoe-monit user.info sysinit: [2][Sat Apr 18
17:56:48 1970][1082](safe.c:97) Failed to fork: Cannot allocate memory.
Bailing out

Wifidog gateway was down when this error was put out.

Environment is,
device: Ubiquiti Nanostation2 (atheros ar2315 mips, 4MB flash, 16MB ram)
firmware: OpenWRT backfire_10.03
wifidog gateway: 20090925 (from openwrt feeds package)

I read fw_iptables,c.
https://dev.wifidog.org/browser/trunk/wifidog/src/fw_iptables.c?rev=765
Debug messages for popen() are written in line 458 and 497. Like this,

/* Look for outgoing traffic */
safe_asprintf(&script, "%s %s", "iptables", "-v -n -x -t mangle -L "
TABLE_WIFIDOG_OUTGOING);
iptables_insert_gateway_id(&script);
output = popen(script, "r");
free(script);
if (!output) {
debug(LOG_ERR, "popen(): %s", strerror(errno));
return -1;
}

If "output" is false, iptables_fw_counters_update() function seems to
end without pclese().
Is this OK?

I'm not a skilled programmer, please correct me if I'm wrong.

Thanks in advance,

Kazuki Shimada
Ninjin-net.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listes.ilesansfil.org/pipermail/wifidog/attachments/20101105/826c8937/attachment.htm>


Plus d'informations sur la liste de diffusion WiFiDog