AdguardTeam / AdGuardHome

Network-wide ads & trackers blocking DNS server
https://adguard.com/adguard-home.html
GNU General Public License v3.0
23.79k stars 1.75k forks source link

panic: runtime error: invalid memory address or nil pointer dereference #5095

Closed jakesteele closed 1 year ago

jakesteele commented 1 year ago

Prerequisites

Operating system type

Windows

CPU architecture

AMD64

Installation

Other (please mention in the description)

Setup

On one machine

AdGuard Home version

1.0.8-b20

Description

What did you do?

Just attempting to run AdGuardHome.exe from CMD

Expected result

Runs fine and lets me connect to it.

Actual result

Errors out and wont start.

`2022/11/03 12:33:18.613521 [info] Entering the UDP listener loop on [::]:53 2022/11/03 12:33:18.614032 [info] Entering the tcp listener loop on [::]:53 2022/11/03 12:33:18.704210 [info] saving filter 1 contents to: C:\AdGuardHome\data\filters\1.txt 2022/11/03 12:33:18.704752 [info] updated filter 1: 980023 bytes, 50568 rules panic: runtime error: invalid memory address or nil pointer dereference [signal 0xc0000005 code=0x0 addr=0x8 pc=0x1146738]

goroutine 150 [running]: github.com/AdguardTeam/urlfilter.(DNSEngine).MatchRequest(0x0, 0xc0005356d0) github.com/AdguardTeam/urlfilter@v0.16.0/dnsengine.go:131 +0x118 github.com/AdguardTeam/AdGuardHome/internal/aghnet.(requestMatcher).MatchRequest(0xc000177f00, 0xc0005b56d0) github.com/AdguardTeam/AdGuardHome/internal/aghnet/hostscontainer.go:67 +0x13a github.com/AdguardTeam/AdGuardHome/internal/filtering.(DNSFilter).matchSysHosts(0xc0001af200, {0xc0000da600, 0x11}, 0x9cc8?, 0xc000500d20) github.com/AdguardTeam/AdGuardHome/internal/filtering/filtering.go:513 +0x176 github.com/AdguardTeam/AdGuardHome/internal/filtering.(DNSFilter).CheckHost(0xc0001af200, {0xc0000da600?, 0x29a10e0?}, 0x7ea0?, 0xc000500d20) github.com/AdguardTeam/AdGuardHome/internal/filtering/filtering.go:489 +0x247 github.com/AdguardTeam/AdGuardHome/internal/dnsforward.(Server).filterDNSRequest(0xc000442000, 0xc0005aa750) github.com/AdguardTeam/AdGuardHome/internal/dnsforward/filter.go:71 +0x1ab github.com/AdguardTeam/AdGuardHome/internal/dnsforward.(Server).processFilteringBeforeRequest(0xc000442000?, 0xc0005aa750) github.com/AdguardTeam/AdGuardHome/internal/dnsforward/dns.go:597 +0xbd github.com/AdguardTeam/AdGuardHome/internal/dnsforward.(Server).handleDNSRequest(0xc000442000, 0x1542560?, 0xc0002e2600) github.com/AdguardTeam/AdGuardHome/internal/dnsforward/dns.go:115 +0x387 github.com/AdguardTeam/dnsproxy/proxy.(Proxy).handleDNSRequest(0xc0002bc380, 0xc0002e2600) github.com/AdguardTeam/dnsproxy@v0.46.2/proxy/server.go:130 +0x398 github.com/AdguardTeam/dnsproxy/proxy.(Proxy).udpHandlePacket(0xc0002bc380, {0xc00070c030, 0x23, 0x23}, {0x0, 0x0, 0x0}, 0xc000404420, 0xc0002b4050) github.com/AdguardTeam/dnsproxy@v0.46.2/proxy/server_udp.go:109 +0x2cb github.com/AdguardTeam/dnsproxy/proxy.(Proxy).udpPacketLoop.func1() github.com/AdguardTeam/dnsproxy@v0.46.2/proxy/server_udp.go:76 +0x4f created by github.com/AdguardTeam/dnsproxy/proxy.(*Proxy).udpPacketLoop github.com/AdguardTeam/dnsproxy@v0.46.2/proxy/server_udp.go:75 +0x33e`

Additional information

Was running fine, but stopped working this morning, went to investigate and now I can't start it.

I am running, Ad Away, AdGuard, OSID Full and a custom URL for my block list. Would be happy to share any files you need to investigate.

jakesteele commented 1 year ago

I am only using the AdGuard DNS Blocklist the others are not enabled, and I deleted the /data/filters folder so its regenerated. Still the same issue.

brunomiguel commented 1 year ago

I have the same issue on Arch Linux with version 0.107.17

PaperCutBad commented 1 year ago

Same issue on Windows 10 with version 0.107.17.

lxabsentxl commented 1 year ago

