output : ~/projects/websocket/server master
./server
[✓] | Created Server Successfully !
[!] | 3 3
[✓] | client ip : 2.0.230.76:3000 connected to the server
[!] | binary tree created
[✓] | path route/index.html
[✓] | file opened successfully
[✓] | could seek end
[✓] | file length is 276
[✓] | could seek set
[✓] | memory allocated successfully
[✓] | file content read successfully
[!] | json formated
[!] | 276 length of file
[!] | 3 3
[✓] | client ip : 2.0.230.86:3000 connected to the server
Segmentation fault (core dumped) ( segfaults when asking a new connection to the socket)
#websocket segfault cause ?
1 messages · Page 1 of 1 (latest)
When your question is answered use !solved to mark the question as resolved.
Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.
Running this with a debugger or address sanitizer will tell you exactly when and where the issue happens
gdb ?
yes, that's an example of a debugger
might want to double-check that the arguments you're passing into it are correct then
you can set a breakpoint at the pthread_create call and inspect the variables with the debugger
bet
but NULL args would still induce in a pthread_create no ?
since segfault is on pthread_create and not handle_client
depends on the argument
its my binary tree implementation for the route thats causing a memory leak
im creating a binary tree on the server for each client connection whilst it should be a global variable that only is instanciated once
im probably doing some out of bounds stuff on the binary tree
!solved