Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
4 tasks done
codac opened this issue Jun 30, 2023 · 9 comments
Closed
4 tasks done

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

codac opened this issue Jun 30, 2023 · 9 comments
Assignees
Milestone

Comments

@codac
Copy link

codac commented Jun 30, 2023

Prerequisites

Platform (OS and CPU architecture)

Custom (please mention in the description)

Installation

Docker

Setup

On one machine

AdGuard Home version

0.107.32

Action

  1. adguard is running as a docker (via docker-compose) on a Synology DS420+ with DSM 7.2-64570 Update 1.
  2. every couple of hours adguard crashes, no traffic running through anymore, after it restarts you can continue, but it crashes again

Expected result

No crahes.

Actual result

Synology Docker LOG:
2023/06/29 18:40:00.908346 [info] Received signal "terminated"
2023/06/29 18:40:00.916664 [info] stopping AdGuard Home
2023/06/29 18:40:00.916701 [info] stopping http server...
2023/06/29 18:40:00.925037 [info] stopped http server
2023/06/29 18:40:02.946945 [info] dnsproxy: stopping dns proxy server
2023/06/29 18:40:02.951355 [info] dnsproxy: stopped dns proxy server
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x1a0 pc=0x866a98]

Additional information and/or screenshots

No response

@ainar-g
Copy link
Contributor

ainar-g commented Jun 30, 2023

Thanks for the report. Please provide the full panic log (with the backtrace). Enabling verbose logs and including them into the output would help as well.

@ainar-g ainar-g added the waiting for data Waiting for users to provide more data. label Jun 30, 2023
@codac
Copy link
Author

codac commented Jun 30, 2023

verbose mode is running, I'll add an update after the next crash.

@codac
Copy link
Author

codac commented Jul 18, 2023

I have trouble to get the verbose log running. I followed your link and set in the AdGuardHome.yaml the value for "log_file:" to /opt/adguardhome/work/logs/aghlog.txt
Afterwards I went to Container Manager on my Synology and added this file as a volume (file). It is mounted to a local file that exists.
The file stays at 0byte.

Here is another extract of the container protocol:

2023/07/18 06:42:40	stdout	github.com/AdguardTeam/dnsproxy@v0.50.2/proxy/server_udp.go:81 +0x37e
2023/07/18 06:42:40	stdout	created by github.com/AdguardTeam/dnsproxy/proxy.(*Proxy).udpPacketLoop
2023/07/18 06:42:40	stdout	github.com/AdguardTeam/dnsproxy@v0.50.2/proxy/server_udp.go:82 +0x4f
2023/07/18 06:42:40	stdout	github.com/AdguardTeam/dnsproxy/proxy.(*Proxy).udpPacketLoop.func1()
2023/07/18 06:42:40	stdout	github.com/AdguardTeam/dnsproxy@v0.50.2/proxy/server_udp.go:115 +0x2e6
2023/07/18 06:42:40	stdout	github.com/AdguardTeam/dnsproxy/proxy.(*Proxy).udpHandlePacket(0xc000105500, {0xc0048675c0, 0x5a, 0x5a}, {0xc0035a4b20, 0x10, 0x10}, 0xc005e9a4b0, 0xc000226108)
2023/07/18 06:42:40	stdout	github.com/AdguardTeam/dnsproxy@v0.50.2/proxy/server.go:131 +0x3d7
2023/07/18 06:42:40	stdout	github.com/AdguardTeam/dnsproxy/proxy.(*Proxy).handleDNSRequest(0xc000105500, 0xc00483b100)
2023/07/18 06:42:40	stdout	github.com/AdguardTeam/AdGuardHome/internal/dnsforward/dns.go:124 +0x3a2
2023/07/18 06:42:40	stdout	github.com/AdguardTeam/AdGuardHome/internal/dnsforward.(*Server).handleDNSRequest(0xc0000c4000, 0xdab2c0?, 0xc00483b100)
2023/07/18 06:42:40	stdout	github.com/AdguardTeam/AdGuardHome/internal/dnsforward/dns.go:210 +0x205
2023/07/18 06:42:40	stdout	github.com/AdguardTeam/AdGuardHome/internal/dnsforward.(*Server).processInitial(0xc0000c4000, 0xc004ec67e0)
2023/07/18 06:42:40	stdout	github.com/AdguardTeam/AdGuardHome/internal/dnsforward/filter.go:56 +0x5e
2023/07/18 06:42:40	stdout	github.com/AdguardTeam/AdGuardHome/internal/dnsforward.(*Server).getClientRequestFilteringSettings(0xc0000c4000, 0xc004ec67e0)
2023/07/18 06:42:40	stdout	github.com/AdguardTeam/AdGuardHome/internal/filtering/filtering.go:303 +0x58
2023/07/18 06:42:40	stdout	github.com/AdguardTeam/AdGuardHome/internal/filtering.(*DNSFilter).GetConfig(0xc002fd7b68?)
2023/07/18 06:42:40	stdout	goroutine 3815562 [running]:
2023/07/18 06:42:40	stdout	
2023/07/18 06:42:40	stdout	[signal SIGSEGV: segmentation violation code=0x1 addr=0x1a0 pc=0x866a98]
2023/07/18 06:42:40	stdout	panic: runtime error: invalid memory address or nil pointer dereference