kern.warn kernel: [48496.297320] kswapd0 invoked oom-killer: gfp_mask=0xcc0(GFP_KERNEL), order=0, oom_score_adj=0 kern.debug kernel: [48496.305817] CPU: 1 PID: 100 Comm: kswapd0 Not tainted 5.15.71 #0 kern.debug kernel: [48496.311818] Hardware name: Xiaomi Redmi Router AX6S (DT) kern.debug kernel: [48496.317121] Call trace: kern.debug kernel: [48496.319557] dump_backtrace+0x0/0x15c kern.debug kernel: [48496.323220] show_stack+0x14/0x30 kern.debug kernel: [48496.326528] dump_stack_lvl+0x64/0x7c kern.debug kernel: [48496.330184] dump_stack+0x14/0x2c kern.debug kernel: [48496.333492] dump_header+0x44/0x17c kern.debug kernel: [48496.336973] oom_kill_process+0x1d0/0x1d4 kern.debug kernel: [48496.340979] out_of_memory+0x1c8/0x310 kern.debug kernel: [48496.344722] balance_pgdat+0x8c4/0x8d0 kern.debug kernel: [48496.348465] kswapd+0x150/0x2d4 kern.debug kernel: [48496.351599] kthread+0x11c/0x130 kern.debug kernel: [48496.354821] ret_from_fork+0x10/0x20 kern.debug kernel: [48496.358417] Mem-Info: kern.debug kernel: [48496.360683] active_anon:44746 inactive_anon:405 isolated_anon:0 kern.debug kernel: [48496.360683] active_file:22 inactive_file:22 isolated_file:0 kern.debug kernel: [48496.360683] unevictable:0 dirty:0 writeback:0 kern.debug kernel: [48496.360683] slab_reclaimable:1387 slab_unreclaimable:4075 kern.debug kernel: [48496.360683] mapped:24 shmem:395 pagetables:268 bounce:0 kern.debug kernel: [48496.360683] kernel_misc_reclaimable:0 kern.debug kernel: [48496.360683] free:4467 free_pcp:52 free_cma:0 kern.debug kernel: [48496.395516] Node 0 active_anon:178984kB inactive_anon:1620kB active_file:104kB inactive_file:32kB unevictable:0kB isolated(anon):0kB isolated(file):0kB mapped:20kB dirty:0kB writeback:0kB shmem:1580kB writeback_tmp:0kB kernel_stack:1424kB pagetables:1072kB all_unreclaimable? no kern.debug kernel: [48496.420107] DMA free:18124kB min:20480kB low:24576kB high:28672kB reserved_highatomic:0KB active_anon:178768kB inactive_anon:1620kB active_file:0kB inactive_file:216kB unevictable:0kB writepending:0kB present:262144kB managed:244860kB mlocked:0kB bounce:0kB free_pcp:260kB local_pcp:208kB free_cma:0kB kern.debug kernel: [48496.446693] lowmem_reserve[]: 0 0 0 0 kern.debug kernel: [48496.450354] DMA: 6394kB (UME) 2298kB (UME) 12016kB (UME) 8932kB (UME) 6664kB (UM) 22128kB (UME) 6256kB (UM) 1512kB (M) 01024kB 02048kB 0*4096kB = 18244kB kern.debug kernel: [48496.464995] 426 total pagecache pages kern.debug kernel: [48496.468647] 0 pages in swap cache kern.debug kernel: [48496.471960] Swap cache stats: add 0, delete 0, find 0/0 kern.debug kernel: [48496.477175] Free swap = 0kB kern.debug kernel: [48496.480046] Total swap = 0kB kern.debug kernel: [48496.482922] 65536 pages RAM kern.debug kernel: [48496.485707] 0 pages HighMem/MovableOnly kern.debug kernel: [48496.489532] 4321 pages reserved kern.info kernel: [48496.492668] Tasks state (memory values in pages): kern.info kernel: [48496.497362] [ pid ] uid tgid total_vm rss pgtables_bytes swapents oom_score_adj name kern.info kernel: [48496.505980] [ 585] 81 585 313 32 28672 0 0 ubusd kern.info kernel: [48496.514158] [ 586] 0 586 212 13 32768 0 0 askfirst kern.info kernel: [48496.522595] [ 621] 0 621 246 16 32768 0 0 urngd kern.info kernel: [48496.530768] [ 1107] 514 1107 305 38 28672 0 0 logd kern.info kernel: [48496.538861] [ 1161] 0 1161 571 86 32768 0 0 rpcd kern.info kernel: [48496.546953] [ 1370] 0 1370 262 16 28672 0 0 dropbear kern.info kernel: [48496.555391] [ 1474] 0 1474 644 27 36864 0 0 hostapd kern.info kernel: [48496.563742] [ 1475] 0 1475 644 28 28672 0 0 wpa_supplicant kern.info kernel: [48496.572702] [ 1500] 101 1500 1141 33 45056 0 0 wpa_supplicant kern.info kernel: [48496.581660] [ 1502] 101 1502 1160 50 45056 0 0 hostapd kern.info kernel: [48496.590005] [ 1539] 0 1539 461 50 32768 0 0 netifd kern.info kernel: [48496.598271] [ 1641] 0 1641 362 28 32768 0 0 odhcpd kern.info kernel: [48496.606534] [ 1777] 0 1777 404 41 36864 0 0 uhttpd kern.info kernel: [48496.614799] [ 2269] 0 2269 644 29 36864 0 0 ntpd kern.info kernel: [48496.622890] [ 2285] 123 2285 312 14 28672 0 0 ntpd kern.info kernel: [48496.630974] [ 2608] 0 2608 312 13 28672 0 0 udhcpc kern.info kernel: [48496.639237] [ 2811] 0 2811 644 29 32768 0 0 dnsmasq kern.info kernel: [48496.647588] [ 2815] 453 2815 356 37 32768 0 0 dnsmasq kern.info kernel: [48496.655942] [ 4384] 0 4384 223714 44144 471040 0 0 AdGuardHome kern.info kernel: [48496.664642] oom-kill:constraint=CONSTRAINT_NONE,nodemask=(null),cpuset=/,mems_allowed=0,global_oom,task_memcg=/,task=AdGuardHome,pid=4384,uid=0 kern.err kernel: [48496.677547] Out of memory: Killed process 4384 (AdGuardHome) total-vm:894856kB, anon-rss:176572kB, file-rss:4kB, shmem-rss:0kB, UID:0 pgtables:460kB oom_score_adj:0

ainar-g commented 1 year ago

Merging into #5089, for which we have released a possible fix to the Edge channel. Please upvote that issue if you have similar issues.