SFML community forums
Help => Network => Topic started by: KageJittai on April 12, 2011, 03:49:21 am
-
I get this backtrace:
Program received signal SIGPIPE, Broken pipe.
0x00007ffff6d37812 in __libc_send (fd=<value optimized out>, buf=0x6388b0, n=6, flags=<value optimized out>)
at ../sysdeps/unix/sysv/linux/x86_64/send.c:28
28 ../sysdeps/unix/sysv/linux/x86_64/send.c: No such file or directory.
in ../sysdeps/unix/sysv/linux/x86_64/send.c
(gdb) bt
#0 0x00007ffff6d37812 in __libc_send (fd=<value optimized out>, buf=0x6388b0, n=6, flags=<value optimized out>)
at ../sysdeps/unix/sysv/linux/x86_64/send.c:28
#1 0x00007ffff7784a9c in sf::SocketTCP::Send(char const*, unsigned long) () from /usr/lib/libsfml-network.so.1.6
#2 0x00007ffff7784ba6 in sf::SocketTCP::Send(sf::Packet&) () from /usr/lib/libsfml-network.so.1.6
#3 0x0000000000413da9 in Packet::send(sf::SocketTCP) ()
#4 0x0000000000410ded in Client::update() ()
#5 0x0000000000413183 in Server::update() ()
#6 0x0000000000412c22 in main ()
When I close my client. When I try to send the next packet it crashes, even if I perform a SocketTCP::IsValid() check... it wasn't doing this earlier and I have no idea what I changed to make it not work...
Source code can be found here: https://gitorious.org/plasma-game/plasmaserv/trees/master/src
-
Source code can be found here: https://gitorious.org/plasma-game/plasmaserv/trees/master/src
Do you really expect us to browse your entire project to find what's wrong? ;)
A complete (compilable and executable) and minimal source code that reproduces the problem would be much more helpful.
-
Actually, I found the issue, it was gdb, it wasn't a crash at all... gdb apparently stops on any signal sent by the OS. Typing "continue" works, but I wish I knew how to turn this off.
-
Source code can be found here: https://gitorious.org/plasma-game/plasmaserv/trees/master/src
Do you really expect us to browse your entire project to find what's wrong? ;)
A complete (compilable and executable) and minimal source code that reproduces the problem would be much more helpful.
I would had produced a example if I could, but I couldn't reproduce it in the testing I was going, mainly cause it wasn't a bug... it was a feature :roll:
-
It's indeed a bug. A broken pipe signal occurs when you try, for example, to send data over a socket that isn't bound anymore -- like a broken pipe ;). The callstack exactly reveals that situation.
Do not call Send() on broken sockets.