From owner-freebsd-hackers Fri May 7 19:56: 9 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from luna.lyris.net (unknown [207.90.155.6]) by hub.freebsd.org (Postfix) with ESMTP id DCCEC153C0 for ; Fri, 7 May 1999 19:56:07 -0700 (PDT) (envelope-from kip@lyris.com) Received: from mail.lyris.com by luna.lyris.net (8.9.1b+Sun/SMI-SVR4) id TAA04899; Fri, 7 May 1999 19:50:34 -0700 (PDT) Received: from (luna.shelby.com [207.90.155.6]) by mail.lyris.com with SMTP (MailShield v1.50); Fri, 07 May 1999 19:55:50 -0700 Date: Fri, 7 May 1999 19:50:33 -0700 (PDT) From: X-Sender: kip@luna To: freebsd-hackers@freebsd.org Cc: john@lyris.com Subject: problems with recursion in libc_r Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-SMTP-HELO: luna X-SMTP-MAIL-FROM: kip@lyris.com X-SMTP-RCPT-TO: freebsd-hackers@freebsd.org,john@lyris.com X-SMTP-PEER-INFO: luna.shelby.com [207.90.155.6] Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG I am running FreeBSD 3.1 STABLE. There appears to be a problem with wrterror and wrtwarning from malloc/free when using threads because it calls _thread_fd_lock_ which in turn calls malloc etc. I have made a stopgap fix to the two functions, by having them return before calling write. I hope that someone else will have a more intelligent fix. A partial trace follows: #0 malloc (size=76) at /usr/src/lib/libc_r/../libc/stdlib/malloc.c:1066 #1 0x82ee633 in _thread_fd_table_init (fd=2) at /usr/src/lib/libc_r/uthread/uthread_fd.c:75 #2 0x82eea9b in _thread_fd_lock (fd=2, lock_type=2, timeout=0x0) at /usr/src/lib/libc_r/uthread/uthread_fd.c:272 #3 0x82e9aa9 in write (fd=2, buf=0xefbfdc27, nbytes=5) at /usr/src/lib/libc_r/uthread/uthread_write.c:58 #4 0x830f370 in wrtwarning (p=0x8399c81 "recursive call.\n") at /usr/src/lib/libc_r/../libc/stdlib/malloc.c:292 #5 0x8310050 in malloc (size=76) at /usr/src/lib/libc_r/../libc/stdlib/malloc.c:1069 #6 0x82ee633 in _thread_fd_table_init (fd=2) at /usr/src/lib/libc_r/uthread/uthread_fd.c:75 #7 0x82eea9b in _thread_fd_lock (fd=2, lock_type=2, timeout=0x0) at /usr/src/lib/libc_r/uthread/uthread_fd.c:272 #8 0x82e9aa9 in write (fd=2, buf=0xefbfdc27, nbytes=5) at /usr/src/lib/libc_r/uthread/uthread_write.c:58 #9 0x830f370 in wrtwarning (p=0x8399b95 "junk pointer, too high to make sense.\n") at /usr/src/lib/libc_r/../libc/stdlib/malloc.c:292 #10 0x830ffb9 in ifree (ptr=0x863c0a0) at /usr/src/lib/libc_r/../libc/stdlib/malloc.c:1043 #11 0x8310151 in free (ptr=0x863c0a0) at /usr/src/lib/libc_r/../libc/stdlib/malloc.c:1097 #12 0x82e2df1 in __builtin_vec_delete (ptr=0x863c0a0) -Kip To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message