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

存在程序崩溃bug问题 #11

Closed
Corps-Cy opened this issue Aug 1, 2020 · 6 comments
Closed

存在程序崩溃bug问题 #11

Corps-Cy opened this issue Aug 1, 2020 · 6 comments
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@Corps-Cy
Copy link

Corps-Cy commented Aug 1, 2020

在程序建立连接后出现异常 导致服务端崩溃

2020/08/01 14:05:00.324|DEBUG|===== FastTunnel Client Start =====
2020/08/01 14:05:00.934|DEBUG|通信已建立
2020/08/01 14:05:01.071|INFO|From Server:
=====隧道已建立成功,可通过以下方式访问内网服务=====

http://test.test.cc:1270 => 127.0.0.1:8001
test.cc:1273 => 127.0.0.1:22
test.cc:1274 => 192.168.0.91:3389

====================================================
2020/08/01 14:05:01.071|ERROR|From Server:Object reference not set to an instance of an object.
2020/08/01 14:05:15.959|DEBUG|last heart recived 15.015728900000001s ago
2020/08/01 14:05:15.973|DEBUG|已退出登录

2020/08/01 14:05:15.994|DEBUG|通信已建立
2020/08/01 14:05:15.994|ERROR|System.Net.Sockets.SocketException (10004): 一个封锁操作被对 WSACancelBlockingCall 的调用 中断。
at System.Net.Sockets.Socket.Receive(Byte[] buffer)
at FastTunnel.Core.Core.FastTunnelClient.ReceiveServer(Object obj) in D:\Github\FastTunnel\FastTunnel.Core\Core\SuiDaoClient.cs:line 197

经过仔细排查后 发现位于处,可能指令分割后恰巧left变量为空 导致重复进行HandleWords函数中,且在后续逻辑中进行序列化时 失败

另有一点 建议 当我客户端远程到域名服务器时,需要考虑如果不是ip参数 需要考虑到域名dns解析,否则异常
2020/08/01 14:03:53.409|DEBUG|===== FastTunnel Client Start =====
2020/08/01 14:03:58.601|ERROR|An invalid IP address was specified.

代码位于处,可判断是否为ip或域名

@SpringHgui
Copy link
Collaborator

感谢提的建议

@SpringHgui
Copy link
Collaborator

客户端远程到域名服务器时,需要考虑如果不是ip参数 需要考虑到域名dns解析

现已支持

@SpringHgui SpringHgui pinned this issue Aug 3, 2020
@SpringHgui SpringHgui added the good first issue Good for newcomers label Aug 3, 2020
@SpringHgui SpringHgui unpinned this issue Aug 3, 2020
@Corps-Cy
Copy link
Author

Corps-Cy commented Aug 3, 2020

当客户端异常断开连接时 服务会存在崩溃关闭

@SpringHgui SpringHgui added the bug Something isn't working label Aug 3, 2020
@SpringHgui
Copy link
Collaborator

确实存在这个问题

@SpringHgui
Copy link
Collaborator

崩溃的问题已解决

@Corps-Cy
Copy link
Author

服务端仍存在异常退出问题,当客户端通过服务端后 由另一个客户端进行远程登陆,主动断开连接时 服务端会异常退出

[root@VM_0_7_centos NasService]# docker logs nasservice
2020/08/17 13:51:51.055|DEBUG|===== FastTunnel Server Start =====
2020/08/17 13:51:51.098|INFO|Application started. Press Ctrl+C to shut down.
2020/08/17 13:51:51.103|INFO|Hosting environment: Production envName=Production
2020/08/17 13:51:51.107|INFO|Content root path: /src contentRoot=/src
2020/08/17 13:58:50.023|ERROR|接收客户端异常 -> 退出登录 Connection reset by peer
2020/08/17 14:01:25.559|ERROR|接收客户端异常 -> 退出登录 Connection reset by peer
Unhandled exception. System.Net.Sockets.SocketException (32): Broken pipe
at System.Net.Sockets.Socket.Send(Byte[] buffer)
at FastTunnel.Core.Extensions.SocketExtension.Send[T](Socket socket, Message1 message) at FastTunnel.Core.Handlers.LoginHandler.<>c__DisplayClass7_0.<HandleLogin>b__0(Socket client, SSHHandlerArg local) at FastTunnel.Core.AsyncListener1.AcceptCallback(IAsyncResult ar)
at System.Net.LazyAsyncResult.Complete(IntPtr userToken)
at System.Net.ContextAwareResult.CompleteCallback()
at System.Net.ContextAwareResult.<>c.b__15_0(Object s)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Net.ContextAwareResult.Complete(IntPtr userToken)
at System.Net.LazyAsyncResult.ProtectedInvokeCallback(Object result, IntPtr userToken)
at System.Net.Sockets.BaseOverlappedAsyncResult.CompletionCallback(Int32 numBytes, SocketError errorCode)
at System.Net.Sockets.AcceptOverlappedAsyncResult.CompletionCallback(IntPtr acceptedFileDescriptor, Byte[] socketAddress, Int32 socketAddressLen, SocketError errorCode)
at System.Net.Sockets.SocketAsyncContext.AcceptOperation.InvokeCallback(Boolean allowPooling)
at System.Threading.ThreadPoolWorkQueue.Dispatch()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants