From owner-freebsd-threads@FreeBSD.ORG Mon Jun 30 20:02:47 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 67B0337B401 for ; Mon, 30 Jun 2003 20:02:47 -0700 (PDT) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id BFB9843F75 for ; Mon, 30 Jun 2003 20:02:46 -0700 (PDT) (envelope-from eischen@vigrid.com) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mail.pcnet.com (8.12.8/8.12.1) with ESMTP id h6132jAI004906; Mon, 30 Jun 2003 23:02:45 -0400 (EDT) Date: Mon, 30 Jun 2003 23:02:45 -0400 (EDT) From: Daniel Eischen X-Sender: eischen@pcnet5.pcnet.com To: xiong jinshan In-Reply-To: <20030701022915.50290.qmail@web80503.mail.yahoo.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: threads@freebsd.org Subject: Re: About the kse signal process X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: deischen@freebsd.org List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Jul 2003 03:02:47 -0000 On Mon, 30 Jun 2003, xiong jinshan wrote: > > --- Daniel Eischen wrote: > > On Mon, 30 Jun 2003, xiong jinshan wrote: > > > It received the SIGSEGV before the main() when I > > > linked with libc_r;(. > > > > I think you have something screwed up somewhere. > > How did you compile and link it? > > Yes, it maybe my fault. > > If I link libc_r with static, it works correctly. > If I link it with dynamic, segv occurs. > If I not linked c_r, th_func() couldn't received the > alarm. > > Why must it be linked with static mode? Does it mean > the native c library in release 5.1 not reentrant? It doesn't have to be statically linked. Are you explicitly using -lc? (don't!) In 5.x, you link threaded programs (if linking against libc_r) with: gcc -o app app.c -lc_r Or, using the deprecated -pthread option: gcc -o app -pthread app.c As I said, it works here for me on -current. It doesn't look like anything has changed in libc_r since 5.1. -- Dan Eischen