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

[Bug] 群辉 docker udp 收发问题 #543

Closed
4 tasks done
hbmask opened this issue Oct 30, 2022 · 2 comments
Closed
4 tasks done

[Bug] 群辉 docker udp 收发问题 #543

hbmask opened this issue Oct 30, 2022 · 2 comments

Comments

@hbmask
Copy link

hbmask commented Oct 30, 2022

在提交之前,请确认

  • 我已经尝试搜索过 Issue ,但没有找到相关问题。
  • 我正在使用最新的 mosdns 版本(或者最新的 commit),问题依旧存在。
  • 我仔细看过 wiki 后仍然无法自行解决该问题。
  • 我非常确定这是 mosdns 核心的问题。(如果是通过第三方衍生软件使用 mosdns 核心,不确定问题源头时,请先向衍生软件开发者提交问题。)

mosdns 版本

V4.5.2

操作系统

群辉

Bug 描述和复现步骤

2022-10-30 02:13:03 stdout github.com/IrineSistiana/mosdns/v4/pkg/server/udp.go:90 +0xa59
2022-10-30 02:13:03 stdout created by github.com/IrineSistiana/mosdns/v4/pkg/server.(*Server).ServeUDP
2022-10-30 02:13:03 stdout github.com/IrineSistiana/mosdns/v4/pkg/server/udp.go:108 +0x55f
2022-10-30 02:13:03 stdout github.com/IrineSistiana/mosdns/v4/pkg/server.(*Server).ServeUDP.func1()
2022-10-30 02:13:03 stdout github.com/IrineSistiana/mosdns/v4/pkg/server/udp_linux.go:67 +0x57
2022-10-30 02:13:03 stdout github.com/IrineSistiana/mosdns/v4/pkg/server.ipv6PacketConn.writeTo({0xc006a400a0?, 0xc006a40050?}, {0xc001534000?, 0xc00161b950?, 0xc005a71cc0?}, {0xd927e0?, 0x0?}, {0xfe0c68?, 0xc005a68030?})
2022-10-30 02:13:03 stdout goroutine 23 [running]:
2022-10-30 02:13:03 stdout  
2022-10-30 02:13:03 stdout [signal SIGSEGV: segmentation violation code=0x1 addr=0x28 pc=0xa65657]
2022-10-30 02:13:03 stdout panic: runtime error: invalid memory address or nil pointer dereference

使用的配置文件

log:
  level: info
  file: ""

data_providers:
  - tag: geosite
    file: ./geosite.dat
    auto_reload: true
  - tag: geoip
    file: ./geoip.dat
    auto_reload: true

plugins:
  # 缓存
  - tag: cache
    type: cache
    args:
      size: 1024

  # 转发至本地服务器的插件
  - tag: forward_local
    type: fast_forward
    args:
      upstream:
        - addr: https://1.12.12.12/dns-query

  # 转发至远程服务器的插件
  - tag: forward_remote
    type: fast_forward
    args:
      upstream:
        - addr: https://8.8.8.8/dns-query

  # 匹配本地域名的插件
  - tag: query_is_local_domain
    type: query_matcher
    args:
      domain:
        - 'provider:geosite:cn'

  # 匹配非本地域名的插件
  - tag: query_is_non_local_domain
    type: query_matcher
    args:
      domain:
        - 'provider:geosite:geolocation-!cn'

  # 匹配广告域名的插件
  - tag: query_is_ad_domain
    type: query_matcher
    args:
      domain:
        - 'provider:geosite:category-ads-all'

  # 匹配本地 IP 的插件
  - tag: response_has_local_ip
    type: response_matcher
    args:
      ip:
        - 'provider:geoip:cn'

  # 主要的运行逻辑插件
  # sequence 插件中调用的插件 tag 必须在 sequence 前定义,
  # 否则 sequence 找不到对应插件。
  - tag: main_sequence
    type: sequence
    args:
      exec:
        # 缓存
        - cache

        # 屏蔽广告域名
        - if: query_is_ad_domain
          exec:
            - _new_nxdomain_response
            - _return

        # 已知的本地域名用本地服务器解析
        - if: query_is_local_domain
          exec:
            - forward_local
            - _return

        # 已知的非本地域名用远程服务器解析
        - if: query_is_non_local_domain
          exec:
            - _prefer_ipv4
            - forward_remote
            - _return

          # 剩下的未知域名用 IP 分流。
          # 这里借助了 `fallback` 工作机制。分流原理请参考 `fallback`
          # 的工作流程。
          # primary 从本地服务器获取应答,丢弃非本地 IP 的结果。
        - primary:
            - forward_local
            - if: "(! response_has_local_ip) && [_response_valid_answer]"
              exec:
                - _drop_response
          # secondary 从远程服务器获取应答。
          secondary:
            - _prefer_ipv4
            - forward_remote
          # 这里建议设置成 local 服务器正常延时的 2~5 倍。
          # 这个延时保证了 local 延时偶尔变高时,其结果不会被 remote 抢答。
          # 如果 local 超过这个延时还没响应,可以假设 local 出现了问题。
          # 这时用就采用 remote 的应答。单位: 毫秒。
          fast_fallback: 200

servers:
  - exec: main_sequence
    listeners:
      - protocol: udp
        addr: '[::]:53'
      - protocol: tcp
        addr: '[::]:53'

mosdns 的 log 记录

2022-10-30 02:13:03	stdout	github.com/IrineSistiana/mosdns/v4/pkg/server/udp.go:90 +0xa59
2022-10-30 02:13:03	stdout	created by github.com/IrineSistiana/mosdns/v4/pkg/server.(*Server).ServeUDP
2022-10-30 02:13:03	stdout	github.com/IrineSistiana/mosdns/v4/pkg/server/udp.go:108 +0x55f
2022-10-30 02:13:03	stdout	github.com/IrineSistiana/mosdns/v4/pkg/server.(*Server).ServeUDP.func1()
2022-10-30 02:13:03	stdout	github.com/IrineSistiana/mosdns/v4/pkg/server/udp_linux.go:67 +0x57
2022-10-30 02:13:03	stdout	github.com/IrineSistiana/mosdns/v4/pkg/server.ipv6PacketConn.writeTo({0xc006a400a0?, 0xc006a40050?}, {0xc001534000?, 0xc00161b950?, 0xc005a71cc0?}, {0xd927e0?, 0x0?}, {0xfe0c68?, 0xc005a68030?})
2022-10-30 02:13:03	stdout	goroutine 23 [running]:
2022-10-30 02:13:03	stdout	
2022-10-30 02:13:03	stdout	[signal SIGSEGV: segmentation violation code=0x1 addr=0x28 pc=0xa65657]
2022-10-30 02:13:03	stdout	panic: runtime error: invalid memory address or nil pointer dereference
2022-10-30 02:13:03	stdout	2022-10-30T02:13:03.323Z info coremain/server.go:81 starting server {"proto": "tcp", "addr": "[::]:53"}
2022-10-30 02:13:03	stdout	2022-10-30T02:13:03.323Z info coremain/server.go:81 starting server {"proto": "udp", "addr": "[::]:53"}
2022-10-30 02:13:03	stdout	2022-10-30T02:13:03.323Z info coremain/mosdns.go:148 loading plugin {"tag": "main_sequence", "type": "sequence"}
2022-10-30 02:13:03	stdout	2022-10-30T02:13:03.323Z info response_has_local_ip response_matcher/response_matcher.go:95 ip matcher loaded {"length": 10522}
2022-10-30 02:13:03	stdout	2022-10-30T02:13:03.091Z info coremain/mosdns.go:148 loading plugin {"tag": "response_has_local_ip", "type": "response_matcher"}
2022-10-30 02:13:03	stdout	2022-10-30T02:13:03.091Z info query_is_ad_domain query_matcher/query_matcher.go:117 domain matcher loaded {"length": 57697}
2022-10-30 02:13:02	stdout	2022-10-30T02:13:02.963Z info coremain/mosdns.go:148 loading plugin {"tag": "query_is_ad_domain", "type": "query_matcher"}
2022-10-30 02:13:02	stdout	2022-10-30T02:13:02.963Z info query_is_non_local_domain query_matcher/query_matcher.go:117 domain matcher loaded {"length": 34429}
2022-10-30 02:13:02	stdout	2022-10-30T02:13:02.859Z info coremain/mosdns.go:148 loading plugin {"tag": "query_is_non_local_domain", "type": "query_matcher"}
2022-10-30 02:13:02	stdout	2022-10-30T02:13:02.859Z info query_is_local_domain query_matcher/query_matcher.go:117 domain matcher loaded {"length": 66567}
2022-10-30 02:13:02	stdout	2022-10-30T02:13:02.736Z info coremain/mosdns.go:148 loading plugin {"tag": "query_is_local_domain", "type": "query_matcher"}
2022-10-30 02:13:02	stdout	2022-10-30T02:13:02.736Z info coremain/mosdns.go:148 loading plugin {"tag": "forward_remote", "type": "fast_forward"}
2022-10-30 02:13:02	stdout	2022-10-30T02:13:02.736Z info coremain/mosdns.go:148 loading plugin {"tag": "forward_local", "type": "fast_forward"}
2022-10-30 02:13:02	stdout	2022-10-30T02:13:02.736Z info coremain/mosdns.go:148 loading plugin {"tag": "cache", "type": "cache"}
2022-10-30 02:13:02	stdout	2022-10-30T02:13:02.728Z info coremain/run.go:107 working directory changed {"path": "/etc/mosdns"}
@urlesistiana
Copy link
Collaborator

760a660 应该已解决。

@hbmask
Copy link
Author

hbmask commented Oct 30, 2022 via email

@urlesistiana urlesistiana changed the title 群辉docker 端口设置成53 启动失败[Bug] [Bug] 群辉 docker udp 收发问题 Oct 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants