Date: Fri, 7 May 1999 19:50:33 -0700 (PDT) From: <kip@lyris.com> To: freebsd-hackers@freebsd.org Cc: john@lyris.com Subject: problems with recursion in libc_r Message-ID: <Pine.SOL.4.05.9905071944380.4894-100000@luna>
next in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.SOL.4.05.9905071944380.4894-100000>