[FS#252] Memory leak in pppoe connection initialization
LEDE Bugs
lede-bugs at lists.infradead.org
Thu Oct 27 04:44:38 PDT 2016
A new Flyspray task has been opened. Details are below.
User who did this - Hamy (Hamy)
Attached to Project - LEDE Project
Summary - Memory leak in pppoe connection initialization
Task Type - Bug Report
Category - Base system
Status - Unconfirmed
Assigned To -
Operating System - All
Severity - High
Priority - Very Low
Reported Version - Trunk
Due in Version - Undecided
Due Date - Undecided
Details - There seems to be a huge memory leak in the way lede handles pppoe "dialing". every time pppoe connection is lost and lede re-initializes it, the system memory gets lower. I am not sure how to troubleshoot this further except that i know it only happens when pppoe daemon is being started by the ppp.sh (manually starting pppd does not seem to be resulting in any memory loss), and that the lost memory does not seem to be accounted for in 'ps' output.
The fastest way to test this is by setting up a pppoe connection in /etc/config/network with the line "option pppd_options 'dryrun'" added to it. that parameter, causes the pppd to only print the effective parameters to syslog and exit immediately instead of timing out after a while and then exiting (just as a reminder, the parameter 'maxfail 1' is added to the pppd by the calling script)
I have tested it in LEDE r1969 in TP-Link WDR4900
Here's the result of before and after setting up a pppoe connection and activating it:
***:~# uptime
23:52:33 up 12 min, load average: 0.00, 0.00, 0.00
***:~# free
total used free shared buffers cached
Mem: 125692 24072 101620 40 1636 6872
-/+ buffers/cache: 15564 110128
Swap: 0 0 0
***:~# cat /proc/meminfo
MemTotal: 125692 kB
MemFree: 101620 kB
MemAvailable: 86532 kB
Buffers: 1636 kB
Cached: 6872 kB
SwapCached: 0 kB
Active: 6960 kB
Inactive: 2404 kB
Active(anon): 884 kB
Inactive(anon): 12 kB
Active(file): 6076 kB
Inactive(file): 2392 kB
Unevictable: 0 kB
Mlocked: 0 kB
SwapTotal: 0 kB
SwapFree: 0 kB
Dirty: 0 kB
Writeback: 0 kB
AnonPages: 860 kB
Mapped: 2040 kB
Shmem: 40 kB
Slab: 8640 kB
SReclaimable: 2312 kB
SUnreclaim: 6328 kB
KernelStack: 312 kB
PageTables: 216 kB
NFS_Unstable: 0 kB
Bounce: 0 kB
WritebackTmp: 0 kB
CommitLimit: 62844 kB
Committed_AS: 2744 kB
VmallocTotal: 868352 kB
VmallocUsed: 0 kB
VmallocChunk: 0 kB
***:~# vi /etc/config/network # Added a pppoe interface with 'dryrun' option set
***:~# /etc/init.d/network restart
# *** After about 10 minutes *** #
***:~# uptime
00:02:10 up 21 min, load average: 3.12, 2.34, 1.27
***:~# free
total used free shared buffers cached
Mem: 125692 68604 57088 44 1712 7316
-/+ buffers/cache: 59576 66116
Swap: 0 0 0
***:~# cat /proc/meminfo
MemTotal: 125692 kB
MemFree: 56824 kB
MemAvailable: 56784 kB
Buffers: 1712 kB
Cached: 7316 kB
SwapCached: 0 kB
Active: 7868 kB
Inactive: 2156 kB
Active(anon): 1024 kB
Inactive(anon): 16 kB
Active(file): 6844 kB
Inactive(file): 2140 kB
Unevictable: 0 kB
Mlocked: 0 kB
SwapTotal: 0 kB
SwapFree: 0 kB
Dirty: 0 kB
Writeback: 0 kB
AnonPages: 1000 kB
Mapped: 2040 kB
Shmem: 44 kB
Slab: 52060 kB
SReclaimable: 31892 kB
SUnreclaim: 20168 kB
KernelStack: 336 kB
PageTables: 264 kB
NFS_Unstable: 0 kB
Bounce: 0 kB
WritebackTmp: 0 kB
CommitLimit: 62844 kB
Committed_AS: 3380 kB
VmallocTotal: 868352 kB
VmallocUsed: 0 kB
VmallocChunk: 0 kB
***:~# ps www
PID USER VSZ STAT COMMAND
1 root 1704 S /sbin/procd
2 root 0 SW [kthreadd]
3 root 0 SW [ksoftirqd/0]
5 root 0 SW< [kworker/0:0H]
6 root 0 SW [kworker/u2:0]
69 root 0 SW [kworker/u2:2]
105 root 0 SW< [writeback]
106 root 0 SW< [crypto]
108 root 0 SW< [bioset]
109 root 0 SW< [kblockd]
142 root 0 SW [kswapd0]
209 root 0 SW [fsnotify_mark]
764 root 0 SW [spi0]
769 root 0 SW< [bioset]
774 root 0 SW< [bioset]
779 root 0 SW< [bioset]
784 root 0 SW< [bioset]
789 root 0 SW< [bioset]
794 root 0 SW< [bioset]
799 root 0 SW< [bioset]
804 root 0 SW< [bioset]
829 root 0 SW< [ipv6_addrconf]
835 root 0 SW< [deferwq]
837 root 0 SW< [kworker/0:1H]
838 root 0 SW [kworker/0:2]
910 root 0 SWN [jffs2_gcd_mtd4]
1491 root 1244 S /sbin/ubusd
1492 root 828 S /sbin/askfirst /usr/libexec/login.sh
1562 root 0 SW< [cfg80211]
1681 root 1244 S /sbin/logd -S 64
1752 root 1416 S /usr/sbin/odhcpd
1787 root 988 S /usr/sbin/dropbear -F -P /var/run/dropbear.1.pid -p 22 -K 300
1888 root 1252 S /usr/sbin/ntpd -n -N -S /usr/sbin/ntpd-hotplug -p 0.lede.pool.ntp.org -p 1.lede.pool.ntp.org -p 2.lede.pool.ntp.org -p 3.lede.pool.ntp.org
2001 dnsmasq 1040 S /usr/sbin/dnsmasq -C /var/etc/dnsmasq.conf -k -x /var/run/dnsmasq/dnsmasq.pid
2004 root 1056 S /usr/sbin/dropbear -F -P /var/run/dropbear.1.pid -p 22 -K 300
2005 root 1252 S -ash
2114 root 1856 S /sbin/netifd
8212 root 1368 S {ppp.sh} /bin/sh ./ppp.sh pppoe teardown wan {"ifname":"eth0.1","proto":"pppoe","username":"123","password":"456","pppd_options":"dryrun"} eth0.1
8216 root 1252 R ps www
8218 root 1432 R ubus call network.interface notify_proto { "action": 2, "interface": "wan" }
19705 root 0 SW [kworker/0:0]
Any suggestions on troubleshooting this more is welcome.
Best Regards,
More information can be found at the following URL:
https://bugs.lede-project.org/index.php?do=details&task_id=252
More information about the lede-bugs
mailing list