From owner-freebsd-current Fri Jun 5 13:57:34 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id NAA12656 for freebsd-current-outgoing; Fri, 5 Jun 1998 13:57:34 -0700 (PDT) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from smtp02.primenet.com (daemon@smtp02.primenet.com [206.165.6.132]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id NAA12549 for ; Fri, 5 Jun 1998 13:56:51 -0700 (PDT) (envelope-from tlambert@usr08.primenet.com) Received: (from daemon@localhost) by smtp02.primenet.com (8.8.8/8.8.8) id NAA28263; Fri, 5 Jun 1998 13:56:43 -0700 (MST) Received: from usr08.primenet.com(206.165.6.208) via SMTP by smtp02.primenet.com, id smtpd028215; Fri Jun 5 13:56:34 1998 Received: (from tlambert@localhost) by usr08.primenet.com (8.8.5/8.8.5) id NAA03615; Fri, 5 Jun 1998 13:56:25 -0700 (MST) From: Terry Lambert Message-Id: <199806052056.NAA03615@usr08.primenet.com> Subject: Re: Problem with libc_r and blocking. To: chaos@oz.org (Simon Coggins) Date: Fri, 5 Jun 1998 20:56:24 +0000 (GMT) Cc: freebsd-current@FreeBSD.ORG In-Reply-To: from "Simon Coggins" at Jun 6, 98 00:27:49 am X-Mailer: ELM [version 2.4 PL25] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > I've come across a problem trying to use c_r on freebsd-current. In the > configure script of Roxen (http://www.roxen.com) web server, if you try and > make the package use freebsd's libc_r (it takes alittle hacking in configure) > when it find the threads functions correctly. But when it gets to test > how to set things non-blocking it freezes and locks up. > > I've attached the .c file of what configure is doing when this happends if you > compile this with > > gcc -pthread -D_THREAD_SAFE -o tst thread_test.c > > and run it it will lock up if you leave off -pthread it works correctly. > > Anyone out there have any idea? (are there plans to improve the threads > support in freebsd?) I was looking thru the archives and didn't see much > in the way of development info. Worked fine for me... hermes% cc -o thread_test thread_test.c hermes% ./thread_test Testing!!! set_nonblocking() set_nonblocking() hermes% hermes% cc -o thread_test -D_THREAD_SAFE thread_test.c -lc_r hermes% ./thread_test Testing!!! set_nonblocking() set_nonblocking() hermes% This is on my FreeBSD 2.2-STABLE (post 2.2.5, before the 2.2.6 release) box. The _THREAD_SAFE is not necessary on -current, and the -pthread isn't in my compiler (that I've been able to tell), but all it does is "-lc_r" before the implied "-lc".. the same thing I did explicitly, above, with the command I used. Supposedly, Julian Elisher checked in all of my and Jeremy Allison's patches to both 2.2.6 and -current. One of these patches dealt *precisely* with this problem; the ioctl was not wrapped. Other changes dealt with fcntl( , F_DUPFD, ), which was also not wrapped, huge changes to error reporting, and signal handling and other various changes. I presume you are running 2.2.5-release or earlier... if so, upgrade. If you plan on using C++ with threads, use gcc 2.8.x with Jeremy's patches for per thread exception stacks. This means you should get the code from -ports, NOT from FSF! And *DON'T* use egcs at all. Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message