Re: Looks like threading is b0rken on FreeBSD/powerpc

From: Marcel Moolenaar <marcel_at_xcllnt.net>
Date: Wed, 2 Aug 2006 20:55:44 -0700
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 <sender_loop>,
>     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
_at__at_ -279,6 +279,7 _at__at_
#  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_at_xcllnt.net
Received on Thu Aug 03 2006 - 01:56:05 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:58 UTC