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

websocket报错 #9

Closed
iLayPark opened this issue Oct 31, 2022 · 10 comments
Closed

websocket报错 #9

iLayPark opened this issue Oct 31, 2022 · 10 comments
Labels
bug Something isn't working

Comments

@iLayPark
Copy link

2022/10/31 01:12:28 worker with func exits from a panic: runtime error: invalid memory address or nil pointer dereference
2022/10/31 01:12:28 worker with func exits from panic: goroutine 240 [running]:
github.com/panjf2000/ants/v2.(*goWorkerWithFunc).run.func1.1(0xc000202a80)
/go/pkg/mod/github.com/panjf2000/ants/v2@v2.4.2/worker_func.go:58 +0x165
panic(0xa66500, 0xf62ce0)
/usr/local/go/src/runtime/panic.go:969 +0x1b9
ehang.io/nps/lib/file.(*Flow).Add(0x0, 0x81, 0x81)
/go/src/ehang.io/nps/lib/file/obj.go:21 +0x33
ehang.io/nps/lib/goroutine.CopyBuffer(0x7f714146f008, 0xc00000d4a0, 0xbd9920, 0xc0000a00c0, 0x0, 0x0, 0xc0000a2670, 0xe, 0x0, 0x0)
/go/src/ehang.io/nps/lib/goroutine/pool.go:81 +0x2db
ehang.io/nps/lib/goroutine.copyConnGroup(0xad7d00, 0xc0002930e0)
/go/src/ehang.io/nps/lib/goroutine/pool.go:114 +0x15d
github.com/panjf2000/ants/v2.(*goWorkerWithFunc).run.func1(0xc000202a80)
/go/pkg/mod/github.com/panjf2000/ants/v2@v2.4.2/worker_func.go:68 +0xb0
created by github.com/panjf2000/ants/v2.(*goWorkerWithFunc).run
/go/pkg/mod/github.com/panjf2000/ants/v2@v2.4.2/worker_func.go:48 +0x4c

@iLayPark iLayPark added the bug Something isn't working label Oct 31, 2022
@yisier
Copy link
Owner

yisier commented Oct 31, 2022

无法复现呐小哥,你用的是http还是tcp协议,这二种协议都试过吗

@iLayPark iLayPark mentioned this issue Oct 31, 2022
@iLayPark
Copy link
Author

无法复现呐小哥,你用的是http还是tcp协议,这二种协议都试过吗

http协议

@iLayPark
Copy link
Author

无法复现呐小哥,你用的是http还是tcp协议,这二种协议都试过吗

如果是服务器本地的话,选择代理到服务器本地是没问题的。不是服务器本地就有问题

@yisier
Copy link
Owner

yisier commented Oct 31, 2022

无法复现呐小哥,你用的是http还是tcp协议,这二种协议都试过吗

如果是服务器本地的话,选择代理到服务器本地是没问题的。不是服务器本地就有问题

你用tcp协议试试看

@iLayPark
Copy link
Author

无法复现呐小哥,你用的是http还是tcp协议,这二种协议都试过吗

如果是服务器本地的话,选择代理到服务器本地是没问题的。不是服务器本地就有问题

你用tcp协议试试看

要用tcp的话原版一直就可以。

@yisier
Copy link
Owner

yisier commented Oct 31, 2022

看了错误信息,貌似不是由websocket 引起的,无法复现,等等看有没有人再有类似的问题吧~~

@git-zjx
Copy link

git-zjx commented Oct 31, 2022

2022/10/31 20:49:09.523 [D] [client.go:216]  new tcp connection with the goal of 127.0.0.1:3389, remote address:111.198.230.51:19608
2022/10/31 20:49:09 worker with func exits from a panic: runtime error: invalid memory address or nil pointer dereference
2022/10/31 20:49:09 worker with func exits from panic: goroutine 11355 [running]:
github.com/panjf2000/ants/v2.(*goWorkerWithFunc).run.func1.1(0xc000203320)
        /home/runner/go/pkg/mod/github.com/panjf2000/ants/v2@v2.4.2/worker_func.go:58 +0x16f
panic(0x1550340, 0x1a4ff00)
        /opt/hostedtoolcache/go/1.15.15/x64/src/runtime/panic.go:969 +0x1c7
