-
Notifications
You must be signed in to change notification settings - Fork 59
Server segfault after client leaves (opengl3) #40
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
Comments
Seems to be an issue with releasing the render target on the server. This
code used to work on Windows (openGL version). When I have a chance, i'll
take a look to see if it's still working fine. If it is, then that means
it's a Linux specific issue :/
…On Thu., Oct. 27, 2022, 22:00 hinxx ***@***.***> wrote:
After compiling and running the server and client (#39
<#39> ) under Linux the
server dies if the client leaves.
Code was compiled on Linux Mint 20 using system glfw and opengl3 libraries.
Here is the backtrace from gdb:
Thread 4 "netimgui_server" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7ffff2819700 (LWP 373138)]
0x00007ffff74e5b69 in ?? () from /lib/x86_64-linux-gnu/libGLdispatch.so.0
(gdb) bt
#0 0x00007ffff74e5b69 in ?? () from /lib/x86_64-linux-gnu/libGLdispatch.so.0
#1 0x00005555556991b9 in NetImguiServer::App::HAL_DestroyRenderTarget ***@***.***: 0x0, ***@***.***: 0x4) at GlfwGL3/NetImguiServer_HAL_GL3.cpp:92
#2 0x00005555556747b2 in NetImguiServer::RemoteClient::Client::Reset (this=0x555555c30bb8) at NetImguiServer_RemoteClient.cpp:137
#3 0x0000555555670dd9 in NetImguiServer::Network::Communications_ClientExchangeLoop (pClientSocket=0x7fffec0014b0, pClient=0x555555c30bb8) at NetImguiServer_Network.cpp:198
#4 0x0000555555673d56 in std::__invoke_impl<void, void (*)(NetImgui::Internal::Network::SocketInfo*, NetImguiServer::RemoteClient::Client*), NetImgui::Internal::Network::SocketInfo*, NetImguiServer::RemoteClient::Client*> (
***@***.***: 0x555555670c96 <NetImguiServer::Network::Communications_ClientExchangeLoop(NetImgui::Internal::Network::SocketInfo*, NetImguiServer::RemoteClient::Client*)>)
at /usr/include/c++/9/bits/invoke.h:60
#5 0x0000555555673c03 in std::__invoke<void (*)(NetImgui::Internal::Network::SocketInfo*, NetImguiServer::RemoteClient::Client*), NetImgui::Internal::Network::SocketInfo*, NetImguiServer::RemoteClient::Client*> (
***@***.***: 0x555555670c96 <NetImguiServer::Network::Communications_ClientExchangeLoop(NetImgui::Internal::Network::SocketInfo*, NetImguiServer::RemoteClient::Client*)>)
at /usr/include/c++/9/bits/invoke.h:95
#6 0x0000555555673a91 in std::thread::_Invoker<std::tuple<void (*)(NetImgui::Internal::Network::SocketInfo*, NetImguiServer::RemoteClient::Client*), NetImgui::Internal::Network::SocketInfo*, NetImguiServer::RemoteClient::Client*> >::_M_invoke<0ul, 1ul, 2ul> (this=0x7fffec0014d8) at /usr/include/c++/9/thread:244
#7 0x00005555556739e7 in std::thread::_Invoker<std::tuple<void (*)(NetImgui::Internal::Network::SocketInfo*, NetImguiServer::RemoteClient::Client*), NetImgui::Internal::Network::SocketInfo*, NetImguiServer::RemoteClient::Client*> >::operator() (this=0x7fffec0014d8) at /usr/include/c++/9/thread:251
#8 0x0000555555673976 in std::thread::_State_impl<std::thread::_Invoker<std::tuple<void (*)(NetImgui::Internal::Network::SocketInfo*, NetImguiServer::RemoteClient::Client*), NetImgui::Internal::Network::SocketInfo*, NetImguiServer::RemoteClient::Client*> > >::_M_run (this=0x7fffec0014d0) at /usr/include/c++/9/thread:195
#9 0x00007ffff7e2fde4 in ?? () from /lib/x86_64-linux-gnu/libstdc++.so.6
#10 0x00007ffff7bd4609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#11 0x00007ffff7af7133 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
(gdb) f 1
#1 0x00005555556991b9 in NetImguiServer::App::HAL_DestroyRenderTarget ***@***.***: 0x0, ***@***.***: 0x4) at GlfwGL3/NetImguiServer_HAL_GL3.cpp:92
92 glDeleteFramebuffers(1, &pRT);
(gdb) p pRT
$1 = 1
(gdb) p *pRT
Cannot access memory at address 0x1
—
Reply to this email directly, view it on GitHub
<#40>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AESBPY3LDA5CTYDDRVH6JPTWFJ4GFANCNFSM6AAAAAARQBEGBQ>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
I've been looking into the issue a bit more myself. Here is some info from the I tried to comment out the
and then just close the server app while the client is connected and no segfault appeared. |
After a dirty hack found in the hinxx.txt I get no more segfaults. The |
I only have access to my cellphone at the moment, so I couldn't
investigate, but when you first reported it, GPU resources release by other
than the 'main' thread was my guess. It should delegate resources
RenderTarget release like I do with textures, or call 'Reset' on the main
thread. It should be easy to fix. It will look into it next week.
…On Fri., Oct. 28, 2022, 23:44 hinxx ***@***.***> wrote:
After a dirty hack found in the hinxx.txt
<https://github.com/sammyfreg/netImgui/files/9889310/hinxx.txt> I get no
more segfaults.
The UpdateRemoteContent() calls the Client::Reset() after the comm thread
sets the (newly introduced) flag client flag mDestroy instead of it
calling pClient->Reset();.
—
Reply to this email directly, view it on GitHub
<#40 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AESBPY3Q7OXQ57IY6OCMSTDWFPRDPANCNFSM6AAAAAARQBEGBQ>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
I have fixes the issue in c707101, using something similar to what you already tried. I'm happy to see that the NetImguiServer runs fine on linux! |
After compiling and running the server and client (#39 ) under Linux the server dies if the client leaves.
Code was compiled on Linux Mint 20 using system glfw and opengl3 libraries.
Here is the backtrace from
gdb
:The text was updated successfully, but these errors were encountered: