From owner-freebsd-current Tue Nov 5 12: 5:33 2002 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E192337B401 for ; Tue, 5 Nov 2002 12:05:31 -0800 (PST) Received: from isilon.com (isilon.com [65.101.129.58]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4425A43E3B for ; Tue, 5 Nov 2002 12:05:31 -0800 (PST) (envelope-from chad@isilon.com) Received: from gateway.isilon.com (gateway.isilon.com [172.16.1.200]) by isilon.com (8.12.2/8.11.1) with ESMTP id gA5K5U1l061128; Tue, 5 Nov 2002 12:05:30 -0800 (PST) (envelope-from chad@isilon.com) Date: Tue, 5 Nov 2002 12:05:30 -0800 (PST) From: Chad Parry To: Steve Kargl Cc: freebsd-current@FreeBSD.ORG Subject: Re: Hello World stuck in infinite loop In-Reply-To: <20021105194529.GA23849@troutmask.apl.washington.edu> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Tue, 5 Nov 2002, Steve Kargl wrote: > What happens if you use > > gcc -v -o hello -pthread hello.c > > /usr/bin/ld -V -dynamic-linker /usr/libexec/ld-elf.so.1 -o h1 /usr/lib/crt1.o > /usr/lib/crti.o /usr/lib/crtbegin.o -L/usr/lib /var/tmp/ccjfgwUn.o -lgcc > -lc_r -lc -lgcc /usr/lib/crtend.o /usr/lib/crtn.o > > Note the order of the libraries. I got the same result. The library order is different, like you said. But libc_r still takes precedence over libc, so the behavior is unchanged. I could solve the problem, of course, by just not linking in the pthreads library. But I have some real-world executables that are vulnerable to this same bug, and they actually need pthreads. So no linker tricks will help me in the end. BTW, I tried to reproduce this bug on a more up-to-date snapshot of current, but I couldn't even build libc_r. Where is the __pselect function (referenced in uthread_pselect.c) defined? -- chad To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message