Dnsmasq:: in a crash loop 6 crashes, 3 seconds since last crash

Hi

regularly I got those (internet not working):

Fri Jul 17 23:51:07 2020 daemon.crit dnsmasq[4485]: could not get memory
Fri Jul 17 23:51:07 2020 daemon.crit dnsmasq[4485]: FAILED to start up
Fri Jul 17 23:51:15 2020 daemon.crit dnsmasq[4486]: could not get memory
Fri Jul 17 23:51:15 2020 daemon.crit dnsmasq[4486]: FAILED to start up
Fri Jul 17 23:51:24 2020 daemon.crit dnsmasq[4487]: could not get memory
Fri Jul 17 23:51:24 2020 daemon.crit dnsmasq[4487]: FAILED to start up
Fri Jul 17 23:51:32 2020 daemon.crit dnsmasq[4488]: could not get memory
Fri Jul 17 23:51:32 2020 daemon.crit dnsmasq[4488]: FAILED to start up
Fri Jul 17 23:51:41 2020 daemon.crit dnsmasq[4489]: could not get memory
Fri Jul 17 23:51:41 2020 daemon.crit dnsmasq[4489]: FAILED to start up
Fri Jul 17 23:51:50 2020 daemon.crit dnsmasq[4490]: could not get memory
Fri Jul 17 23:51:50 2020 daemon.crit dnsmasq[4490]: FAILED to start up
Fri Jul 17 23:51:50 2020 daemon.info procd: Instance dnsmasq::cfg01411c s in a crash loop 6 crashes, 3 seconds since last crash

after reboot everything back normal.

What can I do to avoid reboot?

1 Like

Looks like "Out of memory". How much RAM do you have ?

2 Likes

...and are you running AdGuard by chance? :thinking:

I am running ad block

Adblock
Configuration of the adblock package to block ad/abuse domains by using DNS. For further information check the online documentation
Information
Status / Version
enabled / 4.0.5
Blocked Domains
260,505
Active Sources
adaway, adguard, bitcoin, disconnect, malwaredomains, malwarelist, notracking, reg_de, spam404, stopforumspam, youtube, yoyo
DNS Backend
dnsmasq, /tmp/dnsmasq.d
Run Utils
/bin/uclient-fetch, /usr/bin/awk
Run Interfaces
trigger: wireguard_ivpn, report: br-lan
Run Directories
base: /tmp, backup: /tmp, report: /tmp, jail: /tmp
Run Flags
backup: 1, reset: 0, flush: 0, force: 1, search: 1, report: 1, mail: 1, jail: 0
Last Run
start, n/a, 124/22/1, 18.07.2020 01:46:55

I have 126 MB RAM.

Searching the forums, I saw you posted on using AdBlock.

:open_mouth:

WHOA!

I could BARELY run that on a device with 512 MB RAM. You wont be able to process that many domains.

...btw, do you mean 128 MB?

(The creator of AdBlock also makes an iptables/ipset based blocker, that may work better for you because it may use less resources.)

1 Like

How to see how much memory I have?

This status page is changing:

this looks strange

root@OpenWrt:~# free -h
              total        used        free      shared  buff/cache   available
Mem:         124516       34080       77312        5884       13124       56972
Swap:             0           0           0

do you have a link handy?

I think Adblock 260k domains are a lot more with a device that only has 128MB of ram.

2 Likes

Ok. I wish to filter junk. I go over the lists and see what I can remove

Pay attention to this:

• S (-10k), M (10k-30k) and L (30k-80k) should work for 128 MByte devices,
• XL (80k-200k) should work for 256-512 MByte devices,
• XXL (200k-) needs more RAM and Multicore support, e.g. x86 or raspberry devices.
3 Likes

:confused:

...Imma let someone else answer this.

I'm already assuming you work with computers and this information is known to you...especially since you own the device and must have flashed it according to the Wiki (which contains that information).

Of course it does, it's a running device...like any other...

What's strange about it?

Yes, this is what AdBlock is for.

You can ask on the same forum for AdBlock, I do not recall. Feel free to use the forum.

Thanks for help

It even written:

List of supported and fully pre-configured adblock sources, already active sources are pre-selected.
To avoid OOM errors, please do not select too many lists!

I have problems decide which list I should subscribe and which no.

diff --git a/openwrt/etc/config/adblock b/openwrt/etc/config/adblock
index d3e7851..b335d68 100644
--- a/openwrt/etc/config/adblock
+++ b/openwrt/etc/config/adblock
@@ -10,18 +10,6 @@ config adblock 'global'
 	option adb_trigger 'wireguard_ivpn'
 	option adb_portlist '5353'
 	option adb_maxqueue '16'
-	list adb_sources 'adaway'
-	list adb_sources 'adguard'
-	list adb_sources 'bitcoin'
-	list adb_sources 'disconnect'
-	list adb_sources 'malwaredomains'
-	list adb_sources 'malwarelist'
-	list adb_sources 'notracking'
-	list adb_sources 'reg_de'
-	list adb_sources 'spam404'
-	list adb_sources 'stopforumspam'
-	list adb_sources 'youtube'
-	list adb_sources 'yoyo'
 	option adb_report '1'
 	option adb_repiface 'br-lan'
@@ -29,4 +17,10 @@ config adblock 'global'
 	option adb_safesearch '1'
 	option adb_safesearchmod '1'
 	option adb_mail '0'
+	list adb_sources 'adaway'
+	list adb_sources 'disconnect'
+	list adb_sources 'malwarelist'
+	list adb_sources 'openphish'
+	list adb_sources 'reg_de'
+	list adb_sources 'youtube'

It would be great if there is a 4 word description for each list.

What do you think about my choice?

the -h option say print memory info in human readable format. He accept this option but not doing it.

There is no '-h' option for free:

root@FB4040:~# free --help
BusyBox v1.30.1 () multi-call binary.

Usage: free

Display the amount of free and used system memory

You are mixing this up with df, where the -h option does exist:

root@FB4040:~# df --help
BusyBox v1.30.1 () multi-call binary.

Usage: df [-PkmhT] [FILESYSTEM]...

Print filesystem usage statistics

        -P      POSIX output format
        -k      1024-byte blocks (default)
        -m      1M-byte blocks
        -h      Human readable (e.g. 1K 243M 2G)
        -T      Print filesystem type
2 Likes

oh you don't use adblock gui ? It already has descriptions for each listing.
your choice is ok for me, it's just around 60k domains.

1 Like

What you think if I disable Adblock on Router and install https://pi-hole.net/ on RPI. And point OpenWRT DNS to RPI?

Anybody uses similar setup? What you think?

Not me, but I am sure there are lots of threads in this forum by people with a similar setup.

2 Likes

@Naftali Personally, I use NextDNS. You can probably think of it as 'Pi-hole in the cloud': it performs the same job, but doesn't sit on your local network, so you can benefit from it whilst out-and-about. For example, I use Tasker to automatically set Android's Private DNS feature to my NextDNS config when I leave my home network.

At home, my OpenWRT installation also uses NextDNS (dnsmasq+stubby and dnsmasq+unbound).

1 Like
1 Like

If it's that much of a resource problem, simply use adblocking DNS providers like Neustar.

(I notice they still offer the service; but I'm finding it difficult to locate their: 'Low', 'Medium' and 'High' blocking server IP addresses.)