From owner-freebsd-smp Wed Jan 24 1:17: 3 2001 Delivered-To: freebsd-smp@freebsd.org Received: from mail.west.se (unknown [194.52.130.37]) by hub.freebsd.org (Postfix) with ESMTP id D69E137B404 for ; Wed, 24 Jan 2001 01:16:44 -0800 (PST) Received: from grumpy.west.se (IDENT:ema@grumpy [192.168.10.11]) by mail.west.se (8.11.0/8.9.3) with ESMTP id f0O9GVd04053 for ; Wed, 24 Jan 2001 10:16:33 +0100 (CET) (envelope-from erikmattsson@home.se) Date: Wed, 24 Jan 2001 10:16:30 +0100 (CET) From: Erik Mattsson X-Sender: Reply-To: To: Subject: Bug (?) with sockets/pthreads/freebsd4.2-stable Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-smp@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org 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