From owner-freebsd-current Sat Jan 4 14: 3:20 2003 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B1E3437B401; Sat, 4 Jan 2003 14:03:17 -0800 (PST) Received: from fledge.watson.org (fledge.watson.org [204.156.12.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2CE5943E4A; Sat, 4 Jan 2003 14:03:17 -0800 (PST) (envelope-from robert@fledge.watson.org) Received: from fledge.watson.org (fledge.pr.watson.org [192.0.2.3]) by fledge.watson.org (8.12.6/8.12.5) with SMTP id h04M3G1Z084373; Sat, 4 Jan 2003 17:03:16 -0500 (EST) (envelope-from robert@fledge.watson.org) Date: Sat, 4 Jan 2003 17:03:16 -0500 (EST) From: Robert Watson X-Sender: robert@fledge.watson.org To: current@FreeBSD.org Cc: jmallett@FreeBSD.org Subject: pthread ^T problem on recent -CURRENT: death in libc_r mutex Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Juli Mallett pointed me at the following reproduceable problem on my -current notebook with userland/kernel dated Dec 29: paprika:~/freebsd/test/pthread> ./test 1 2 1 2 1 2 load: 0.02 cmd: test 910 [running] 0.00u 0.01s 0% 824k 1 Bus error (core dumped) paprika:~/freebsd/test/pthread> ./test 1 2 load: 0.23 cmd: test 914 [running] 0.00u 0.01s 0% 824k 1 Bus error (core dumped) Hitting ^T to get status information seems to break output following the first printf after the information display. Here's the stack trace from the test program from the first execution above: (gdb) bt #0 0x2807a559 in _pthread_mutex_trylock () from /usr/lib/libc_r.so.5 #1 0x2807a71c in _pthread_mutex_lock () from /usr/lib/libc_r.so.5 #2 0x2813598f in flockfile () from /usr/lib/libc.so.5 #3 0x2812bfd0 in vfprintf () from /usr/lib/libc.so.5 #4 0x2811a552 in printf () from /usr/lib/libc.so.5 #5 0x0804860d in thread2 (arg=0x0) at test.c:22 #6 0x280732ce in _thread_start () from /usr/lib/libc_r.so.5 The program source is attached below. Robert N M Watson FreeBSD Core Team, TrustedBSD Projects robert@fledge.watson.org Network Associates Laboratories #include #include #include void * thread1(void *arg) { while (1) { sleep(2); printf("1\n"); } } void * thread2(void *arg) { sleep(1); while (1) { sleep(2); printf("2\n"); } } int main(int argc, char *argv[]) { pthread_t t1, t2; int error; error = pthread_create(&t1, NULL, thread1, NULL); error = pthread_create(&t2, NULL, thread2, NULL); error = pthread_join(t1, NULL); error = pthread_join(t2, NULL); return (0); } To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message