Mythologyli / zju-connect

ZJU RVPN 客户端的 Go 语言实现
GNU Affero General Public License v3.0
313 stars 21 forks source link

[Error report] Received SIGSEGV when starting program #18

Closed bowling233 closed 1 year ago

bowling233 commented 1 year ago

When starting the program with command

/opt/zju-connect -config /etc/zju-connect/config.toml

I received runtime error:

2023/03/18 23:11:02 HTTP server listening on :1081
2023/03/18 23:11:02 Port forwarding (udp): 127.0.0.1:53 <- 10.10.0.21:53
listen udp 127.0.0.1:53: bind: permission denied
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x8700b9]

goroutine 99 [running]:
github.com/mythologyli/zju-connect/core.(*udpForward).StartUdpForward(0x0)
    github.com/mythologyli/zju-connect/core/udp_forwarding.go:88 +0x99
github.com/mythologyli/zju-connect/core.ServeUdpForwarding({0xc000038810?, 0xd?}, {0xc000038820?, 0x0?}, 0x0?)
    github.com/mythologyli/zju-connect/core/udp_forwarding.go:46 +0x2a
github.com/mythologyli/zju-connect/core.(*EasyConnectClient).ServeForwarding(0xc0001fc380, {0xc0000387f6?, 0x0?}, {0xc000038810, 0xc}, {0xc000038820, 0xd})
    github.com/mythologyli/zju-connect/core/EasyConnectClient.go:241 +0x1eb
created by github.com/mythologyli/zju-connect/core.StartClient
    github.com/mythologyli/zju-connect/core/EasyConnectClient.go:138 +0xc25
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x50 pc=0x870438]

goroutine 113 [running]:
github.com/mythologyli/zju-connect/core.(*udpForward).janitor(0x0)
    github.com/mythologyli/zju-connect/core/udp_forwarding.go:100 +0x38
created by github.com/mythologyli/zju-connect/core.(*udpForward).StartUdpForward
    github.com/mythologyli/zju-connect/core/udp_forwarding.go:85 +0x71

Software version: v0.2.0

Mythologyli commented 1 year ago

如果不需要的话可以移除端口转发部分配置

修改为:

# Port forwarding
port_forwarding = []

如果需要端口转发,权限不够应该可以加 sudo 解决

bowling233 commented 1 year ago

Solved. Thanks very much.