Hunting a Memory Leak in 19.07.1 WRT1900ACS

development snapshot, but that changes anytime there is a reason for your target to be rebuilt; meaning grab everything you need as it may be different the next time you need something, and no LuCI OOTB.

Now I have two questions:

  1. If there is a snapshot built today that means that there were changes relevant to my device?
  2. As soon as i upgrade with linksys_wrt1900acs-squashfs-sysupgrade.bin I'm losing LuCi OOTB?
  1. If there is a snapshot today, then there are changes relevant for some device, not necessarily yours.
  2. Yes, you lose Luci, but you can still ssh into your router and install it from the command line.
  3. Make sure you install all the needed packages on the first day, because installation of any package that requires any extra kernel module will fail once there is a new snapshot.
  4. Backup everything (including the list of installed packages) before trying a snapshot.

Installation of snapshots is expected to be safe, you can always restore to the stable release, restore the backup and reinstall the packages.

I found it.
The router was underpowered.

Since

the problems started and the first culprit was my new

I disconnected it from the router so I thought probable source of problem was isolated. What I did not do was to power it off. And that's why the memory leak was still there. The NAS was sucking up enough power to make the Router run underpowered.
I confirmed that whenever I switch the NAS on the Router starts to leak memory and, as soon as I switch the NAS off the router recovers the leaked memory back.

Honestly, sorry for not realizing before, I really thought that it was a SW memory leak, but it seems it was caused by the router running underpowered.
Thanks again for the time you took for helping me hunt this memory leak.

Lesson of the day: Do not plug all your stuff on the same electric phase.

1 Like

I'm not going to question your conclusions... but this is the weirdest consequences of running a device underpowered that I have ever seen.

1 Like

So the NAS may be sending some IP packets that the router does not like. Could you please confirm by having the NAS in a different network segment?

I could not determine any other cause...
I did the test again after writing here my findings with the same results.
NAS is powered on -> memory leak
NAS is powered off -> no memory leak

The NAS is powered on but disconnected from the router (ethernet cable unplugged) so there is no IP connectivity.

Sorry for being super annoying, just one more confirmation. The alternative theory is that the NAS (if it has a WiFi chip) could scan for networks in a super-weird way, and the probes might confuse the wireless driver, even though the IP protocol is not running. I will believe the theory about the power supply if you cannot reproduce your findings with one of the devices being powered from an UPS or a power bank, or if there is no WiFi chip in the NAS at all.

No problem @patrakov, I'm happy to do as many tests as needed.
Maybe I should clarify what I meant with "NAS". I have a RPi runnign OpenMediaVault and a 4-HDD Enclosure connected to the RPi via USB 3.0

That mean that the only component that may be disturbing the router is the RPi (where I did not configur any Wifi-Network as it has been connected to the router via Ethernet).

So I will perform the following two tests this evening:

  1. NAS + RPi connected on the same electrical phase as the Router, no Ethernet cable conneted and the wlan interface of the RPi disabled. I should expect a memory leak if the problem is the "underpowering".
  2. NAS + RPi connected on a different electrical phase as the Router, no Ethernet cable connected but with the wlan interface up. I should expect a memory leak if the problem is the "WiFi chip of the RPi messing up with the router".

Actually the Scenario 1 is what I expect to do in order to be able to use my NAS and my Router at the same time :sweat_smile:

Unfortunately I can neither power the NAS from an UPS (which I don't have) nor from a powerbank (the HDD Enclosure is connected to the wall plug directly).
Any other test scenarios are welcome.

Maybe temporarily replace the HDD enclosure with a USB flash drive? Then the powerbank test will become feasible.

not saying it's it but lots of microcontrollers have a low voltage maybe this chip has one & it's not being handled correctly and each power hit is chewing up more stack space an each interrupt

Hi there, here the results:
Scenario 1: I observed the memory leak (so the memory leak is related to the underpowering of the router)
Scenario 2: I did not observe the memory leak (therefore the Wifi chip of the RPi does not mess up with the router).

I also performed the test that @patrakov suggested as "Scenario 3".

Scenario 3: As Scenario 1 did not show a memory leak I guessed the result, nevertheless I performed the test with 2 USB Flash drives in raid 1(as I have configured the HDD Enclosure) and did not observed the memory leak.

Same on TP-Link Archer C7 v2 here. More observations: only wlan0 (ath10k, 5 GHz) is affected, even though nothing connects to it. wlan1 (ath9k, 2.4 GHz) is fine. I will try the -smallbuffers variant and report.

1 Like

Looks stable. The 5 GHz WiFi was enabled at 16:00, with no clients to connect. Previously, even random scans from unauthorized devices were enough to cause an OOM. At 03:00 I have changed the vm.min_free_kbytes sysctl, please ignore.

For the good sake can you confirm you use the original supplied AC adapter connected the WRT1900ACS (according specs it requires 12V/2.5A)? And your NAS solution has its own AC adapter but both adapters connected to the same power phase? Do you have means to measure your AC voltage of your mains and your WRT1900ACS adapter DC outlet (unloaded and loaded)?

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