hi again, 

just saw this thread right after posting mine : http://lists.puredata.info/pipermail/pd-list/2013-07/103236.html

sorry for bothering

here is attached three small patches that make PD crash
raw_client and raw_server work well together 
but when I try to connect more client (eg. 10 with 10_raw_client)
crash happens...

I realize that with iemnet's version of tcpclient/tcpserver,
if two client connect at the same time to server, only on receive data not the other, 
so I put a timeout to disconnect the client if no answer was received in a certain time and then reconnect 

i first make this with iemnet's tcpserver
and I got a SIGPIPE on the server side (see my previous post)
while I got SIGSEGV on the client side, here is the gdb backtrace : 

[New Thread 0x7fff7bfff700 (LWP 4478)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffc8ff9700 (LWP 4477)]
0x0000000000472963 in clock_set ()
(gdb) watchdog: signaling pd...


I think in the server side a 
signal(SIGPIPE, SIG_IGN);
could help but I don't know where to put it (in tcpserver.c ? in iemlnet_sender.c or somewhere else ?)

also I tested it with the mrpeach's version, it doesn't crash but the GUI hangs
gdb doesn't tell anything, it continue to show thread creation and exiting

also I'm using iemnet's first because it has a [port( method to change the binding port on the fly
and I made a rebinding routing to choose an available port in a certain range both in server and in client side
to prenvent connection error if port is still used after a crash for example

I don't know how to go further with this,
But I really need a reliable server for some project and for now I just have an headache :-)
please tell me how i can help fixing this (and please note that I don't know anything on tcp communication...)

cheers

antoine


--
do it yourself                      
http://antoine.villeret.free.fr


2013/7/2 Antoine Villeret <antoine.villeret@gmail.com>
hi all, 

I got some crashes with iemnet's tcpserver

gdb tells : 
[New Thread 0x7fffb9ffb700 (LWP 7828)]

Program received signal SIGPIPE, Broken pipe.
[Switching to Thread 0x7fffea57a700 (LWP 7713)]
0x00007ffff73b52cc in __libc_send (fd=<optimized out>, buf=<optimized out>, 
    n=<optimized out>, flags=<optimized out>)

and it happends when several (10) clients are connected at the same time and send some data

I guess tcpserver is trying to write to a broken pipe and receive a SIGPIPE signal which is not handle and then exit - so crashes pd

am I right ?
if so, is it possible to set the SIG_PIPE handler to SIG_IGN to avoid crash ?
I saw that here [1].

should I file a bug report ? 
if so where ?

best regards

antoine


--
do it yourself                      
http://antoine.villeret.free.fr