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

smartdns崩溃 #144

Closed
ghost opened this issue Apr 14, 2019 · 20 comments
Closed

smartdns崩溃 #144

ghost opened this issue Apr 14, 2019 · 20 comments

Comments

@ghost
Copy link

ghost commented Apr 14, 2019

问题现象
简要描述问题出现的现象

运行环境

  1. 固件型号
    Padavan
    mipselsf
    Linux Router 3.4.113 mips GNU/Linux

信息收集

  1. 将/var/log/smrtdns.log日志作为附件上传。
    无/var/log/smrtdns.log
  2. 如进程异常,请将coredump功能开启,上传coredump信息文件。
    在自定义界面,开启设置->自定义设置->生成coredump配置,重现问题后提交coredump文件
    coredump文件在/tmp目录下
    process exit with signal 11, code = 1, errno = 0, pid = 762538342, self = 3156, pc = 0x2d736967, addr = 0x2d736966, build(Mar 15 2019 23:07:39)
    由于未使用luci,coredump无法开启。
@pymumu
Copy link
Owner

pymumu commented Apr 14, 2019

是不是内存不足了导致异常了

dmesg看一下syslog吧。

@ghost
Copy link
Author

ghost commented Apr 14, 2019

内存剩余70MB+,dmesg无异常

@pymumu
Copy link
Owner

pymumu commented Apr 14, 2019

那可能是hosts里面有些记录太长了,smartdns处理有错误。

把长度超过128的记录注释掉看看

@ghost
Copy link
Author

ghost commented Apr 14, 2019

的确是这个问题

@pymumu
Copy link
Owner

pymumu commented Apr 14, 2019

我改了个版本,增大了域名长度, 你测试下看看把。
smartdns.1.2019.04.14-2114.mipselsf.ipk.zip

@ghost
Copy link
Author

ghost commented Apr 14, 2019

process exit with signal 11, code = 1, errno = 0, pid = 762538342, self = 3156, pc = 0x2d736967, addr = 0x2d736966, build(Mar 15 2019 23:07:39)

这个报错消失,程序运行后无任何输出,几秒后退出。
去除这个配置文件也一样
smartdns.log报错

[2019-04-14 22:30:21,704][ERROR][     dns_client.c:229 ] get addr info failed. Unknown error
[2019-04-14 22:30:21,704][ERROR][     dns_client.c:230 ] host = 9.9.9.10r, port = 443, type = 2, protocol = 0
[2019-04-14 22:30:21,704][ERROR][     dns_client.c:873 ] get address failed, 9.9.9.10r:443
[2019-04-14 22:30:21,704][ERROR][       smartdns.c:164 ] add server failed, 9.9.9.10r:443
[2019-04-14 22:30:21,704][ERROR][       smartdns.c:277 ] add servers failed.

@pymumu
Copy link
Owner

pymumu commented Apr 14, 2019

server配置项错误了,配置了错误的地址。

@ghost
Copy link
Author

ghost commented Apr 14, 2019

然而使用release 23是没问题的。
而且可以确认地址没错。

@pymumu
Copy link
Owner

pymumu commented Apr 14, 2019

smartdns.1.2019.04.14-2322.mipselsf.ipk.zip

最近改的server-https功能有点问题。这个应该改掉了。

@ghost
Copy link
Author

ghost commented Apr 14, 2019

暂时看起来没什么大问题,启动时报错
[2019-04-15 00:09:15,085][ WARN][ dns_client.c:1936] peer verify failed.

@pymumu
Copy link
Owner

pymumu commented Apr 15, 2019

看一下配置的spki是否正确。
这里是校验spki失败了,对应配置的server未生效。

@ghost ghost closed this as completed Apr 19, 2019
@ghost ghost reopened this Apr 19, 2019
@ghost
Copy link
Author

ghost commented Apr 19, 2019

已确认 spki 正确。
现在启动时不是报错
[2019-04-19 23:19:19,981][ WARN][ dns_client.c:1936] peer verify failed.
就是报错

[2019-04-19 23:19:47,774][ERROR][       smartdns.c:184 ] add server cloudflare-dns.com to group foreign failed
[2019-04-19 23:19:47,775][ERROR][       smartdns.c:277 ] add servers failed.

然后几秒后退出。

@pymumu
Copy link
Owner

pymumu commented Apr 19, 2019

启动退出时因为调用路由器默认DNS解析cloudflare-dns.com失败。

@pymumu
Copy link
Owner

pymumu commented Apr 19, 2019

可以先找到cloudflare-dns.com的IP地址,然后指定IP地址。
配置如下

server-https https://104.16.112.25/query-dns -http-host=cloudflare-dns.com

@pymumu
Copy link
Owner

pymumu commented Apr 19, 2019

cloudflare-dns的SPKI应该时这个,你对比一下

yioEpqeR4WtDwE9YxNVnCEkTxIjx6EEIwFSQW+lJsbc=

@ghost
Copy link
Author

ghost commented Apr 20, 2019

spki已确认正确。
路由器默认DNS正常。

example@example:~$ dig @211.99.143.33 cloudflare-dns.com
;; ->>HEADER<<- opcode: QUERY; status: NOERROR; id: 47814
;; Flags: qr rd ra; QUERY: 1; ANSWER: 2; AUTHORITY: 0; ADDITIONAL: 0

;; QUESTION SECTION:
;; cloudflare-dns.com.          IN      A

;; ANSWER SECTION:
cloudflare-dns.com.     300     IN      A       104.16.112.25
cloudflare-dns.com.     300     IN      A       104.16.111.25

;; Received 68 B
;; Time 2019-04-20 15:00:30 DST
;; From 211.99.143.33@53(UDP) in 521.3 ms
example@example:~$ dig @58.30.131.33 cloudflare-dns.com
;; ->>HEADER<<- opcode: QUERY; status: NOERROR; id: 17954
;; Flags: qr rd ra; QUERY: 1; ANSWER: 2; AUTHORITY: 0; ADDITIONAL: 0

;; QUESTION SECTION:
;; cloudflare-dns.com.          IN      A

;; ANSWER SECTION:
cloudflare-dns.com.     300     IN      A       104.16.111.25
cloudflare-dns.com.     300     IN      A       104.16.112.25

;; Received 68 B
;; Time 2019-04-20 15:00:40 DST
;; From 58.30.131.33@53(UDP) in 229.0 ms

@pymumu
Copy link
Owner

pymumu commented Apr 20, 2019

不是路由器上执行dig命令。是路由器里面ping命令能正确解析域名。
也就是/etc/resolv.conf文件里面的上游DNS是否配置正确。

如果没有路由器自己的DNS服务器,那么smartdns的http就不可用,必须使用IP地址。

@pymumu
Copy link
Owner

pymumu commented Apr 24, 2019

你用这个命令获取SPKI
echo | openssl s_client -servername cloudflare-dns.com -connect 'cloudflare-dns.com:443' | openssl x509 -pubkey -noout | openssl pkey -pubin -outform der | openssl dgst -sha256 -binary | openssl enc -base64

DNS用的SPKI和https的不一样。指定servername后,才能获取到正确的SPKI

获取到的SPKI其实就是1.1.1.1的

@ghost
Copy link
Author

ghost commented Apr 26, 2019

建议增加一个参数,允许忽略所有错误,尽可能启动并提供服务。

@pymumu
Copy link
Owner

pymumu commented May 21, 2019

Release 25新增域名延迟解析,避免启动失败。

@pymumu pymumu closed this as completed May 21, 2019
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

1 participant