ehang.io/nps/lib/file.(*Flow).Add(0x0, 0x13, 0x13)
        /home/runner/work/nps/nps/lib/file/obj.go:21 +0x3a
ehang.io/nps/lib/goroutine.CopyBuffer(0x16c29a0, 0xc0008ca0a0, 0x1676b393138, 0xc000602700, 0x0, 0x0, 0xc000680410, 0xe, 0x0, 0x0)
        /home/runner/work/nps/nps/lib/goroutine/pool.go:81 +0x2dc
ehang.io/nps/lib/goroutine.copyConnGroup(0x15c0d40, 0xc0002726e0)
        /home/runner/work/nps/nps/lib/goroutine/pool.go:114 +0x165
github.com/panjf2000/ants/v2.(*goWorkerWithFunc).run.func1(0xc000203320)
        /home/runner/go/pkg/mod/github.com/panjf2000/ants/v2@v2.4.2/worker_func.go:68 +0xb7
created by github.com/panjf2000/ants/v2.(*goWorkerWithFunc).run
        /home/runner/go/pkg/mod/github.com/panjf2000/ants/v2@v2.4.2/worker_func.go:48 +0x53

2022/10/31 20:49:09 worker with func exits from a panic: runtime error: invalid memory address or nil pointer dereference
2022/10/31 20:49:09 worker with func exits from panic: goroutine 11354 [running]:
github.com/panjf2000/ants/v2.(*goWorkerWithFunc).run.func1.1(0xc000188e40)
        /home/runner/go/pkg/mod/github.com/panjf2000/ants/v2@v2.4.2/worker_func.go:58 +0x16f
panic(0x1550340, 0x1a4ff00)
        /opt/hostedtoolcache/go/1.15.15/x64/src/runtime/panic.go:969 +0x1c7
ehang.io/nps/lib/file.(*Flow).Add(0x0, 0x13, 0x13)
        /home/runner/work/nps/nps/lib/file/obj.go:21 +0x3a
ehang.io/nps/lib/goroutine.CopyBuffer(0x1676b204008, 0xc000602700, 0x1676b115840, 0xc0008ca0a0, 0x0, 0x0, 0xc000680410, 0xe, 0x0, 0x0)
        /home/runner/work/nps/nps/lib/goroutine/pool.go:81 +0x2dc
ehang.io/nps/lib/goroutine.copyConnGroup(0x15c0d40, 0xc000272690)
        /home/runner/work/nps/nps/lib/goroutine/pool.go:114 +0x165
github.com/panjf2000/ants/v2.(*goWorkerWithFunc).run.func1(0xc000188e40)
        /home/runner/go/pkg/mod/github.com/panjf2000/ants/v2@v2.4.2/worker_func.go:68 +0xb7
created by github.com/panjf2000/ants/v2.(*goWorkerWithFunc).run
        /home/runner/go/pkg/mod/github.com/panjf2000/ants/v2@v2.4.2/worker_func.go:48 +0x53

配置文件:

[common]
server_addr=
conn_type=tcp
vkey=
auto_reconnection=true
max_conn=1000
flow_limit=1000
rate_limit=1000
basic_username=11
basic_password=3
web_username=user
web_password=1234
crypt=true
compress=true
#pprof_addr=0.0.0.0:9999
disconnect_timeout=60

[health_check_test1]
health_check_timeout=1
health_check_max_failed=3
health_check_interval=1
health_http_url=/
health_check_type=http
health_check_target=127.0.0.1:8083,127.0.0.1:8082

[health_check_test2]
health_check_timeout=1
health_check_max_failed=3
health_check_interval=1
health_check_type=tcp
health_check_target=127.0.0.1:8083,127.0.0.1:8082

[web]
host=
target_addr=127.0.0.1:8083,127.0.0.1:8082

@git-zjx
Copy link

git-zjx commented Oct 31, 2022

使用原版的客户端可解决我的问题

@yisier
Copy link
Owner

yisier commented Oct 31, 2022

复现出来了,的确是由新版客户端引起的,可以暂时使用0.26.10 客户端,后续会修复新版本客户端的bug

@yisier
Copy link
Owner

yisier commented Nov 1, 2022

已修复 v0.26.12.2

@iLayPark iLayPark closed this as completed Nov 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants