From owner-freebsd-ppc@FreeBSD.ORG Thu Aug 3 03:56:05 2006 Return-Path: X-Original-To: freebsd-ppc@freebsd.org Delivered-To: freebsd-ppc@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4C99416A5B3; Thu, 3 Aug 2006 03:56:05 +0000 (UTC) (envelope-from marcel@xcllnt.net) Received: from ns1.xcllnt.net (209-128-86-226.BAYAREA.NET [209.128.86.226]) by mx1.FreeBSD.org (Postfix) with ESMTP id 281DF43D5C; Thu, 3 Aug 2006 03:55:56 +0000 (GMT) (envelope-from marcel@xcllnt.net) Received: from [192.168.5.252] (dhcp52.wlan.xcllnt.net [192.168.5.252]) by ns1.xcllnt.net (8.13.6/8.13.6) with ESMTP id k733tuUp020448; Wed, 2 Aug 2006 20:55:56 -0700 (PDT) (envelope-from marcel@xcllnt.net) In-Reply-To: <44D13BC7.8010309@FreeBSD.org> References: <44D12AC0.90009@sippysoft.com> <20060802230803.GA32778@troutmask.apl.washington.edu> <44D13BC7.8010309@FreeBSD.org> Mime-Version: 1.0 (Apple Message framework v752.2) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: Content-Transfer-Encoding: 7bit From: Marcel Moolenaar Date: Wed, 2 Aug 2006 20:55:44 -0700 To: Maxim Sobolev X-Mailer: Apple Mail (2.752.2) Cc: "current@freebsd.org" , Steve Kargl , freebsd-ppc@freebsd.org Subject: Re: Looks like threading is b0rken on FreeBSD/powerpc X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Aug 2006 03:56:05 -0000 On Aug 2, 2006, at 4:56 PM, Maxim Sobolev wrote: > Steve Kargl wrote: >> On Wed, Aug 02, 2006 at 03:44:16PM -0700, Maxim Sobolev wrote: >>> Apparently threading is b0rken on the FreeBSD/powerpc - csup(8) >>> dumps core with seg 11. The same csup(8) version compiled on 6.0 >>> works just fine on the same 7-CURRENT kernel. >>> >> What does ldd show? > > Here is the backtrace: > > Loaded symbols for /libexec/ld-elf.so.1 > #0 0x2183f7b4 in tls_get_addr_common (dtvp=0x1a31490, index=2, > offset=4294934528) at rtld.c:2663 > 2663 if (dtv[0] != tls_dtv_generation) { > (gdb) bt > #0 0x2183f7b4 in tls_get_addr_common (dtvp=0x1a31490, index=2, > offset=4294934528) at rtld.c:2663 > #1 0x218397f8 in __tls_get_addr (ti=0x21bbf0e8) at /usr/src/ > libexec/rtld-elf/powerpc/reloc.c:577 > #2 0x21ad3ef8 in choose_arena () at /usr/src/lib/libc/stdlib/ > malloc.c:1422 > #3 0x21ad8f40 in imalloc (size=480) at /usr/src/lib/libc/stdlib/ > malloc.c:2662 > #4 0x21ada810 in malloc (size=480) at /usr/src/lib/libc/stdlib/ > malloc.c:3422 > #5 0x21a1ba90 in _thr_alloc (curthread=0x1a502e0) at /usr/src/lib/ > libpthread/thread/thr_kern.c:2369 > #6 0x21a021b0 in _pthread_create (thread=0x1ab05a0, attr=0x0, > start_routine=0x18109dc , > arg=0x1ab0580) at /usr/src/lib/libpthread/thread/thr_create.c:110 > #7 0x01810640 in mux_init (m=0x1ab0580) at /usr/src/usr.bin/ > csup/../../contrib/csup/mux.c:661 > #8 0x0180f8b0 in mux_open (sock=3, chan=0x7fffdad8) at /usr/src/ > usr.bin/csup/../../contrib/csup/mux.c:328 > #9 0x018146a4 in proto_mux (config=0x1a118c0) at /usr/src/usr.bin/ > csup/../../contrib/csup/proto.c:555 > #10 0x018148f4 in proto_run (config=0x1a118c0) at /usr/src/usr.bin/ > csup/../../contrib/csup/proto.c:617 > #11 0x0180dddc in main (argc=1, argv=0x7fffdcac) at /usr/src/ > usr.bin/csup/../../contrib/csup/main.c:314 > (gdb) print dtv > $1 = (Elf_Addr *) 0x0 > (gdb) This is probably the same bug that affects ia64. See PR ia64/91846. I think the following should work-around it: Index: malloc.c =================================================================== RCS file: /home/ncvs/src/lib/libc/stdlib/malloc.c,v retrieving revision 1.132 diff -u -r1.132 malloc.c --- malloc.c 27 Jul 2006 19:09:32 -0000 1.132 +++ malloc.c 3 Aug 2006 03:55:03 -0000 @@ -279,6 +279,7 @@ # define QUANTUM_2POW_MIN 4 # define SIZEOF_PTR 4 # define USE_BRK +# define NO_TLS #endif /* sizeof(int) == (1 << SIZEOF_INT_2POW). */ FYI, -- Marcel Moolenaar USPA: A-39004 marcel@xcllnt.net