From owner-freebsd-hackers Fri Mar 2 10:44: 5 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from security.za.net (security.za.net [196.2.146.22]) by hub.freebsd.org (Postfix) with ESMTP id F07E037B719 for ; Fri, 2 Mar 2001 10:43:55 -0800 (PST) (envelope-from lists@security.za.net) Received: from localhost (lists@localhost) by security.za.net (8.9.3/8.9.3) with ESMTP id UAA68224 for ; Fri, 2 Mar 2001 20:43:48 +0200 (SAST) (envelope-from lists@security.za.net) Date: Fri, 2 Mar 2001 20:43:48 +0200 (SAST) From: Lists Account To: hackers@freebsd.org Subject: gcc -pthread / segfault problem Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Hi all, I was coding some stuff under a 4.2 box of mine here earlier today and I seem to have hit a very strange bug, I was wondering if anyone could help me out here. I wrote a bunch of pthread enabled code, when I tried to run the program, after I compiled it with -pthread (I had to with the threading code in there), it segfaulted, so I ran it through gdb, and it was segfaulting on malloc(). So I dug around some more, and eventually I tried changing that single line to a c++ new() call, no more problems... So for the sake of testing, I commented out all the code that needed pthreads, and compiled it again, without the -pthread flag, unchanged except for a function that I commented out, with the original malloc() call, no problems again. Then, with that function commented out, exactly was I had compiled it a few seconds earlier where it worked, I recompiled it, using the -pthread flag again, ran it, and sure enough it segfaults on the first malloc() it reaches. Is there a bug in the pthreads, or have I possibly missed something in the code that I need in there to make it work with -pthread? Any help or suggestions would be MUCH appreciated Thanks Andrew Alston To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message