[PD] SIGPIPE on iemnet's tcpserver

Antoine Villeret antoine.villeret at gmail.com
Tue Jul 2 13:39:03 CEST 2013

hi again,

just saw this thread right after posting mine :

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
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
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...)



do it yourself

2013/7/2 Antoine Villeret <antoine.villeret at 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
> [1] :
> http://stackoverflow.com/questions/108183/how-to-prevent-sigpipes-or-handle-them-properly
> --
> do it yourself
> http://antoine.villeret.free.fr
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20130702/32e5afab/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 10_raw_client.pd
Type: application/octet-stream
Size: 496 bytes
Desc: not available
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20130702/32e5afab/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: raw_client.pd
Type: application/octet-stream
Size: 3105 bytes
Desc: not available
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20130702/32e5afab/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: raw_server.pd
Type: application/octet-stream
Size: 2208 bytes
Desc: not available
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20130702/32e5afab/attachment-0002.obj>

More information about the Pd-list mailing list