Date: Wed, 24 Jan 2001 10:16:30 +0100 (CET) From: Erik Mattsson <erikmattsson@home.se> To: <freebsd-smp@FreeBSD.ORG> Subject: Bug (?) with sockets/pthreads/freebsd4.2-stable Message-ID: <Pine.LNX.4.30.0101241005590.2767-100000@grumpy.west.se>
next in thread | raw e-mail | index | archive | help
Im having problem using threads and sockets on a freebsd smp box. Ive mailed freebsd-questions without any reply, and I wonder if this is a bug in freebsd/smp/pthreads ? (I was told on a newsgroup that this behaviour might be a bug in the OS) The thing is that I've executed the signal(SIGPIPE, SIG_IGN) but still get SIGPIPE's thrown at the program. This shouldnt be possible should it ? Im sending the complete mail (that I posted on questions) --------------------------------------------------------------- A little background: A server listens on sockets (each socket is placed in a thread), the server replies to the incoming data and send the info over the same socket. (and the same thread) But sometimes it also sends data over sockets in another thread, and it seems that when this happens the program 'hangs'. ( it happens every one of 10 times) ((relaying data from another socket)) Ive debugged my program and found that the thread hangs on the send() method. It never finishs and because of that some mutex's are still locked the whole server hangs. But when Im using gdb, I find that the program receives a SIGPIPE even though Ive told the program to ignore it; signal(SIGPIPE, SIG_IGN). Is it necessary to run this signal() in every thread, or does it suffice once in the process ? (ive tried both approaches, with no luck) I'm wondering : if it is possible to send() and recv() on a socket at the same time in different threads ? if it is possible to get SIGPIPE's even though you executed signal(SIGPIPE, SIG_IGN) in every thread ? if it is possible that a send() call can hang a thread ? Could anyone shed some light on this ? Im using pthreads, freebsd4.2 stable, SMP, dual 600 mhz, 512 mb. (what other info do you need ?) Any help is appreciated ! Erik Mattsson ps. It would be nice if you could bcc my mail address since Im not subscribed to this list..(erikmattsson@home.se) To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-smp" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.LNX.4.30.0101241005590.2767-100000>