@ainar-g
Copy link
Contributor

ainar-g commented Aug 1, 2023

Apologies for the long wait. This log actually hints at an issue we might have, so thank you for posting this.

@ainar-g ainar-g added bug P3: Medium and removed waiting for data Waiting for users to provide more data. labels Aug 1, 2023
@ainar-g ainar-g added this to the v0.107.36 milestone Aug 1, 2023
adguard pushed a commit that referenced this issue Aug 7, 2023
Updates #5948.

Squashed commit of the following:

commit 9dbc197
Author: Stanislav Chzhen <s.chzhen@adguard.com>
Date:   Mon Aug 7 15:06:38 2023 +0300

    all: imp chlog

commit fbcccc2
Author: Stanislav Chzhen <s.chzhen@adguard.com>
Date:   Thu Aug 3 16:58:35 2023 +0300

    all: upd chlog

commit 4f9e8fc
Author: Stanislav Chzhen <s.chzhen@adguard.com>
Date:   Wed Aug 2 19:24:42 2023 +0300

    dnsforward: fix dns filter
@schzhn
Copy link
Member

schzhn commented Aug 9, 2023

Hello, @codac.
We've pushed the edge release, containing the fix. Could you please check it?

@codac
Copy link
Author

codac commented Aug 15, 2023

@schzhn
It turned out, that tis error message show up after I have restarted the docker.
Why do I need to restart the docker? Becaus every 5-12 hours the traffic turns extremely slow or even dead.
Then I need to restart the docker and the traffic is at its best performance.
The logs are empty though regarding this behaviour.
Any ideas how to investigate?

@schzhn
Copy link
Member

schzhn commented Aug 15, 2023

Hello, @codac. Sounds like a different issue. Let's try to put things in order.
If this issue is resolved close it and start a new one with all info you have. And we will look into it.

@ainar-g
Copy link
Contributor

ainar-g commented Aug 15, 2023

@codac

It turned out, that tis error message show up after I have restarted the docker.

Just to be clear, do you mean that the message is still there on the Edge channel?

The logs are empty though regarding this behaviour.
Any ideas how to investigate?

We've landed a fix of log settings recently, so one of the things you could do is update to the latest edge Docker tag. (Backing up your configuration, of course.)

@ainar-g
Copy link
Contributor

ainar-g commented Aug 21, 2023

We'll close this issue. Please reopen with new data if you see the same panic again.

@ainar-g ainar-g closed this as completed Aug 21, 2023
@ainar-g ainar-g modified the milestones: v0.107.38, v0.107.37 Sep 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants