klzgrad / naiveproxy

Make a fortune quietly
BSD 3-Clause "New" or "Revised" License
6.31k stars 868 forks source link

v124.0.6367.54-1配置quic异常退出 #640

Closed openips closed 4 weeks ago

openips commented 1 month ago

系统为openwrt 客户端为naiveproxy-v124.0.6367.54-1-openwrt-aarch64_cortex-a53.tar.xz 运行后报错,具体coredump日志如下:

root@BPI_R4:~# gdb --core core-naive-30048-1713788116 /usr/bin/naive
GNU gdb (GDB) 14.1
Copyright (C) 2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "aarch64-openwrt-linux".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /usr/bin/naive...
(No debugging symbols found in /usr/bin/naive)
[New LWP 30048]
[New LWP 30050]
[New LWP 30051]
[New LWP 30049]
Core was generated by `/usr/bin/naive /etc/naiveproxy/config_dc_http.json'.
Program terminated with signal SIGTRAP, Trace/breakpoint trap.
#0  0x00000055951ba1c4 in ?? ()
[Current thread is 1 (LWP 30048)]
(gdb) bt
#0  0x00000055951ba1c4 in ?? ()
#1  0x0000007ff0394ca0 in ?? ()
Backtrace stopped: not enough registers or memory available to unwind further
(gdb)  info sharedlibrary
From                To                  Syms Read   Shared Object Library
0x0000005594f30000  0x0000005594f30000  Yes (*)     /usr/bin/naive
                                        Yes (*)     /lib/libgcc_s.so.1
                                        Yes (*)     /lib/ld-musl-aarch64.so.1
(*): Shared library is missing debugging information.
(gdb) quit

配置文件如下:

{
  "listen": "socks://127.0.0.1:2086",
  "proxy": "quic://AAA@BBB.CCC.DDD",
  "log": "",
  "concurrency": "2"
}

同样的配置在v123.0.6312.40-1版本中完全正常 同样的配置,将quic改为https也完全正常 有时间请排查一下

Chilledheart commented 1 month ago

gdb 打开core文件后面要加 --core参数

openips commented 1 month ago

gdb 打开core文件后面要加 --core参数

已经修正

Chilledheart commented 1 month ago

gdb 打开core文件后面要加 --core参数

已经修正

然后接 naive的文件路径, 比如

gdb --core core.879718 ./naiveproxy-v123.0.6312.40-1-linux-x64/naive
Chilledheart commented 1 month ago

还有 BPI_R4 不应该用a72 (a73)吗? https://wiki.banana-pi.org/Banana_Pi_BPI-R4

openips commented 1 month ago

gdb 打开core文件后面要加 --core参数

已经修正

然后接 naive的文件路径, 比如

gdb --core core.879718 ./naiveproxy-v123.0.6312.40-1-linux-x64/naive

已经修正

openips commented 1 month ago

还有 BPI_R4 不应该用a72 (a73)吗? https://wiki.banana-pi.org/Banana_Pi_BPI-R4 编译的时候默认的就是a53,开发者专门说过


CONFIG_TARGET_ARCH_PACKAGES="aarch64_cortex-a53"
CONFIG_DEFAULT_TARGET_OPTIMIZATION="-Os -pipe -mcpu=cortex-a53"
CONFIG_CPU_TYPE="cortex-a53"
CONFIG_TARGET_OPTIMIZATION="-Os -pipe -mcpu=cortex-a53"
Chilledheart commented 1 month ago

还有 BPI_R4 不应该用a72 (a73)吗? https://wiki.banana-pi.org/Banana_Pi_BPI-R4 编译的时候默认的就是a53,开发者专门说过

CONFIG_TARGET_ARCH_PACKAGES="aarch64_cortex-a53"
CONFIG_DEFAULT_TARGET_OPTIMIZATION="-Os -pipe -mcpu=cortex-a53"
CONFIG_CPU_TYPE="cortex-a53"
CONFIG_TARGET_OPTIMIZATION="-Os -pipe -mcpu=cortex-a53"

感谢,但是就目前提供的信息(backtrace都是??)好像很难判断

openips commented 1 month ago

还有 BPI_R4 不应该用a72 (a73)吗? https://wiki.banana-pi.org/Banana_Pi_BPI-R4 编译的时候默认的就是a53,开发者专门说过

CONFIG_TARGET_ARCH_PACKAGES="aarch64_cortex-a53"
CONFIG_DEFAULT_TARGET_OPTIMIZATION="-Os -pipe -mcpu=cortex-a53"
CONFIG_CPU_TYPE="cortex-a53"
CONFIG_TARGET_OPTIMIZATION="-Os -pipe -mcpu=cortex-a53"

感谢,但是就目前提供的信息(backtrace都是??)好像很难判断

感谢回复,现在就看看K大能找到问题不能了,实在不行我退回上个版本也行

Chilledheart commented 1 month ago

直接通过函数地址也很难判断,

Screenshot 2024-04-22 at 17 51 21

通过gdb 内输入 info sharedlibrary,你可以看到动态链接库调试符号是否加载,如果没有你试试可以安装上 这样bt 可以提供更多有效的信息。

openips commented 1 month ago

直接通过函数地址也很难判断, Screenshot 2024-04-22 at 17 51 21

通过gdb 内输入 info sharedlibrary,你可以看到动态链接库调试符号是否加载,如果没有你试试可以安装上 这样bt 可以提供更多有效的信息。

收到 已更新

klzgrad commented 1 month ago

https://issues.chromium.org/issues/40141686

openips commented 1 month ago

https://issues.chromium.org/issues/40141686

不太明白啊 这是20年的bug quic配置的格式不对吗?

Chilledheart commented 1 month ago

最近几个版本它把quic映射到https,现在又把quic这个scheme移除了,现在已经没有quic了(本来底层也没用quic)

openips commented 1 month ago

好吧 个人感觉quic延迟更低一点 还是有用的 如果取消了有点可惜 使用说明也更新一下吧

openips commented 1 month ago

QUIC 代理的配置方式会重新设计 开来恢复有望

klzgrad commented 1 month ago

https://github.com/klzgrad/naiveproxy/releases/tag/v124.0.6367.54-2

Chilledheart commented 4 weeks ago

@klzgrad I tested the new binary with

{
  "listen": "socks://127.0.0.1:2086",
  "proxy": "quic://AAA@BBB.CCC.DDD",
  "log": "",
  "concurrency": "2"
}

It says:

➜  src git:(master) ✗ ninja -C out/Release naive && ./out/Release/naive config.json
ninja: Entering directory `out/Release'
[3/3] LINK ./naive
Invalid proxy URL
Chilledheart commented 4 weeks ago

After removing GetWithEmptyPath() which caused 'Invalid proxy URL' warning in https://github.com/klzgrad/naiveproxy/blob/master/src/net/tools/naive/naive_proxy_bin.cc#L353

it crashed

(gdb) bt
#0  0x0000555555859ffa in base::ImmediateCrash ()
    at ../../base/immediate_crash.h:176
#1  logging::CheckFailure () at ../../base/check.h:212
#2  net::ProxyList::First (this=<optimized out>)
    at ../../net/proxy_resolution/proxy_list.cc:131
#3  net::(anonymous namespace)::BuildURLRequestContext (params=...,
    cert_net_fetcher=..., net_log=<optimized out>)
    at ../../net/tools/naive/naive_proxy_bin.cc:509
#4  main (argc=<optimized out>, argv=<optimized out>)
    at ../../net/tools/naive/naive_proxy_bin.cc:708
(gdb)
Chilledheart commented 4 weeks ago

Suspicious commits causing this issue:

and

klzgrad commented 4 weeks ago

Cannot reproduce

$ ./naive quic2.json 
[0504/231452.759368:INFO:naive_proxy_bin.cc(498)] Proxying via QUIC bbb.ccc.ddd:443
[0504/231452.773128:INFO:naive_proxy_bin.cc(698)] Listening on socks://127.0.0.1:2086
Chilledheart commented 4 weeks ago

It seems my problem with kyber768 patch.

Tested with new patch.

hky@NUCWIN7:~$ ./naive
enabled post quantum kyber curves
[0505/002145.285869:INFO:naive_proxy_bin.cc(514)] Proxying via QUIC bbb.ccc.ddd:443
[0505/002145.327540:INFO:naive_proxy_bin.cc(728)] Listening on socks://127.0.0.1:2086