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

运行socks server时,admin节点panic崩溃 #10

Open
ier005 opened this issue Sep 4, 2019 · 1 comment
Open

运行socks server时,admin节点panic崩溃 #10

ier005 opened this issue Sep 4, 2019 · 1 comment
Labels
bug Something isn't working

Comments

@ier005
Copy link
Contributor

ier005 commented Sep 4, 2019

版本1.1.0,released on 10 Jun

在运行一段时间后,报错:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x40 pc=0x53e5e6]

goroutine 13303 [running]:
github.com/Dliv3/Venom/admin/dispather.localSocks5Server(0x5d0200, 0xc00000e010, 0xc00005e2c0, 0x40, 0xc000110000, 0xc000044000, 0x1, 0x1)
        /Users/dlive/Code/Go/src/github.com/Dliv3/Venom/admin/dispather/sender.go:427 +0xb6
created by github.com/Dliv3/Venom/netio.InitTCP.func1
        /Users/dlive/Code/Go/src/github.com/Dliv3/Venom/netio/init.go:56 +0x1e1

@Dliv3 Dliv3 added the bug Something isn't working label Sep 4, 2019
@ier005
Copy link
Contributor Author

ier005 commented Sep 15, 2019

看了一波源码,发现问题出在下面的代码上:

peerNode := node.Nodes[peerNodeID]
currentSessionID := node.Nodes[peerNodeID].DataBuffers[protocol.SOCKSDATA].GetSessionID()

若是agent节点掉线被删除,对应的peerNodeID已经不存在,则此处会报错,个人认为出现此种情况应该停止监听此端口,即修改下述源码逻辑,在Accept处判断peerNodeID是否仍然合法,并做相应操作(不过仅修改此处无法保证已经被调用的handlerFunc中不出现非法引用?)

Venom/netio/init.go

Lines 49 to 58 in e13049c

for {
c <- true
conn, err := listener.Accept()
if err != nil {
log.Println("[-]listener.Accept error:", err)
// continue
break
}
go handlerFunc(conn, peerNodeID, c, args)
}

但在package netio内引入package node会导致循环引用问题,这样一来就需要对整个代码架构进行一定的修改,个人时间及能力有限,所以希望作者能够对该问题进行修正。。

BTW,在查看源码的过程中发现了上传与下载文件的一个小bug,已提PR。

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