From owner-freebsd-current@FreeBSD.ORG Thu Jun 5 07:04:53 2003 Return-Path: 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 0F0A237B405; Thu, 5 Jun 2003 07:04:53 -0700 (PDT) Received: from newsguy.com (smtp.newsguy.com [129.250.170.69]) by mx1.FreeBSD.org (Postfix) with ESMTP id ABAF043FE1; Thu, 5 Jun 2003 07:04:45 -0700 (PDT) (envelope-from kachun@newsguy.com) Received: (from root@localhost) by newsguy.com (8.9.1p2/8.9.1) id HAA99430; Thu, 5 Jun 2003 07:04:43 -0700 (PDT) Mail-From: owner-freebsd-sparc64@freebsd.org Wed Jun 4 16:56:59 2003 Received: from mx2.freebsd.org (mx2.freebsd.org [216.136.204.119]) by newsguy.com (8.9.1p2/8.9.1) with ESMTP id QAA68298 for ; Wed, 4 Jun 2003 16:56:59 -0700 (PDT) Received: from hub.freebsd.org (hub.freebsd.org [216.136.204.18]) by mx2.freebsd.org (Postfix) with ESMTP id 838C45728E; Wed, 4 Jun 2003 16:56:40 -0700 (PDT) (envelope-from owner-freebsd-sparc64@freebsd.org) Received: from hub.freebsd.org (localhost [127.0.0.1]) by hub.freebsd.org (Postfix) with ESMTP id 461FB37B405; Wed, 4 Jun 2003 16:56:40 -0700 (PDT) Delivered-To: freebsd-sparc64@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 854D537B404 for ; Wed, 4 Jun 2003 16:56:21 -0700 (PDT) Received: from mail.gmx.net (pop.gmx.net [213.165.64.20]) by mx1.FreeBSD.org (Postfix) with SMTP id 5C2C943F75 for ; Wed, 4 Jun 2003 16:56:18 -0700 (PDT) (envelope-from tmoestl@gmx.net) Received: (qmail 24605 invoked by uid 65534); 4 Jun 2003 23:56:16 -0000 Received: from p508E7CD9.dip.t-dialin.net (EHLO galatea.local) (80.142.124.217) by mail.gmx.net (mp012) with SMTP; 05 Jun 2003 01:56:16 +0200 Received: from tmm by galatea.local with local (Exim 4.20 #1) id 19Ni6y-0004vW-7C; Thu, 05 Jun 2003 01:56:08 +0200 Date: Thu, 5 Jun 2003 01:56:08 +0200 From: Thomas Moestl To: Kris Kennaway Message-ID: <20030604235607.GA682@crow.dom2ip.de> Mail-Followup-To: Kris Kennaway , Daniel Eischen , current@freebsd.org, sparc64@freebsd.org References: <20030602231543.GA28135@rot13.obsecurity.org> <20030604073036.GA35212@rot13.obsecurity.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="tKW2IUtsqtDRztdT" Content-Disposition: inline In-Reply-To: <20030604073036.GA35212@rot13.obsecurity.org> User-Agent: Mutt/1.4.1i X-BeenThere: freebsd-sparc64@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Sender: owner-freebsd-sparc64@freebsd.org Errors-To: owner-freebsd-sparc64@freebsd.org cc: Daniel Eischen cc: current@freebsd.org cc: sparc64@freebsd.org Subject: Re: phoenix crash in libc_r on sparc64 X-BeenThere: freebsd-current@freebsd.org List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jun 2003 14:04:53 -0000 --tKW2IUtsqtDRztdT Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, 2003/06/04 at 00:30:36 -0700, Kris Kennaway wrote: > On Mon, Jun 02, 2003 at 04:15:43PM -0700, Kris Kennaway wrote: > > phoenix on my sparc64 crashed while idle with the following: > > > > Fatal error '_waitq_insert: Already in queue' at line 321 in file /usr/src/lib/libc_r/uthread/uthread_priority_queue.c (errno = 2) > > > > Any ideas? It should have dropped a core - can you please take a look at it with gdb? > One of the libc_r tests seems to hang: > > Test static library: > -------------------------------------------------------------------------- > Test c_user c_system c_total chng > passed/FAILED h_user h_system h_total % chng > -------------------------------------------------------------------------- > hello_d 0.00 0.02 0.02 > passed > -------------------------------------------------------------------------- > hello_s 0.00 0.02 0.02 > passed > -------------------------------------------------------------------------- > join_leak_d 0.77 0.18 0.95 > passed > -------------------------------------------------------------------------- > mutex_d 9.08 92.42 101.50 > passed > -------------------------------------------------------------------------- > sem_d 0.01 0.02 0.02 > passed > -------------------------------------------------------------------------- > sigsuspend_d 0.00 0.02 0.02 > passed > -------------------------------------------------------------------------- > sigwait_d 0.00 0.02 0.02 > *** FAILED *** > -------------------------------------------------------------------------- > guard_s.pl > > It's been sitting there for hours now. This an unfortunate failure mode, which is caused by a fault on the stack while all signals are masked (by libc_r internals, I assume); the kernel will fail to store the user register windows on the stack, and because SIGILL is blocked, it cannot notify (or terminate) the process and is stuck trying to copy out the register windows over and over. > P.S. Why do 3 of the tests even fail on i386? The guard test includes constants which are machine- and compiler-specific, probably this broke due to a gcc upgrade. The sigwait test is killed by it's own SIGUSR1, and this behaviour actually looks correct to me (but I could easily be wrong, since the signal behaviour of pthreads seems to be quite complex). The propagate test failure is due to problems in libc (failing to use the underscored versions of functions overridden in libc_r). The attached patch should fix that; Daniel, does this look OK to you? - Thomas -- Thomas Moestl http://www.tu-bs.de/~y0015675/ http://people.FreeBSD.org/~tmm/ PGP fingerprint: 1C97 A604 2BD0 E492 51D0 9C0F 1FE6 4F1D 419C 776C --tKW2IUtsqtDRztdT Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="namespace.diff" Index: gen/sysconf.c =================================================================== RCS file: /vol/ncvs/src/lib/libc/gen/sysconf.c,v retrieving revision 1.20 diff -u -r1.20 sysconf.c --- gen/sysconf.c 17 Nov 2002 08:54:29 -0000 1.20 +++ gen/sysconf.c 4 Jun 2003 20:44:47 -0000 @@ -40,6 +40,7 @@ #include __FBSDID("$FreeBSD: src/lib/libc/gen/sysconf.c,v 1.20 2002/11/17 08:54:29 dougb Exp $"); +#include "namespace.h" #include #include #include @@ -52,6 +53,7 @@ #include /* we just need the limits */ #include #include +#include "un-namespace.h" #include "../stdlib/atexit.h" #include "../stdtime/tzfile.h" @@ -560,7 +562,7 @@ value = socket(PF_INET6, SOCK_DGRAM, 0); errno = sverrno; if (value >= 0) { - close(value); + _close(value); return (200112L); } else return (0); Index: include/namespace.h =================================================================== RCS file: /vol/ncvs/src/lib/libc/include/namespace.h,v retrieving revision 1.16 diff -u -r1.16 namespace.h --- include/namespace.h 1 May 2003 19:03:13 -0000 1.16 +++ include/namespace.h 4 Jun 2003 20:38:29 -0000 @@ -122,8 +122,10 @@ /*#define sigaction _sigaction*/ #define sigprocmask _sigprocmask #define sigsuspend _sigsuspend +#define sleep _sleep #define socket _socket #define socketpair _socketpair +#define wait _wait #define wait4 _wait4 #define waitpid _waitpid #define write _write @@ -154,10 +156,8 @@ #define sigpending _sigpending #define sigreturn _sigreturn #define sigsetmask _sigsetmask -#define sleep _sleep #define system _system #define tcdrain _tcdrain -#define wait _wait #endif #endif /* _NAMESPACE_H_ */ Index: include/un-namespace.h =================================================================== RCS file: /vol/ncvs/src/lib/libc/include/un-namespace.h,v retrieving revision 1.13 diff -u -r1.13 un-namespace.h --- include/un-namespace.h 1 May 2003 19:03:13 -0000 1.13 +++ include/un-namespace.h 4 Jun 2003 20:44:04 -0000 @@ -103,8 +103,10 @@ #undef sigaction #undef sigprocmask #undef sigsuspend +#undef sleep #undef socket #undef socketpair +#undef wait #undef wait4 #undef waitpid #undef write @@ -127,10 +129,8 @@ #undef sigpending #undef sigreturn #undef sigsetmask -#undef sleep #undef system #undef tcdrain -#undef wait #endif /* 0 */ #ifdef _SIGNAL_H_ Index: net/rcmdsh.c =================================================================== RCS file: /vol/ncvs/src/lib/libc/net/rcmdsh.c,v retrieving revision 1.5 diff -u -r1.5 rcmdsh.c --- net/rcmdsh.c 27 Feb 2003 13:40:00 -0000 1.5 +++ net/rcmdsh.c 4 Jun 2003 21:01:20 -0000 @@ -36,6 +36,7 @@ #include __FBSDID("$FreeBSD: src/lib/libc/net/rcmdsh.c,v 1.5 2003/02/27 13:40:00 nectar Exp $"); +#include "namespace.h" #include #include #include @@ -48,6 +49,7 @@ #include #include #include +#include "un-namespace.h" #ifndef _PATH_RSH #define _PATH_RSH "/usr/bin/rsh" @@ -117,7 +119,7 @@ /* * Child. We use sp[1] to be stdin/stdout, and close sp[0]. */ - (void)close(sp[0]); + (void)_close(sp[0]); if (dup2(sp[1], 0) == -1 || dup2(0, 1) == -1) { perror("rcmdsh: dup2 failed"); _exit(255); @@ -161,9 +163,9 @@ _exit(255); } else { /* Parent. close sp[1], return sp[0]. */ - (void)close(sp[1]); + (void)_close(sp[1]); /* Reap child. */ - (void)wait(NULL); + (void)_wait(NULL); return (sp[0]); } /* NOTREACHED */ Index: rpc/getnetconfig.c =================================================================== RCS file: /vol/ncvs/src/lib/libc/rpc/getnetconfig.c,v retrieving revision 1.9 diff -u -r1.9 getnetconfig.c --- rpc/getnetconfig.c 16 Feb 2003 17:29:10 -0000 1.9 +++ rpc/getnetconfig.c 4 Jun 2003 20:45:42 -0000 @@ -428,7 +428,7 @@ fprintf(stderr, "See UPDATING entry 20021216 for details.\n"); fprintf(stderr, "Continuing in 10 seconds\n\n"); fprintf(stderr, "This warning will be removed 20030301\n"); - sleep(10); + _sleep(10); } --tKW2IUtsqtDRztdT Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ freebsd-sparc64@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-sparc64 To unsubscribe, send any mail to "freebsd-sparc64-unsubscribe@freebsd.org" --tKW2IUtsqtDRztdT--