From owner-freebsd-hackers@FreeBSD.ORG Sun Jan 2 06:15:34 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B25AB106566C for ; Sun, 2 Jan 2011 06:15:34 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com [209.85.210.182]) by mx1.freebsd.org (Postfix) with ESMTP id 8AD068FC0A for ; Sun, 2 Jan 2011 06:15:34 +0000 (UTC) Received: by iyb26 with SMTP id 26so11804177iyb.13 for ; Sat, 01 Jan 2011 22:15:33 -0800 (PST) Received: by 10.231.16.131 with SMTP id o3mr3214994iba.5.1293948933697; Sat, 01 Jan 2011 22:15:33 -0800 (PST) MIME-Version: 1.0 Received: by 10.231.178.195 with HTTP; Sat, 1 Jan 2011 22:15:13 -0800 (PST) From: Eitan Adler Date: Sun, 2 Jan 2011 01:15:13 -0500 Message-ID: To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset=UTF-8 Subject: [patch] have rtprio check that arguments are numeric; change atoi to strtol X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Jan 2011 06:15:34 -0000 When looking at the rtprio(1) source I noticed that the dg in revision 3291 has indicated that he wanted to check to ensure that the user provided priority was numeric. Also the man page for atoi says the function is deprecated - so I replaced those functions as well. Index: rtprio.c =================================================================== --- rtprio.c (revision 216679) +++ rtprio.c (working copy) @@ -56,6 +56,7 @@ char *p; int proc = 0; struct rtprio rtp; + int c; /* find basename */ if ((p = rindex(argv[0], '/')) == NULL) @@ -70,8 +71,10 @@ switch (argc) { case 2: - proc = abs(atoi(argv[1])); /* Should check if numeric - * arg! */ + for (c=0; c < strlen(argv[1]); ++c) + if (!isdigit(argv[1][c])) + errx(1,"%s", "Priority should be a number"); + proc = (int)strtol(argv[1], (char **)NULL, 10); /* FALLTHROUGH */ case 1: if (rtprio(RTP_LOOKUP, proc, &rtp) != 0) @@ -104,7 +107,10 @@ break; } } else { - rtp.prio = atoi(argv[1]); + for (c=0; c < strlen(argv[1]); ++c) + if (!isdigit(argv[1][c])) + errx(1,"%s", "Priority should be a number"); + rtp.prio = (int)strtol(argv[1], (char **)NULL, 10); } } else { usage(); @@ -112,7 +118,7 @@ } if (argv[2][0] == '-') - proc = -atoi(argv[2]); + proc = -(int)strtol(argv[2], (char **)NULL, 10); if (rtprio(RTP_SET, proc, &rtp) != 0) err(1, "%s", argv[0]); -- Eitan Adler From owner-freebsd-hackers@FreeBSD.ORG Sun Jan 2 07:19:16 2011 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F37AA106566C for ; Sun, 2 Jan 2011 07:19:16 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com [209.85.210.182]) by mx1.freebsd.org (Postfix) with ESMTP id CB9A78FC13 for ; Sun, 2 Jan 2011 07:19:16 +0000 (UTC) Received: by iyb26 with SMTP id 26so11825356iyb.13 for ; Sat, 01 Jan 2011 23:19:16 -0800 (PST) Received: by 10.231.16.131 with SMTP id o3mr3258963iba.5.1293952756108; Sat, 01 Jan 2011 23:19:16 -0800 (PST) MIME-Version: 1.0 Received: by 10.231.178.195 with HTTP; Sat, 1 Jan 2011 23:18:55 -0800 (PST) From: Eitan Adler Date: Sun, 2 Jan 2011 02:18:55 -0500 Message-ID: To: hackers@freebsd.org Content-Type: text/plain; charset=UTF-8 Cc: Subject: [patch] rtprio/idprio should use basename(3) instead of acting on its own X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Jan 2011 07:19:17 -0000 Index: rtprio.c =================================================================== --- rtprio.c (revision 216884) +++ rtprio.c (working copy) @@ -41,6 +41,7 @@ #include #include +#include #include #include #include @@ -57,11 +58,7 @@ int proc = 0; struct rtprio rtp; - /* find basename */ - if ((p = rindex(argv[0], '/')) == NULL) - p = argv[0]; - else - ++p; + p = basename(argv[0]); if (!strcmp(p, "rtprio")) rtp.type = RTP_PRIO_REALTIME; -- Eitan Adler From owner-freebsd-hackers@FreeBSD.ORG Sun Jan 2 07:37:22 2011 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 550291065670; Sun, 2 Jan 2011 07:37:22 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com [209.85.210.182]) by mx1.freebsd.org (Postfix) with ESMTP id B3BDC8FC1E; Sun, 2 Jan 2011 07:37:21 +0000 (UTC) Received: by iyb26 with SMTP id 26so11830945iyb.13 for ; Sat, 01 Jan 2011 23:37:21 -0800 (PST) Received: by 10.231.17.205 with SMTP id t13mr19104624iba.80.1293953841250; Sat, 01 Jan 2011 23:37:21 -0800 (PST) MIME-Version: 1.0 Received: by 10.231.178.195 with HTTP; Sat, 1 Jan 2011 23:37:01 -0800 (PST) From: Eitan Adler Date: Sun, 2 Jan 2011 02:37:01 -0500 Message-ID: To: hackers@freebsd.org, joe@freebsd.org, jkh@freebsd.org, phk@freebsd.org Content-Type: text/plain; charset=UTF-8 Cc: Subject: [patch] should crunchgen use basename(3) instead of homebrew code? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Jan 2011 07:37:22 -0000 I'm not sure about this patch because of the behavior change of - slash = strrchr(path, '/'); - basename = slash? slash+1 : path; + bn = basename(slash); CCed to the last few people to touch the relevant code (via svn praise) Index: crunched_main.c =================================================================== --- crunched_main.c (revision 216884) +++ crunched_main.c (working copy) @@ -33,6 +33,7 @@ * or calls one of them based on argv[1]. This allows the testing of * the crunched binary without creating all the links. */ +#include #include #include #include @@ -47,22 +48,21 @@ int main(int argc, char **argv, char **envp) { - char *slash, *basename; + char *slash, *bn; struct stub *ep; if(argv[0] == NULL || *argv[0] == '\0') crunched_usage(); - slash = strrchr(argv[0], '/'); - basename = slash? slash+1 : argv[0]; + bn = basename(argv[0]); for(ep=entry_points; ep->name != NULL; ep++) - if(!strcmp(basename, ep->name)) break; + if(!strcmp(bn, ep->name)) break; if(ep->name) return ep->f(argc, argv, envp); else { - fprintf(stderr, "%s: %s not compiled in\n", EXECNAME, basename); + fprintf(stderr, "%s: %s not compiled in\n", EXECNAME, bn); crunched_usage(); } } @@ -70,14 +70,13 @@ int crunched_here(char *path) { - char *slash, *basename; + char *slash, *bn; struct stub *ep; - slash = strrchr(path, '/'); - basename = slash? slash+1 : path; + bn = basename(slash); for(ep=entry_points; ep->name != NULL; ep++) - if(!strcmp(basename, ep->name)) + if(!strcmp(bn, ep->name)) return 1; return 0; } -- Eitan Adler From owner-freebsd-hackers@FreeBSD.ORG Sun Jan 2 07:41:30 2011 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C01411065670 for ; Sun, 2 Jan 2011 07:41:30 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-iw0-f182.google.com (mail-iw0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id 943868FC1B for ; Sun, 2 Jan 2011 07:41:30 +0000 (UTC) Received: by iwn39 with SMTP id 39so12879189iwn.13 for ; Sat, 01 Jan 2011 23:41:30 -0800 (PST) Received: by 10.231.14.9 with SMTP id e9mr6837277iba.105.1293954090190; Sat, 01 Jan 2011 23:41:30 -0800 (PST) MIME-Version: 1.0 Received: by 10.231.178.195 with HTTP; Sat, 1 Jan 2011 23:41:10 -0800 (PST) In-Reply-To: References: <6BEFA669-2E1F-44E6-897A-0A51DA939A74@gmail.com> From: Eitan Adler Date: Sun, 2 Jan 2011 02:41:10 -0500 Message-ID: To: hackers@freebsd.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: base64 Cc: Subject: [patch] have rtprio check that arguments are numeric; change atoi to strtol X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Jan 2011 07:41:30 -0000 PiBKdXN0IHNldCB0aGUgc2Vjb25kIGFyZ3VtZW50IHRvIHN0cnRvbCB0byBzb21ldGhpbmcgbm9u LU5VTEwgYW5kIHRoZW4gY2hlY2sKPiB0aGUgdmFsdWUgcmV0dXJuZWQ7IHRoYXQgd2lsbCBoZWxw IHByb3ZpZGUgdGhlIGVycm9yIGhhbmRsaW5nIHdpdGgKPiBzaW1wbGljaXR5IHRoYXQgeW91IGRl c2lyZSA6KS4KCkhvdyBhYm91dCB0aGlzIHZlcnNpb24/IEl0IGFsc28gY29ycmVjdHMgYSBjb3B5 L3Bhc3RlIGVycm9yIEkgaGF2ZSBhYm92ZQoKSW5kZXg6IHJ0cHJpby5jCj09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0t IHJ0cHJpby5jIMKgIMKgKHJldmlzaW9uIDIxNjY3OSkKKysrIHJ0cHJpby5jIMKgIMKgKHdvcmtp bmcgY29weSkKQEAgLTU2LDYgKzU2LDcgQEAKwqAgwqAgwqAgwqBjaGFyIMKgICpwOwrCoCDCoCDC oCDCoGludCDCoCDCoCBwcm9jID0gMDsKwqAgwqAgwqAgwqBzdHJ1Y3QgcnRwcmlvIHJ0cDsKKyDC oCDCoCDCoCBjaGFyICppbnZhbGlkQ2hhcjsKCsKgIMKgIMKgIMKgLyogZmluZCBiYXNlbmFtZSAq LwrCoCDCoCDCoCDCoGlmICgocCA9IHJpbmRleChhcmd2WzBdLCAnLycpKSA9PSBOVUxMKQpAQCAt NzAsOCArNzEsOSBAQAoKwqAgwqAgwqAgwqBzd2l0Y2ggKGFyZ2MpIHsKwqAgwqAgwqAgwqBjYXNl IDI6Ci0gwqAgwqAgwqAgwqAgwqAgwqAgwqAgcHJvYyA9IGFicyhhdG9pKGFyZ3ZbMV0pKTsgwqAg wqAgwqAvKiBTaG91bGQgY2hlY2sgaWYgbnVtZXJpYwotIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKg IMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgKiBhcmchICov CisgwqAgwqAgwqAgwqAgwqAgwqAgwqAgcHJvYyA9IGFicygoaW50KXN0cnRvbChhcmd2WzFdLCAm aW52YWxpZENoYXIsIDEwKSk7CisgwqAgwqAgwqAgwqAgwqAgwqAgwqAgaWYgKCppbnZhbGlkQ2hh ciAhPSAnXDAnKQorIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIGVycngoMSwiUHJv Y2VzcyBzaG91bGQgYmUgYSBudW1iZXIiKTsKwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAvKiBGQUxM VEhST1VHSCAqLwrCoCDCoCDCoCDCoGNhc2UgMToKwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqBpZiAo cnRwcmlvKFJUUF9MT09LVVAsIHByb2MsICZydHApICE9IDApCkBAIC0xMDQsMTYgKzEwNiwyMCBA QArCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDC oCDCoGJyZWFrOwrCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDC oH0KwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqB9IGVsc2UgewotIMKgIMKgIMKg IMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIHJ0cC5wcmlvID0gYXRvaShhcmd2 WzFdKTsKKyDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCBydHAu cHJpbyA9IChpbnQpc3RydG9sKGFyZ3ZbMV0sCiZpbnZhbGlkQ2hhciwgMTApOworIMKgIMKgIMKg IMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIGlmICgqaW52YWxpZENoYXIgIT0g J1wwJykKKyDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDC oCDCoCDCoCBlcnJ4KDEsIlByaW9yaXR5IHNob3VsZCBiZSBhCm51bWJlciIsIGludmFsaWRDaGFy KTsKwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqB9CsKgIMKgIMKgIMKgIMKgIMKg IMKgIMKgfSBlbHNlIHsKwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqB1c2FnZSgp OwrCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoGJyZWFrOwrCoCDCoCDCoCDCoCDC oCDCoCDCoCDCoH0KCi0gwqAgwqAgwqAgwqAgwqAgwqAgwqAgaWYgKGFyZ3ZbMl1bMF0gPT0gJy0n KQotIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIHByb2MgPSAtYXRvaShhcmd2WzJd KTsKLQorIMKgIMKgIMKgIMKgIMKgIMKgIMKgIGlmIChhcmd2WzJdWzBdID09ICctJykgeworIMKg IMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIHByb2MgPSAtKGludClzdHJ0b2woYXJndlsy XSwgJmludmFsaWRDaGFyLCAxMCk7CisgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAgwqAg aWYgKCppbnZhbGlkQ2hhciAhPSAnXDAnKQorIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgIMKg IMKgIMKgIMKgIMKgIMKgIGVycngoMSwiUHJvY2VzcyBzaG91bGQgYmUgYSBudW1iZXIiKTsKKyDC oCDCoCDCoCDCoCDCoCDCoCDCoCB9CsKgIMKgIMKgIMKgIMKgIMKgIMKgIMKgaWYgKHJ0cHJpbyhS VFBfU0VULCBwcm9jLCAmcnRwKSAhPSAwKQrCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDC oCDCoGVycigxLCAiJXMiLCBhcmd2WzBdKTsKCgotLQpFaXRhbiBBZGxlcgo= From owner-freebsd-hackers@FreeBSD.ORG Sun Jan 2 10:38:38 2011 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 66F77106566B for ; Sun, 2 Jan 2011 10:38:38 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id D14DC8FC16 for ; Sun, 2 Jan 2011 10:38:35 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id p02AK3lW009200 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 2 Jan 2011 12:20:03 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id p02AK3u7093280; Sun, 2 Jan 2011 12:20:03 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id p02AK39l093279; Sun, 2 Jan 2011 12:20:03 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 2 Jan 2011 12:20:03 +0200 From: Kostik Belousov To: Eitan Adler Message-ID: <20110102102003.GD90883@deviant.kiev.zoral.com.ua> References: Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="GpIToxGFjxEkdZJB" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: hackers@freebsd.org Subject: Re: [patch] rtprio/idprio should use basename(3) instead of acting on its own X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Jan 2011 10:38:38 -0000 --GpIToxGFjxEkdZJB Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Jan 02, 2011 at 02:18:55AM -0500, Eitan Adler wrote: > Index: rtprio.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- rtprio.c (revision 216884) > +++ rtprio.c (working copy) > @@ -41,6 +41,7 @@ >=20 > #include > #include > +#include > #include > #include > #include > @@ -57,11 +58,7 @@ > int proc =3D 0; > struct rtprio rtp; >=20 > - /* find basename */ > - if ((p =3D rindex(argv[0], '/')) =3D=3D NULL) > - p =3D argv[0]; > - else > - ++p; > + p =3D basename(argv[0]); >=20 > if (!strcmp(p, "rtprio")) > rtp.type =3D RTP_PRIO_REALTIME; >=20 basename(3) does much more work that IMO not needed there. rindex() use is a well-known pattern that is common for almost all utilities that check the calling name. I do not think it is worth the churn. --GpIToxGFjxEkdZJB Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEARECAAYFAk0gUVIACgkQC3+MBN1Mb4jJWwCgkP18+ttTxJfLXewB4QCrRWHy G2QAn1f1pKPHpSIUQpKv4JUUo9MIojcN =a9kw -----END PGP SIGNATURE----- --GpIToxGFjxEkdZJB-- From owner-freebsd-hackers@FreeBSD.ORG Sun Jan 2 10:38:40 2011 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 53E74106566C for ; Sun, 2 Jan 2011 10:38:40 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id DE4DE8FC0C for ; Sun, 2 Jan 2011 10:38:39 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id p02AIjuv009104 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 2 Jan 2011 12:18:45 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id p02AIj3L093251; Sun, 2 Jan 2011 12:18:45 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id p02AIjbE093250; Sun, 2 Jan 2011 12:18:45 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 2 Jan 2011 12:18:45 +0200 From: Kostik Belousov To: Eitan Adler Message-ID: <20110102101845.GC90883@deviant.kiev.zoral.com.ua> References: <6BEFA669-2E1F-44E6-897A-0A51DA939A74@gmail.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="62BerGhzGk0sq9XA" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: hackers@freebsd.org Subject: Re: [patch] have rtprio check that arguments are numeric; change atoi to strtol X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Jan 2011 10:38:40 -0000 --62BerGhzGk0sq9XA Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Jan 02, 2011 at 02:41:10AM -0500, Eitan Adler wrote: > > Just set the second argument to strtol to something non-NULL and then c= heck > > the value returned; that will help provide the error handling with > > simplicity that you desire :). >=20 > How about this version? It also corrects a copy/paste error I have above >=20 > Index: rtprio.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- rtprio.c =9A =9A(revision 216679) > +++ rtprio.c =9A =9A(working copy) > @@ -56,6 +56,7 @@ > =9A =9A =9A =9Achar =9A *p; > =9A =9A =9A =9Aint =9A =9A proc =3D 0; > =9A =9A =9A =9Astruct rtprio rtp; While there, you may change the type of proc to pid_t. Also, move the initialization of proc out of local declaration section, according to style(9). > + =9A =9A =9A char *invalidChar; We do not use camelCase, according to style(9). >=20 > =9A =9A =9A =9A/* find basename */ > =9A =9A =9A =9Aif ((p =3D rindex(argv[0], '/')) =3D=3D NULL) > @@ -70,8 +71,9 @@ >=20 > =9A =9A =9A =9Aswitch (argc) { > =9A =9A =9A =9Acase 2: > - =9A =9A =9A =9A =9A =9A =9A proc =3D abs(atoi(argv[1])); =9A =9A =9A/* = Should check if numeric > - =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A= =9A =9A =9A =9A =9A =9A* arg! */ > + =9A =9A =9A =9A =9A =9A =9A proc =3D abs((int)strtol(argv[1], &invalidC= har, 10)); Why is the cast needed there ? Also, I think that doing proc =3D strtol(); if (*invalid_char ...) ...; proc =3D abs(proc); > + =9A =9A =9A =9A =9A =9A =9A if (*invalidChar !=3D '\0') > + =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A errx(1,"Process should be a= number"); Probably, "Pid" or "Process id" instead of "Process". > =9A =9A =9A =9A =9A =9A =9A =9A/* FALLTHROUGH */ > =9A =9A =9A =9Acase 1: > =9A =9A =9A =9A =9A =9A =9A =9Aif (rtprio(RTP_LOOKUP, proc, &rtp) !=3D 0) > @@ -104,16 +106,20 @@ > =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A = =9A =9Abreak; > =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A} > =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A} else { > - =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A rtp.prio = =3D atoi(argv[1]); > + =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A rtp.prio = =3D (int)strtol(argv[1], > &invalidChar, 10); > + =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A if (*invali= dChar !=3D '\0') > + =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A= =9A errx(1,"Priority should be a > number", invalidChar); I suspect that the line overflows 80 characters limit. Consider wrapping it or unindenting. > =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A} > =9A =9A =9A =9A =9A =9A =9A =9A} else { > =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9Ausage(); > =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9Abreak; > =9A =9A =9A =9A =9A =9A =9A =9A} >=20 > - =9A =9A =9A =9A =9A =9A =9A if (argv[2][0] =3D=3D '-') > - =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A proc =3D -atoi(argv[2]); > - > + =9A =9A =9A =9A =9A =9A =9A if (argv[2][0] =3D=3D '-') { > + =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A proc =3D -(int)strtol(argv[= 2], &invalidChar, 10); The easier solution would be proc =3D strtol(argv[2] + 1, &invalid_char, 10); ? > + =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A if (*invalidChar !=3D '\0') > + =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A errx(1,"Pro= cess should be a number"); Again, Pid. > + =9A =9A =9A =9A =9A =9A =9A } > =9A =9A =9A =9A =9A =9A =9A =9Aif (rtprio(RTP_SET, proc, &rtp) !=3D 0) > =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9Aerr(1, "%s", argv[0]); >=20 The syntax of the prio commands is weird, there is an obvious corner (or wrongly handled) case, where the command name starts with a digit. Command name starting with dash is even harder. --62BerGhzGk0sq9XA Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEARECAAYFAk0gUQQACgkQC3+MBN1Mb4ipKwCgpBcLWn6311tDaL+sdRjE57l5 CyQAn1ZahHOjHjBJtikaViSvgNNd9Qv4 =WbWg -----END PGP SIGNATURE----- --62BerGhzGk0sq9XA-- From owner-freebsd-hackers@FreeBSD.ORG Sun Jan 2 15:02:44 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6295A106566C; Sun, 2 Jan 2011 15:02:44 +0000 (UTC) (envelope-from lev@FreeBSD.org) Received: from ftp.translate.ru (ftp.translate.ru [80.249.188.42]) by mx1.freebsd.org (Postfix) with ESMTP id 1D8E68FC0C; Sun, 2 Jan 2011 15:02:43 +0000 (UTC) Received: from [192.168.134.2] (89.112.15.178.pppoe.eltel.net [89.112.15.178]) (Authenticated sender: lev@serebryakov.spb.ru) by ftp.translate.ru (Postfix) with ESMTPA id E6B6213DF5F; Sun, 2 Jan 2011 18:02:41 +0300 (MSK) Date: Sun, 2 Jan 2011 18:02:40 +0300 From: Lev Serebryakov Organization: FreeBSD X-Priority: 3 (Normal) Message-ID: <85784951.20110102180240@serebryakov.spb.ru> To: Giovanni Trematerra In-Reply-To: References: <1385259976.20101230134918@serebryakov.spb.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=windows-1251 Content-Transfer-Encoding: quoted-printable Cc: freebsd-hackers@freebsd.org, lev@freebsd.org Subject: Re: PANIC: thread_exit: Last thread exiting on its own. X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: lev@FreeBSD.org List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Jan 2011 15:02:44 -0000 Hello, Giovanni. You wrote 31 =E4=E5=EA=E0=E1=F0=FF 2010 =E3., 1:56:20: >> =A0I've =A0got =A0this =A0panic on reboot from geom_raid5. > Could you please provide some backtrace? Have you got a core? > Which revision of -STABLE are you running(or when last src update)? Ok, it is reproducable on reboot from single-user mode. Exact stack is: kdb_enter() panic() thread_exit() kthread_exit() g_raid5_worker() fork_exit() fork_trampoline() No dump again because it was single user mode and dump was notr enabled (and kernel debugger WAS). --=20 // Black Lion AKA Lev Serebryakov From owner-freebsd-hackers@FreeBSD.ORG Sun Jan 2 15:15:55 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E258C1065672 for ; Sun, 2 Jan 2011 15:15:55 +0000 (UTC) (envelope-from dsc.fbsd.other@gmail.com) Received: from mail-ey0-f196.google.com (mail-ey0-f196.google.com [209.85.215.196]) by mx1.freebsd.org (Postfix) with ESMTP id 1EDAC8FC17 for ; Sun, 2 Jan 2011 15:15:54 +0000 (UTC) Received: by eyd10 with SMTP id 10so1950832eyd.7 for ; Sun, 02 Jan 2011 07:15:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:subject:date:keywords :message-id:mime-version:content-type:x-mailer:thread-index :content-language; bh=8QLYL0W7tRdXqSkk+qQs/ayjIsjOv9R+t2k/HgVVqbA=; b=HB6rSRyvjLsQnwdjGG+p08m5DUNEKuRI8yPWLDcvTPELszw1kyl26zKBDDzfFXs0Xz 1Z0jIaVLzNcF2n6iT67aApuhpTnyYQwHpAOkHIzhv1j4Xk68iAfYbZCzDs8dhgR/JFOx 5GCG/SV428S4QnbODQRCAfutxrRAp7rFn7x4A= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:date:keywords:message-id:mime-version:content-type :x-mailer:thread-index:content-language; b=f2lsoouDhGOImcdNAn5pypqKqk8DzplEvnlRj96NtnAFoY3yj/oqQavjJm6jxkXYu1 w7xdBB7315qpcN+UbI+3+ZAKASgTTWmd1NrGkh8rL9jd+ucKrpB6C0nF9X+W1cAoRzcs uVYzF9NRNPfQ9tyDJ1Gl2adhDcYhn+vH6RVKg= Received: by 10.213.29.197 with SMTP id r5mr16555844ebc.28.1293980451625; Sun, 02 Jan 2011 07:00:51 -0800 (PST) Received: from fscld ([94.176.153.23]) by mx.google.com with ESMTPS id u1sm13989378eeh.16.2011.01.02.07.00.49 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 02 Jan 2011 07:00:50 -0800 (PST) From: "dsc fbsd.other" To: Date: Sun, 2 Jan 2011 17:00:31 +0200 Keywords: BDF1out Message-ID: <005501cbaa8d$cfbe3190$6f3a94b0$@gmail.com> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 14.0 Thread-Index: AcuqjcCSWME2dttnQ7mDSBNFuAQDmg== Content-Language: en-us Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: jailing MySQL error X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Jan 2011 15:15:56 -0000 Hi. I'm using ezjail standard config file, with a modified fstab file (mount_nullfs ports to jail). Cat /usr/local/etc/ezjail/j009_mysql2 export jail_j009_mysql2_hostname="j009_mysql2" export jail_j009_mysql2_ip="xx.xx.xx.xx" export jail_j009_mysql2_rootdir="/ezjail/j009_mysql2" export jail_j009_mysql2_exec_start="/bin/sh /etc/rc" export jail_j009_mysql2_exec_stop="" export jail_j009_mysql2_mount_enable="YES" export jail_j009_mysql2_devfs_enable="YES" export jail_j009_mysql2_devfs_ruleset="devfsrules_jail" export jail_j009_mysql2_procfs_enable="YES" export jail_j009_mysql2_fdescfs_enable="YES" export jail_j009_mysql2_image="" export jail_j009_mysql2_imagetype="" export jail_j009_mysql2_attachparams="" export jail_j009_mysql2_attachblocking="" export jail_j009_mysql2_forceblocking="" export jail_j009_mysql2_zfs_datasets="" export jail_j009_mysql2_cpuset="" export jail_j009_mysql2_fib="" My steps: 1. Ezjail-admin onestart j009_mysql2 2. Ezjail-admin console j009_mysql2 3. Cd /usr/ports/database/mysql55-server && make install clean 4. cp /usr/local/share/mysql/my-innodb-heavy-4G.cnf /usr/local/etc/my.cnf (modified socket file path to /var/db/mysql/mysql.sock, in both client and server lines) 5. chown -R mysql:mysql ... for ... /tmp /var/tmp /var/db/mysql 6. mysql_enable="YES" in jail rc.conf 7. /usr/local/etc/rc.d/mysql-server start 8. ...and NOTHING ... mysql-server scripts starts /usr/local/bin/mysql_install_db (creates mysql and test folders in /var/db/mysql ... but nothing else ... it's just running) I had to kill everything. After reading lots of webpages and trying all kind of stuff (including http://devel.reinikainen.net/15, but without ssl stuff), I decided to install MySQL on the host. I've made the same steps (3-5 and 7 with "onestart" instead "start") and used the same my-innodb-heavy-4G.cnf file Everything went well. Mysqld started, creating socket file and pid file; mysql_install_db had no errors. The log file says: 110102 18:07:06 mysqld_safe Starting mysqld daemon with databases from /var/db/mysql 110102 18:07:06 [Note] Plugin 'FEDERATED' is disabled. InnoDB: The InnoDB memory heap is disabled InnoDB: Mutexes and rw_locks use GCC atomic builtins InnoDB: Compressed tables use zlib 1.2.5 110102 18:07:06 InnoDB: Initializing buffer pool, size = 2.0G 110102 18:07:07 InnoDB: Completed initialization of buffer pool 110102 18:07:07 InnoDB: highest supported file format is Barracuda. 110102 18:07:07 InnoDB: 1.1.3 started; log sequence number 1595675 110102 18:07:07 [Note] Event Scheduler: Loaded 0 events 110102 18:07:07 [Note] /usr/local/libexec/mysqld: ready for connections. Version: '5.5.7-rc-log' socket: '/var/db/mysql/mysql.sock' port: 3306 FreeBSD port: mysql-server-5.5.7 I didn't give up ... so I did: 9. Rm -rf /var/db/mysql/* (in jail) 10. Cp /var/db/mysql/mysql/* /ezjail/j009_mysql2/var/db/mysql/mysql (from host to jail) 11. Cp /var/db/mysql/performance_schema/* /ezjail/j009_mysql2/var/db/mysql/performance_schema (from host to jail) 12. Starting and entering the jail again 13. usr/local/etc/rc.d/mysql-server start was started upon entering the jail (did not create pid and socket file) but generated this log: 110102 17:03:05 [Note] Plugin 'FEDERATED' is disabled. /usr/local/libexec/mysqld: Can't find file: './mysql/plugin.frm' (errno: 13) 110102 17:03:05 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it. InnoDB: The InnoDB memory heap is disabled InnoDB: Mutexes and rw_locks use GCC atomic builtins InnoDB: Compressed tables use zlib 1.2.5 110102 17:03:05 InnoDB: Initializing buffer pool, size = 2.0G 110102 17:03:06 InnoDB: Completed initialization of buffer pool InnoDB: The first specified data file /innodb/ibdata1 did not exist: InnoDB: a new database to be created! 110102 17:03:06 InnoDB: Setting file /innodb/ibdata1 size to 10 MB InnoDB: Database physically writes the file full: wait... 110102 17:03:06 InnoDB: Log file ./ib_logfile0 did not exist: new to be created InnoDB: Setting log file ./ib_logfile0 size to 256 MB InnoDB: Database physically writes the file full: wait... InnoDB: Progress in MB: 100 200 110102 17:03:08 InnoDB: Log file ./ib_logfile1 did not exist: new to be created InnoDB: Setting log file ./ib_logfile1 size to 256 MB InnoDB: Database physically writes the file full: wait... InnoDB: Progress in MB: 100 200 110102 17:03:10 InnoDB: Log file ./ib_logfile2 did not exist: new to be created InnoDB: Setting log file ./ib_logfile2 size to 256 MB InnoDB: Database physically writes the file full: wait... InnoDB: Progress in MB: 100 200 14. usr/local/etc/rc.d/mysql-server stop ... doesn't work because of missing pid file (the same with "mysql_upgrade" suggested by the log file) 15. './mysql/plugin.frm' file exists 16. kill everything and run again usr/local/etc/rc.d/mysql-server start with this result: 110102 17:07:40 [Note] Plugin 'FEDERATED' is disabled. /usr/local/libexec/mysqld: Can't find file: './mysql/plugin.frm' (errno: 13) 110102 17:07:40 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it. InnoDB: The InnoDB memory heap is disabled InnoDB: Mutexes and rw_locks use GCC atomic builtins InnoDB: Compressed tables use zlib 1.2.5 110102 17:07:40 InnoDB: Initializing buffer pool, size = 2.0G 110102 17:07:40 InnoDB: Completed initialization of buffer pool 110102 17:07:40 InnoDB: highest supported file format is Barracuda. InnoDB: No valid checkpoint found. InnoDB: If this error appears when you are creating an InnoDB database, InnoDB: the problem may be that during an earlier attempt you managed InnoDB: to create the InnoDB data files, but log file creation failed. InnoDB: If that is the case, please refer to InnoDB: http://dev.mysql.com/doc/refman/5.1/en/error-creating-innodb.html 110102 17:07:40 [ERROR] Plugin 'InnoDB' init function returned error. 110102 17:07:40 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed. 17. But i have a pid and socket file 18. "mysql_upgrade" doesn't work (hangs up) 19. Also "mysql -u root" doesn't work (hangs up) I've read http://dev.mysql.com/doc/refman/5.1/en/error-creating-innodb.html and other related webpages. I think is something related with permissions in jail, but I can't figure it out. So, my final hope is this email. Anyone has any idea? Thanks in advance! Lulu PS: I'm using: - FreeBSD Current (amd64) - Geli encryption - ZFS v28 with world and kernel build with src r215329 (patched with head-v28-v2.patch from Martin Matuska)(the patch doesn't work on the latest src) - Ports updated one week ago - Ezjail installed one week ago (buildworld with src updated one week ago) From owner-freebsd-hackers@FreeBSD.ORG Sun Jan 2 16:29:20 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 912E91065696 for ; Sun, 2 Jan 2011 16:29:20 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-px0-f182.google.com (mail-px0-f182.google.com [209.85.212.182]) by mx1.freebsd.org (Postfix) with ESMTP id 57FB88FC12 for ; Sun, 2 Jan 2011 16:29:20 +0000 (UTC) Received: by pxi1 with SMTP id 1so2555830pxi.13 for ; Sun, 02 Jan 2011 08:29:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:references:in-reply-to :mime-version:content-transfer-encoding:content-type:message-id:cc :x-mailer:from:subject:date:to; bh=GT7PQu7O7dEunmb2YiOcz4DlZUhRiY28nY1/LxTVe7I=; b=ltQnyfNNCgR3ucHRtmkXj+SHPL3iEyyO7HLBKvqxtb3TJzfzKp3y9dFioSCWwGjMtX yLyiWO22BYa1XDFa6y0ebYJQtMg+E48RgQTYG27MNeVlA/smYKAUJLYWejqtO5x+RpL9 rua3YrlLHwDmObQe0xdscOf1ykDP+xpa/LwlI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=references:in-reply-to:mime-version:content-transfer-encoding :content-type:message-id:cc:x-mailer:from:subject:date:to; b=KJT9bl6Jvq/9z6pxcLblIEhSCJdBuTPSIsykR3M52O+g9bG6/ggTmVNX0R5TWbbGSV gjTBsppCk8tpSX3J7bPWbsLTkjavDvppfBAJU+iq4jwCkNwtezHwkFgeq80WQy3qFLsZ kcFWR6PANddQ6BbOPer8bbmoI6Pw96hkHErow= Received: by 10.142.223.7 with SMTP id v7mr15927958wfg.358.1293985759825; Sun, 02 Jan 2011 08:29:19 -0800 (PST) Received: from [192.168.20.8] (c-24-130-151-210.hsd1.ca.comcast.net [24.130.151.210]) by mx.google.com with ESMTPS id v19sm27812014wfh.0.2011.01.02.08.29.16 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 02 Jan 2011 08:29:18 -0800 (PST) References: <1385259976.20101230134918@serebryakov.spb.ru> <85784951.20110102180240@serebryakov.spb.ru> In-Reply-To: <85784951.20110102180240@serebryakov.spb.ru> Mime-Version: 1.0 (iPhone Mail 8C148) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=iso-2022-jp Message-Id: <913DB826-B213-46CD-B617-22854B64235E@gmail.com> X-Mailer: iPhone Mail (8C148) From: Garrett Cooper Date: Sun, 2 Jan 2011 08:29:08 -0800 To: "lev@FreeBSD.org" Cc: "freebsd-hackers@freebsd.org" , "lev@freebsd.org" , Giovanni Trematerra Subject: Re: PANIC: thread_exit: Last thread exiting on its own. X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Jan 2011 16:29:20 -0000 On Jan 2, 2011, at 7:02 AM, Lev Serebryakov wrote: > Hello, Giovanni. > You wrote 31 =1B$B'U'V'\'Q'R'b'q=1B(B 2010 =1B$B'T=1B(B., 1:56:20: >=20 >=20 >>> I've got this panic on reboot from geom_raid5. >> Could you please provide some backtrace? Have you got a core? >> Which revision of -STABLE are you running(or when last src update)? > Ok, it is reproducable on reboot from single-user mode. >=20 > Exact stack is: >=20 > kdb_enter() > panic() > thread_exit() > kthread_exit() > g_raid5_worker() > fork_exit() > fork_trampoline() >=20 > No dump again because it was single user mode and dump was notr > enabled (and kernel debugger WAS). Could you please disable autoreboot and do bt providing us with a full backd= raft instead of a partial one please? Thanks, -Garrett= From owner-freebsd-hackers@FreeBSD.ORG Sun Jan 2 17:08:39 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E49A4106566B for ; Sun, 2 Jan 2011 17:08:39 +0000 (UTC) (envelope-from darmawan_salihun@yahoo.com) Received: from web76816.mail.sg1.yahoo.com (web76816.mail.sg1.yahoo.com [124.108.123.120]) by mx1.freebsd.org (Postfix) with SMTP id 5AE5D8FC0A for ; Sun, 2 Jan 2011 17:08:38 +0000 (UTC) Received: (qmail 84230 invoked by uid 60001); 2 Jan 2011 17:08:38 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1293988117; bh=xw9oiU06EoYrqOmdhdS1wB1RBu4C9BhNVM/b0T5moPs=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=cRoNVMXy1OVNzrsG7M/Hsm7jSYP1MDXTsMkt4Vp7YFicdf6yuw0e6OjMchJDY+ecwa+E6vm88VasxDPUjkNX6sGNm+o5P3sYmWhWvJmsAaHrEE/Rh+M+WVdrZQCLcWR66Dl2XF2TA9goK0cBq1AKBghaoHNNQ4esaeAS+r/jNbk= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=DhmlD7ABVK9wbUkDPktDFR2+zA8Kwi7RRVnUtGcKbHE//PLwzAui3WU3E57T60tVr7iQxzZCMJJpPkkJObI6kNZos1vnxX59E5q23UKpHLIM5LbLsr77ULWa05OvtYROR6PZRlFJGaOGpspopKhMVG0VQO0ffQ4tv7sGyVLaZMo=; Message-ID: <990577.69255.qm@web76816.mail.sg1.yahoo.com> X-YMail-OSG: LmgcZU4VM1mQ2bRUHPWSSjE2ywYzXmo38rY1k1ITAZXBKSy dqqaurV7oAOtppgZb42bdclwBfRVpjZ6X7TW9VPfEVGwdcZTlat8JgA899hf RVRbXto2EurS.lNpjmXHKFqpfE4ShrLsj2EIR78xYQ9Btw6nz.yrkc4c4Inv vXD06ZcUGfxY24k68W5DrwmKYCIPNA0XHgAN3vFqeRCPmgf1Phnqdsx_O5nL S8CwHEMZZahX6ohPQWLoL7eEWB4UHqxGU.SoxJSo4r5zQCfxHxbnY38.MXwa ybGHe6gcSeZrBdgSp9Y1rbo3kTGad8y81JnY_ZrxURtO4PHvlBWtNslS06DA ev5lwix4apZD89eDX1g-- Received: from [114.59.178.161] by web76816.mail.sg1.yahoo.com via HTTP; Mon, 03 Jan 2011 01:08:37 SGT X-Mailer: YahooMailClassic/11.4.20 YahooMailWebService/0.8.107.285259 Date: Mon, 3 Jan 2011 01:08:37 +0800 (SGT) From: Darmawan Salihun To: John Baldwin In-Reply-To: <745749.9930.qm@web76811.mail.sg1.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-hackers@freebsd.org Subject: Re: PCI IDE Controller Base Address Register setting X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Jan 2011 17:08:40 -0000 Hi, --- On Sat, 1/1/11, Darmawan Salihun wrote: > From: Darmawan Salihun > Subject: Re: PCI IDE Controller Base Address Register setting > To: "John Baldwin" > Cc: freebsd-hackers@freebsd.org > Date: Saturday, January 1, 2011, 2:58 PM ... > > Thanks, I tested this option and it worked.=20 > > I could see the debugging messages.=20 > >=20 > > FreeBSD cannot detect the disk in all of the IDE > > interfaces.=A0=20 > > (The AMDCS5536 only implemented the primary channel) > >=20 > > Anyway, I manage to change the mapping in BAR4 of the > IDE > > controller.=20 > > However, I'm confused as to how to "force" FreeBSD to > > recognize the=20 > > IDE controller to work only in compatibility mode.=20 > > Because, I'm not sure if the physical IDE controller > chip > > supports=20 > > Native-PCI mode correctly at all.=20 > > If I set BAR4 to "disabled"(i.e. not decoding any I/O > > addresses at all),=20 > > would FreeBSD use compatibility mode? or would it > consider > > the=20 > > IDE controller not present? > >=20 > > Here's some notes about the IDE controller PCI > > configuration registers: > > 1. The Programming Interface register contains 80h > (which > > means _only_=20 > > compatibility mode supported). I have yet to be able > to > > write new values=20 > > into this register. That's the state of the register > right > > now.=20 > > I noticed in your previous reply that for FreeBSD to > be > > forced to use=20 > > compatibility mode, the programming interface register > bits > > in the PCI configuration register must be set > accordingly=20 > > (I suppose the bits in the lower nibble). > >=20 > > 2. BAR0-BAR3 cannot be changed and contains 00h.=20 > > I have yet to experiment with BAR5.The default value > is > > 00h > >=20 >=20 > Silly me that I didn't know about the SFF-8038i standard=20 > (PCI IDE Bus mastering). So, I found out that it seems the >=20 > allocation of I/O ports for the IDE controller is just > fine.=20 > However, the primary IDE channel is shared between=20 > an IDE interface=A0 and a CF card. Moreover, Linux > detects=20 > DMA bug, because all drives connected to the interface > would be=20 > in PIO mode :-/ > If all drives on the primary channel are "forced" to PIO > mode, then=20 > shouldn't the "IDE PCI bus master register" (offset 20h per > SFF-8038i) > along with the command register (offset 4h), are set to > indicate the=20 > controller doesn't support bus mastering?=20 >=20 Anyway, is it possible for devices on _the same_ channel to use=20 different setting in FreeBSD? For example, the primary slave=20 is using UDMA66 while the primary master is using PIO-4. Or such configuration is considered invalid. =20 The AMDLX800-CS5536 board I'm working with has different connectors=20 for the primary master and primary slave. Moreover, the chipset=20 supports different setting in primary master and primary slave.=20 TIA,=20 Darmawan =0A=0A=0A From owner-freebsd-hackers@FreeBSD.ORG Sun Jan 2 19:43:21 2011 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 020471065670 for ; Sun, 2 Jan 2011 19:43:21 +0000 (UTC) (envelope-from keramida@ceid.upatras.gr) Received: from igloo.linux.gr (igloo.linux.gr [62.1.205.36]) by mx1.freebsd.org (Postfix) with ESMTP id 6FD858FC08 for ; Sun, 2 Jan 2011 19:43:19 +0000 (UTC) X-Spam-Status: No X-Hellug-MailScanner-From: keramida@ceid.upatras.gr X-Hellug-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-2.9, required 5, autolearn=not spam, ALL_TRUSTED -1.00, BAYES_00 -1.90) X-Hellug-MailScanner: Found to be clean X-Hellug-MailScanner-ID: p02JTn78011381 Received: from gkeramidas-glaptop.linux.gr (217-162-216-74.dclient.hispeed.ch [217.162.216.74]) (authenticated bits=0) by igloo.linux.gr (8.14.3/8.14.3/Debian-9.4) with ESMTP id p02JTn78011381 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Sun, 2 Jan 2011 21:29:57 +0200 From: Giorgos Keramidas To: Kostik Belousov References: <6BEFA669-2E1F-44E6-897A-0A51DA939A74@gmail.com> <20110102101845.GC90883@deviant.kiev.zoral.com.ua> Date: Sun, 02 Jan 2011 20:29:30 +0100 In-Reply-To: <20110102101845.GC90883@deviant.kiev.zoral.com.ua> (Kostik Belousov's message of "Sun, 2 Jan 2011 12:18:45 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Cc: Eitan Adler , hackers@freebsd.org Subject: Re: [patch] have rtprio check that arguments are numeric; change atoi to strtol X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Jan 2011 19:43:21 -0000 On Sun, 2 Jan 2011 12:18:45 +0200, Kostik Belousov wr= ote: > On Sun, Jan 02, 2011 at 02:41:10AM -0500, Eitan Adler wrote: >> > Just set the second argument to strtol to something non-NULL and then = check >> > the value returned; that will help provide the error handling with >> > simplicity that you desire :). >> >> How about this version? It also corrects a copy/paste error I have above >> >> Index: rtprio.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> --- rtprio.c =A0 =A0(revision 216679) >> +++ rtprio.c =A0 =A0(working copy) >> @@ -56,6 +56,7 @@ >> =A0 =A0 =A0 =A0char =A0 *p; >> =A0 =A0 =A0 =A0int =A0 =A0 proc =3D 0; >> =A0 =A0 =A0 =A0struct rtprio rtp; > While there, you may change the type of proc to pid_t. > Also, move the initialization of proc out of local declaration section, > according to style(9). > >> + =A0 =A0 =A0 char *invalidChar; > We do not use camelCase, according to style(9). > >> >> =A0 =A0 =A0 =A0/* find basename */ >> =A0 =A0 =A0 =A0if ((p =3D rindex(argv[0], '/')) =3D=3D NULL) >> @@ -70,8 +71,9 @@ >> >> =A0 =A0 =A0 =A0switch (argc) { >> =A0 =A0 =A0 =A0case 2: >> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 proc =3D abs(atoi(argv[1])); =A0 =A0 =A0/*= Should check if numeric >> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0* arg! */ >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 proc =3D abs((int)strtol(argv[1], &invalid= Char, 10)); > > Why is the cast needed there ? > Also, I think that doing > proc =3D strtol(); > if (*invalid_char ...) > ...; > proc =3D abs(proc); It's quite surprising how easy it is to use strtol() in an allegedly "safe" manner, but miss some of the edge cases. We should probably check for errno too, e.g.: #include #include #include pid_t proc; long x; char *endp; errno =3D 0; x =3D strtol(argv[1], &endp, 0); if (errno !=3D 0 || (endp !=3D NULL && endp !=3D str && *endp !=3D '\0'= && (isdigit(*endp) =3D=3D 0 || isspace(*endp) =3D=3D 0))) error(); Then if we want to avoid overflows of pid_t, we might have to check against PID_MAX or at least INT32_MAX. The sizeof(pid_t) is __int32_t on all FreeBSD architectures, so it may be useful to check for: if (x >=3D INT32_MAX) error(); proc =3D (pid_t)x; But this is probably being too paranoid now. From owner-freebsd-hackers@FreeBSD.ORG Sun Jan 2 23:02:45 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5E284106566B for ; Sun, 2 Jan 2011 23:02:45 +0000 (UTC) (envelope-from jhellenthal@gmail.com) Received: from mail-gy0-f182.google.com (mail-gy0-f182.google.com [209.85.160.182]) by mx1.freebsd.org (Postfix) with ESMTP id 110108FC0A for ; Sun, 2 Jan 2011 23:02:44 +0000 (UTC) Received: by gyf3 with SMTP id 3so5467631gyf.13 for ; Sun, 02 Jan 2011 15:02:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :organization:user-agent:mime-version:to:cc:subject:references :in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; bh=LGP8w6kMM8JTr0t9zgl1uEbopwII2e72KDAnb2yxN9Q=; b=Bewkxc18OZ7/Lmo+PKIPqxi2rHJCIi5o1meOG3/hftkFSOHA2cVx8SwkYIbUig7+qQ wUrbYA+iFejc5C3AyArtfCeqghXqVlAUlB55OsQgfOhObxCrtz8YmuXbQniIJMKFUf2N 7BZC4ZJeBgk4qKKi1n2+mj++4qhxRW+imj9jU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:organization:user-agent:mime-version:to :cc:subject:references:in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; b=Y+HmSu0hznBlyHr9JRo7AUp64BAEMOFLQOYJGHSTluFp60EnUPhMC81F3RImCjeAk0 KLEAgPaQOAAvXlcS/9FzvCXry0bDk4oK1sGj3mFbBs1HG/9Aoi9ipSTwNJez0F5uOH8V TUG90I4O3ZZkd6PrHuXFmIAZrF3SBfsvG8jrc= Received: by 10.100.191.7 with SMTP id o7mr11768856anf.198.1294007756754; Sun, 02 Jan 2011 14:35:56 -0800 (PST) Received: from centel.dataix.local (adsl-99-181-155-97.dsl.klmzmi.sbcglobal.net [99.181.155.97]) by mx.google.com with ESMTPS id 35sm27199898ano.11.2011.01.02.14.35.54 (version=SSLv3 cipher=RC4-MD5); Sun, 02 Jan 2011 14:35:55 -0800 (PST) Sender: "J. Hellenthal" Message-ID: <4D20FDC9.2000204@DataIX.net> Date: Sun, 02 Jan 2011 17:35:53 -0500 From: "J. Hellenthal" Organization: http://www.DataIX.net User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.9.2.13) Gecko/20101230 Lightning/1.0b1 Thunderbird MIME-Version: 1.0 To: "dsc fbsd.other" References: <005501cbaa8d$cfbe3190$6f3a94b0$@gmail.com> In-Reply-To: <005501cbaa8d$cfbe3190$6f3a94b0$@gmail.com> X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org Subject: Re: jailing MySQL error X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Jan 2011 23:02:45 -0000 This is the fourth or fifth list Ive seen this very same message on. If anything I would have thought it had more to do with the relaase your running '-CURRENT' or '-STABLE' + 'JAILS' + 'PORTS'. But as it seems 'QUESTIONS' or 'PORTS' would have been a proper burial ground for this as it has more to do with configuration issue rather than a issue that would be covered by any of the other lists. -- Regards, jhell,v JJH48-ARIN From owner-freebsd-hackers@FreeBSD.ORG Sun Jan 2 23:47:08 2011 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 058C3106564A for ; Sun, 2 Jan 2011 23:47:08 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-iw0-f182.google.com (mail-iw0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id CC4378FC16 for ; Sun, 2 Jan 2011 23:47:07 +0000 (UTC) Received: by iwn39 with SMTP id 39so13244239iwn.13 for ; Sun, 02 Jan 2011 15:47:07 -0800 (PST) Received: by 10.231.36.205 with SMTP id u13mr3651052ibd.155.1294012027313; Sun, 02 Jan 2011 15:47:07 -0800 (PST) MIME-Version: 1.0 Received: by 10.231.178.195 with HTTP; Sun, 2 Jan 2011 15:46:47 -0800 (PST) In-Reply-To: <20110102101845.GC90883@deviant.kiev.zoral.com.ua> References: <6BEFA669-2E1F-44E6-897A-0A51DA939A74@gmail.com> <20110102101845.GC90883@deviant.kiev.zoral.com.ua> From: Eitan Adler Date: Sun, 2 Jan 2011 18:46:47 -0500 Message-ID: To: Kostik Belousov Content-Type: text/plain; charset=UTF-8 Cc: hackers@freebsd.org Subject: Re: [patch] have rtprio check that arguments are numeric; change atoi to strtol X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Jan 2011 23:47:08 -0000 What about this patch? I incorporated your feedback so I am not going to reply inline. > The syntax of the prio commands is weird, there is an obvious corner > (or wrongly handled) case, where the command name starts with a digit. > Command name starting with dash is even harder. > I agree - and I wouldn't mind seeing the syntax changed (along with the licensed changed to a 2 clause BSD license) - but I suspect the benefits conferred by those two things would not be enough to overcome the reluctance to change a very old command (since 1994). If I'm wrong I'll gladly write a "cleanroom" version with sane syntax. Index: rtprio.c =================================================================== --- rtprio.c (revision 216679) +++ rtprio.c (working copy) @@ -41,6 +41,7 @@ #include #include +#include #include #include #include @@ -54,14 +55,12 @@ char **argv; { char *p; - int proc = 0; + pid_t proc; struct rtprio rtp; + char *invalidchar; - /* find basename */ - if ((p = rindex(argv[0], '/')) == NULL) - p = argv[0]; - else - ++p; + proc = 0; + p = basename(argv[0]); if (!strcmp(p, "rtprio")) rtp.type = RTP_PRIO_REALTIME; @@ -70,8 +69,10 @@ switch (argc) { case 2: - proc = abs(atoi(argv[1])); /* Should check if numeric - * arg! */ + proc = (int)strtol(argv[1], &invalidchar, 10); + if (*invalidchar != '\0') + errx(1,"Process should be a pid"); + proc = abs(proc); /* FALLTHROUGH */ case 1: if (rtprio(RTP_LOOKUP, proc, &rtp) != 0) @@ -104,16 +105,20 @@ break; } } else { - rtp.prio = atoi(argv[1]); + rtp.prio = (int)strtol(argv[1], &invalidchar, 10); + if (*invalidchar != '\0') + errx(1,"Priority should be a number", invalidchar); } } else { usage(); break; } - if (argv[2][0] == '-') - proc = -atoi(argv[2]); - + if (argv[2][0] == '-') { + proc = (int)strtol(argv[2]+1, &invalidchar, 10); + if (*invalidchar != '\0') + errx(1,"Process should be a pid"); + } if (rtprio(RTP_SET, proc, &rtp) != 0) err(1, "%s", argv[0]); -- Eitan Adler From owner-freebsd-hackers@FreeBSD.ORG Mon Jan 3 05:24:55 2011 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4137F106566B for ; Mon, 3 Jan 2011 05:24:55 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com [209.85.210.182]) by mx1.freebsd.org (Postfix) with ESMTP id D1F5B8FC14 for ; Mon, 3 Jan 2011 05:24:54 +0000 (UTC) Received: by iyb26 with SMTP id 26so12323809iyb.13 for ; Sun, 02 Jan 2011 21:24:54 -0800 (PST) Received: by 10.231.17.205 with SMTP id t13mr19974753iba.80.1294032293909; Sun, 02 Jan 2011 21:24:53 -0800 (PST) MIME-Version: 1.0 Received: by 10.231.178.195 with HTTP; Sun, 2 Jan 2011 21:24:33 -0800 (PST) In-Reply-To: <6DCC53BA-D20A-4593-B3B0-1389734AD308@turbofuzz.com> References: <6DCC53BA-D20A-4593-B3B0-1389734AD308@turbofuzz.com> From: Eitan Adler Date: Mon, 3 Jan 2011 00:24:33 -0500 Message-ID: To: "Jordan K. Hubbard" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: hackers@freebsd.org Subject: Re: [patch] should crunchgen use basename(3) instead of homebrew code? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Jan 2011 05:24:55 -0000 Hi, On Sun, Jan 2, 2011 at 11:50 PM, Jordan K. Hubbard wrot= e: > Wow. =C2=A0A couple of questions. There was a reason my subject line was in the form of a question. When poking around various parts of the "crypt" I noticed that the code does something seemingly covered by an existing function so I decided to poke the relevant people about it. More generally - I don't like seeing old code do something on its own that we have an existing function for. However your post convinced me that gain of consistency is not worth the headaches it may cause. --=20 Eitan Adler From owner-freebsd-hackers@FreeBSD.ORG Mon Jan 3 05:09:24 2011 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 19B25106564A; Mon, 3 Jan 2011 05:09:23 +0000 (UTC) (envelope-from jkh@turbofuzz.com) Received: from mail.brierdr.com (mail.brierdr.com [208.71.156.155]) by mx1.freebsd.org (Postfix) with ESMTP id B83F48FC18; Mon, 3 Jan 2011 05:09:23 +0000 (UTC) Received: from 208-106-35-98.static.sonic.net (208-106-35-98.static.sonic.net [208.106.35.98]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.brierdr.com (Postfix) with ESMTPS id B585D164830; Sun, 2 Jan 2011 20:37:23 -0800 (PST) Mime-Version: 1.0 (Apple Message framework v1082) Content-Type: multipart/signed; boundary=Apple-Mail-296-42958711; protocol="application/pkcs7-signature"; micalg=sha1 From: "Jordan K. Hubbard" In-Reply-To: Date: Sun, 2 Jan 2011 20:50:54 -0800 Message-Id: <6DCC53BA-D20A-4593-B3B0-1389734AD308@turbofuzz.com> References: To: Eitan Adler X-Mailer: Apple Mail (2.1082) X-Mailman-Approved-At: Mon, 03 Jan 2011 05:39:46 +0000 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: joe@freebsd.org, jkh@freebsd.org, hackers@freebsd.org, phk@freebsd.org Subject: Re: [patch] should crunchgen use basename(3) instead of homebrew code? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Jan 2011 05:09:24 -0000 --Apple-Mail-296-42958711 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Wow. A couple of questions. 1. Is it really worth messing with code as old as crunchgen(1) at all? = Seriously. What's there isn't exactly "broken", and it seems like = needlessly walking into a vampire's crypt without so much as a stake or = clove of garlic on your person. Only something bad can happen. 2. basename(3) also strips trailing '/' characters, which the code you = are replacing does not. Does this actually matter? Hell if I know, I = haven't looked at the inputs to that code in ages and I have enough = common sense to stay out of musty crypts, so I'm not going to look, = either. :) - Jordan On Jan 1, 2011, at 11:37 PM, Eitan Adler wrote: > I'm not sure about this patch because of the behavior change of > - slash =3D strrchr(path, '/'); > - basename =3D slash? slash+1 : path; > + bn =3D basename(slash); >=20 > CCed to the last few people to touch the relevant code (via svn = praise) >=20 > Index: crunched_main.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- crunched_main.c (revision 216884) > +++ crunched_main.c (working copy) > @@ -33,6 +33,7 @@ > * or calls one of them based on argv[1]. This allows the testing = of > * the crunched binary without creating all the links. > */ > +#include > #include > #include > #include > @@ -47,22 +48,21 @@ >=20 > int main(int argc, char **argv, char **envp) > { > - char *slash, *basename; > + char *slash, *bn; > struct stub *ep; >=20 > if(argv[0] =3D=3D NULL || *argv[0] =3D=3D '\0') > crunched_usage(); >=20 > - slash =3D strrchr(argv[0], '/'); > - basename =3D slash? slash+1 : argv[0]; > + bn =3D basename(argv[0]); >=20 > for(ep=3Dentry_points; ep->name !=3D NULL; ep++) > - if(!strcmp(basename, ep->name)) break; > + if(!strcmp(bn, ep->name)) break; >=20 > if(ep->name) > return ep->f(argc, argv, envp); > else { > - fprintf(stderr, "%s: %s not compiled in\n", EXECNAME, basename); > + fprintf(stderr, "%s: %s not compiled in\n", EXECNAME, bn); > crunched_usage(); > } > } > @@ -70,14 +70,13 @@ >=20 > int crunched_here(char *path) > { > - char *slash, *basename; > + char *slash, *bn; > struct stub *ep; >=20 > - slash =3D strrchr(path, '/'); > - basename =3D slash? slash+1 : path; > + bn =3D basename(slash); >=20 > for(ep=3Dentry_points; ep->name !=3D NULL; ep++) > - if(!strcmp(basename, ep->name)) > + if(!strcmp(bn, ep->name)) > return 1; > return 0; > } >=20 >=20 > --=20 > Eitan Adler --Apple-Mail-296-42958711-- From owner-freebsd-hackers@FreeBSD.ORG Mon Jan 3 12:48:20 2011 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EEC4A10656A4 for ; Mon, 3 Jan 2011 12:48:20 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 3A64D8FC15 for ; Mon, 3 Jan 2011 12:48:19 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id p03Cm6YD021987 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 3 Jan 2011 14:48:06 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id p03Cm6kD003401; Mon, 3 Jan 2011 14:48:06 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id p03Cm54b003400; Mon, 3 Jan 2011 14:48:05 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 3 Jan 2011 14:48:05 +0200 From: Kostik Belousov To: Eitan Adler Message-ID: <20110103124805.GB3140@deviant.kiev.zoral.com.ua> References: <6BEFA669-2E1F-44E6-897A-0A51DA939A74@gmail.com> <20110102101845.GC90883@deviant.kiev.zoral.com.ua> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="yEPQxsgoJgBvi8ip" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: hackers@freebsd.org Subject: Re: [patch] have rtprio check that arguments are numeric; change atoi to strtol X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Jan 2011 12:48:21 -0000 --yEPQxsgoJgBvi8ip Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Jan 02, 2011 at 06:46:47PM -0500, Eitan Adler wrote: > What about this patch? I incorporated your feedback so I am not going > to reply inline. >=20 > > The syntax of the prio commands is weird, there is an obvious corner > > (or wrongly handled) case, where the command name starts with a digit. > > Command name starting with dash is even harder. > > >=20 > I agree - and I wouldn't mind seeing the syntax changed (along with > the licensed changed to a 2 clause BSD license) - but I suspect the > benefits conferred by those two things would not be enough to overcome > the reluctance to change a very old command (since 1994). If I'm wrong > I'll gladly write a "cleanroom" version with sane syntax. >=20 > Index: rtprio.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- rtprio.c (revision 216679) > +++ rtprio.c (working copy) > @@ -41,6 +41,7 @@ >=20 > #include > #include > +#include > #include > #include > #include > @@ -54,14 +55,12 @@ > char **argv; > { > char *p; > - int proc =3D 0; > + pid_t proc; > struct rtprio rtp; > + char *invalidchar; >=20 > - /* find basename */ > - if ((p =3D rindex(argv[0], '/')) =3D=3D NULL) > - p =3D argv[0]; > - else > - ++p; > + proc =3D 0; > + p =3D basename(argv[0]); >=20 > if (!strcmp(p, "rtprio")) > rtp.type =3D RTP_PRIO_REALTIME; > @@ -70,8 +69,10 @@ >=20 > switch (argc) { > case 2: > - proc =3D abs(atoi(argv[1])); /* Should check if numeric > - * arg! */ > + proc =3D (int)strtol(argv[1], &invalidchar, 10); > + if (*invalidchar !=3D '\0') > + errx(1,"Process should be a pid"); > + proc =3D abs(proc); > /* FALLTHROUGH */ > case 1: > if (rtprio(RTP_LOOKUP, proc, &rtp) !=3D 0) > @@ -104,16 +105,20 @@ > break; > } > } else { > - rtp.prio =3D atoi(argv[1]); > + rtp.prio =3D (int)strtol(argv[1], &invalidchar, 10); > + if (*invalidchar !=3D '\0') > + errx(1,"Priority should be a number", invalidchar); This did not compiled for me. > } > } else { > usage(); > break; > } >=20 > - if (argv[2][0] =3D=3D '-') > - proc =3D -atoi(argv[2]); > - > + if (argv[2][0] =3D=3D '-') { > + proc =3D (int)strtol(argv[2]+1, &invalidchar, 10); > + if (*invalidchar !=3D '\0') > + errx(1,"Process should be a pid"); > + } > if (rtprio(RTP_SET, proc, &rtp) !=3D 0) > err(1, "%s", argv[0]); >=20 >=20 Unless loud objections are heard, I indend to commit the following patch, based on your submission. diff --git a/usr.sbin/rtprio/rtprio.c b/usr.sbin/rtprio/rtprio.c index 245f714..bdd61ea 100644 --- a/usr.sbin/rtprio/rtprio.c +++ b/usr.sbin/rtprio/rtprio.c @@ -37,7 +37,6 @@ __FBSDID("$FreeBSD$"); =20 #include #include -#include =20 #include #include @@ -46,22 +45,21 @@ __FBSDID("$FreeBSD$"); #include #include =20 -static void usage(); +static void usage(void); =20 int -main(argc, argv) - int argc; - char **argv; +main(int argc, char *argv[]) { - char *p; - int proc =3D 0; struct rtprio rtp; + char *invalidchar, *p; + pid_t proc; =20 /* find basename */ if ((p =3D rindex(argv[0], '/')) =3D=3D NULL) p =3D argv[0]; else ++p; + proc =3D 0; =20 if (!strcmp(p, "rtprio")) rtp.type =3D RTP_PRIO_REALTIME; @@ -70,12 +68,14 @@ main(argc, argv) =20 switch (argc) { case 2: - proc =3D abs(atoi(argv[1])); /* Should check if numeric - * arg! */ + proc =3D strtol(argv[1], &invalidchar, 10); + if (*invalidchar !=3D '\0' || invalidchar =3D=3D argv[1]) + errx(1, "Pid should be a number"); + proc =3D abs(proc); /* FALLTHROUGH */ case 1: if (rtprio(RTP_LOOKUP, proc, &rtp) !=3D 0) - err(1, "%s", argv[0]); + err(1, "RTP_LOOKUP"); printf("%s: ", p); switch (rtp.type) { case RTP_PRIO_REALTIME: @@ -104,18 +104,23 @@ main(argc, argv) break; } } else { - rtp.prio =3D atoi(argv[1]); + rtp.prio =3D strtol(argv[1], &invalidchar, 10); + if (*invalidchar !=3D '\0' || + invalidchar =3D=3D argv[1]) + errx(1, "Priority should be a number"); } } else { usage(); break; } =20 - if (argv[2][0] =3D=3D '-') - proc =3D -atoi(argv[2]); - + if (argv[2][0] =3D=3D '-') { + proc =3D strtol(argv[2] + 1, &invalidchar, 10); + if (*invalidchar !=3D '\0' || invalidchar =3D=3D argv[2] + 1) + errx(1, "Pid should be a number"); + } if (rtprio(RTP_SET, proc, &rtp) !=3D 0) - err(1, "%s", argv[0]); + err(1, "RTP_SET"); =20 if (proc =3D=3D 0) { execvp(argv[2], &argv[2]); @@ -123,12 +128,13 @@ main(argc, argv) } exit(0); } - exit (1); + exit(1); } =20 static void -usage() +usage(void) { + (void) fprintf(stderr, "%s\n%s\n%s\n%s\n%s\n%s\n", "usage: [id|rt]prio", " [id|rt]prio [-]pid", --yEPQxsgoJgBvi8ip Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEARECAAYFAk0hxYUACgkQC3+MBN1Mb4h6cACg7A4GWm+t1TMTbztERjYCGxmz C+oAnjfjNTCOIWmasShQ3+d0tUfwbn62 =ZNty -----END PGP SIGNATURE----- --yEPQxsgoJgBvi8ip-- From owner-freebsd-hackers@FreeBSD.ORG Mon Jan 3 15:28:16 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3A623106567A; Mon, 3 Jan 2011 15:28:16 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id EF6F48FC1C; Mon, 3 Jan 2011 15:28:15 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 9F97646B51; Mon, 3 Jan 2011 10:28:15 -0500 (EST) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id A01348A01D; Mon, 3 Jan 2011 10:28:14 -0500 (EST) From: John Baldwin To: Darmawan Salihun Date: Mon, 3 Jan 2011 10:22:02 -0500 User-Agent: KMail/1.13.5 (FreeBSD/7.3-CBSD-20101102; KDE/4.4.5; amd64; ; ) References: <745749.9930.qm@web76811.mail.sg1.yahoo.com> In-Reply-To: <745749.9930.qm@web76811.mail.sg1.yahoo.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201101031022.02558.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Mon, 03 Jan 2011 10:28:14 -0500 (EST) X-Virus-Scanned: clamav-milter 0.96.3 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-1.9 required=4.2 tests=BAYES_00 autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on bigwig.baldwin.cx Cc: freebsd-hackers@freebsd.org, Alexander Motin Subject: Re: PCI IDE Controller Base Address Register setting X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Jan 2011 15:28:16 -0000 On Saturday, January 01, 2011 2:58:12 pm Darmawan Salihun wrote: > > --- On Thu, 12/30/10, Darmawan Salihun wrote: > > > From: Darmawan Salihun > > Subject: Re: PCI IDE Controller Base Address Register setting > > To: "John Baldwin" > > Cc: freebsd-hackers@freebsd.org > > Date: Thursday, December 30, 2010, 3:28 PM > > --- On Tue, 12/28/10, John Baldwin > > > > wrote: > > > > > From: John Baldwin > > > Subject: Re: PCI IDE Controller Base Address Register > > setting > > > To: "Darmawan Salihun" > > > Cc: freebsd-hackers@freebsd.org > > > Date: Tuesday, December 28, 2010, 2:22 PM > > > On Tuesday, December 28, 2010 2:10:59 > > > pm Darmawan Salihun wrote: > > > > Hi, > > > > > > > > --- On Tue, 12/28/10, John Baldwin > > > wrote: > > > > > > > > > From: John Baldwin > > > > > Subject: Re: PCI IDE Controller Base > > Address > > > Register setting > > > > > To: "Darmawan Salihun" > > > > > Cc: freebsd-hackers@freebsd.org > > > > > Date: Tuesday, December 28, 2010, 1:52 PM > > > > > On Tuesday, December 28, 2010 1:38:05 > > > > > pm Darmawan Salihun wrote: > > > > > > Hi, > > > > > > > > > > > > --- On Tue, 12/28/10, John Baldwin > > > > > > > wrote: > > > > > > > > > > > > > From: John Baldwin > > > > > > > Subject: Re: PCI IDE Controller > > Base > > > Address > > > > > Register setting > > > > > > > To: freebsd-hackers@freebsd.org > > > > > > > Cc: "Darmawan Salihun" > > > > > > > Date: Tuesday, December 28, 2010, > > 10:20 > > > AM > > > > > > > On Monday, December 27, 2010 > > 6:07:35 > > > > > > > am Darmawan Salihun wrote: > > > > > > > > Hi, > > > > > > > > > > > > > > > > I'm trying to install FreeBSD > > 8.0 > > > on AMD > > > > > Geode LX800 > > > > > > > (CS5536 "southbridge"). > > > > > > > However, it cannot detect the IDE > > > controller (in > > > > > the > > > > > > > CS5536) correctly. It > > > > > > > says something similar to this: > > > > > > > > "IDE controller not present" > > > > > > > > > > > > > > Hmm, I can't find a message like > > that > > > > > anywhere. Can > > > > > > > you get the exact message > > > > > > > you are seeing? > > > > > > > > > > > > > > > > > > > It says: > > > > > > > > > > > > "No disks found! Please verify that > > your > > > disk > > > > > controller is being properly > > > > > > probed at boot time." > > > > > > > > > > Oh, so this is a message from the > > > installer. Can you > > > > > capture a verbose dmesg > > > > > via a serial console perhaps? > > > > > > > > I'm not sure if I can do this because I've tried > > a > > > couple of times > > > > but nothing comes out of the serial console. > > Perhaps a > > > wrong baud rate setting? > > > > I set it to 96bps and 8-N-1 back then. Is that > > > correct? > > > > > > Yes, that should be correct. You have to turn the > > > console on however (it is > > > not enabled by default). The simplest way to do > > this > > > is probably to hit the > > > key option to break into the loader prompt when you > > see the > > > boot menu (I think > > > it is option '6'). Then enter 'boot -D' at the 'OK' > > > prompt. This should boot > > > with both the video and serial consoles enabled with > > the > > > video console as the > > > primary console. For a verbose boot, use 'boot -Dv' > > > > > > > Thanks, I tested this option and it worked. > > I could see the debugging messages. > > > > FreeBSD cannot detect the disk in all of the IDE > > interfaces. > > (The AMDCS5536 only implemented the primary channel) > > > > Anyway, I manage to change the mapping in BAR4 of the IDE > > controller. > > However, I'm confused as to how to "force" FreeBSD to > > recognize the > > IDE controller to work only in compatibility mode. > > Because, I'm not sure if the physical IDE controller chip > > supports > > Native-PCI mode correctly at all. > > If I set BAR4 to "disabled"(i.e. not decoding any I/O > > addresses at all), > > would FreeBSD use compatibility mode? or would it consider > > the > > IDE controller not present? > > > > Here's some notes about the IDE controller PCI > > configuration registers: > > 1. The Programming Interface register contains 80h (which > > means _only_ > > compatibility mode supported). I have yet to be able to > > write new values > > into this register. That's the state of the register right > > now. > > I noticed in your previous reply that for FreeBSD to be > > forced to use > > compatibility mode, the programming interface register bits > > in the PCI configuration register must be set accordingly > > (I suppose the bits in the lower nibble). > > > > 2. BAR0-BAR3 cannot be changed and contains 00h. > > I have yet to experiment with BAR5.The default value is > > 00h > > > > Silly me that I didn't know about the SFF-8038i standard > (PCI IDE Bus mastering). So, I found out that it seems the > allocation of I/O ports for the IDE controller is just fine. > However, the primary IDE channel is shared between > an IDE interface and a CF card. Moreover, Linux detects > DMA bug, because all drives connected to the interface would be > in PIO mode :-/ > If all drives on the primary channel are "forced" to PIO mode, then > shouldn't the "IDE PCI bus master register" (offset 20h per SFF-8038i) > along with the command register (offset 4h), are set to indicate the > controller doesn't support bus mastering? This part I cannot help with as much (I'm not familiar with ATA/IDE/SATA specifics). I've cc'd mav@ who has done much of the recent work on our ATA drivers who is probably better able to answer this question. -- John Baldwin From owner-freebsd-hackers@FreeBSD.ORG Mon Jan 3 17:07:35 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6C8ED10656A3; Mon, 3 Jan 2011 17:07:35 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 3DB2A8FC1A; Mon, 3 Jan 2011 17:07:35 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id E748C46B4C; Mon, 3 Jan 2011 12:07:34 -0500 (EST) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 22DA08A01D; Mon, 3 Jan 2011 12:07:34 -0500 (EST) From: John Baldwin To: freebsd-hackers@freebsd.org, lev@freebsd.org Date: Mon, 3 Jan 2011 11:26:00 -0500 User-Agent: KMail/1.13.5 (FreeBSD/7.3-CBSD-20101102; KDE/4.4.5; amd64; ; ) References: <1385259976.20101230134918@serebryakov.spb.ru> <459047846.20101231122236@serebryakov.spb.ru> In-Reply-To: <459047846.20101231122236@serebryakov.spb.ru> MIME-Version: 1.0 Content-Type: Text/Plain; charset="windows-1251" Content-Transfer-Encoding: quoted-printable Message-Id: <201101031126.00450.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Mon, 03 Jan 2011 12:07:34 -0500 (EST) X-Virus-Scanned: clamav-milter 0.96.3 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-1.9 required=4.2 tests=BAYES_00 autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on bigwig.baldwin.cx Cc: Giovanni Trematerra Subject: Re: PANIC: thread_exit: Last thread exiting on its own. X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Jan 2011 17:07:35 -0000 On Friday, December 31, 2010 4:22:36 am Lev Serebryakov wrote: > Hello, Giovanni. > You wrote 31 =E4=E5=EA=E0=E1=F0=FF 2010 =E3., 1:56:20: >=20 > >> I've got this panic on reboot from geom_raid5. > > Could you please provide some backtrace? Have you got a core? > Backtrace was were simple (I've reproduce it from my memory, but it > really was that simple): >=20 > > panic() > thread_exit() > kthread_exit() > g_raid5_worker() > fork_trampoline() > ... >=20 > No core, because I didn't have dumpdev configured :( >=20 > > Which revision of -STABLE are you running(or when last src update)? > uname shows: >=20 > FreeBSD 8.2-PRERELEASE #2: Tue Dec 21 01:17:16 MSK 2010 >=20 > I've rebuilt kernel RIGHT after `csup', so difference is no more > than several hours. Looks like 204087 needs to be MFC'd. =2D-=20 John Baldwin From owner-freebsd-hackers@FreeBSD.ORG Mon Jan 3 17:23:03 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BE17A1065674; Mon, 3 Jan 2011 17:23:03 +0000 (UTC) (envelope-from lev@FreeBSD.org) Received: from ftp.translate.ru (ftp.translate.ru [80.249.188.42]) by mx1.freebsd.org (Postfix) with ESMTP id 70F628FC16; Mon, 3 Jan 2011 17:23:03 +0000 (UTC) Received: from [192.168.134.2] (89.112.15.178.pppoe.eltel.net [89.112.15.178]) (Authenticated sender: lev@serebryakov.spb.ru) by ftp.translate.ru (Postfix) with ESMTPA id 099D913DF61; Mon, 3 Jan 2011 20:23:01 +0300 (MSK) Date: Mon, 3 Jan 2011 20:22:58 +0300 From: Lev Serebryakov Organization: FreeBSD X-Priority: 3 (Normal) Message-ID: <1375017547.20110103202258@serebryakov.spb.ru> To: John Baldwin In-Reply-To: <201101031126.00450.jhb@freebsd.org> References: <1385259976.20101230134918@serebryakov.spb.ru> <459047846.20101231122236@serebryakov.spb.ru> <201101031126.00450.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=windows-1251 Content-Transfer-Encoding: quoted-printable Cc: freebsd-hackers@freebsd.org, lev@freebsd.org, Giovanni Trematerra Subject: Re: PANIC: thread_exit: Last thread exiting on its own. X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: lev@FreeBSD.org List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Jan 2011 17:23:03 -0000 Hello, John. You wrote 3 =FF=ED=E2=E0=F0=FF 2011 =E3., 19:26:00: >> >> I've got this panic on reboot from geom_raid5. >> > Could you please provide some backtrace? Have you got a core? >> Backtrace was were simple (I've reproduce it from my memory, but it >> really was that simple): >>=20 >> >> panic() >> thread_exit() >> kthread_exit() >> g_raid5_worker() >> fork_trampoline() >> ... >>=20 >> No core, because I didn't have dumpdev configured :( >>=20 >> > Which revision of -STABLE are you running(or when last src update)? >> uname shows: >>=20 >> FreeBSD 8.2-PRERELEASE #2: Tue Dec 21 01:17:16 MSK 2010 >>=20 >> I've rebuilt kernel RIGHT after `csup', so difference is no more >> than several hours. > Looks like 204087 needs to be MFC'd. I've looked at this patch, and it seems to be relevant. --=20 // Black Lion AKA Lev Serebryakov From owner-freebsd-hackers@FreeBSD.ORG Mon Jan 3 18:08:19 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 64DAF106566B; Mon, 3 Jan 2011 18:08:19 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id BE2B78FC0A; Mon, 3 Jan 2011 18:08:18 +0000 (UTC) Received: by fxm16 with SMTP id 16so13252557fxm.13 for ; Mon, 03 Jan 2011 10:08:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=wmG3uZ88/4bLl3rw/e5Jd2yi51OyB6WEK5xiVm21xF4=; b=gtN0WUarCoTEhTSLMqwAEtWehtesH7S093hI3an2ts7jx67CzrsKAda1zobHSjM/HT pk7cULPVM+lQ2xpMZgugxG5UqKB/wrl8rlx/uNvDykC2J4XNU9Jn+MsAojXPOd3CMl2I CYqX5mNyYoHLMFdhlRTPCpGnbnDjqLlZPBxvU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; b=fCkEZ3DFatU4yK2HwlfaRblt/mtFQDJXlKlYJzrKoR2IbPyYwr2Y0jRPvrIsZAUkQZ 36t5cVnK4lJJZxRAOnX3xH5M3mKe4u0FCdG9ovOSRI+c6SiJ/d44Mirg6QaR13rQsL1A GVJQlFlK5bE7YZi21zpXB2a0Q0awOsHcLngWc= Received: by 10.103.240.12 with SMTP id s12mr1539529mur.42.1294078097542; Mon, 03 Jan 2011 10:08:17 -0800 (PST) Received: from mavbook.mavhome.dp.ua ([91.198.175.253]) by mx.google.com with ESMTPS id l3sm3089632fan.2.2011.01.03.10.08.13 (version=SSLv3 cipher=RC4-MD5); Mon, 03 Jan 2011 10:08:15 -0800 (PST) Sender: Alexander Motin Message-ID: <4D221088.8080103@FreeBSD.org> Date: Mon, 03 Jan 2011 20:08:08 +0200 From: Alexander Motin User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.12) Gecko/20101104 Thunderbird/3.1.6 MIME-Version: 1.0 To: John Baldwin References: <745749.9930.qm@web76811.mail.sg1.yahoo.com> <201101031022.02558.jhb@freebsd.org> In-Reply-To: <201101031022.02558.jhb@freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org, Darmawan Salihun Subject: Re: PCI IDE Controller Base Address Register setting X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Jan 2011 18:08:19 -0000 > On Saturday, January 01, 2011 2:58:12 pm Darmawan Salihun wrote: >> So, I found out that it seems the >> allocation of I/O ports for the IDE controller is just fine. >> However, the primary IDE channel is shared between >> an IDE interface and a CF card. Moreover, Linux detects >> DMA bug, because all drives connected to the interface would be >> in PIO mode :-/ >> If all drives on the primary channel are "forced" to PIO mode, then >> shouldn't the "IDE PCI bus master register" (offset 20h per SFF-8038i) >> along with the command register (offset 4h), are set to indicate the >> controller doesn't support bus mastering? I don't think that BIOS should change controller capabilities depending on attached drives, may be except may be for workarounding some known bugs/incompatibilities. Otherwise this will just make hot-plug things tricky and unpredictable. >> Anyway, is it possible for devices on _the same_ channel to use >> different setting in FreeBSD? For example, the primary slave >> is using UDMA66 while the primary master is using PIO-4. >> Or such configuration is considered invalid. Yes, it is possible. If automatic negotiation doesn't succeed for some reason, you may limit initial mode for each specific device using hint.ata.X.devY.mode loader tunables, added not so long ago. After boot it can also be tuned per-device via atacontrol or camcontrol tools, depending on ATA stack used. >> The AMDLX800-CS5536 board I'm working with has different connectors >> for the primary master and primary slave. Moreover, the chipset >> supports different setting in primary master and primary slave. There are few other controllers not supporting such configurations, but it is handled by their specific drivers. -- Alexander Motin From owner-freebsd-hackers@FreeBSD.ORG Mon Jan 3 19:01:58 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C136B106566B; Mon, 3 Jan 2011 19:01:58 +0000 (UTC) (envelope-from giovanni.trematerra@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id C93798FC1C; Mon, 3 Jan 2011 19:01:57 +0000 (UTC) Received: by fxm16 with SMTP id 16so13302727fxm.13 for ; Mon, 03 Jan 2011 11:01:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:references:from:in-reply-to :mime-version:date:message-id:subject:to:cc:content-type; bh=i425HTrBzzS6hA06VmABWZXee94wRO+7ScCrlmB+L2I=; b=NDcLD8lm58/+5oZI56RDxif9fOBkJHQ6v4DPd35T/dUGXnCzWF7o7LyaAvCFkxHSqK P0pcTbqEPYlOgkj2v7vrN5531vQjPnUJ2Tp/+wytx6ZAQDsEUaz5jSDjLQWlXTCNWB2R F5jhDYHZyoUkaVNTyhqPSG/4LXAv526gugYl4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=references:from:in-reply-to:mime-version:date:message-id:subject:to :cc:content-type; b=sFeMxPoS2d8JWP56QGyAgPLud5qIC0F9ryEBNKYVmhX3WtT2k2wVoHFyeMaAkbM0a5 E5NYvSnPbEDUN8Tl0zrW3saRnisVZAXqJk1aeGmenGGTOGF/YOoeZcOMVZV5OHLENTPM x3gWXxL3Za8EZO1O/vnpjKNRP60I4Ho6fA+Os= Received: by 10.223.83.11 with SMTP id d11mr166765fal.37.1294081316736; Mon, 03 Jan 2011 11:01:56 -0800 (PST) References: <1385259976.20101230134918@serebryakov.spb.ru> <459047846.20101231122236@serebryakov.spb.ru> <201101031126.00450.jhb@freebsd.org> <1375017547.20110103202258@serebryakov.spb.ru> From: Giovanni Trematerra In-Reply-To: <1375017547.20110103202258@serebryakov.spb.ru> Mime-Version: 1.0 (iPod Mail 8C148) Date: Mon, 3 Jan 2011 20:03:59 +0100 Message-ID: <1906391484091420528@unknownmsgid> To: "lev@FreeBSD.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: "freebsd-hackers@freebsd.org" , Giovanni Trematerra Subject: Re: PANIC: thread_exit: Last thread exiting on its own. X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Jan 2011 19:01:58 -0000 On 03/gen/2011, at 18:23, Lev Serebryakov wrote: Hello, John. You wrote 3 =D1=8F=D0=BD=D0=B2=D0=B0=D1=80=D1=8F 2011 =D0=B3., 19:26:00: I've got this panic on reboot from geom_raid5. Could you please provide some backtrace? Have you got a core? Backtrace was were simple (I've reproduce it from my memory, but it really was that simple): panic() thread_exit() kthread_exit() g_raid5_worker() fork_trampoline() ... No core, because I didn't have dumpdev configured :( Which revision of -STABLE are you running(or when last src update)? uname shows: FreeBSD 8.2-PRERELEASE #2: Tue Dec 21 01:17:16 MSK 2010 I've rebuilt kernel RIGHT after `csup', so difference is no more than several hours. Looks like 204087 needs to be MFC'd. I've looked at this patch, and it seems to be relevant. --=20 // Black Lion AKA Lev Serebryakov Please, let's us to know if that patch resolve your issue Thank you -- Gianni From owner-freebsd-hackers@FreeBSD.ORG Mon Jan 3 20:02:37 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7DBBA106564A for ; Mon, 3 Jan 2011 20:02:37 +0000 (UTC) (envelope-from darmawan_salihun@yahoo.com) Received: from web76801.mail.sg1.yahoo.com (web76801.mail.sg1.yahoo.com [124.108.123.105]) by mx1.freebsd.org (Postfix) with SMTP id E77F38FC1A for ; Mon, 3 Jan 2011 20:02:36 +0000 (UTC) Received: (qmail 22065 invoked by uid 60001); 3 Jan 2011 20:02:35 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1294084955; bh=LyKCf672DsLOqQEZv22NtCDn0HQWWUqKbLHbX6oLOm8=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=581N1uMg4XqGCteb/r9U0sRYdpz+1N9ryK5HOh56gUTPwiR/9ACQAXeaRo6peQyifrQQJekxvAPlMyU3P46LK+FG/C5cZtCabpMUz/b7vc9TAiyjaHtUeX/zrFcaMzlIiB8idmoWGUnj+qXHjQvBKBO3nkoEqwtYXiLqQaNuqdI= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=QiCEejTNgpyXLeuSC9ZlOAx6qWm3ZrY+9EQqoJynw2RDptrEHVMVEMhxfxIEWw5ECJEMtxJiQts357XIPkdTD45lC+gj0iIdbTKyXz6tfUAVyTSg8IwhKfpN+tEyzNgeWFsDR4WkXYmivPLndJoEIUjBRZMaU7+G7/XZohSM10M=; Message-ID: <690521.13311.qm@web76801.mail.sg1.yahoo.com> X-YMail-OSG: doyCVTkVM1kyxzYxSVe1Gz7c9ON5zRgsVG5Q0GMI8.HRsqp pVIheIsRFk_rd_66vEwy70VYIlx_IWD9VvkQr_26wkXGFbPMopSYnr.CTO8a uPs3bUNiw0mMDUyhszGUqOxb7HIs9Zt5qaMJzN6wRAahYeFo2FSejKzj8aZH XCP_3mpOFUT8Ogmgm.Jg8xS6Ujl27GQDtx2FbMShy5gQgWvPJ8hHLpQbvduo q10vyNFIpEbUphmJikHsSkTm3T2MHIXRCMObswWzgqWGauVBAk_uFgm0SEqR gxV9cWFjnA97WznJ_fi38fAOUF3CfCxmsnsMBTj.6vzextUORXUqtPJCZZ6w 5UX71tCiDeSb7k9fMXQ-- Received: from [114.58.119.157] by web76801.mail.sg1.yahoo.com via HTTP; Tue, 04 Jan 2011 04:02:35 SGT X-Mailer: YahooMailClassic/11.4.20 YahooMailWebService/0.8.107.285259 Date: Tue, 4 Jan 2011 04:02:35 +0800 (SGT) From: Darmawan Salihun To: Alexander Motin In-Reply-To: <4D221088.8080103@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-hackers@freebsd.org Subject: Re: PCI IDE Controller Base Address Register setting X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Jan 2011 20:02:37 -0000 --- On Mon, 1/3/11, Alexander Motin wrote: > From: Alexander Motin > Subject: Re: PCI IDE Controller Base Address Register setting > To: "John Baldwin" > Cc: "Darmawan Salihun" , freebsd-hackers@free= bsd.org > Date: Monday, January 3, 2011, 1:08 PM > > On Saturday, January 01, 2011 > 2:58:12 pm Darmawan Salihun wrote: > >> So, I found out that it seems the > >> allocation of I/O ports for the IDE controller is > just fine. > >> However, the primary IDE channel is shared > between > >> an IDE interface=A0 and a CF card. Moreover, > Linux detects > >> DMA bug, because all drives connected to the > interface would be > >> in PIO mode :-/ > >> If all drives on the primary channel are "forced" > to PIO mode, then > >> shouldn't the "IDE PCI bus master register" > (offset 20h per SFF-8038i) > >> along with the command register (offset 4h), are > set to indicate the > >> controller doesn't support bus mastering? >=20 > I don't think that BIOS should change controller > capabilities depending on attached drives, may be except may > be for workarounding some known bugs/incompatibilities. > Otherwise this will just make hot-plug things tricky and > unpredictable. >=20 > >> Anyway, is it possible for devices on _the same_ > channel to use > >> different setting in FreeBSD? For example, the > primary slave > >> is using UDMA66 while the primary master is using > PIO-4. > >> Or such configuration is considered invalid. >=20 > Yes, it is possible. If automatic negotiation doesn't > succeed for some reason, you may limit initial mode for each > specific device using hint.ata.X.devY.mode loader tunables, > added not so long ago. After boot it can also be tuned > per-device via atacontrol or camcontrol tools, depending on > ATA stack used. >=20 > >> The AMDLX800-CS5536 board I'm working with has > different connectors > >> for the primary master and primary slave. > Moreover, the chipset > >> supports different setting in primary master and > primary slave. >=20 > There are few other controllers not supporting such > configurations, but it is handled by their specific > drivers. >=20 > -- Alexander Motin >=20 I get the following log message upon booting with "boot -Dv": =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D ata0: on atapci0 ata0: reset tp1 mask=3D03 ostat0=3D50 ostat1=3D50 ata0: stat0=3D0x80 err=3D0x00 lsb=3D0x00 msb=3D0x00 ata0: stat0=3D0x50 err=3D0x01 lsb=3D0x00 msb=3D0x00 ata0: stat1=3D0x50 err=3D0x01 lsb=3D0x00 msb=3D0x00 ata0: reset tp2 stat0=3D50 stat1=3D50 devices=3D0x3 ... ata0: Identifying devices: 00000003 ata0: New devices: 00000003 ... ata0-slave: pio=3DPIO4 wdma=3DWDMA2 udma=3DUDMA100 cable=3D80 wire ata0-master: pio=3DPIO1 wdma=3DUNSUPPORTED udma=3DUNSUPPORTED cable=3D40 wi= re ... ad0: FAILURE setting PIO1 on CS5536 chip ad0: 488MB at ata0-master BIOSPIO ... GEOM: newdisk ad0 ad0: Adaptec check1 failed ad0: LSI(v3) check1 failed ad0: FAILURE - READ status=3D51 error=3Dc4 LBA=3D0 ... ad1: setting PIO4 on CS5536 chip ad1: setting UDMA100 on CS5536 chip ad1: 38150MB at ata0-slave UDMA100 ... GEOM: newdisk ad1 ... ad1: FAILURE - READ_DMA status=3D51 error=3D84 LBA=3D78132575 ad1: FAILURE - READ_DMA status=3D51 error=3D84 LBA=3D78132591 ... =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D I have several questions:=20 1. How FreeBSD sets the PIO mode on the target IDE controller?=20 what could've caused it to fail like the message above? 2. It seems to me that setting the UDMA100 in the=20 AMD CS5536 IDE controller went just fine (in the log above).=20 But, FreeBSD fails when it tries to read something from the drive.=20 Does it mean the UDMA100 "mode" failed to be set correctly=20 in the IDE controller?=20 3. As I'm currently trying to fix the bug in the BIOS for the particular=20 board used to boot FreeBSD, what would you suggest to fix it?=20 Thank you very much.=20 Kind Regards,=20 Darmawan =0A=0A=0A From owner-freebsd-hackers@FreeBSD.ORG Tue Jan 4 10:36:55 2011 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B7F63106566C for ; Tue, 4 Jan 2011 10:36:55 +0000 (UTC) (envelope-from keramida@ceid.upatras.gr) Received: from igloo.linux.gr (igloo.linux.gr [62.1.205.36]) by mx1.freebsd.org (Postfix) with ESMTP id 13BF68FC15 for ; Tue, 4 Jan 2011 10:36:54 +0000 (UTC) X-Spam-Status: No X-Hellug-MailScanner-From: keramida@ceid.upatras.gr X-Hellug-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-2.9, required 5, autolearn=not spam, ALL_TRUSTED -1.00, BAYES_00 -1.90) X-Hellug-MailScanner: Found to be clean X-Hellug-MailScanner-ID: p04AaclW022543 Received: from gkeramidas-glaptop.linux.gr ([74.125.57.36]) (authenticated bits=0) by igloo.linux.gr (8.14.3/8.14.3/Debian-9.4) with ESMTP id p04AaclW022543 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 4 Jan 2011 12:36:44 +0200 From: Giorgos Keramidas To: Eitan Adler References: <6BEFA669-2E1F-44E6-897A-0A51DA939A74@gmail.com> <20110102101845.GC90883@deviant.kiev.zoral.com.ua> Date: Tue, 04 Jan 2011 11:36:38 +0100 In-Reply-To: (Eitan Adler's message of "Sun, 2 Jan 2011 18:46:47 -0500") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Cc: Kostik Belousov , hackers@freebsd.org Subject: Re: [patch] have rtprio check that arguments are numeric; change atoi to strtol X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Jan 2011 10:36:55 -0000 On Sun, 2 Jan 2011 18:46:47 -0500, Eitan Adler wrote: > What about this patch? I incorporated your feedback so I am not going > to reply inline. Since the pattern of converting strings to int-derivative values appears multiple times, I'd probably prefer something like a new function that does the parsing *and* error-checking, to avoid duplication of errno checks, invalidchar checks, and so on, e.g. something like this near the top of rtprio.c: #include #include #include /* * Parse an integer from 'string' into 'value'. Return the first * invalid character in 'endp', if endp is non-NULL. The return value * of parseint is 0 on success, -1 for any parse error. */ int parseint(const char *string, const char **endp, int base, int *value) { long x; errno = 0; x = strtol(string, endp, base); if (errno != 0 || endp == str || (endp != NULL && endp != str && *endp != '\0' && (isdigit(*endp) == 0 || isspace(*endp) != 0))) return -1; if (x >= INT_MAX) { errno = ERANGE; return -1; } return (int)x; } Then you can replace all the atoi() calls with: int x; if (parseint(argv[1], NULL, 0, &x) != 0) errx(1, "your message"); which is a relatively cleaner way of handling strtol() parsing errors, without the associated clutter of checking properly all possible edge cases at every call-point. From owner-freebsd-hackers@FreeBSD.ORG Tue Jan 4 10:41:09 2011 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4D1C71065670 for ; Tue, 4 Jan 2011 10:41:09 +0000 (UTC) (envelope-from keramida@ceid.upatras.gr) Received: from igloo.linux.gr (igloo.linux.gr [62.1.205.36]) by mx1.freebsd.org (Postfix) with ESMTP id C04FA8FC0C for ; Tue, 4 Jan 2011 10:41:08 +0000 (UTC) X-Spam-Status: No X-Hellug-MailScanner-From: keramida@ceid.upatras.gr X-Hellug-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-2.9, required 5, autolearn=not spam, ALL_TRUSTED -1.00, BAYES_00 -1.90) X-Hellug-MailScanner: Found to be clean X-Hellug-MailScanner-ID: p04Aejhl022747 Received: from gkeramidas-glaptop.linux.gr ([74.125.57.36]) (authenticated bits=0) by igloo.linux.gr (8.14.3/8.14.3/Debian-9.4) with ESMTP id p04Aejhl022747 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 4 Jan 2011 12:40:51 +0200 From: Giorgos Keramidas To: Eitan Adler References: <6BEFA669-2E1F-44E6-897A-0A51DA939A74@gmail.com> <20110102101845.GC90883@deviant.kiev.zoral.com.ua> Date: Tue, 04 Jan 2011 11:40:45 +0100 In-Reply-To: (Giorgos Keramidas's message of "Tue, 04 Jan 2011 11:36:38 +0100") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Cc: Kostik Belousov , hackers@freebsd.org Subject: Re: [patch] have rtprio check that arguments are numeric; change atoi to strtol X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Jan 2011 10:41:09 -0000 On Tue, 04 Jan 2011 11:36:38 +0100, Giorgos Keramidas wrote: > On Sun, 2 Jan 2011 18:46:47 -0500, Eitan Adler wrote: >> What about this patch? I incorporated your feedback so I am not going >> to reply inline. > > Since the pattern of converting strings to int-derivative values appears > multiple times, I'd probably prefer something like a new function that > does the parsing *and* error-checking, to avoid duplication of errno > checks, invalidchar checks, and so on, e.g. something like this near the > top of rtprio.c: > > #include > #include > #include > > /* > * Parse an integer from 'string' into 'value'. Return the first > * invalid character in 'endp', if endp is non-NULL. The return value > * of parseint is 0 on success, -1 for any parse error. > */ > > int > parseint(const char *string, const char **endp, int base, int *value) > { > long x; > > errno = 0; > x = strtol(string, endp, base); > if (errno != 0 || endp == str || (endp != NULL && > endp != str && *endp != '\0' && (isdigit(*endp) == 0 || > isspace(*endp) != 0))) > return -1; > if (x >= INT_MAX) { > errno = ERANGE; > return -1; > } > return (int)x; > } instead of `return (int)x' the last bits should be slightly different, of course: if (value != NULL) *value = (int)x; return 0; } From owner-freebsd-hackers@FreeBSD.ORG Tue Jan 4 11:25:08 2011 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ACD48106564A; Tue, 4 Jan 2011 11:25:08 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 34A088FC13; Tue, 4 Jan 2011 11:25:07 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id p04BP2tg020146 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 4 Jan 2011 13:25:02 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id p04BP2Gw010392; Tue, 4 Jan 2011 13:25:02 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id p04BP2KJ010391; Tue, 4 Jan 2011 13:25:02 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 4 Jan 2011 13:25:02 +0200 From: Kostik Belousov To: Giorgos Keramidas Message-ID: <20110104112502.GM3140@deviant.kiev.zoral.com.ua> References: <6BEFA669-2E1F-44E6-897A-0A51DA939A74@gmail.com> <20110102101845.GC90883@deviant.kiev.zoral.com.ua> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="OGW1Z2JKiS9bXo17" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: Eitan Adler , hackers@freebsd.org Subject: Re: [patch] have rtprio check that arguments are numeric; change atoi to strtol X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Jan 2011 11:25:08 -0000 --OGW1Z2JKiS9bXo17 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jan 04, 2011 at 11:40:45AM +0100, Giorgos Keramidas wrote: > On Tue, 04 Jan 2011 11:36:38 +0100, Giorgos Keramidas wrote: > > On Sun, 2 Jan 2011 18:46:47 -0500, Eitan Adler w= rote: > >> What about this patch? I incorporated your feedback so I am not going > >> to reply inline. > > > > Since the pattern of converting strings to int-derivative values appears > > multiple times, I'd probably prefer something like a new function that > > does the parsing *and* error-checking, to avoid duplication of errno > > checks, invalidchar checks, and so on, e.g. something like this near the > > top of rtprio.c: > > > > #include > > #include > > #include > > > > /* > > * Parse an integer from 'string' into 'value'. Return the fir= st > > * invalid character in 'endp', if endp is non-NULL. The retur= n value > > * of parseint is 0 on success, -1 for any parse error. > > */ > > > > int > > parseint(const char *string, const char **endp, int base, int *= value) > > { > > long x; > > > > errno =3D 0; > > x =3D strtol(string, endp, base); > > if (errno !=3D 0 || endp =3D=3D str || (endp !=3D NULL = && > > endp !=3D str && *endp !=3D '\0' && (isdigit(*endp)= =3D=3D 0 || > > isspace(*endp) !=3D 0))) > > return -1; > > if (x >=3D INT_MAX) { > > errno =3D ERANGE; > > return -1; > > } > > return (int)x; > > } >=20 > instead of `return (int)x' the last bits should be slightly different, > of course: >=20 > if (value !=3D NULL) > *value =3D (int)x; > return 0; > } Well, I think it shall be simplified. What about this ? diff --git a/usr.sbin/rtprio/rtprio.c b/usr.sbin/rtprio/rtprio.c index 245f714..fc212b5 100644 --- a/usr.sbin/rtprio/rtprio.c +++ b/usr.sbin/rtprio/rtprio.c @@ -37,31 +37,31 @@ __FBSDID("$FreeBSD$"); =20 #include #include -#include =20 #include #include +#include #include #include #include #include =20 -static void usage(); +static int parseint(const char *, const char *); +static void usage(void); =20 int -main(argc, argv) - int argc; - char **argv; +main(int argc, char *argv[]) { - char *p; - int proc =3D 0; struct rtprio rtp; + char *p; + pid_t proc; =20 /* find basename */ if ((p =3D rindex(argv[0], '/')) =3D=3D NULL) p =3D argv[0]; else ++p; + proc =3D 0; =20 if (!strcmp(p, "rtprio")) rtp.type =3D RTP_PRIO_REALTIME; @@ -70,12 +70,12 @@ main(argc, argv) =20 switch (argc) { case 2: - proc =3D abs(atoi(argv[1])); /* Should check if numeric - * arg! */ + proc =3D parseint(argv[1], "pid"); + proc =3D abs(proc); /* FALLTHROUGH */ case 1: if (rtprio(RTP_LOOKUP, proc, &rtp) !=3D 0) - err(1, "%s", argv[0]); + err(1, "RTP_LOOKUP"); printf("%s: ", p); switch (rtp.type) { case RTP_PRIO_REALTIME: @@ -103,19 +103,17 @@ main(argc, argv) usage(); break; } - } else { - rtp.prio =3D atoi(argv[1]); - } + } else + rtp.prio =3D parseint(argv[1], "priority"); } else { usage(); break; } =20 if (argv[2][0] =3D=3D '-') - proc =3D -atoi(argv[2]); - + proc =3D parseint(argv[2] + 1, "pid"); if (rtprio(RTP_SET, proc, &rtp) !=3D 0) - err(1, "%s", argv[0]); + err(1, "RTP_SET"); =20 if (proc =3D=3D 0) { execvp(argv[2], &argv[2]); @@ -123,12 +121,28 @@ main(argc, argv) } exit(0); } - exit (1); + exit(1); +} + +static int +parseint(const char *str, const char *errname) +{ + char *endp; + long res; + + errno =3D 0; + res =3D strtol(str, &endp, 10); + if (errno !=3D 0 || endp =3D=3D str || *endp !=3D '\0') + err(1, "%s shall be a number", errname); + if (res >=3D INT_MAX) + err(1, "Integer overflow parsing %s", errname); + return (res); } =20 static void -usage() +usage(void) { + (void) fprintf(stderr, "%s\n%s\n%s\n%s\n%s\n%s\n", "usage: [id|rt]prio", " [id|rt]prio [-]pid", --OGW1Z2JKiS9bXo17 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEARECAAYFAk0jA40ACgkQC3+MBN1Mb4jWbACg8/dLTPu1y3BtiADPqDyzcxsE 5Y4AnAyT3okHzF2IF1yEkJ8pf8Xr9oDe =MFsG -----END PGP SIGNATURE----- --OGW1Z2JKiS9bXo17-- From owner-freebsd-hackers@FreeBSD.ORG Tue Jan 4 12:27:01 2011 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 056E61065670 for ; Tue, 4 Jan 2011 12:27:01 +0000 (UTC) (envelope-from keramida@ceid.upatras.gr) Received: from igloo.linux.gr (igloo.linux.gr [62.1.205.36]) by mx1.freebsd.org (Postfix) with ESMTP id 88AA78FC18 for ; Tue, 4 Jan 2011 12:27:00 +0000 (UTC) X-Spam-Status: No X-Hellug-MailScanner-From: keramida@ceid.upatras.gr X-Hellug-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-2.9, required 5, autolearn=not spam, ALL_TRUSTED -1.00, BAYES_00 -1.90) X-Hellug-MailScanner: Found to be clean X-Hellug-MailScanner-ID: p04CQktb029436 Received: from gkeramidas-glaptop.linux.gr ([74.125.57.36]) (authenticated bits=0) by igloo.linux.gr (8.14.3/8.14.3/Debian-9.4) with ESMTP id p04CQktb029436 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 4 Jan 2011 14:26:52 +0200 From: Giorgos Keramidas To: Kostik Belousov References: <6BEFA669-2E1F-44E6-897A-0A51DA939A74@gmail.com> <20110102101845.GC90883@deviant.kiev.zoral.com.ua> <20110104112502.GM3140@deviant.kiev.zoral.com.ua> Date: Tue, 04 Jan 2011 13:26:40 +0100 In-Reply-To: <20110104112502.GM3140@deviant.kiev.zoral.com.ua> (Kostik Belousov's message of "Tue, 4 Jan 2011 13:25:02 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" Cc: Eitan Adler , hackers@freebsd.org Subject: Re: [patch] have rtprio check that arguments are numeric; change atoi to strtol X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Jan 2011 12:27:01 -0000 --=-=-= Content-Type: text/plain On Tue, 4 Jan 2011 13:25:02 +0200, Kostik Belousov wrote: >On Tue, Jan 04, 2011 at 11:40:45AM +0100, Giorgos Keramidas wrote: >>On Tue, 04 Jan 2011 11:36:38 +0100, Giorgos Keramidas wrote: >>> Since the pattern of converting strings to int-derivative values appears >>> multiple times, I'd probably prefer something like a new function that >>> does the parsing *and* error-checking, to avoid duplication of errno >>> checks, invalidchar checks, and so on, e.g. something like this near the >>> top of rtprio.c: >>> >>> /* >>> * Parse an integer from 'string' into 'value'. Return the first >>> * invalid character in 'endp', if endp is non-NULL. The return value >>> * of parseint is 0 on success, -1 for any parse error. >>> */ >>> >>> int >>> parseint(const char *string, const char **endp, int base, int *value) >>> ... > } > > Well, I think it shall be simplified. What about this ? This looks much better than plain strtol() calls. Thanks :) > diff --git a/usr.sbin/rtprio/rtprio.c b/usr.sbin/rtprio/rtprio.c > index 245f714..fc212b5 100644 > --- a/usr.sbin/rtprio/rtprio.c > +++ b/usr.sbin/rtprio/rtprio.c > @@ -37,31 +37,31 @@ __FBSDID("$FreeBSD$"); > > #include > #include > -#include > > #include > #include > +#include > #include > #include > #include > #include > > -static void usage(); > +static int parseint(const char *, const char *); > +static void usage(void); > > int > -main(argc, argv) > - int argc; > - char **argv; > +main(int argc, char *argv[]) > { > - char *p; > - int proc = 0; > struct rtprio rtp; > + char *p; > + pid_t proc; > > /* find basename */ > if ((p = rindex(argv[0], '/')) == NULL) > p = argv[0]; > else > ++p; > + proc = 0; > > if (!strcmp(p, "rtprio")) > rtp.type = RTP_PRIO_REALTIME; > @@ -70,12 +70,12 @@ main(argc, argv) > > switch (argc) { > case 2: > - proc = abs(atoi(argv[1])); /* Should check if numeric > - * arg! */ > + proc = parseint(argv[1], "pid"); > + proc = abs(proc); > /* FALLTHROUGH */ > case 1: > if (rtprio(RTP_LOOKUP, proc, &rtp) != 0) > - err(1, "%s", argv[0]); > + err(1, "RTP_LOOKUP"); > printf("%s: ", p); > switch (rtp.type) { > case RTP_PRIO_REALTIME: > @@ -103,19 +103,17 @@ main(argc, argv) > usage(); > break; > } > - } else { > - rtp.prio = atoi(argv[1]); > - } > + } else > + rtp.prio = parseint(argv[1], "priority"); > } else { > usage(); > break; > } > > if (argv[2][0] == '-') > - proc = -atoi(argv[2]); > - > + proc = parseint(argv[2] + 1, "pid"); > if (rtprio(RTP_SET, proc, &rtp) != 0) > - err(1, "%s", argv[0]); > + err(1, "RTP_SET"); > > if (proc == 0) { > execvp(argv[2], &argv[2]); > @@ -123,12 +121,28 @@ main(argc, argv) > } > exit(0); > } > - exit (1); > + exit(1); > +} > + > +static int > +parseint(const char *str, const char *errname) > +{ > + char *endp; > + long res; > + > + errno = 0; > + res = strtol(str, &endp, 10); > + if (errno != 0 || endp == str || *endp != '\0') > + err(1, "%s shall be a number", errname); > + if (res >= INT_MAX) > + err(1, "Integer overflow parsing %s", errname); > + return (res); > } > > static void > -usage() > +usage(void) > { > + > (void) fprintf(stderr, "%s\n%s\n%s\n%s\n%s\n%s\n", > "usage: [id|rt]prio", > " [id|rt]prio [-]pid", --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iEYEARECAAYFAk0jEgAACgkQ1g+UGjGGA7aeSACffIzcQAu+rwUHEmSx4t2bMVeY iUcAn3MZ9Dqdb7uuC7Bf7I1luDY7sc7+ =PXOi -----END PGP SIGNATURE----- --=-=-=-- From owner-freebsd-hackers@FreeBSD.ORG Tue Jan 4 13:27:29 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D84381065672; Tue, 4 Jan 2011 13:27:29 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id A75CE8FC13; Tue, 4 Jan 2011 13:27:29 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 565F246B58; Tue, 4 Jan 2011 08:27:29 -0500 (EST) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 876708A01D; Tue, 4 Jan 2011 08:27:28 -0500 (EST) From: John Baldwin To: freebsd-hackers@freebsd.org Date: Tue, 4 Jan 2011 08:05:59 -0500 User-Agent: KMail/1.13.5 (FreeBSD/7.3-CBSD-20101102; KDE/4.4.5; amd64; ; ) References: <20110104112502.GM3140@deviant.kiev.zoral.com.ua> In-Reply-To: <20110104112502.GM3140@deviant.kiev.zoral.com.ua> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201101040805.59412.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Tue, 04 Jan 2011 08:27:28 -0500 (EST) X-Virus-Scanned: clamav-milter 0.96.3 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-1.9 required=4.2 tests=BAYES_00 autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on bigwig.baldwin.cx Cc: Kostik Belousov , Eitan Adler , hackers@freebsd.org, Giorgos Keramidas Subject: Re: [patch] have rtprio check that arguments are numeric; change atoi to strtol X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Jan 2011 13:27:29 -0000 On Tuesday, January 04, 2011 6:25:02 am Kostik Belousov wrote: > On Tue, Jan 04, 2011 at 11:40:45AM +0100, Giorgos Keramidas wrote: > @@ -123,12 +121,28 @@ main(argc, argv) > } > exit(0); > } > - exit (1); > + exit(1); > +} > + > +static int > +parseint(const char *str, const char *errname) > +{ > + char *endp; > + long res; > + > + errno = 0; > + res = strtol(str, &endp, 10); > + if (errno != 0 || endp == str || *endp != '\0') > + err(1, "%s shall be a number", errname); Small nit, maybe use 'must' instead of 'shall'. -- John Baldwin From owner-freebsd-hackers@FreeBSD.ORG Tue Jan 4 13:27:29 2011 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D84381065672; Tue, 4 Jan 2011 13:27:29 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id A75CE8FC13; Tue, 4 Jan 2011 13:27:29 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 565F246B58; Tue, 4 Jan 2011 08:27:29 -0500 (EST) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 876708A01D; Tue, 4 Jan 2011 08:27:28 -0500 (EST) From: John Baldwin To: freebsd-hackers@freebsd.org Date: Tue, 4 Jan 2011 08:05:59 -0500 User-Agent: KMail/1.13.5 (FreeBSD/7.3-CBSD-20101102; KDE/4.4.5; amd64; ; ) References: <20110104112502.GM3140@deviant.kiev.zoral.com.ua> In-Reply-To: <20110104112502.GM3140@deviant.kiev.zoral.com.ua> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201101040805.59412.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Tue, 04 Jan 2011 08:27:28 -0500 (EST) X-Virus-Scanned: clamav-milter 0.96.3 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-1.9 required=4.2 tests=BAYES_00 autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on bigwig.baldwin.cx Cc: Kostik Belousov , Eitan Adler , hackers@freebsd.org, Giorgos Keramidas Subject: Re: [patch] have rtprio check that arguments are numeric; change atoi to strtol X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Jan 2011 13:27:29 -0000 On Tuesday, January 04, 2011 6:25:02 am Kostik Belousov wrote: > On Tue, Jan 04, 2011 at 11:40:45AM +0100, Giorgos Keramidas wrote: > @@ -123,12 +121,28 @@ main(argc, argv) > } > exit(0); > } > - exit (1); > + exit(1); > +} > + > +static int > +parseint(const char *str, const char *errname) > +{ > + char *endp; > + long res; > + > + errno = 0; > + res = strtol(str, &endp, 10); > + if (errno != 0 || endp == str || *endp != '\0') > + err(1, "%s shall be a number", errname); Small nit, maybe use 'must' instead of 'shall'. -- John Baldwin From owner-freebsd-hackers@FreeBSD.ORG Tue Jan 4 13:49:40 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1233) id 6322F106566B; Tue, 4 Jan 2011 13:49:40 +0000 (UTC) Date: Tue, 4 Jan 2011 13:49:40 +0000 From: Alexander Best To: John Baldwin Message-ID: <20110104134940.GA8529@freebsd.org> References: <20110104112502.GM3140@deviant.kiev.zoral.com.ua> <201101040805.59412.jhb@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201101040805.59412.jhb@freebsd.org> Cc: Kostik Belousov , freebsd-hackers@freebsd.org, hackers@freebsd.org, Giorgos Keramidas , Eitan Adler Subject: Re: [patch] have rtprio check that arguments are numeric; change atoi to strtol X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Jan 2011 13:49:40 -0000 On Tue Jan 4 11, John Baldwin wrote: > On Tuesday, January 04, 2011 6:25:02 am Kostik Belousov wrote: > > On Tue, Jan 04, 2011 at 11:40:45AM +0100, Giorgos Keramidas wrote: > > @@ -123,12 +121,28 @@ main(argc, argv) > > } > > exit(0); > > } > > - exit (1); > > + exit(1); > > +} > > + > > +static int > > +parseint(const char *str, const char *errname) > > +{ > > + char *endp; > > + long res; > > + > > + errno = 0; > > + res = strtol(str, &endp, 10); > > + if (errno != 0 || endp == str || *endp != '\0') > > + err(1, "%s shall be a number", errname); > > Small nit, maybe use 'must' instead of 'shall'. it seems at some point there has been a massive usage of the term 'shall' in manual pages, which people tried to get rid of. hence the 'usr/share/examples/mdoc/deshallify.sh' script. maybe this should be noted in style(9)? cheers. alex > > -- > John Baldwin -- a13x From owner-freebsd-hackers@FreeBSD.ORG Tue Jan 4 13:49:40 2011 Return-Path: Delivered-To: hackers@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1233) id 6322F106566B; Tue, 4 Jan 2011 13:49:40 +0000 (UTC) Date: Tue, 4 Jan 2011 13:49:40 +0000 From: Alexander Best To: John Baldwin Message-ID: <20110104134940.GA8529@freebsd.org> References: <20110104112502.GM3140@deviant.kiev.zoral.com.ua> <201101040805.59412.jhb@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201101040805.59412.jhb@freebsd.org> Cc: Kostik Belousov , freebsd-hackers@freebsd.org, hackers@freebsd.org, Giorgos Keramidas , Eitan Adler Subject: Re: [patch] have rtprio check that arguments are numeric; change atoi to strtol X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Jan 2011 13:49:40 -0000 On Tue Jan 4 11, John Baldwin wrote: > On Tuesday, January 04, 2011 6:25:02 am Kostik Belousov wrote: > > On Tue, Jan 04, 2011 at 11:40:45AM +0100, Giorgos Keramidas wrote: > > @@ -123,12 +121,28 @@ main(argc, argv) > > } > > exit(0); > > } > > - exit (1); > > + exit(1); > > +} > > + > > +static int > > +parseint(const char *str, const char *errname) > > +{ > > + char *endp; > > + long res; > > + > > + errno = 0; > > + res = strtol(str, &endp, 10); > > + if (errno != 0 || endp == str || *endp != '\0') > > + err(1, "%s shall be a number", errname); > > Small nit, maybe use 'must' instead of 'shall'. it seems at some point there has been a massive usage of the term 'shall' in manual pages, which people tried to get rid of. hence the 'usr/share/examples/mdoc/deshallify.sh' script. maybe this should be noted in style(9)? cheers. alex > > -- > John Baldwin -- a13x From owner-freebsd-hackers@FreeBSD.ORG Tue Jan 4 16:58:55 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 19009106566C; Tue, 4 Jan 2011 16:58:55 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-pz0-f54.google.com (mail-pz0-f54.google.com [209.85.210.54]) by mx1.freebsd.org (Postfix) with ESMTP id BAD978FC08; Tue, 4 Jan 2011 16:58:54 +0000 (UTC) Received: by pzk32 with SMTP id 32so3409707pzk.13 for ; Tue, 04 Jan 2011 08:58:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:mime-version :content-type:from:in-reply-to:date:cc:message-id:references:to :x-mailer; bh=nDk5JrOTgWUdAheeIQRR4NPZ2Bw58fHW3lD3T/rWoU0=; b=OM7CXh3Ilg/uUi6zLyPvOz9VBq81lj8Jj9E1Z0fH8OkgUDfrUm/Qe/NsiTrsFsydY4 XmbCb4Ykh7OKix+RlhJrsA0Cj6TtLJ6X/aHB6ZJBUh4mWyV9aVg0V+yiPc6YAVYBy3zd F25fadp/NZ1TU7CkQifoIQLZbG5e/JiyR/D74= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:mime-version:content-type:from:in-reply-to:date:cc :message-id:references:to:x-mailer; b=PTH0/rq95b5lxEj/rIf4wxQMU4jcebv4m1fy2ynrMehdmpDwmNHeIAe7abmeww79dC sXoc7VbJw0/zRSw7sYfa9oDq62w1J8hFuJd1LVLlpbDrgdJBFVBcpvpLUmtsEAgWxsmZ uARbUcExUYd98nTRv9kkg4WN/I/JcUHKn4Xnk= Received: by 10.142.133.4 with SMTP id g4mr7054121wfd.152.1294160334048; Tue, 04 Jan 2011 08:58:54 -0800 (PST) Received: from [192.168.20.5] (c-24-130-151-210.hsd1.ca.comcast.net [24.130.151.210]) by mx.google.com with ESMTPS id w22sm31092099wfd.7.2011.01.04.08.58.50 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 04 Jan 2011 08:58:52 -0800 (PST) Mime-Version: 1.0 (Apple Message framework v1082) From: Garrett Cooper In-Reply-To: <20110104134940.GA8529@freebsd.org> Date: Tue, 4 Jan 2011 08:58:48 -0800 Message-Id: <0CC6BFE3-3381-401A-A9E3-26EB7EB46A3E@gmail.com> References: <20110104112502.GM3140@deviant.kiev.zoral.com.ua> <201101040805.59412.jhb@freebsd.org> <20110104134940.GA8529@freebsd.org> To: Alexander Best X-Mailer: Apple Mail (2.1082) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-hackers@freebsd.org, Eitan Adler , hackers@freebsd.org, Giorgos Keramidas , Kostik Belousov Subject: Re: [patch] have rtprio check that arguments are numeric; change atoi to strtol X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Jan 2011 16:58:55 -0000 On Jan 4, 2011, at 5:49 AM, Alexander Best wrote: > On Tue Jan 4 11, John Baldwin wrote: >> On Tuesday, January 04, 2011 6:25:02 am Kostik Belousov wrote: >>> On Tue, Jan 04, 2011 at 11:40:45AM +0100, Giorgos Keramidas wrote: >>> @@ -123,12 +121,28 @@ main(argc, argv) >>> } >>> exit(0); >>> } >>> - exit (1); >>> + exit(1); >>> +} >>> + >>> +static int >>> +parseint(const char *str, const char *errname) >>> +{ >>> + char *endp; >>> + long res; >>> + >>> + errno =3D 0; >>> + res =3D strtol(str, &endp, 10); >>> + if (errno !=3D 0 || endp =3D=3D str || *endp !=3D '\0') >>> + err(1, "%s shall be a number", errname); >>=20 >> Small nit, maybe use 'must' instead of 'shall'. >=20 > it seems at some point there has been a massive usage of the term = 'shall' in > manual pages, which people tried to get rid of. hence the > 'usr/share/examples/mdoc/deshallify.sh' script. I know shall is used widely by opengroup when describing definitions and = interfaces in the POSIX standards, but the connotation in English is = very squishy, so I agree with John that must would be better. BTW, only if errno was non-zero would using err(3) be logical. Otherwise = it will just produce noise :). > maybe this should be noted in style(9)? Thanks, -Garrett= From owner-freebsd-hackers@FreeBSD.ORG Tue Jan 4 17:29:13 2011 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8922A106564A for ; Tue, 4 Jan 2011 17:29:13 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-pz0-f54.google.com (mail-pz0-f54.google.com [209.85.210.54]) by mx1.freebsd.org (Postfix) with ESMTP id 521578FC14 for ; Tue, 4 Jan 2011 17:29:13 +0000 (UTC) Received: by pzk32 with SMTP id 32so3414550pzk.13 for ; Tue, 04 Jan 2011 09:29:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:mime-version :content-type:from:in-reply-to:date:cc:message-id:references:to :x-mailer; bh=nDk5JrOTgWUdAheeIQRR4NPZ2Bw58fHW3lD3T/rWoU0=; b=OM7CXh3Ilg/uUi6zLyPvOz9VBq81lj8Jj9E1Z0fH8OkgUDfrUm/Qe/NsiTrsFsydY4 XmbCb4Ykh7OKix+RlhJrsA0Cj6TtLJ6X/aHB6ZJBUh4mWyV9aVg0V+yiPc6YAVYBy3zd F25fadp/NZ1TU7CkQifoIQLZbG5e/JiyR/D74= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:mime-version:content-type:from:in-reply-to:date:cc :message-id:references:to:x-mailer; b=PTH0/rq95b5lxEj/rIf4wxQMU4jcebv4m1fy2ynrMehdmpDwmNHeIAe7abmeww79dC sXoc7VbJw0/zRSw7sYfa9oDq62w1J8hFuJd1LVLlpbDrgdJBFVBcpvpLUmtsEAgWxsmZ uARbUcExUYd98nTRv9kkg4WN/I/JcUHKn4Xnk= Received: by 10.142.133.4 with SMTP id g4mr7054121wfd.152.1294160334048; Tue, 04 Jan 2011 08:58:54 -0800 (PST) Received: from [192.168.20.5] (c-24-130-151-210.hsd1.ca.comcast.net [24.130.151.210]) by mx.google.com with ESMTPS id w22sm31092099wfd.7.2011.01.04.08.58.50 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 04 Jan 2011 08:58:52 -0800 (PST) Mime-Version: 1.0 (Apple Message framework v1082) From: Garrett Cooper In-Reply-To: <20110104134940.GA8529@freebsd.org> Date: Tue, 4 Jan 2011 08:58:48 -0800 Message-Id: <0CC6BFE3-3381-401A-A9E3-26EB7EB46A3E@gmail.com> References: <20110104112502.GM3140@deviant.kiev.zoral.com.ua> <201101040805.59412.jhb@freebsd.org> <20110104134940.GA8529@freebsd.org> To: Alexander Best X-Mailer: Apple Mail (2.1082) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-hackers@freebsd.org, Eitan Adler , hackers@freebsd.org, Giorgos Keramidas , Kostik Belousov Subject: Re: [patch] have rtprio check that arguments are numeric; change atoi to strtol X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Jan 2011 17:29:13 -0000 On Jan 4, 2011, at 5:49 AM, Alexander Best wrote: > On Tue Jan 4 11, John Baldwin wrote: >> On Tuesday, January 04, 2011 6:25:02 am Kostik Belousov wrote: >>> On Tue, Jan 04, 2011 at 11:40:45AM +0100, Giorgos Keramidas wrote: >>> @@ -123,12 +121,28 @@ main(argc, argv) >>> } >>> exit(0); >>> } >>> - exit (1); >>> + exit(1); >>> +} >>> + >>> +static int >>> +parseint(const char *str, const char *errname) >>> +{ >>> + char *endp; >>> + long res; >>> + >>> + errno =3D 0; >>> + res =3D strtol(str, &endp, 10); >>> + if (errno !=3D 0 || endp =3D=3D str || *endp !=3D '\0') >>> + err(1, "%s shall be a number", errname); >>=20 >> Small nit, maybe use 'must' instead of 'shall'. >=20 > it seems at some point there has been a massive usage of the term = 'shall' in > manual pages, which people tried to get rid of. hence the > 'usr/share/examples/mdoc/deshallify.sh' script. I know shall is used widely by opengroup when describing definitions and = interfaces in the POSIX standards, but the connotation in English is = very squishy, so I agree with John that must would be better. BTW, only if errno was non-zero would using err(3) be logical. Otherwise = it will just produce noise :). > maybe this should be noted in style(9)? Thanks, -Garrett= From owner-freebsd-hackers@FreeBSD.ORG Tue Jan 4 18:13:03 2011 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 473CA1065675; Tue, 4 Jan 2011 18:13:03 +0000 (UTC) (envelope-from keramida@ceid.upatras.gr) Received: from igloo.linux.gr (igloo.linux.gr [62.1.205.36]) by mx1.freebsd.org (Postfix) with ESMTP id AAE148FC20; Tue, 4 Jan 2011 18:13:02 +0000 (UTC) X-Spam-Status: No X-Hellug-MailScanner-From: keramida@ceid.upatras.gr X-Hellug-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-2.9, required 5, autolearn=not spam, ALL_TRUSTED -1.00, BAYES_00 -1.90) X-Hellug-MailScanner: Found to be clean X-Hellug-MailScanner-ID: p04ICkbP018162 Received: from gkeramidas-glaptop.linux.gr (217-162-216-74.dclient.hispeed.ch [217.162.216.74]) (authenticated bits=0) by igloo.linux.gr (8.14.3/8.14.3/Debian-9.4) with ESMTP id p04ICkbP018162 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 4 Jan 2011 20:12:53 +0200 From: Giorgos Keramidas To: Garrett Cooper References: <20110104112502.GM3140@deviant.kiev.zoral.com.ua> <201101040805.59412.jhb@freebsd.org> <20110104134940.GA8529@freebsd.org> <0CC6BFE3-3381-401A-A9E3-26EB7EB46A3E@gmail.com> Date: Tue, 04 Jan 2011 19:12:41 +0100 In-Reply-To: <0CC6BFE3-3381-401A-A9E3-26EB7EB46A3E@gmail.com> (Garrett Cooper's message of "Tue, 4 Jan 2011 08:58:48 -0800") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Cc: freebsd-hackers@freebsd.org, Eitan Adler , hackers@freebsd.org, Kostik Belousov , Alexander Best Subject: Re: [patch] have rtprio check that arguments are numeric; change atoi to strtol X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Jan 2011 18:13:03 -0000 On Tue, 4 Jan 2011 08:58:48 -0800, Garrett Cooper wrote: >>>> + errno = 0; >>>> + res = strtol(str, &endp, 10); >>>> + if (errno != 0 || endp == str || *endp != '\0') >>>> + err(1, "%s shall be a number", errname); >>> >>> Small nit, maybe use 'must' instead of 'shall'. >> >> it seems at some point there has been a massive usage of the term >> 'shall' in manual pages, which people tried to get rid of. hence the >> 'usr/share/examples/mdoc/deshallify.sh' script. > > I know shall is used widely by opengroup when describing definitions > and interfaces in the POSIX standards, but the connotation in English > is very squishy, so I agree with John that must would be better. > > BTW, only if errno was non-zero would using err(3) be > logical. Otherwise it will just produce noise :). That's a good point. I think we should change err() to errx() there. From owner-freebsd-hackers@FreeBSD.ORG Tue Jan 4 18:19:15 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4BA1A1065698; Tue, 4 Jan 2011 18:19:15 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-px0-f182.google.com (mail-px0-f182.google.com [209.85.212.182]) by mx1.freebsd.org (Postfix) with ESMTP id ED3428FC1F; Tue, 4 Jan 2011 18:19:14 +0000 (UTC) Received: by pxi1 with SMTP id 1so2895752pxi.13 for ; Tue, 04 Jan 2011 10:19:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:mime-version :content-type:from:in-reply-to:date:cc:message-id:references:to :x-mailer; bh=nTyIFHQvaGx3XHv/+N1PX/tx3K7rX3y/zE/z+R8USm8=; b=Mv+/OmCGygKeBMHoIHBVMKpOx/5ifZlV2YJub8eSqWIf06uuMH37USU132ZRn4izuI q/J967EkwYXVMgueML93/YQCRRCBbFYKEPhm0KBdLfx3ISlW6HOfc5Ie5vJbcTba2Vw2 vp7Q0knYsVaj5zGg2iIYrTTWH6cwsVrRnZ1mQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:mime-version:content-type:from:in-reply-to:date:cc :message-id:references:to:x-mailer; b=pFMyROgs1wov9kxGgt9v9MGZjXnVLgk1o6jkLsaDnAZftbWyAsIaOkdqzhP5E8L6Nb scF0BWiaNFF3UX3UNk8gl56ROsj94GU2VHQtXRgkKYA3+itu6BjGKKnUUkhK4tBiWYou FHL2/ixn+WLp+aWvDZDi1bBylAh+X9+4Ix93A= Received: by 10.142.11.9 with SMTP id 9mr17004433wfk.59.1294165154298; Tue, 04 Jan 2011 10:19:14 -0800 (PST) Received: from [192.168.20.5] (c-24-130-151-210.hsd1.ca.comcast.net [24.130.151.210]) by mx.google.com with ESMTPS id q13sm31172925wfc.5.2011.01.04.10.19.11 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 04 Jan 2011 10:19:12 -0800 (PST) Mime-Version: 1.0 (Apple Message framework v1082) From: Garrett Cooper In-Reply-To: Date: Tue, 4 Jan 2011 10:19:09 -0800 Message-Id: References: <20110104112502.GM3140@deviant.kiev.zoral.com.ua> <201101040805.59412.jhb@freebsd.org> <20110104134940.GA8529@freebsd.org> <0CC6BFE3-3381-401A-A9E3-26EB7EB46A3E@gmail.com> To: Giorgos Keramidas X-Mailer: Apple Mail (2.1082) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-hackers@freebsd.org, Eitan Adler , hackers@freebsd.org, Kostik Belousov , Alexander Best Subject: Re: [patch] have rtprio check that arguments are numeric; change atoi to strtol X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Jan 2011 18:19:15 -0000 On Jan 4, 2011, at 10:12 AM, Giorgos Keramidas wrote: > On Tue, 4 Jan 2011 08:58:48 -0800, Garrett Cooper = wrote: >>>>> + errno =3D 0; >>>>> + res =3D strtol(str, &endp, 10); >>>>> + if (errno !=3D 0 || endp =3D=3D str || *endp !=3D '\0') >>>>> + err(1, "%s shall be a number", errname); >>>>=20 >>>> Small nit, maybe use 'must' instead of 'shall'. >>>=20 >>> it seems at some point there has been a massive usage of the term >>> 'shall' in manual pages, which people tried to get rid of. hence the >>> 'usr/share/examples/mdoc/deshallify.sh' script. >>=20 >> I know shall is used widely by opengroup when describing definitions >> and interfaces in the POSIX standards, but the connotation in English >> is very squishy, so I agree with John that must would be better. >>=20 >> BTW, only if errno was non-zero would using err(3) be >> logical. Otherwise it will just produce noise :). >=20 > That's a good point. I think we should change err() to errx() there. kib was quick and already did it in r216967. Cheers! -Garrett= From owner-freebsd-hackers@FreeBSD.ORG Tue Jan 4 18:19:15 2011 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4BA1A1065698; Tue, 4 Jan 2011 18:19:15 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-px0-f182.google.com (mail-px0-f182.google.com [209.85.212.182]) by mx1.freebsd.org (Postfix) with ESMTP id ED3428FC1F; Tue, 4 Jan 2011 18:19:14 +0000 (UTC) Received: by pxi1 with SMTP id 1so2895752pxi.13 for ; Tue, 04 Jan 2011 10:19:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:mime-version :content-type:from:in-reply-to:date:cc:message-id:references:to :x-mailer; bh=nTyIFHQvaGx3XHv/+N1PX/tx3K7rX3y/zE/z+R8USm8=; b=Mv+/OmCGygKeBMHoIHBVMKpOx/5ifZlV2YJub8eSqWIf06uuMH37USU132ZRn4izuI q/J967EkwYXVMgueML93/YQCRRCBbFYKEPhm0KBdLfx3ISlW6HOfc5Ie5vJbcTba2Vw2 vp7Q0knYsVaj5zGg2iIYrTTWH6cwsVrRnZ1mQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:mime-version:content-type:from:in-reply-to:date:cc :message-id:references:to:x-mailer; b=pFMyROgs1wov9kxGgt9v9MGZjXnVLgk1o6jkLsaDnAZftbWyAsIaOkdqzhP5E8L6Nb scF0BWiaNFF3UX3UNk8gl56ROsj94GU2VHQtXRgkKYA3+itu6BjGKKnUUkhK4tBiWYou FHL2/ixn+WLp+aWvDZDi1bBylAh+X9+4Ix93A= Received: by 10.142.11.9 with SMTP id 9mr17004433wfk.59.1294165154298; Tue, 04 Jan 2011 10:19:14 -0800 (PST) Received: from [192.168.20.5] (c-24-130-151-210.hsd1.ca.comcast.net [24.130.151.210]) by mx.google.com with ESMTPS id q13sm31172925wfc.5.2011.01.04.10.19.11 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 04 Jan 2011 10:19:12 -0800 (PST) Mime-Version: 1.0 (Apple Message framework v1082) From: Garrett Cooper In-Reply-To: Date: Tue, 4 Jan 2011 10:19:09 -0800 Message-Id: References: <20110104112502.GM3140@deviant.kiev.zoral.com.ua> <201101040805.59412.jhb@freebsd.org> <20110104134940.GA8529@freebsd.org> <0CC6BFE3-3381-401A-A9E3-26EB7EB46A3E@gmail.com> To: Giorgos Keramidas X-Mailer: Apple Mail (2.1082) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-hackers@freebsd.org, Eitan Adler , hackers@freebsd.org, Kostik Belousov , Alexander Best Subject: Re: [patch] have rtprio check that arguments are numeric; change atoi to strtol X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Jan 2011 18:19:15 -0000 On Jan 4, 2011, at 10:12 AM, Giorgos Keramidas wrote: > On Tue, 4 Jan 2011 08:58:48 -0800, Garrett Cooper = wrote: >>>>> + errno =3D 0; >>>>> + res =3D strtol(str, &endp, 10); >>>>> + if (errno !=3D 0 || endp =3D=3D str || *endp !=3D '\0') >>>>> + err(1, "%s shall be a number", errname); >>>>=20 >>>> Small nit, maybe use 'must' instead of 'shall'. >>>=20 >>> it seems at some point there has been a massive usage of the term >>> 'shall' in manual pages, which people tried to get rid of. hence the >>> 'usr/share/examples/mdoc/deshallify.sh' script. >>=20 >> I know shall is used widely by opengroup when describing definitions >> and interfaces in the POSIX standards, but the connotation in English >> is very squishy, so I agree with John that must would be better. >>=20 >> BTW, only if errno was non-zero would using err(3) be >> logical. Otherwise it will just produce noise :). >=20 > That's a good point. I think we should change err() to errx() there. kib was quick and already did it in r216967. Cheers! -Garrett= From owner-freebsd-hackers@FreeBSD.ORG Tue Jan 4 18:32:20 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A9CCE1065674; Tue, 4 Jan 2011 18:32:20 +0000 (UTC) (envelope-from keramida@ceid.upatras.gr) Received: from igloo.linux.gr (igloo.linux.gr [62.1.205.36]) by mx1.freebsd.org (Postfix) with ESMTP id 1BFFA8FC08; Tue, 4 Jan 2011 18:32:19 +0000 (UTC) X-Spam-Status: No X-Hellug-MailScanner-From: keramida@ceid.upatras.gr X-Hellug-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-2.9, required 5, autolearn=not spam, ALL_TRUSTED -1.00, BAYES_00 -1.90) X-Hellug-MailScanner: Found to be clean X-Hellug-MailScanner-ID: p04ICkbP018162 Received: from gkeramidas-glaptop.linux.gr (217-162-216-74.dclient.hispeed.ch [217.162.216.74]) (authenticated bits=0) by igloo.linux.gr (8.14.3/8.14.3/Debian-9.4) with ESMTP id p04ICkbP018162 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 4 Jan 2011 20:12:53 +0200 From: Giorgos Keramidas To: Garrett Cooper References: <20110104112502.GM3140@deviant.kiev.zoral.com.ua> <201101040805.59412.jhb@freebsd.org> <20110104134940.GA8529@freebsd.org> <0CC6BFE3-3381-401A-A9E3-26EB7EB46A3E@gmail.com> Date: Tue, 04 Jan 2011 19:12:41 +0100 In-Reply-To: <0CC6BFE3-3381-401A-A9E3-26EB7EB46A3E@gmail.com> (Garrett Cooper's message of "Tue, 4 Jan 2011 08:58:48 -0800") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Cc: freebsd-hackers@freebsd.org, Eitan Adler , hackers@freebsd.org, Kostik Belousov , Alexander Best Subject: Re: [patch] have rtprio check that arguments are numeric; change atoi to strtol X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Jan 2011 18:32:20 -0000 On Tue, 4 Jan 2011 08:58:48 -0800, Garrett Cooper wrote: >>>> + errno = 0; >>>> + res = strtol(str, &endp, 10); >>>> + if (errno != 0 || endp == str || *endp != '\0') >>>> + err(1, "%s shall be a number", errname); >>> >>> Small nit, maybe use 'must' instead of 'shall'. >> >> it seems at some point there has been a massive usage of the term >> 'shall' in manual pages, which people tried to get rid of. hence the >> 'usr/share/examples/mdoc/deshallify.sh' script. > > I know shall is used widely by opengroup when describing definitions > and interfaces in the POSIX standards, but the connotation in English > is very squishy, so I agree with John that must would be better. > > BTW, only if errno was non-zero would using err(3) be > logical. Otherwise it will just produce noise :). That's a good point. I think we should change err() to errx() there. From owner-freebsd-hackers@FreeBSD.ORG Wed Jan 5 10:45:10 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 42F501065670; Wed, 5 Jan 2011 10:45:10 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id F23678FC15; Wed, 5 Jan 2011 10:45:09 +0000 (UTC) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id BA7361FFC33; Wed, 5 Jan 2011 10:45:08 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id 5862A84531; Wed, 5 Jan 2011 11:45:08 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: "Christopher J. Ruwe" References: <20101229232030.25b2bd5a@dijkstra> Date: Wed, 05 Jan 2011 11:45:08 +0100 In-Reply-To: <20101229232030.25b2bd5a@dijkstra> (Christopher J. Ruwe's message of "Wed, 29 Dec 2010 23:20:30 +0100") Message-ID: <864o9nhbnv.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: freebsd-hackers@freebsd.org, freebsd-doc@freebsd.org, freebsd-questions@freebsd.org, freebsd-security@freebsd.org Subject: Re: setting a random password with PAM API X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Jan 2011 10:45:10 -0000 "Christopher J. Ruwe" writes: > I am trying to implement the feature to set a random password like in > BSD "pw usermod -W" in the Solaris passwd. Regrettably, I have not > found or perhaps not understood the PAM API documentation on how to > _inject a given string_ into the change-auth-token function > pam_chauthtok(...), which always jumps in an interactive pw-changing > loop. There is no reliable way to do that. You don't even know that there is such a thing as a password. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-freebsd-hackers@FreeBSD.ORG Wed Jan 5 14:57:20 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D050410656A4; Wed, 5 Jan 2011 14:57:20 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id 3722B8FC08; Wed, 5 Jan 2011 14:57:19 +0000 (UTC) Received: by fxm16 with SMTP id 16so14967171fxm.13 for ; Wed, 05 Jan 2011 06:57:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :x-enigmail-version:content-type:content-transfer-encoding; bh=jIuiXN+NhvtkTuUhB+wtEuxtSq/Ot2kEdhPLESZUFOA=; b=BIrlx0Jdf4EVEg1W7ZE8arbWgEQlJbmeei3w14DrIrElkg/ayp0iiljV1/6RsibFuD vsU8dVEh0aZ4vvYjCddhsw/WGSIUruq9kYWpbLZZexlAQzB06QeCCx5paW3UFHy+B5j4 TYbGhTneI7csZk+so0P/tVN9QbyXuVu8ML0Hs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; b=Oko7rvPwYXxrisX1qKvswS4DYFjmBL7Cgysti0ARYuaRHYO1xRvSjRuWzujwafUww4 5OPiaLdtsF8to448bGrVzVqB9GqHxqalU07DwV6sTGOD671Asv+pgyYTZNJ50F/shqnT lUnv3asqt1OWIr+3VlnY0VI5wLWGP6ENngDHE= Received: by 10.223.83.200 with SMTP id g8mr2765018fal.98.1294239438957; Wed, 05 Jan 2011 06:57:18 -0800 (PST) Received: from mavbook2.mavhome.dp.ua (pc.mavhome.dp.ua [212.86.226.226]) by mx.google.com with ESMTPS id e17sm5489226fak.34.2011.01.05.06.57.17 (version=SSLv3 cipher=RC4-MD5); Wed, 05 Jan 2011 06:57:18 -0800 (PST) Sender: Alexander Motin Message-ID: <4D2486B9.2090705@FreeBSD.org> Date: Wed, 05 Jan 2011 16:56:57 +0200 From: Alexander Motin User-Agent: Thunderbird 2.0.0.23 (X11/20091212) MIME-Version: 1.0 To: Darmawan Salihun References: <690521.13311.qm@web76801.mail.sg1.yahoo.com> In-Reply-To: <690521.13311.qm@web76801.mail.sg1.yahoo.com> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org Subject: Re: PCI IDE Controller Base Address Register setting X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Jan 2011 14:57:21 -0000 Darmawan Salihun wrote: > I get the following log message upon booting with "boot -Dv": > ============================== > ata0: on atapci0 > ata0: reset tp1 mask=03 ostat0=50 ostat1=50 > ata0: stat0=0x80 err=0x00 lsb=0x00 msb=0x00 > ata0: stat0=0x50 err=0x01 lsb=0x00 msb=0x00 > ata0: stat1=0x50 err=0x01 lsb=0x00 msb=0x00 > ata0: reset tp2 stat0=50 stat1=50 devices=0x3 > ... > ata0: Identifying devices: 00000003 > ata0: New devices: 00000003 > ... > ata0-slave: pio=PIO4 wdma=WDMA2 udma=UDMA100 cable=80 wire > ata0-master: pio=PIO1 wdma=UNSUPPORTED udma=UNSUPPORTED cable=40 wire > ... > ad0: FAILURE setting PIO1 on CS5536 chip > ad0: 488MB at ata0-master BIOSPIO > ... > GEOM: newdisk ad0 > ad0: Adaptec check1 failed > ad0: LSI(v3) check1 failed > ad0: FAILURE - READ status=51 error=c4 LBA=0 > ... > ad1: setting PIO4 on CS5536 chip > ad1: setting UDMA100 on CS5536 chip > ad1: 38150MB at ata0-slave UDMA100 > ... > GEOM: newdisk ad1 > ... > ad1: FAILURE - READ_DMA status=51 error=84 LBA=78132575 > ad1: FAILURE - READ_DMA status=51 error=84 LBA=78132591 > ... > ====================== > I have several questions: > 1. How FreeBSD sets the PIO mode on the target IDE controller? > what could've caused it to fail like the message above? Looking to your messages I would suggest you are running something like FreeBSD 8.0. At that time controller-specific method first set mode on device and then programmed the chip. Most likely this error returned by device. Some very old devices not supporting more then PIO3 may not support mode setting command. Mode setting code was significantly rewritten between 8.0 and 8.1. I would recommend you to take newer version of FreeBSD for experiments. > 2. It seems to me that setting the UDMA100 in the > AMD CS5536 IDE controller went just fine (in the log above). > But, FreeBSD fails when it tries to read something from the drive. > Does it mean the UDMA100 "mode" failed to be set correctly > in the IDE controller? It can be. For UDMA transfer rate is driven by transmitting side (for reading - by device), but there is always a chance to do something wrong. :) I don't have CS5536 board, so can't be completely sure how correct is the code. > 3. As I'm currently trying to fix the bug in the BIOS for the particular > board used to boot FreeBSD, what would you suggest to fix it? Try latest FreeBSD -- 8.2 is now in RC state. Try to disconnect devices one by one. Try to limit initial mode via loader tunables (note that some of them were added not so long ago and may be missing on 8.0). -- Alexander Motin From owner-freebsd-hackers@FreeBSD.ORG Wed Jan 5 17:25:04 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C25B01065673 for ; Wed, 5 Jan 2011 17:25:04 +0000 (UTC) (envelope-from darmawan_salihun@yahoo.com) Received: from web76816.mail.sg1.yahoo.com (web76816.mail.sg1.yahoo.com [124.108.123.120]) by mx1.freebsd.org (Postfix) with SMTP id 381F08FC16 for ; Wed, 5 Jan 2011 17:25:03 +0000 (UTC) Received: (qmail 58296 invoked by uid 60001); 5 Jan 2011 17:25:02 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1294248302; bh=FB4D0AlVuYCKutcbdN9s37brWSkK39ZqOIzCJ5xf+rc=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type; b=ifGFGU+xn7egRck4lyIcP+3zy39vA7sm0ITh7LGtkFsOjFCZYXnJEfpmnjWurB+fbhvEUeaoPJzLD1UKcEPaUCaFXa/WlIX/yOf1HJXn7ilPFAVolGRrVRGX1h6eb2rb7gPKNGHH5sIGOHRn4k0vPsmdRh7gj0eDNwbgS4vvJ8M= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type; b=YKb9pdBwacT3k1sifHxS2E/tVtgeLZoNGg6yY7YdMrXPeBfEyVwPT5dks5gw+dGtAG+8RzWLxBYGPaTerkWHwzAzEn1Z7CJ58f9j1X3Gmjx1uU0bzfBzLzZD+nb5Q7e8bFVMUN+FnGaRNuZYsCVxogyRQGevKvjR03GZH3p0jH8=; Message-ID: <736116.58130.qm@web76816.mail.sg1.yahoo.com> X-YMail-OSG: gkogQrcVM1kujj_2jbT.tZZs4dTKCAFwTTe.kG2IGMJG46v EDLZq65I3hAs55mw7_fLS.Vn3jryuxkcUNecv2sZ8aqgeoLbw5GydqgAeOLI u64XX_q24sYMlmCMYkMQEhoxsjXXMYQZiHZtSrsiygNu7UhrkQ6B_yWZ.2Wr 6daElkVyY3Nt0RG2ythWegrp7548PRlNC2YyomGE0OUUs3dF6iAb_ZaPdDJi prptA9W_s2SvZq1VxsmsIdUTKBYpORuMlFWQj24SfG.davMyN0dsHX9Iya5i .jbzQ_AKWE5tGEdzHmiYpRvs2Rdk9ghmeQE82cUOHCEmsPC4zPznoyjRV_bA UhA1n3myWbBtZ85dcrA-- Received: from [114.56.244.171] by web76816.mail.sg1.yahoo.com via HTTP; Thu, 06 Jan 2011 01:25:02 SGT X-Mailer: YahooMailClassic/11.4.20 YahooMailWebService/0.8.107.285259 Date: Thu, 6 Jan 2011 01:25:02 +0800 (SGT) From: Darmawan Salihun To: Alexander Motin In-Reply-To: <4D2486B9.2090705@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: freebsd-hackers@freebsd.org Subject: Re: PCI IDE Controller Base Address Register setting X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Jan 2011 17:25:04 -0000 --- On Wed, 1/5/11, Alexander Motin wrote: > From: Alexander Motin > Subject: Re: PCI IDE Controller Base Address Register setting > To: "Darmawan Salihun" > Cc: "John Baldwin" , freebsd-hackers@freebsd.org > Date: Wednesday, January 5, 2011, 9:56 AM > Darmawan Salihun wrote: > > I get the following log message upon booting with > "boot -Dv": > > ============================== > > ata0: on atapci0 > > ata0: reset tp1 mask=03 ostat0=50 ostat1=50 > > ata0: stat0=0x80 err=0x00 lsb=0x00 msb=0x00 > > ata0: stat0=0x50 err=0x01 lsb=0x00 msb=0x00 > > ata0: stat1=0x50 err=0x01 lsb=0x00 msb=0x00 > > ata0: reset tp2 stat0=50 stat1=50 devices=0x3 > > ... > > ata0: Identifying devices: 00000003 > > ata0: New devices: 00000003 > > ... > > ata0-slave: pio=PIO4 wdma=WDMA2 udma=UDMA100 cable=80 > wire > > ata0-master: pio=PIO1 wdma=UNSUPPORTED > udma=UNSUPPORTED cable=40 wire > > ... > > ad0: FAILURE setting PIO1 on CS5536 chip > > ad0: 488MB at > ata0-master BIOSPIO > > ... > > GEOM: newdisk ad0 > > ad0: Adaptec check1 failed > > ad0: LSI(v3) check1 failed > > ad0: FAILURE - READ status=51 > error=c4 LBA=0 > > ... > > ad1: setting PIO4 on CS5536 chip > > ad1: setting UDMA100 on CS5536 chip > > ad1: 38150MB at > ata0-slave UDMA100 > > ... > > GEOM: newdisk ad1 > > ... > > ad1: FAILURE - READ_DMA > status=51 > error=84 LBA=78132575 > > ad1: FAILURE - READ_DMA > status=51 > error=84 LBA=78132591 > > ... > > ====================== > > I have several questions: > > 1. How FreeBSD sets the PIO mode on the target IDE > controller? > > what could've caused it to fail like the message > above? > > Looking to your messages I would suggest you are running > something like > FreeBSD 8.0. At that time controller-specific method first > set mode on > device and then programmed the chip. Most likely this error > returned by > device. Some very old devices not supporting more then PIO3 > may not > support mode setting command. > > Mode setting code was significantly rewritten between 8.0 > and 8.1. I > would recommend you to take newer version of FreeBSD for > experiments. > The device is a CF-card. Do I need to add some sort of CFA-specific initialization code to the BIOS? I'm using FreeBSD 8.0 as the test bed for the log message above. I have FreeBSD 8.1 DVD to do further tests. Will report later. > > 2. It seems to me that setting the UDMA100 in the > > AMD CS5536 IDE controller went just fine (in the log > above). > > But, FreeBSD fails when it tries to read something > from the drive. > > Does it mean the UDMA100 "mode" failed to be set > correctly > > in the IDE controller? > > It can be. For UDMA transfer rate is driven by transmitting > side (for > reading - by device), but there is always a chance to do > something > wrong. :) I don't have CS5536 board, so can't be completely > sure how > correct is the code. Does it require chipset-specific support code on the OS (say a device driver) or setting via PCI Bus Master registers is enough? > > > 3. As I'm currently trying to fix the bug in the BIOS > for the particular > > board used to boot FreeBSD, what would you suggest to > fix it? > > Try latest FreeBSD -- 8.2 is now in RC state. > Try to disconnect devices one by one. > Try to limit initial mode via loader tunables (note that > some of them > were added not so long ago and may be missing on 8.0). > A question about the loader tunable: is it enough to pass it through the "boot" command, similar to the "-Dv" in "boot -Dv"? Thanks, Darmawan From owner-freebsd-hackers@FreeBSD.ORG Wed Jan 5 18:16:31 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 745C81065672 for ; Wed, 5 Jan 2011 18:16:31 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id 021F38FC08 for ; Wed, 5 Jan 2011 18:16:30 +0000 (UTC) Received: by fxm16 with SMTP id 16so15166436fxm.13 for ; Wed, 05 Jan 2011 10:16:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=Rkr0ygLofps2BFFHC/ZKSVaJ8rRgM7BcmeG+o+WGm0E=; b=xnWcpxEKxny68PDZyKe72NYYkU17kJCGwvbM0eDz4oLdDiFhZFtz8eikaciolFc75p 4unMDwGtps/McDynxRT8SxgllSI8ACqACcpMY3k0/EKkeVT2V62OdPy+qiVzAC/weOHe CFjQ/rsSCous2P8rW8bLco8aOOhc2gYRTvshg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; b=X4RJX3oTfKZjib6eT3MB0DN5uCKPnJND9es4H0HLbSyIniV4GctGSTpKrRMknBnp0R vMi2Ly4dao392YcrOH358pTKexegrQIgVREDwtN0tpb9d+jE/9DK61CxAo2JurEw8c3M mLSj8ZWMsTuRFH8b97blGr0F6D9dRk6pHIiZw= Received: by 10.223.113.73 with SMTP id z9mr1620320fap.41.1294251389887; Wed, 05 Jan 2011 10:16:29 -0800 (PST) Received: from mavbook.mavhome.dp.ua (pc.mavhome.dp.ua [212.86.226.226]) by mx.google.com with ESMTPS id n3sm5578362fax.31.2011.01.05.10.16.28 (version=SSLv3 cipher=RC4-MD5); Wed, 05 Jan 2011 10:16:29 -0800 (PST) Sender: Alexander Motin Message-ID: <4D24B576.1090509@FreeBSD.org> Date: Wed, 05 Jan 2011 20:16:22 +0200 From: Alexander Motin User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.12) Gecko/20101104 Thunderbird/3.1.6 MIME-Version: 1.0 To: Darmawan Salihun References: <736116.58130.qm@web76816.mail.sg1.yahoo.com> In-Reply-To: <736116.58130.qm@web76816.mail.sg1.yahoo.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org Subject: Re: PCI IDE Controller Base Address Register setting X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Jan 2011 18:16:31 -0000 On 05.01.2011 19:25, Darmawan Salihun wrote: > --- On Wed, 1/5/11, Alexander Motin wrote: > >> From: Alexander Motin >> Subject: Re: PCI IDE Controller Base Address Register setting >> To: "Darmawan Salihun" >> Cc: "John Baldwin", freebsd-hackers@freebsd.org >> Date: Wednesday, January 5, 2011, 9:56 AM >> Darmawan Salihun wrote: >>> I get the following log message upon booting with >> "boot -Dv": >>> ============================== >>> ata0: on atapci0 >>> ata0: reset tp1 mask=03 ostat0=50 ostat1=50 >>> ata0: stat0=0x80 err=0x00 lsb=0x00 msb=0x00 >>> ata0: stat0=0x50 err=0x01 lsb=0x00 msb=0x00 >>> ata0: stat1=0x50 err=0x01 lsb=0x00 msb=0x00 >>> ata0: reset tp2 stat0=50 stat1=50 devices=0x3 >>> ... >>> ata0: Identifying devices: 00000003 >>> ata0: New devices: 00000003 >>> ... >>> ata0-slave: pio=PIO4 wdma=WDMA2 udma=UDMA100 cable=80 >> wire >>> ata0-master: pio=PIO1 wdma=UNSUPPORTED >> udma=UNSUPPORTED cable=40 wire >>> ... >>> ad0: FAILURE setting PIO1 on CS5536 chip >>> ad0: 488MB at >> ata0-master BIOSPIO >>> ... >>> GEOM: newdisk ad0 >>> ad0: Adaptec check1 failed >>> ad0: LSI(v3) check1 failed >>> ad0: FAILURE - READ status=51 >> error=c4 LBA=0 >>> ... >>> ad1: setting PIO4 on CS5536 chip >>> ad1: setting UDMA100 on CS5536 chip >>> ad1: 38150MB at >> ata0-slave UDMA100 >>> ... >>> GEOM: newdisk ad1 >>> ... >>> ad1: FAILURE - READ_DMA >> status=51 >> error=84 LBA=78132575 >>> ad1: FAILURE - READ_DMA >> status=51 >> error=84 LBA=78132591 >>> ... >>> ====================== >>> I have several questions: >>> 1. How FreeBSD sets the PIO mode on the target IDE >> controller? >>> what could've caused it to fail like the message >> above? >> >> Looking to your messages I would suggest you are running >> something like >> FreeBSD 8.0. At that time controller-specific method first >> set mode on >> device and then programmed the chip. Most likely this error >> returned by >> device. Some very old devices not supporting more then PIO3 >> may not >> support mode setting command. >> >> Mode setting code was significantly rewritten between 8.0 >> and 8.1. I >> would recommend you to take newer version of FreeBSD for >> experiments. > > The device is a CF-card. Do I need to add some sort of CFA-specific > initialization code to the BIOS? Some CF devices AFAIR may wish power-up command before they will be able to access media, but I have never seen such ones, suppose it was applicable only to some old microdrives. AFAIR in all other points CF specification only extends ATA without additional requirements. > I'm using FreeBSD 8.0 as the test bed for the log message above. > I have FreeBSD 8.1 DVD to do further tests. Will report later. OK. >>> 2. It seems to me that setting the UDMA100 in the >>> AMD CS5536 IDE controller went just fine (in the log >> above). >>> But, FreeBSD fails when it tries to read something >> from the drive. >>> Does it mean the UDMA100 "mode" failed to be set >> correctly >>> in the IDE controller? >> >> It can be. For UDMA transfer rate is driven by transmitting >> side (for >> reading - by device), but there is always a chance to do >> something >> wrong. :) I don't have CS5536 board, so can't be completely >> sure how >> correct is the code. > > Does it require chipset-specific support code on the OS > (say a device driver) or setting via PCI Bus Master registers > is enough? There is no standard for setting I/O mode on ATA controllers. Most of vendors have own ways for setting it. Most of controllers have some additional registers, accessible via PCI configuration space. So for most of controllers FreeBSD has specific sub-drivers inside ata(4). If no matching sub-driver found - controller handled as "Generic" and mode setting is assumed to be done by BIOS, but it is a last resort. >>> 3. As I'm currently trying to fix the bug in the BIOS >> for the particular >>> board used to boot FreeBSD, what would you suggest to >> fix it? >> >> Try latest FreeBSD -- 8.2 is now in RC state. >> Try to disconnect devices one by one. >> Try to limit initial mode via loader tunables (note that >> some of them >> were added not so long ago and may be missing on 8.0). > > A question about the loader tunable: is it enough to pass it through > the "boot" command, similar to the "-Dv" in "boot -Dv"? You can use `set ...` command at the same loader command line before typing `boot ...`. To make it permanent - you can add wanted options to /boot/loader.conf file. -- Alexander Motin From owner-freebsd-hackers@FreeBSD.ORG Wed Jan 5 18:50:30 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C967710656A5 for ; Wed, 5 Jan 2011 18:50:30 +0000 (UTC) (envelope-from darmawan_salihun@yahoo.com) Received: from web76810.mail.sg1.yahoo.com (web76810.mail.sg1.yahoo.com [124.108.123.114]) by mx1.freebsd.org (Postfix) with SMTP id 3F42B8FC0C for ; Wed, 5 Jan 2011 18:50:29 +0000 (UTC) Received: (qmail 73384 invoked by uid 60001); 5 Jan 2011 18:50:29 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1294253429; bh=+X09lKK1bXA1xaXwaacK78x/mdiMLOSjPuCEg6XpGcE=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=EFZgV5ukpCkBJjA53lzlP+s5WFxh2xt9fSL8Oi0YcyTi4llPO/73CoZorJMKh4rcy6q2pkVsYBdNZJ5aKjTaP3PbpSiEgm42UtI/hYhOlg1A7PrxTHMpr6dZdf+bvX/wZH4+A8GwOA+khv/Rm5a4CxWg2c1OGibfbjoRZrYly7Y= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=XeQqoRHlJeE7RJBDGY6kv6Y9VjkhGJPgP+WulAG5Z44nXkjkpQpwanNvbtEeZXZWrBvNSwzkIVn+Iqd+wHGecmT3bpJdVY+xU2PmAJiJwUub/MG6IzW7TkJaFsaOlg6LSO0ZlXsYKnTHaxb27HCH5fN3i50NA7z8cFPDjFvGbOk=; Message-ID: <20396.71261.qm@web76810.mail.sg1.yahoo.com> X-YMail-OSG: CokGVSIVM1mJzbZcMGychMDtpDP0_UPSYEoE.JSeeOVkCZ4 09jNBVn0RuhQwh5p.hbkEzK6wc9WJ_OqccLn9Ersrl9HNLuk_t6Ohy597tx9 BAo4Hy5PTb533p_Do3dR6dlmcY8qL87Z_in287z24Zh3H45Phip8xXuizwtF 7tMad2CETfTZMnJ.c_JuIR2aXQb3sYz8Jyb7oDM_1z3cs80rqxCcEkF7Gsxt v8Z_0fGKSUZRY3ic00r7yyw994XenKdLjWIMztdy69uhJHb30vqSYUFuM8FQ eTdYhTnQOpV4uT_yuB6KJevOlkYTtfMLJbpG7A85ciS9pUZJoU0KyjYlv9fP 0DSusdkJ8B7s6UqMqVw-- Received: from [114.56.244.171] by web76810.mail.sg1.yahoo.com via HTTP; Thu, 06 Jan 2011 02:50:28 SGT X-Mailer: YahooMailClassic/11.4.20 YahooMailWebService/0.8.107.285259 Date: Thu, 6 Jan 2011 02:50:28 +0800 (SGT) From: Darmawan Salihun To: FreeBSD-hackers MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Fw: Re: PCI IDE Controller Base Address Register setting X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Jan 2011 18:50:31 -0000 --- On Wed, 1/5/11, Darmawan Salihun wrote: > From: Darmawan Salihun > Subject: Re: PCI IDE Controller Base Address Register setting > To: "Alexander Motin" > Date: Wednesday, January 5, 2011, 1:48 PM > --- On Wed, 1/5/11, Alexander Motin > > wrote: >=20 > > From: Alexander Motin > > Subject: Re: PCI IDE Controller Base Address Register > setting > > To: "Darmawan Salihun" > > Cc: freebsd-hackers@freebsd.org > > Date: Wednesday, January 5, 2011, 1:16 PM > > On 05.01.2011 19:25, Darmawan Salihun > > wrote: > > > --- On Wed, 1/5/11, Alexander Motin=A0 > > wrote: > > >=20 > > >> From: Alexander Motin > > >> Subject: Re: PCI IDE Controller Base Address > > Register setting > > >> To: "Darmawan Salihun" > > >> Cc: "John Baldwin", > > freebsd-hackers@freebsd.org > > >> Date: Wednesday, January 5, 2011, 9:56 AM > > >> Darmawan Salihun wrote: > > >>> I get the following log message upon > booting > > with > > >> "boot -Dv": > > >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D > > >>> ata0:=A0 on atapci0 > > >>> ata0: reset tp1 mask=3D03 ostat0=3D50 > ostat1=3D50 > > >>> ata0: stat0=3D0x80 err=3D0x00 lsb=3D0x00 > msb=3D0x00 > > >>> ata0: stat0=3D0x50 err=3D0x01 lsb=3D0x00 > msb=3D0x00 > > >>> ata0: stat1=3D0x50 err=3D0x01 lsb=3D0x00 > msb=3D0x00 > > >>> ata0: reset tp2 stat0=3D50 stat1=3D50 > devices=3D0x3 > > >>> ... > > >>> ata0: Identifying devices: 00000003 > > >>> ata0: New devices: 00000003 > > >>> ... > > >>> ata0-slave: pio=3DPIO4 wdma=3DWDMA2 > udma=3DUDMA100 > > cable=3D80 > > >> wire > > >>> ata0-master: pio=3DPIO1 wdma=3DUNSUPPORTED > > >> udma=3DUNSUPPORTED cable=3D40 wire > > >>> ... > > >>> ad0: FAILURE setting PIO1 on CS5536 chip > > >>> ad0: 488MB > 6.2.0>=A0 at > > >> ata0-master BIOSPIO > > >>> ... > > >>> GEOM: newdisk ad0 > > >>> ad0: Adaptec check1 failed > > >>> ad0: LSI(v3) check1 failed > > >>> ad0: FAILURE - READ > > status=3D51 > > >> error=3Dc4=A0 > > LBA=3D0 > > >>> ... > > >>> ad1: setting PIO4 on CS5536 chip > > >>> ad1: setting UDMA100 on CS5536 chip > > >>> ad1: 38150MB > 3.06>=A0 at > > >> ata0-slave UDMA100 > > >>> ... > > >>> GEOM: newdisk ad1 > > >>> ... > > >>> ad1: FAILURE - READ_DMA > > >> status=3D51 > > >> error=3D84=A0 LBA=3D78132575 > > >>> ad1: FAILURE - READ_DMA > > >> status=3D51 > > >> error=3D84=A0 LBA=3D78132591 > > >>> ... > > >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > >>> I have several questions: > > >>> 1. How FreeBSD sets the PIO mode on the > target > > IDE > > >> controller? > > >>> what could've caused it to fail like the > > message > > >> above? > > >>=20 > > >> Looking to your messages I would suggest you > are > > running > > >> something like > > >> FreeBSD 8.0. At that time > controller-specific > > method first > > >> set mode on > > >> device and then programmed the chip. Most > likely > > this error > > >> returned by > > >> device. Some very old devices not supporting > more > > then PIO3 > > >> may not > > >> support mode setting command. > > >>=20 > > >> Mode setting code was significantly > rewritten > > between 8.0 > > >> and 8.1. I > > >> would recommend you to take newer version of > > FreeBSD for > > >> experiments. > > >=20 > > > The device is a CF-card. Do I need to add some > sort of > > CFA-specific > > > initialization code to the BIOS? > >=20 > > Some CF devices AFAIR may wish power-up command before > they > > will be able to access media, but I have never seen > such > > ones, suppose it was applicable only to some old > > microdrives. AFAIR in all other points CF > specification only > > extends ATA without additional requirements. > >=20 > > > I'm using FreeBSD 8.0 as the test bed for the > log > > message above. > > > I have FreeBSD 8.1 DVD to do further tests. Will > > report later. > >=20 > > OK. > >=20 >=20 > I have done the tests and found that using a different CF > card which supports PIO4 doesn't produce the same error.=20 > It only shows that PIO4 mode is set, but I'm not sure if it > would work=20 > correctly given the fact that the ATA-contoller timing > registers were=20 > not set correctly (from Linux lspci results). >=20 >=20 > > >>> 2. It seems to me that setting the > UDMA100 in > > the > > >>> AMD CS5536 IDE controller went just fine > (in > > the log > > >> above). > > >>> But, FreeBSD fails when it tries to read > > something > > >> from the drive. > > >>> Does it mean the UDMA100 "mode" failed to > be > > set > > >> correctly > > >>> in the IDE controller? > > >>=20 > > >> It can be. For UDMA transfer rate is driven > by > > transmitting > > >> side (for > > >> reading - by device), but there is always a > chance > > to do > > >> something > > >> wrong. :) I don't have CS5536 board, so can't > be > > completely > > >> sure how > > >> correct is the code. > > >=20 > > > Does it require chipset-specific support code on > the > > OS > > > (say a device driver) or setting via PCI Bus > Master > > registers > > > is enough? > >=20 > > There is no standard for setting I/O mode on ATA > > controllers. Most of vendors have own ways for setting > it. > > Most of controllers have some additional registers, > > accessible via PCI configuration space. So for most > of > > controllers FreeBSD has specific sub-drivers inside > ata(4). > > If no matching sub-driver found - controller handled > as > > "Generic" and mode setting is assumed to be done by > BIOS, > > but it is a last resort. > >=20 >=20 > I see. I must provide this code in the current BIOS that=20 > I'm working with then. I have the datasheets and source > code=20 > but I have yet to succeed in setting the PCI registers in > the=20 > ATA controller inside the CS5536. The "Virtual-PCI" > approach=20 > in this platform is really a big headache. >=20 > > >>> 3. As I'm currently trying to fix the bug > in > > the BIOS > > >> for the particular > > >>> board used to boot FreeBSD, what would > you > > suggest to > > >> fix it? > > >>=20 > > >> Try latest FreeBSD -- 8.2 is now in RC > state. > > >> Try to disconnect devices one by one. > > >> Try to limit initial mode via loader > tunables > > (note that > > >> some of them > > >> were added not so long ago and may be missing > on > > 8.0). > > >=20 > > > A question about the loader tunable: is it enough > to > > pass it through > > > the "boot" command, similar to the "-Dv" in > "boot > > -Dv"? > >=20 > > You can use `set ...` command at the same loader > command > > line before typing `boot ...`. To make it permanent - > you > > can add wanted options to /boot/loader.conf file. > >=20 >=20 > Ok. Thanks a lot.=20 >=20 > -Darmawan >=20 >=20 >=20 >=20 > =0A=0A=0A From owner-freebsd-hackers@FreeBSD.ORG Thu Jan 6 01:40:46 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1233) id BF4171065673; Thu, 6 Jan 2011 01:40:46 +0000 (UTC) Date: Thu, 6 Jan 2011 01:40:46 +0000 From: Alexander Best To: freebsd-hackers@freebsd.org Message-ID: <20110106014046.GA324@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Subject: broken INCLUDE in sys/conf/kern.pre.mk for opensolaris code? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Jan 2011 01:40:46 -0000 hi there, while building target buildkernel with 'clang -v' i noticed a lot of these lines: ignoring nonexistent directory "/usr/subversion-src/sys/contrib/opensolaris/compat" i checked sys/conf/kern.pre.mk and there's a line refering to a non-existing directory: # ... and OpenSolaris INCLUDES+= -I$S/contrib/opensolaris/compat is suspect this should actually be: # ... and OpenSolaris INCLUDES+= -I$S/cddl/compat/opensolaris but i'm not sure of it. cheers. alex -- a13x From owner-freebsd-hackers@FreeBSD.ORG Thu Jan 6 02:41:51 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 49927106566C; Thu, 6 Jan 2011 02:41:51 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-qw0-f54.google.com (mail-qw0-f54.google.com [209.85.216.54]) by mx1.freebsd.org (Postfix) with ESMTP id D4CBA8FC0A; Thu, 6 Jan 2011 02:41:50 +0000 (UTC) Received: by qwj9 with SMTP id 9so15691398qwj.13 for ; Wed, 05 Jan 2011 18:41:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=tGt23EBaH9iM4SCVuykGR5QQokBKKALlezot+trp1L8=; b=oeEM/Spv1tlO5n5hRfqCawz1pCVh0z+vmAiVfd8D4FSCIGHsl/g6Y3UZBLWsD/MQgW ANxgVaGP/WUcGxS+hhlHA/Rl2WApD37FB8NOoLD8PZp0GgiVEJTNxrdknASE3kemIcZh ZMcVAhSqFnfDS/XHsxBdQ3HaV+GvX1Y8PsdQE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=lmEhJ+tOrbJgIep91Emx9Wu4N4OTc9MceqQ6ukQoz2fcYMYMqEHvJtupbZoQ0mnaeG HXgaT417fT5rfzi9edBJvBMVv+3q27URDE92X6CFOJvss1YOLgU+//YTmr1njOOqb9P7 ADriYfbg4Wpu37WJkYHgVi3f++uzr0AdUbOGc= MIME-Version: 1.0 Received: by 10.229.89.208 with SMTP id f16mr21259498qcm.43.1294280250984; Wed, 05 Jan 2011 18:17:30 -0800 (PST) Received: by 10.229.39.147 with HTTP; Wed, 5 Jan 2011 18:17:30 -0800 (PST) In-Reply-To: <20110106014046.GA324@freebsd.org> References: <20110106014046.GA324@freebsd.org> Date: Thu, 6 Jan 2011 05:17:30 +0300 Message-ID: From: Sergey Kandaurov To: Alexander Best Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-hackers@freebsd.org Subject: Re: broken INCLUDE in sys/conf/kern.pre.mk for opensolaris code? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Jan 2011 02:41:51 -0000 On 6 January 2011 04:40, Alexander Best wrote: > hi there, > > while building target buildkernel with 'clang -v' i noticed a lot of thes= e > lines: > > ignoring nonexistent directory "/usr/subversion-src/sys/contrib/opensolar= is/compat" > > i checked sys/conf/kern.pre.mk and there's a line refering to a non-exist= ing > directory: > > # ... =A0and OpenSolaris > INCLUDES+=3D -I$S/contrib/opensolaris/compat I guess that's leftover from early dtrace stages in perforce. See //depot/projects/dtrace/src/sys/contrib/opensolaris/compat/sys > > is suspect this should actually be: > > # ... =A0and OpenSolaris > INCLUDES+=3D -I$S/cddl/compat/opensolaris > > but i'm not sure of it. > --=20 wbr, pluknet From owner-freebsd-hackers@FreeBSD.ORG Thu Jan 6 13:45:31 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1233) id F115C1065672; Thu, 6 Jan 2011 13:45:31 +0000 (UTC) Date: Thu, 6 Jan 2011 13:45:31 +0000 From: Alexander Best To: Sergey Kandaurov Message-ID: <20110106134531.GA81523@freebsd.org> References: <20110106014046.GA324@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Cc: freebsd-hackers@freebsd.org Subject: Re: broken INCLUDE in sys/conf/kern.pre.mk for opensolaris code? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Jan 2011 13:45:32 -0000 On Thu Jan 6 11, Sergey Kandaurov wrote: > On 6 January 2011 04:40, Alexander Best wrote: > > hi there, > > > > while building target buildkernel with 'clang -v' i noticed a lot of these > > lines: > > > > ignoring nonexistent directory "/usr/subversion-src/sys/contrib/opensolaris/compat" > > > > i checked sys/conf/kern.pre.mk and there's a line refering to a non-existing > > directory: > > > > # ...  and OpenSolaris > > INCLUDES+= -I$S/contrib/opensolaris/compat > > I guess that's leftover from early dtrace stages in perforce. > See //depot/projects/dtrace/src/sys/contrib/opensolaris/compat/sys ah i see. whom do i have to ping to get this fixed? i'm not sure if the include is even necessary, because obviosly a kernel will build without it. the only issue i had with cddl code is that when you compile and install world with WITHOUT_CDDL=true, you cannot rebuild world with cddl support. but i don't think that's something the include (even if it points to the correct directory) can fix. cheers. alex > > > > > is suspect this should actually be: > > > > # ...  and OpenSolaris > > INCLUDES+= -I$S/cddl/compat/opensolaris > > > > but i'm not sure of it. > > > > > -- > wbr, > pluknet -- a13x From owner-freebsd-hackers@FreeBSD.ORG Thu Jan 6 19:15:09 2011 Return-Path: Delivered-To: freebsd-hackers@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 21CCD1065673 for ; Thu, 6 Jan 2011 19:15:09 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id D45E58FC22 for ; Thu, 6 Jan 2011 19:15:08 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id p06J63Ca033353 for ; Thu, 6 Jan 2011 12:06:03 -0700 (MST) (envelope-from imp@bsdimp.com) Message-ID: <4D261299.6090003@bsdimp.com> Date: Thu, 06 Jan 2011 12:06:01 -0700 From: Warner Losh User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.12) Gecko/20101029 Thunderbird/3.1.6 MIME-Version: 1.0 To: freebsd-hackers@FreeBSD.org References: <20110106014046.GA324@freebsd.org> <20110106134531.GA81523@freebsd.org> In-Reply-To: <20110106134531.GA81523@freebsd.org> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Cc: Subject: Re: broken INCLUDE in sys/conf/kern.pre.mk for opensolaris code? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Jan 2011 19:15:09 -0000 On 01/06/2011 06:45, Alexander Best wrote: > On Thu Jan 6 11, Sergey Kandaurov wrote: >> On 6 January 2011 04:40, Alexander Best wrote: >>> hi there, >>> >>> while building target buildkernel with 'clang -v' i noticed a lot of these >>> lines: >>> >>> ignoring nonexistent directory "/usr/subversion-src/sys/contrib/opensolaris/compat" >>> >>> i checked sys/conf/kern.pre.mk and there's a line refering to a non-existing >>> directory: >>> >>> # ... and OpenSolaris >>> INCLUDES+= -I$S/contrib/opensolaris/compat >> I guess that's leftover from early dtrace stages in perforce. >> See //depot/projects/dtrace/src/sys/contrib/opensolaris/compat/sys > ah i see. whom do i have to ping to get this fixed? i'm not sure if the include > is even necessary, because obviosly a kernel will build without it. the only > issue i had with cddl code is that when you compile and install world with > WITHOUT_CDDL=true, you cannot rebuild world with cddl support. but i don't > think that's something the include (even if it points to the correct directory) > can fix. Maybe we should just remove it and be on our way. Warner > cheers. > alex > >>> is suspect this should actually be: >>> >>> # ... and OpenSolaris >>> INCLUDES+= -I$S/cddl/compat/opensolaris >>> >>> but i'm not sure of it. >>> >> >> -- >> wbr, >> pluknet From owner-freebsd-hackers@FreeBSD.ORG Fri Jan 7 03:15:36 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 074DA1065672 for ; Fri, 7 Jan 2011 03:15:36 +0000 (UTC) (envelope-from leres@ee.lbl.gov) Received: from fun.ee.lbl.gov (fun.ee.lbl.gov [IPv6:2001:400:610:102::ca]) by mx1.freebsd.org (Postfix) with ESMTP id E89B58FC12 for ; Fri, 7 Jan 2011 03:15:35 +0000 (UTC) Received: from hot.ee.lbl.gov (hot.ee.lbl.gov [IPv6:2001:400:610:102::cb]) (authenticated bits=0) by fun.ee.lbl.gov (8.14.4/8.14.4) with ESMTP id p073FZoh016299 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO) for ; Thu, 6 Jan 2011 19:15:35 -0800 (PST) Message-ID: <4D268557.2090704@ee.lbl.gov> Date: Thu, 06 Jan 2011 19:15:35 -0800 From: Craig Leres User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.13) Gecko/20110101 Thunderbird/3.1.7 MIME-Version: 1.0 To: freebsd-hackers@freebsd.org X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: xterm -C and TIOCCONS vs. PRIV_TTY_CONSOLE X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Jan 2011 03:15:36 -0000 I recently upgraded my desktop from 7.2-RELEASE to 8.1-RELEASE and noticed that I no longer get biff messages in my "console" xterm window. I traced this to: xterm: cannot open console: Operation not permitted and see that the TIOCCONS code in tty_generic_ioctl() is checking for PRIV_TTY_CONSOLE. So far so good. But I don't *any* code that ever grants PRIV_TTY_CONSOLE! As far as I can tell it's now totally impossible to ever set a terminal as a console TTY (even for root). This ioctl has been effectively disabled. Shouldn't PRIV_TTY_CONSOLE be granted when a user logs onto /dev/ttyvX? Craig From owner-freebsd-hackers@FreeBSD.ORG Fri Jan 7 09:45:13 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 78597106566C for ; Fri, 7 Jan 2011 09:45:13 +0000 (UTC) (envelope-from joris.dedieu@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id 029D08FC18 for ; Fri, 7 Jan 2011 09:45:12 +0000 (UTC) Received: by fxm16 with SMTP id 16so16735583fxm.13 for ; Fri, 07 Jan 2011 01:45:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:content-type; bh=FMksgL1BHH9GHKJN4ugRV487UpygsgN4OPfqaNkzHss=; b=p5vrbpKsvDItiFIw7ADqJOhfGoUIRxldnJsHwVor4ZbeeGMvsbwtjBPBeqxfEZSbc5 AXrCTj5AHZiMLo2CEtJcjyBXQjuTevJEzSo34IHPfrdNb7Ol+CwvpaBNWFp06MqbDVkz IORJKe+qsXY2Ov2ovCJQW0/LmlyLTe+63uRL0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=GQNR/htL/xV+W960ZGGPF2prgYJui5hleFI90ZY45ip6c1EvRsJOVNC1xtU6LBQ/rF kn5fsAnMqyRL0MSZRtGJksuxjUi2XjVx7mGQ/rP16WxNS3ea5+7cJulEuMCISfDDHZPl cM6AFKn4L6FeNO82cVJ3kJKOA5NfqYah+0K1k= MIME-Version: 1.0 Received: by 10.223.86.16 with SMTP id q16mr666867fal.58.1294391802381; Fri, 07 Jan 2011 01:16:42 -0800 (PST) Received: by 10.223.86.207 with HTTP; Fri, 7 Jan 2011 01:16:42 -0800 (PST) Date: Fri, 7 Jan 2011 10:16:42 +0100 Message-ID: From: joris dedieu To: freebsd-hackers Content-Type: text/plain; charset=ISO-8859-1 Subject: netinet6 little cleanup X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Jan 2011 09:45:13 -0000 Hi, As I was reading netinet6 code, I found some redundant SYSCTL_DECL. I don't know if it's really useful but here is a patch to clean it. - remove SYSCTL_DECL(_net_inet6_ip6) and SYSCTL_DECL(_net_inet6) from c files + add them to netinet6/in6_var.h header (like for netinet). Cheers Joris diff --git a/sys/netinet/ipfw/ip_fw2.c b/sys/netinet/ipfw/ip_fw2.c index 43b2d11..d1d1f6d 100644 --- a/sys/netinet/ipfw/ip_fw2.c +++ b/sys/netinet/ipfw/ip_fw2.c @@ -175,7 +175,6 @@ SYSCTL_VNET_INT(_net_inet_ip_fw, OID_AUTO, static_count, "Number of static rules"); #ifdef INET6 -SYSCTL_DECL(_net_inet6_ip6); SYSCTL_NODE(_net_inet6_ip6, OID_AUTO, fw, CTLFLAG_RW, 0, "Firewall"); SYSCTL_VNET_INT(_net_inet6_ip6_fw, OID_AUTO, deny_unknown_exthdrs, CTLFLAG_RW | CTLFLAG_SECURE, &VNET_NAME(fw_deny_unknown_exthdrs), 0, diff --git a/sys/netinet6/in6_gif.c b/sys/netinet6/in6_gif.c index e786836..1cf0cc6 100644 --- a/sys/netinet6/in6_gif.c +++ b/sys/netinet6/in6_gif.c @@ -74,7 +74,6 @@ __FBSDID("$FreeBSD$"); VNET_DEFINE(int, ip6_gif_hlim) = GIF_HLIM; #define V_ip6_gif_hlim VNET(ip6_gif_hlim) -SYSCTL_DECL(_net_inet6_ip6); SYSCTL_VNET_INT(_net_inet6_ip6, IPV6CTL_GIF_HLIM, gifhlim, CTLFLAG_RW, &VNET_NAME(ip6_gif_hlim), 0, ""); diff --git a/sys/netinet6/in6_mcast.c b/sys/netinet6/in6_mcast.c index 1438c32..9f33cb7 100644 --- a/sys/netinet6/in6_mcast.c +++ b/sys/netinet6/in6_mcast.c @@ -148,7 +148,6 @@ static int in6p_set_multicast_if(struct inpcb *, struct sockopt *); static int in6p_set_source_filters(struct inpcb *, struct sockopt *); static int sysctl_ip6_mcast_filters(SYSCTL_HANDLER_ARGS); -SYSCTL_DECL(_net_inet6_ip6); /* XXX Not in any common header. */ SYSCTL_NODE(_net_inet6_ip6, OID_AUTO, mcast, CTLFLAG_RW, 0, "IPv6 multicast"); diff --git a/sys/netinet6/in6_rmx.c b/sys/netinet6/in6_rmx.c index 2a13646..1943945 100644 --- a/sys/netinet6/in6_rmx.c +++ b/sys/netinet6/in6_rmx.c @@ -204,7 +204,6 @@ in6_matroute(void *v_arg, struct radix_node_head *head) return rn; } -SYSCTL_DECL(_net_inet6_ip6); static VNET_DEFINE(int, rtq_reallyold6) = 60*60; /* one hour is ``really old'' */ diff --git a/sys/netinet6/in6_src.c b/sys/netinet6/in6_src.c index 49bc715..bb60996 100644 --- a/sys/netinet6/in6_src.c +++ b/sys/netinet6/in6_src.c @@ -989,7 +989,6 @@ struct walkarg { }; static int in6_src_sysctl(SYSCTL_HANDLER_ARGS); -SYSCTL_DECL(_net_inet6_ip6); SYSCTL_NODE(_net_inet6_ip6, IPV6CTL_ADDRCTLPOLICY, addrctlpolicy, CTLFLAG_RD, in6_src_sysctl, ""); diff --git a/sys/netinet6/in6_var.h b/sys/netinet6/in6_var.h index 00342fd..23f927d 100644 --- a/sys/netinet6/in6_var.h +++ b/sys/netinet6/in6_var.h @@ -653,6 +653,11 @@ im6s_get_mode(const struct in6_multi *inm, const struct ip6_msource *ims, @@ -653,6 +653,11 @@ im6s_get_mode(const struct in6_multi *inm, const struct ip6_msource *ims, @@ -653,6 +653,11 @@ im6s_get_mode(const struct in6_multi *inm, const struct ip6_msource *ims, diff --git a/sys/netinet/ipfw/ip_fw2.c b/sys/netinet/ipfw/ip_fw2.c index 43b2d11..d1d1f6d 100644 --- a/sys/netinet/ipfw/ip_fw2.c +++ b/sys/netinet/ipfw/ip_fw2.c @@ -175,7 +175,6 @@ SYSCTL_VNET_INT(_net_inet_ip_fw, OID_AUTO, static_count, "Number of static rules"); #ifdef INET6 -SYSCTL_DECL(_net_inet6_ip6); SYSCTL_NODE(_net_inet6_ip6, OID_AUTO, fw, CTLFLAG_RW, 0, "Firewall"); SYSCTL_VNET_INT(_net_inet6_ip6_fw, OID_AUTO, deny_unknown_exthdrs, CTLFLAG_RW | CTLFLAG_SECURE, &VNET_NAME(fw_deny_unknown_exthdrs), 0, diff --git a/sys/netinet6/in6_gif.c b/sys/netinet6/in6_gif.c index e786836..1cf0cc6 100644 --- a/sys/netinet6/in6_gif.c +++ b/sys/netinet6/in6_gif.c @@ -74,7 +74,6 @@ __FBSDID("$FreeBSD$"); VNET_DEFINE(int, ip6_gif_hlim) = GIF_HLIM; #define V_ip6_gif_hlim VNET(ip6_gif_hlim) -SYSCTL_DECL(_net_inet6_ip6); SYSCTL_VNET_INT(_net_inet6_ip6, IPV6CTL_GIF_HLIM, gifhlim, CTLFLAG_RW, &VNET_NAME(ip6_gif_hlim), 0, ""); diff --git a/sys/netinet6/in6_mcast.c b/sys/netinet6/in6_mcast.c index 1438c32..9f33cb7 100644 --- a/sys/netinet6/in6_mcast.c +++ b/sys/netinet6/in6_mcast.c @@ -148,7 +148,6 @@ static int in6p_set_multicast_if(struct inpcb *, struct sockopt *); static int in6p_set_source_filters(struct inpcb *, struct sockopt *); static int sysctl_ip6_mcast_filters(SYSCTL_HANDLER_ARGS); -SYSCTL_DECL(_net_inet6_ip6); /* XXX Not in any common header. */ SYSCTL_NODE(_net_inet6_ip6, OID_AUTO, mcast, CTLFLAG_RW, 0, "IPv6 multicast"); diff --git a/sys/netinet6/in6_rmx.c b/sys/netinet6/in6_rmx.c index 2a13646..1943945 100644 --- a/sys/netinet6/in6_rmx.c +++ b/sys/netinet6/in6_rmx.c @@ -204,7 +204,6 @@ in6_matroute(void *v_arg, struct radix_node_head *head) return rn; } -SYSCTL_DECL(_net_inet6_ip6); static VNET_DEFINE(int, rtq_reallyold6) = 60*60; /* one hour is ``really old'' */ diff --git a/sys/netinet6/in6_src.c b/sys/netinet6/in6_src.c index 49bc715..bb60996 100644 --- a/sys/netinet6/in6_src.c +++ b/sys/netinet6/in6_src.c @@ -989,7 +989,6 @@ struct walkarg { }; static int in6_src_sysctl(SYSCTL_HANDLER_ARGS); -SYSCTL_DECL(_net_inet6_ip6); SYSCTL_NODE(_net_inet6_ip6, IPV6CTL_ADDRCTLPOLICY, addrctlpolicy, CTLFLAG_RD, in6_src_sysctl, ""); diff --git a/sys/netinet6/in6_var.h b/sys/netinet6/in6_var.h index 00342fd..23f927d 100644 --- a/sys/netinet6/in6_var.h +++ b/sys/netinet6/in6_var.h @@ -653,6 +653,11 @@ im6s_get_mode(const struct in6_multi *inm, const struct ip6_msource *ims, index 1438c32..9f33cb7 100644 --- a/sys/netinet6/in6_mcast.c +++ b/sys/netinet6/in6_mcast.c @@ -148,7 +148,6 @@ static int in6p_set_multicast_if(struct inpcb *, struct sockopt *); static int in6p_set_source_filters(struct inpcb *, struct sockopt *); static int sysctl_ip6_mcast_filters(SYSCTL_HANDLER_ARGS); -SYSCTL_DECL(_net_inet6_ip6); /* XXX Not in any common header. */ SYSCTL_NODE(_net_inet6_ip6, OID_AUTO, mcast, CTLFLAG_RW, 0, "IPv6 multicast"); diff --git a/sys/netinet6/in6_rmx.c b/sys/netinet6/in6_rmx.c index 2a13646..1943945 100644 --- a/sys/netinet6/in6_rmx.c +++ b/sys/netinet6/in6_rmx.c @@ -204,7 +204,6 @@ in6_matroute(void *v_arg, struct radix_node_head *head) return rn; } -SYSCTL_DECL(_net_inet6_ip6); static VNET_DEFINE(int, rtq_reallyold6) = 60*60; /* one hour is ``really old'' */ diff --git a/sys/netinet6/in6_src.c b/sys/netinet6/in6_src.c index 49bc715..bb60996 100644 --- a/sys/netinet6/in6_src.c +++ b/sys/netinet6/in6_src.c @@ -989,7 +989,6 @@ struct walkarg { }; static int in6_src_sysctl(SYSCTL_HANDLER_ARGS); -SYSCTL_DECL(_net_inet6_ip6); SYSCTL_NODE(_net_inet6_ip6, IPV6CTL_ADDRCTLPOLICY, addrctlpolicy, CTLFLAG_RD, in6_src_sysctl, ""); diff --git a/sys/netinet6/in6_var.h b/sys/netinet6/in6_var.h index 00342fd..23f927d 100644 --- a/sys/netinet6/in6_var.h +++ b/sys/netinet6/in6_var.h @@ -653,6 +653,11 @@ im6s_get_mode(const struct in6_multi *inm, const struct ip6_msource *ims, diff --git a/sys/netinet6/in6_mcast.c b/sys/netinet6/in6_mcast.c index 1438c32..9f33cb7 100644 --- a/sys/netinet6/in6_mcast.c +++ b/sys/netinet6/in6_mcast.c @@ -148,7 +148,6 @@ static int in6p_set_multicast_if(struct inpcb *, struct sockopt *); static int in6p_set_source_filters(struct inpcb *, struct sockopt *); static int sysctl_ip6_mcast_filters(SYSCTL_HANDLER_ARGS); -SYSCTL_DECL(_net_inet6_ip6); /* XXX Not in any common header. */ SYSCTL_NODE(_net_inet6_ip6, OID_AUTO, mcast, CTLFLAG_RW, 0, "IPv6 multicast"); diff --git a/sys/netinet6/in6_rmx.c b/sys/netinet6/in6_rmx.c index 2a13646..1943945 100644 --- a/sys/netinet6/in6_rmx.c +++ b/sys/netinet6/in6_rmx.c @@ -204,7 +204,6 @@ in6_matroute(void *v_arg, struct radix_node_head *head) return rn; } -SYSCTL_DECL(_net_inet6_ip6); static VNET_DEFINE(int, rtq_reallyold6) = 60*60; /* one hour is ``really old'' */ diff --git a/sys/netinet6/in6_src.c b/sys/netinet6/in6_src.c index 49bc715..bb60996 100644 --- a/sys/netinet6/in6_src.c +++ b/sys/netinet6/in6_src.c @@ -989,7 +989,6 @@ struct walkarg { }; static int in6_src_sysctl(SYSCTL_HANDLER_ARGS); -SYSCTL_DECL(_net_inet6_ip6); SYSCTL_NODE(_net_inet6_ip6, IPV6CTL_ADDRCTLPOLICY, addrctlpolicy, CTLFLAG_RD, in6_src_sysctl, ""); diff --git a/sys/netinet6/in6_var.h b/sys/netinet6/in6_var.h index 00342fd..23f927d 100644 --- a/sys/netinet6/in6_var.h +++ b/sys/netinet6/in6_var.h @@ -653,6 +653,11 @@ im6s_get_mode(const struct in6_multi *inm, const struct ip6_msource *ims, #ifdef _KERNEL +#ifdef SYSCTL_DECL +SYSCTL_DECL(_net_inet6); +SYSCTL_DECL(_net_inet6_ip6); +#endif + /* * Lock macros for IPv6 layer multicast address lists. IPv6 lock goes * before link layer multicast locks in the lock order. In most cases, diff --git a/sys/netinet6/ip6_ipsec.c b/sys/netinet6/ip6_ipsec.c index 96b09ef..72ec2d7 100644 --- a/sys/netinet6/ip6_ipsec.c +++ b/sys/netinet6/ip6_ipsec.c @@ -86,7 +86,6 @@ static VNET_DEFINE(int, ip6_ipsec6_filtertunnel) = 0; #endif #define V_ip6_ipsec6_filtertunnel VNET(ip6_ipsec6_filtertunnel) -SYSCTL_DECL(_net_inet6_ipsec6); SYSCTL_VNET_INT(_net_inet6_ipsec6, OID_AUTO, filtertunnel, CTLFLAG_RW, &VNET_NAME(ip6_ipsec6_filtertunnel), 0, "If set filter packets from an IPsec tunnel."); diff --git a/sys/netinet6/ip6_mroute.c b/sys/netinet6/ip6_mroute.c index 0c1ff78..395ccf2 100644 --- a/sys/netinet6/ip6_mroute.c +++ b/sys/netinet6/ip6_mroute.c @@ -154,8 +154,6 @@ static int pim6_encapcheck(const struct mbuf *, int, int, void *); static VNET_DEFINE(int, ip6_mrouter_ver) = 0; #define V_ip6_mrouter_ver VNET(ip6_mrouter_ver) -SYSCTL_DECL(_net_inet6); -SYSCTL_DECL(_net_inet6_ip6); SYSCTL_NODE(_net_inet6, IPPROTO_PIM, pim, CTLFLAG_RW, 0, "PIM"); static struct mrt6stat mrt6stat; diff --git a/sys/netinet6/mld6.c b/sys/netinet6/mld6.c index 21d9eab..7bea10a 100644 --- a/sys/netinet6/mld6.c +++ b/sys/netinet6/mld6.c @@ -215,8 +215,6 @@ static VNET_DEFINE(int, current_state_timers_running6); #define V_state_change_timers_running6 VNET(state_change_timers_running6) #define V_current_state_timers_running6 VNET(current_state_timers_running6) -SYSCTL_DECL(_net_inet6); /* Note: Not in any common header. */ - SYSCTL_NODE(_net_inet6, OID_AUTO, mld, CTLFLAG_RW, 0, "IPv6 Multicast Listener Discovery"); From owner-freebsd-hackers@FreeBSD.ORG Fri Jan 7 10:58:16 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 429C0106564A for ; Fri, 7 Jan 2011 10:58:16 +0000 (UTC) (envelope-from gljennjohn@googlemail.com) Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id BDF9D8FC0A for ; Fri, 7 Jan 2011 10:58:15 +0000 (UTC) Received: by bwz12 with SMTP id 12so9854947bwz.13 for ; Fri, 07 Jan 2011 02:58:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:in-reply-to:references:reply-to:x-mailer:mime-version :content-type:content-transfer-encoding; bh=38qNOd9E3hS9sbkRb3LFjgG7B/Xtg79Uc7WymonE51k=; b=o0Z8+Mnh/j2sDfIt6lEU7FBGe4mE/6VvLLSb7nhHqk1FDeGOg5iXUX5jxkKJ0vxIiB 5npoRIo746qz0UC5tSAT7GS/OVVQFNGl0L7+eytQXlndAZD39G8g5wmUC090zgwg92ZU R3ZuVwVXUtnwWmGUb7MpX0uylfXuLDig2DXrY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=date:from:to:cc:subject:message-id:in-reply-to:references:reply-to :x-mailer:mime-version:content-type:content-transfer-encoding; b=dNHvFdGc2+sy62uLshaKZr9A9zUYzhi5dFJEyrM6a0R5A7u/6S4Bk05Nd80JMN29u2 ILbHU6TfRYonqy0mRnZ7PXipuvYH2dIV+1XyUSI3oN71SzppI9t05m4QmGNhyowmjJ86 zr0asGySjLMc17QlVG+vFJoUUBZ4CNyNdAyPo= Received: by 10.204.52.138 with SMTP id i10mr2460395bkg.23.1294397894410; Fri, 07 Jan 2011 02:58:14 -0800 (PST) Received: from ernst.jennejohn.org (p578E194D.dip.t-dialin.net [87.142.25.77]) by mx.google.com with ESMTPS id v25sm14096191bkt.18.2011.01.07.02.58.12 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 07 Jan 2011 02:58:13 -0800 (PST) Date: Fri, 7 Jan 2011 11:58:11 +0100 From: Gary Jennejohn To: Craig Leres Message-ID: <20110107115811.12d993b6@ernst.jennejohn.org> In-Reply-To: <4D268557.2090704@ee.lbl.gov> References: <4D268557.2090704@ee.lbl.gov> X-Mailer: Claws Mail 3.7.8 (GTK+ 2.18.7; amd64-portbld-freebsd9.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org Subject: Re: xterm -C and TIOCCONS vs. PRIV_TTY_CONSOLE X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: gljennjohn@googlemail.com List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Jan 2011 10:58:16 -0000 On Thu, 06 Jan 2011 19:15:35 -0800 Craig Leres wrote: > I recently upgraded my desktop from 7.2-RELEASE to 8.1-RELEASE and > noticed that I no longer get biff messages in my "console" xterm window. > I traced this to: > > xterm: cannot open console: Operation not permitted > > and see that the TIOCCONS code in tty_generic_ioctl() is checking for > PRIV_TTY_CONSOLE. So far so good. But I don't *any* code that ever > grants PRIV_TTY_CONSOLE! As far as I can tell it's now totally > impossible to ever set a terminal as a console TTY (even for root). This > ioctl has been effectively disabled. > > Shouldn't PRIV_TTY_CONSOLE be granted when a user logs onto /dev/ttyvX? > See the reply I just posted to current. If your xterm is setuid root it does work, because the privilege checking code doesn't look at the credential passed in. It's still a bug, but you can work around it. -- Gary Jennejohn From owner-freebsd-hackers@FreeBSD.ORG Fri Jan 7 12:16:07 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 10BA61065673 for ; Fri, 7 Jan 2011 12:16:07 +0000 (UTC) (envelope-from lev@FreeBSD.org) Received: from ftp.translate.ru (ftp.translate.ru [80.249.188.42]) by mx1.freebsd.org (Postfix) with ESMTP id C43718FC20 for ; Fri, 7 Jan 2011 12:16:06 +0000 (UTC) Received: from [192.168.134.2] (89.112.15.178.pppoe.eltel.net [89.112.15.178]) (Authenticated sender: lev@serebryakov.spb.ru) by ftp.translate.ru (Postfix) with ESMTPA id 92BA913DF5F for ; Fri, 7 Jan 2011 15:16:04 +0300 (MSK) Date: Fri, 7 Jan 2011 15:15:59 +0300 From: Lev Serebryakov Organization: FreeBSD X-Priority: 3 (Normal) Message-ID: <1241746160.20110107151559@serebryakov.spb.ru> To: freebsd-hackers@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=windows-1251 Content-Transfer-Encoding: quoted-printable Subject: Building "third-party" modules for kernel with debug options? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: lev@FreeBSD.org List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Jan 2011 12:16:07 -0000 Hello, Freebsd-hackers. I've found, that "struct bio" is depend on state of "DIAGNOSTIC" flag ("options DIAGNOSTIC" in kernel config). But when I build third-party GEOM (or any other) module with using of , there is no access to these options. So, module, built from ports, can fail on user's kernel, even if it built with proper kernel sources in "/usr/src/sys". Is here any solution for this problem? P.S. NB: GEOM module is only example, question is about modules & kernel options in general, so I put this message on Hackers list. --=20 // Black Lion AKA Lev Serebryakov From owner-freebsd-hackers@FreeBSD.ORG Fri Jan 7 12:57:23 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3CC05106564A for ; Fri, 7 Jan 2011 12:57:23 +0000 (UTC) (envelope-from joris.dedieu@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id C8EB28FC08 for ; Fri, 7 Jan 2011 12:57:22 +0000 (UTC) Received: by fxm16 with SMTP id 16so16850430fxm.13 for ; Fri, 07 Jan 2011 04:57:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:content-type; bh=jIFj4zYIwpvntCcYPa3thONxi9XN9GkOAr+2p+5hjNo=; b=jOttLDSI+IuwTG6ehnRAVQueFbpnxferFMoaUZRViwow/zmUaqQelvD0VbRYKgL6yj d6KN3wYE3CcqPjD+2Emo63zcAaiae3DVMckNGhkG4HC8gnSc5/XOqL4TLuBq4B8Gmf9r TmvegOx5kDm2onmCaNQitvxlQX7iOKcwkZ+H4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=W1B6D2X6fuGDWnD3bGiyvGdqfdN1JHP5Z56yUHJIbRHyHnuCEQWh+bcYCvDf+fawu9 8D+VeVST+3DwJr9AnEUWdjW4W+j776gYJ1tsO27wVjL76pDrixgOz1WBWQuqx/2P+lsR 5nTox6dXrpAfm1r8sglKwn/unggSKAzuL/tw4= MIME-Version: 1.0 Received: by 10.223.100.5 with SMTP id w5mr9544851fan.20.1294405041622; Fri, 07 Jan 2011 04:57:21 -0800 (PST) Received: by 10.223.86.207 with HTTP; Fri, 7 Jan 2011 04:57:21 -0800 (PST) Date: Fri, 7 Jan 2011 13:57:21 +0100 Message-ID: From: joris dedieu To: freebsd-hackers Content-Type: text/plain; charset=ISO-8859-1 Subject: binding non local ip. X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Jan 2011 12:57:23 -0000 Hi, I need a to bind non local ips daemons that don't implement IP_BINDANY sockopt. There are several solutions as patching every single daemon or using carp (You may not want automatic failover), jailing the process and of course binding INADDR_ANY when possible ... Has I'm too lazy for this, I wrote a little (maybe ugly as my kernel knowledges are really low) patch that add a sysctl entry in net.inet.ip that allow binding non local ips. It's maybe buggy and insecure but it seems to work. What do you think about it ? Thanks Joris --- a/sys/netinet/in_pcb.c +++ b/sys/netinet/in_pcb.c @@ -321,6 +321,9 @@ in_pcbbind(struct inpcb *inp, struct sockaddr *nam, struct ucred *cred) * * On error, the values of *laddrp and *lportp are not changed. */ +static int bindany = 0; /* 1 allows to bind a non local ip */ +SYSCTL_INT(_net_inet_ip, OID_AUTO, bindany, CTLFLAG_RW, &bindany, 0, + "Allow to bind a non local ip"); int in_pcbbind_setup(struct inpcb *inp, struct sockaddr *nam, in_addr_t *laddrp, u_short *lportp, struct ucred *cred) @@ -393,8 +396,12 @@ in_pcbbind_setup(struct inpcb *inp, struct sockaddr *nam, in_addr_t *laddrp, * to any endpoint address, local or not. */ if ((inp->inp_flags & INP_BINDANY) == 0 && - ifa_ifwithaddr_check((struct sockaddr *)sin) == 0) - return (EADDRNOTAVAIL); + ifa_ifwithaddr_check((struct sockaddr *)sin) == 0) { + if(bindany > 0) + inp->inp_flags |= INP_BINDANY; + else + return (EADDRNOTAVAIL); + } } laddr = sin->sin_addr; if (lport) { From owner-freebsd-hackers@FreeBSD.ORG Fri Jan 7 13:39:04 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 822C91065670 for ; Fri, 7 Jan 2011 13:39:04 +0000 (UTC) (envelope-from rea@codelabs.ru) Received: from 0.mx.codelabs.ru (0.mx.codelabs.ru [144.206.177.45]) by mx1.freebsd.org (Postfix) with ESMTP id 34CA48FC12 for ; Fri, 7 Jan 2011 13:39:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=codelabs.ru; s=two; h=Sender:In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date; bh=qtdhg+y3Ay0/ZkMAgchedcFfrAzirOKWMgQRLiPMIMY=; b=QmqPSKhS6PkrwGhtG1wZn3+lyVwnY3NQ9kbyuuuwr+zncuMFjtCSqXUaztjGeSfdb5zFe184++x6zqyyG/JocGVnOj5iHUVAHkKmXMAYzXBdt/3Gf7GYaHgCS3E0KhIdsa3JfDg/vQdtdhMycxMVfhSNStwhhdEaFHXD4yCZ+XDF2WZeuy6rQ0wPVXnS7gjvk5eWcnfmYaLZ6Q+ZeYvWQ/aeetwhi8dfykajQgmTRzvjEPrjdDcRogaS825uW6vhBAseiEBvX7I9qglM5rr3WKtW9R8kSCzwzveB5Q50O21imCHyUk6K/6XLquP7lKvmVnOKqIa+aUAWVNIe1qR6WA==; Received: from amnesiac.at.no.dns (ppp85-141-65-122.pppoe.mtu-net.ru [85.141.65.122]) by 0.mx.codelabs.ru with esmtpsa (TLSv1:AES256-SHA:256) id 1PbCX0-000HkF-MG; Fri, 07 Jan 2011 16:39:02 +0300 Date: Fri, 7 Jan 2011 16:38:59 +0300 From: Eygene Ryabinkin To: joris dedieu Message-ID: References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="IR1Y5IvQhrKgS4e6" Content-Disposition: inline In-Reply-To: Sender: rea@codelabs.ru Cc: freebsd-hackers Subject: Re: binding non local ip. X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Jan 2011 13:39:04 -0000 --IR1Y5IvQhrKgS4e6 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Fri, Jan 07, 2011 at 01:57:21PM +0100, joris dedieu wrote: > What do you think about it ? [...] > +static int bindany =3D 0; /* 1 allows to bind a non local ip */ > +SYSCTL_INT(_net_inet_ip, OID_AUTO, bindany, CTLFLAG_RW, &bindany, 0, > + "Allow to bind a non local ip"); On at least 8.x, you will likely want to use VNET_* macros to enable your new sysctl to be virtualized. Something like this: {{{ VNET_DEFINE(int, inp_bindany) =3D 0; SYSCTL_VNET_INT(_net_inet_ip, OID_AUTO, bindany, CTLFLAG_RW, &VNET_NAME(inp_bindany), 0, "Force INP_BINDANY on all sockets"); }}} and use VNET(inp_bindany) in subsequent code. > if ((inp->inp_flags & INP_BINDANY) =3D=3D 0 && > - ifa_ifwithaddr_check((struct sockaddr *)sin) = =3D=3D 0) > - return (EADDRNOTAVAIL); > + ifa_ifwithaddr_check((struct sockaddr *)sin) = =3D=3D 0) { > + if(bindany > 0) > + inp->inp_flags |=3D INP_BINDANY; > + else > + return (EADDRNOTAVAIL); > + } The check is better to be rewritten as {{{ if (VNET(inp_bindany) > 0) inp->inp_flags |=3D INP_BINDANY; else if ((inp->inp_flags & INP_BINDANY) =3D=3D 0 && ifa_ifwithaddr_check((struct sockaddr *)sin) = =3D=3D 0) return (EADDRNOTAVAIL); }}} it will save you two conditionals if bindany is enabled. On the other hand, if you will set the value of VNET(inp_bindany) to INP_BINDANY instead of 1, you can even do {{{ inp->inp_flags |=3D VNET(inp_bindany); if ((inp->inp_flags & INP_BINDANY) =3D=3D 0 && ifa_ifwithaddr_check((struct sockaddr *)sin) = =3D=3D 0) return (EADDRNOTAVAIL); }}} and this will eliminate one branching instruction at the expense of memory access and fast logical operation. --=20 Eygene Ryabinkin ,,,^..^,,, [ Life's unfair - but root password helps! | codelabs.ru ] [ 82FE 06BC D497 C0DE 49EC 4FF0 16AF 9EAE 8152 ECFB | freebsd.org ] --IR1Y5IvQhrKgS4e6 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (FreeBSD) iF4EAREIAAYFAk0nF3MACgkQFq+eroFS7PuMGQD/YB6OMYyGB1djniDCYAr+PVYh StIjtDcjFWMgjOiWEoQA/0G9mJnH0UcjAXLAVhGkqxP2xbCOvBejXe6gCzIM8Wp+ =b8TD -----END PGP SIGNATURE----- --IR1Y5IvQhrKgS4e6-- From owner-freebsd-hackers@FreeBSD.ORG Fri Jan 7 13:57:36 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 449A0106564A for ; Fri, 7 Jan 2011 13:57:36 +0000 (UTC) (envelope-from gleb.kurtsou@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id C9F058FC14 for ; Fri, 7 Jan 2011 13:57:35 +0000 (UTC) Received: by fxm16 with SMTP id 16so16897865fxm.13 for ; Fri, 07 Jan 2011 05:57:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:references:mime-version:content-type:content-disposition :in-reply-to:user-agent; bh=Wcher6iriY0Zw0b+HiGoJ9wpKf/DQR0ZFPSGwtoXCt0=; b=B9Wa9y/kc71eu251JY8pzXwO+KtVBtrQzR0umw9A+9+rOHxEWhH19LBJ/aF5vRb6Zr J4QaxIMYEgvgKrb5+WBg3D/kjWSj78GKp5g9W2qjvGOGGhrDwh9ya+oUjPGOP2z2utfx RwGY1Rn3dtlwqvE4/n3KU3KmQL+qK2moNyCo0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=SA7zN6JAFJ9ui9CVc+J6ZpqpFwCY9vO4xIOR3F+7uGLASoZZDjCqFea1il3RC2fy29 fRXVB1SZk14/fNO65ZL0rmEzkGAtQ07UX9Krv67BohHTKpOTMoDVhnN1i4yJSPAlym66 qU0YZv4hrr+ifhzn/p23LaUFkqXoJ/j7k5UzA= Received: by 10.223.96.138 with SMTP id h10mr1936506fan.120.1294408654058; Fri, 07 Jan 2011 05:57:34 -0800 (PST) Received: from localhost (lan-78-157-92-5.vln.skynet.lt [78.157.92.5]) by mx.google.com with ESMTPS id a25sm6148782fak.44.2011.01.07.05.57.32 (version=SSLv3 cipher=RC4-MD5); Fri, 07 Jan 2011 05:57:33 -0800 (PST) Date: Fri, 7 Jan 2011 15:56:36 +0200 From: Gleb Kurtsou To: Lev Serebryakov Message-ID: <20110107133555.GA12490@tops.skynet.lt> References: <1241746160.20110107151559@serebryakov.spb.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1241746160.20110107151559@serebryakov.spb.ru> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: freebsd-hackers@freebsd.org Subject: Re: Building "third-party" modules for kernel with debug options? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Jan 2011 13:57:36 -0000 On (07/01/2011 15:15), Lev Serebryakov wrote: > Hello, Freebsd-hackers. > > > I've found, that "struct bio" is depend on state of "DIAGNOSTIC" > flag ("options DIAGNOSTIC" in kernel config). But when I build > third-party GEOM (or any other) module with using of , > there is no access to these options. So, module, built from ports, can > fail on user's kernel, even if it built with proper kernel sources in > "/usr/src/sys". Is here any solution for this problem? Set KERNBUILDDIR before building module for options to be picked up, e.g.: export KERNBUILDDIR=`make -C /sys -V .OBJDIR`/`uname -i` cd /module/path; make > > P.S. NB: GEOM module is only example, question is about modules & > kernel options in general, so I put this message on Hackers list. > > -- > // Black Lion AKA Lev Serebryakov > > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" From owner-freebsd-hackers@FreeBSD.ORG Fri Jan 7 14:46:49 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 779C71065746; Fri, 7 Jan 2011 14:46:49 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 4B1548FC08; Fri, 7 Jan 2011 14:46:49 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 044DE46B1A; Fri, 7 Jan 2011 09:46:49 -0500 (EST) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 310198A01D; Fri, 7 Jan 2011 09:46:48 -0500 (EST) From: John Baldwin To: freebsd-hackers@freebsd.org, lev@freebsd.org Date: Fri, 7 Jan 2011 08:20:23 -0500 User-Agent: KMail/1.13.5 (FreeBSD/7.3-CBSD-20101102; KDE/4.4.5; amd64; ; ) References: <1241746160.20110107151559@serebryakov.spb.ru> In-Reply-To: <1241746160.20110107151559@serebryakov.spb.ru> MIME-Version: 1.0 Content-Type: Text/Plain; charset="windows-1251" Content-Transfer-Encoding: 7bit Message-Id: <201101070820.24144.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Fri, 07 Jan 2011 09:46:48 -0500 (EST) X-Virus-Scanned: clamav-milter 0.96.3 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-1.9 required=4.2 tests=BAYES_00 autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on bigwig.baldwin.cx Cc: phk@freebsd.org Subject: Re: Building "third-party" modules for kernel with debug options? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Jan 2011 14:46:49 -0000 On Friday, January 07, 2011 7:15:59 am Lev Serebryakov wrote: > Hello, Freebsd-hackers. > > > I've found, that "struct bio" is depend on state of "DIAGNOSTIC" > flag ("options DIAGNOSTIC" in kernel config). But when I build > third-party GEOM (or any other) module with using of , > there is no access to these options. So, module, built from ports, can > fail on user's kernel, even if it built with proper kernel sources in > "/usr/src/sys". Is here any solution for this problem? > > P.S. NB: GEOM module is only example, question is about modules & > kernel options in general, so I put this message on Hackers list. In general we try to avoid having "public" kernel data structures change size when various kernel options are in use. Some noticeable exceptions to this rule are PAE (i386-only) and LOCK_PROFILING (considered to be something users would not typically use). DIAGNOSTIC might arguably be considered the same as LOCK_PROFILING, but I am surprised it affects bio. It should only affect a GEOM module that uses bio_pblockno however in this case since you should be using kernel routines to allocate bio structures rather than malloc'ing one directly. Perhaps phk@ would ok moving bio_pblockno up above the optional diagnostic fields. -- John Baldwin From owner-freebsd-hackers@FreeBSD.ORG Fri Jan 7 17:24:23 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 650FE106564A for ; Fri, 7 Jan 2011 17:24:23 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from out-0.mx.aerioconnect.net (out-0-30.mx.aerioconnect.net [216.240.47.90]) by mx1.freebsd.org (Postfix) with ESMTP id 3536E8FC08 for ; Fri, 7 Jan 2011 17:24:22 +0000 (UTC) Received: from idiom.com (postfix@mx0.idiom.com [216.240.32.160]) by out-0.mx.aerioconnect.net (8.13.8/8.13.8) with ESMTP id p07HOLT5020402; Fri, 7 Jan 2011 09:24:21 -0800 X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e Received: from julian-mac.elischer.org (h-67-100-89-137.snfccasy.static.covad.net [67.100.89.137]) by idiom.com (Postfix) with ESMTP id 0CEAD2D6012; Fri, 7 Jan 2011 09:24:20 -0800 (PST) Message-ID: <4D274C5E.500@freebsd.org> Date: Fri, 07 Jan 2011 09:24:46 -0800 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10.4; en-US; rv:1.9.2.13) Gecko/20101207 Thunderbird/3.1.7 MIME-Version: 1.0 To: joris dedieu References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.67 on 216.240.47.51 Cc: freebsd-hackers Subject: Re: binding non local ip. X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Jan 2011 17:24:23 -0000 On 1/7/11 4:57 AM, joris dedieu wrote: > Hi, > I need a to bind non local ips daemons that don't > implement IP_BINDANY sockopt. I'm not sure you need it you can use the ipfw 'fwd' command to make a locally bound socket act and look as if it is bound to a non local address You need to tell us a little more about what you need to do for example, Is the socket just listenning? or is it initiating? > There are several solutions as patching every single daemon > or using carp (You may not want automatic failover), jailing > the process and of course binding INADDR_ANY when possible ... > > As I'm too lazy for this, I wrote a little (maybe ugly as my > kernel knowledges are really low) patch that add a sysctl > entry in net.inet.ip that allow binding non local ips. It's > maybe buggy and insecure but it seems to work. seems ok, but if the daemon is initiating, how does it know to bind to a non local address? also. if you have source, a single setsockopt() in each one is not much of a job.. > What do you think about it ? > > Thanks > Joris > > --- a/sys/netinet/in_pcb.c > +++ b/sys/netinet/in_pcb.c > @@ -321,6 +321,9 @@ in_pcbbind(struct inpcb *inp, struct sockaddr > *nam, struct ucred *cred) > * > * On error, the values of *laddrp and *lportp are not changed. > */ > +static int bindany = 0; /* 1 allows to bind a non local ip */ > +SYSCTL_INT(_net_inet_ip, OID_AUTO, bindany, CTLFLAG_RW,&bindany, 0, > + "Allow to bind a non local ip"); > int > in_pcbbind_setup(struct inpcb *inp, struct sockaddr *nam, in_addr_t *laddrp, > u_short *lportp, struct ucred *cred) > @@ -393,8 +396,12 @@ in_pcbbind_setup(struct inpcb *inp, struct > sockaddr *nam, in_addr_t *laddrp, > * to any endpoint address, local or not. > */ > if ((inp->inp_flags& INP_BINDANY) == 0&& > - ifa_ifwithaddr_check((struct sockaddr *)sin) == 0) > - return (EADDRNOTAVAIL); > + ifa_ifwithaddr_check((struct sockaddr *)sin) == 0) { > + if(bindany> 0) > + inp->inp_flags |= INP_BINDANY; > + else > + return (EADDRNOTAVAIL); > + } > } > laddr = sin->sin_addr; > if (lport) { > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" > From owner-freebsd-hackers@FreeBSD.ORG Fri Jan 7 20:02:28 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8BDF610657C3; Fri, 7 Jan 2011 20:02:28 +0000 (UTC) (envelope-from jay@experts-exchange.com) Received: from mail.experts-exchange.com (mail.experts-exchange.com [72.29.183.251]) by mx1.freebsd.org (Postfix) with ESMTP id 694358FC1D; Fri, 7 Jan 2011 20:02:28 +0000 (UTC) Received: from mail.experts-exchange.com (localhost [127.0.0.1]) by mail.experts-exchange.com (Postfix) with ESMTP id A22E26F093C; Fri, 7 Jan 2011 11:45:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d= experts-exchange.com; h=content-transfer-encoding:content-type :content-type:mime-version:user-agent:from:from:subject:subject :date:date:message-id:received:received:received; s=ee; t= 1294429514; x=1296243914; bh=NmGQmsXS3R7cmTpulBJ7wf5eZcunzdcr69k vFGSGk84=; b=SHvM0yZ+yKX2NmIy1B0xg3wqL5fkgbYcrGbLNmi4j8M7024VyZr x584vUZgCmBy16RcyLoM3uHuvW7PyJkFChZuJUN9VfwWXuMX1ptPkTZLb9/gZBx6 GymKyAEY9s8WRTIKnYn1y5qkHlXv1kea6EFfGCIryjzRp4sCtqH2UtG8= X-Virus-Scanned: amavisd-new at experts-exchange.com Received: from mail.experts-exchange.com ([127.0.0.1]) by mail.experts-exchange.com (mail.experts-exchange.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xU8F+exIbgAk; Fri, 7 Jan 2011 11:45:14 -0800 (PST) Received: from mail.experts-exchange.com (localhost [127.0.0.1]) by mail.experts-exchange.com (Postfix) with ESMTP id 6545A6F0939; Fri, 7 Jan 2011 11:45:14 -0800 (PST) Received: from 192.168.103.176 (SquirrelMail authenticated user jay) by mail.experts-exchange.com with HTTP; Fri, 7 Jan 2011 11:45:14 -0800 Message-ID: <9b22ed5e31d4e547daf27e01d6d08528.squirrel@mail.experts-exchange.com> Date: Fri, 7 Jan 2011 11:45:14 -0800 From: jay@experts-exchange.com To: freebsd-hackers@freebsd.org User-Agent: SquirrelMail/1.4.20 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal Cc: freebsd-stable@freebsd.org, freebsd-ports@freebsd.org Subject: stunnel transparent proxy X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Jan 2011 20:02:28 -0000 Folks, Would it be possible to devise an ipfw 'fwd' rule to pass along a socket connection with IP_BINDANY set via stunnel that forwards it to another process? The problem I'm having is the vnc service on the other side cannot reply back to the IP address because the routing does not redirect back through stunnel. I am testing configurations using apache (port 80 and 443) for convenience. Request : ext ip -> stunnel -> vnc svc Response : vnc svc X->ext ip instead of : vnc svc -> stunnel -> ext ip With stunnel's transparent set option traffic looks like : 19:31:34.162337 IP 192.168.103.69.52671 > 127.0.0.1.80: Flags [S], seq 2050938762, win 65535, options [mss 16344,nop,wscale 3,sackOK,TS val 7437993 ecr 0], length 0 19:31:37.153079 IP 192.168.103.69.52671 > 127.0.0.1.80: Flags [S], .. 19:31:40.351804 IP 192.168.103.69.52671 > 127.0.0.1.80: Flags [S], .. 19:31:43.550543 IP 192.168.103.69.52671 > 127.0.0.1.80: Flags [S], seq 2050938762, win 65535, options [mss 16344,sackOK,eol], length 0 Without transparent, traffic flows fine, and looks like : 19:32:55.883404 IP 127.0.0.1.30326 > 127.0.0.1.80: Flags [S], seq 2147354729, win 65535, options [mss 16344,nop,wscale 3,sackOK,TS val 7446169 ecr 0], length 0 19:32:55.883575 IP 127.0.0.1.80 > 127.0.0.1.30326: Flags [S.], seq 2770470513, ack 2147354730, win 65535, options [mss 16344,nop,wscale 3,sackOK,TS val 1229815108 ecr 7446169], length 0 19:32:55.883589 IP 127.0.0.1.30326 > 127.0.0.1.80: Flags [.], ack 1, win 8960, options [nop,nop,TS val 7446169 ecr 1229815108], length 0 ... I did try and devise pf rules to redirect or rdr and nat, but neither worked. I am only vaguely familiar with ipfw, and from some of my research led me to believe it may be possible. Thanks P.S. I did post the same question earlier on freebsd-pf list as well. http://lists.freebsd.org/pipermail/freebsd-pf/2011-January/005914.html From owner-freebsd-hackers@FreeBSD.ORG Fri Jan 7 19:55:56 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7D112106566B for ; Fri, 7 Jan 2011 19:55:56 +0000 (UTC) (envelope-from lgj@usenix.org) Received: from lonestar.usenix.org (lonestar.usenix.org [131.106.3.102]) by mx1.freebsd.org (Postfix) with ESMTP id 628358FC14 for ; Fri, 7 Jan 2011 19:55:56 +0000 (UTC) Received: from negroni.usenix.org (negroni.usenix.org [131.106.3.145]) (authenticated bits=0) by lonestar.usenix.org (8.14.2/8.14.2) with ESMTP id p07Jr8vb008745 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO) for ; Fri, 7 Jan 2011 11:55:56 -0800 (PST) From: Lionel Garth Jones Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Fri, 7 Jan 2011 11:55:56 -0800 Message-Id: <321D02CA-263C-40A4-AC6B-41B984118CF3@usenix.org> To: freebsd-hackers@freebsd.org Mime-Version: 1.0 (Apple Message framework v1082) X-Mailer: Apple Mail (2.1082) X-DCC-USENIX-Metrics: lonestar; whitelist X-Spam-Status: No, score=0.7 required=6.0 tests=ALL_TRUSTED, FH_DATE_PAST_20XX autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on lonestar X-Mailman-Approved-At: Fri, 07 Jan 2011 20:21:34 +0000 Subject: USENIX ATC '11 Submission Deadline Next Week (1/12) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Jan 2011 19:55:56 -0000 We're writing to remind you that the submission deadline for the 2011 USENIX Annual Technical Conference is next week. Please submit your work by 11:59 p.m. EST on Wednesday, January 12, 2011. The submission system is live and can be found at: http://papers.usenix.org/hotcrp/atc11/ The USENIX ATC '11 Program Committee is seeking high-quality submissions that further the knowledge and understanding of modern computing systems, with an emphasis on implementations and experimental results. We encourage papers that break new ground or present insightful results based on practical experience with computer systems. For more details on the submission process and suggested topics of interest, please see the complete Call for Papers at http://www.usenix.org/atc11/cfpd/ We look forward to your submissions. Jason Nieh, Columbia University Carl Waldspurger USENIX ATC '11 Program Chairs atc11chairs@usenix.org --------------------------------------- Call for Papers 2011 USENIX Annual Technical Conference June 15-17, 2011, Portland, OR Part of USENIX Federated Conferences Week, June 12-17, 2011 http://www.usenix.org/atc11/cfpd/ Submissions Deadline: January 12, 2011, 11:59 p.m. EST --------------------------------------- From owner-freebsd-hackers@FreeBSD.ORG Fri Jan 7 21:48:54 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 60705106564A for ; Fri, 7 Jan 2011 21:48:54 +0000 (UTC) (envelope-from nonesuch@longcount.org) Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id F313C8FC18 for ; Fri, 7 Jan 2011 21:48:53 +0000 (UTC) Received: by bwz12 with SMTP id 12so10402936bwz.13 for ; Fri, 07 Jan 2011 13:48:53 -0800 (PST) MIME-Version: 1.0 Received: by 10.204.140.208 with SMTP id j16mr1363326bku.151.1294435234801; Fri, 07 Jan 2011 13:20:34 -0800 (PST) Received: by 10.204.151.212 with HTTP; Fri, 7 Jan 2011 13:20:34 -0800 (PST) X-Originating-IP: [209.66.78.50] Date: Fri, 7 Jan 2011 16:20:34 -0500 Message-ID: From: Mark Saad To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset=UTF-8 Subject: With out ddb and kdb set 7.3-RELEASE amd64 does not boot. X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Jan 2011 21:48:54 -0000 Hello hackers@, I have a good question that I cant find an answer for. I believe found a kernel bug in 7.3-RELEASE that prevents me from booting 64-bit kernels on HP's DL360 G4p . The kernel dies with "Fatal trap 12: page fault while in kernel mode " . The hardware works fine in 7.2-RELEASE amd64, 7.1-RELEASE amd64, and 6.4-RELEASE amd64 . In 7.3-RELEASE amd64 I can not boot from cd or pxe correctly using the stock 7.3-RELEASE amd64 kernel however i386 works fine. To see if this issue was some how fixed in 7.3-RELEASE-p4 amd64 I rebuilt a GENERIC kernel using patches sources and tried to boot and I got the same crash. Next I rebuilt the kernel with KDB and DDB to see if I could get a core-dump of the system. I also set loader.conf to kernel="kernel.DEBUG" kern.dumpdev="/dev/da0s1b" Next I pxebooted the box and the system does not crash on boot up, it will easily load a nfs root and work fine. So I copied my debug kernel, and loader.conf to the local disk and rebooted and it boots fine from the local disk . Rebooting the server and running off the local disks and debug kernel, I cant find any issues. Reboot the box into a GENERIC 7.3-RELEASE-p4 kernel and it crashes With this error Fatal trap 12: page fault while in kernel mode cpuid = 0; apic id = 00 fault virtual address = 0x0 fault code = supervisor write data, page not present instruction pointer = 0x8:0xffffffff800070fa stack pointer = 0x10:0xffffffff8153cbe0 frame pointer = 0x10:0xffffffff8153cc50 code segment = base 0x0, limit 0xfffff, type 0x1b = DPL 0, pres 1, long 1, def32 0, gran 1 processor eflags = interrupt enabled, resume, IOPL = 0 current process = 0 (swapper) [thread pid 0 tid 100000 ] Stopped at bzero+0xa: repe stosq %es:(%rdi) What do I do , has anyone else seen anything like this ? -- mark saad | nonesuch@longcount.org From owner-freebsd-hackers@FreeBSD.ORG Fri Jan 7 21:56:28 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 270451065695 for ; Fri, 7 Jan 2011 21:56:28 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id F24C48FC1E for ; Fri, 7 Jan 2011 21:56:26 +0000 (UTC) Received: by wyf19 with SMTP id 19so18020676wyf.13 for ; Fri, 07 Jan 2011 13:56:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=Li8/s1buIc95VJViidtM+Hb1pD+myDY5a1LB6gXg0/M=; b=v+y9DWrekmQziQIJa0ngDAmaC9ApJiq351UcaY9oJnKvocpdZx5GTygGW0sxORWjtS mXyzSvAqJ6QG+7+MJKEnFHWJum7eO/Yl8qub3eWtfIt7h5sBd3CH4bY9FUPm+UlvwlQy vjWYMuPgX51ia+UHANYDEUiRY9UxUi01UjOZo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=j4sxBb1+WyCenEBZypVFfb2QAWHSwYroPd/y8RGaRvVlWOVbwawLkiqENxepxIvzL9 NxAlw4OH6w0nZUqztGCPH1yy8QBoFbFHjoN0dgOLaAicLK9pjTuM/vkv+g72JCjHeQu/ 2e9oNkQhZynJ4nGoUotPDufgsNuFz7qkUJ8nE= MIME-Version: 1.0 Received: by 10.227.162.197 with SMTP id w5mr16470204wbx.169.1294437386022; Fri, 07 Jan 2011 13:56:26 -0800 (PST) Sender: yanegomi@gmail.com Received: by 10.216.254.226 with HTTP; Fri, 7 Jan 2011 13:56:25 -0800 (PST) In-Reply-To: References: Date: Fri, 7 Jan 2011 13:56:25 -0800 X-Google-Sender-Auth: 0FWpo6CTFZNXFNatEmSyTbYu8qM Message-ID: From: Garrett Cooper To: Mark Saad Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-hackers@freebsd.org Subject: Re: With out ddb and kdb set 7.3-RELEASE amd64 does not boot. X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Jan 2011 21:56:28 -0000 On Fri, Jan 7, 2011 at 1:20 PM, Mark Saad wrote: > Hello hackers@, > =A0I have a good question that I cant find an answer for. I believe > found a kernel bug in 7.3-RELEASE that prevents me from booting 64-bit > kernels on HP's DL360 G4p . The kernel dies with "Fatal trap 12: page > fault while in kernel mode " . The hardware works fine in 7.2-RELEASE > amd64, 7.1-RELEASE amd64, and 6.4-RELEASE amd64 . > > In 7.3-RELEASE amd64 I can not boot from cd or pxe correctly using the > stock 7.3-RELEASE amd64 kernel however i386 works fine. To see if this > issue was some how fixed in 7.3-RELEASE-p4 amd64 I rebuilt a GENERIC > kernel using patches sources and tried to boot and I got the same > crash. > > =A0Next I rebuilt the kernel with KDB and DDB to see if I could get a > core-dump of the system. I also set loader.conf to > > kernel=3D"kernel.DEBUG" > kern.dumpdev=3D"/dev/da0s1b" > > Next I pxebooted =A0the box and the system does not crash on boot up, it > will easily load a nfs root and work fine. So I copied my debug > kernel, and loader.conf to the local disk and rebooted and it boots > fine from the local disk . > > Rebooting the server and running off the local disks and debug kernel, > I cant find any issues. > > Reboot the box into a GENERIC 7.3-RELEASE-p4 kernel and it crashes > > With this error > > Fatal trap 12: page fault while in kernel mode > cpuid =3D 0; apic id =3D 00 > fault virtual address =A0 =3D 0x0 > fault code =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =3D supervisor write data, pag= e not present > instruction pointer =A0 =A0 =3D 0x8:0xffffffff800070fa > stack pointer =A0 =A0 =A0 =A0 =A0 =A0=3D 0x10:0xffffffff8153cbe0 > frame pointer =A0 =A0 =A0 =A0 =A0 =A0=3D 0x10:0xffffffff8153cc50 > code segment =A0 =A0 =A0 =A0 =A0=3D base 0x0, limit 0xfffff, type 0x1b > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=3D DPL 0, pre= s 1, long 1, def32 0, gran 1 > processor eflags =A0 =A0 =A0=3D interrupt enabled, resume, IOPL =3D 0 > current process =A0 =A0 =A0 =3D 0 (swapper) > [thread pid 0 tid 100000 ] > Stopped at =A0 =A0 =A0bzero+0xa: =A0 =A0 repe stosq =A0 =A0 =A0 %es:(%rdi= ) > > > What do I do , has anyone else seen anything like this ? What are the messages before that on the kernel console and what are your drivers loaded on a stable system? Thanks, -Garrett From owner-freebsd-hackers@FreeBSD.ORG Fri Jan 7 22:22:07 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CD51F106566C for ; Fri, 7 Jan 2011 22:22:07 +0000 (UTC) (envelope-from nonesuch@longcount.org) Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 279AB8FC0C for ; Fri, 7 Jan 2011 22:22:06 +0000 (UTC) Received: by bwz12 with SMTP id 12so10432068bwz.13 for ; Fri, 07 Jan 2011 14:22:06 -0800 (PST) MIME-Version: 1.0 Received: by 10.204.55.129 with SMTP id u1mr3134235bkg.43.1294438925686; Fri, 07 Jan 2011 14:22:05 -0800 (PST) Received: by 10.204.151.212 with HTTP; Fri, 7 Jan 2011 14:22:05 -0800 (PST) X-Originating-IP: [209.66.78.50] In-Reply-To: References: Date: Fri, 7 Jan 2011 17:22:05 -0500 Message-ID: From: Mark Saad To: Garrett Cooper Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: freebsd-hackers@freebsd.org Subject: Re: With out ddb and kdb set 7.3-RELEASE amd64 does not boot. X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Jan 2011 22:22:07 -0000 On Fri, Jan 7, 2011 at 4:56 PM, Garrett Cooper wrote: > On Fri, Jan 7, 2011 at 1:20 PM, Mark Saad wrote: >> Hello hackers@, >> =C2=A0I have a good question that I cant find an answer for. I believe >> found a kernel bug in 7.3-RELEASE that prevents me from booting 64-bit >> kernels on HP's DL360 G4p . The kernel dies with "Fatal trap 12: page >> fault while in kernel mode " . The hardware works fine in 7.2-RELEASE >> amd64, 7.1-RELEASE amd64, and 6.4-RELEASE amd64 . >> >> In 7.3-RELEASE amd64 I can not boot from cd or pxe correctly using the >> stock 7.3-RELEASE amd64 kernel however i386 works fine. To see if this >> issue was some how fixed in 7.3-RELEASE-p4 amd64 I rebuilt a GENERIC >> kernel using patches sources and tried to boot and I got the same >> crash. >> >> =C2=A0Next I rebuilt the kernel with KDB and DDB to see if I could get a >> core-dump of the system. I also set loader.conf to >> >> kernel=3D"kernel.DEBUG" >> kern.dumpdev=3D"/dev/da0s1b" >> >> Next I pxebooted =C2=A0the box and the system does not crash on boot up,= it >> will easily load a nfs root and work fine. So I copied my debug >> kernel, and loader.conf to the local disk and rebooted and it boots >> fine from the local disk . >> >> Rebooting the server and running off the local disks and debug kernel, >> I cant find any issues. >> >> Reboot the box into a GENERIC 7.3-RELEASE-p4 kernel and it crashes >> >> With this error >> >> Fatal trap 12: page fault while in kernel mode >> cpuid =3D 0; apic id =3D 00 >> fault virtual address =C2=A0 =3D 0x0 >> fault code =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =3D s= upervisor write data, page not present >> instruction pointer =C2=A0 =C2=A0 =3D 0x8:0xffffffff800070fa >> stack pointer =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=3D 0x10:0xffffff= ff8153cbe0 >> frame pointer =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=3D 0x10:0xffffff= ff8153cc50 >> code segment =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=3D base 0x0, limit 0xfff= ff, type 0x1b >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=3D DPL 0, pres 1, long 1, def32 0, gran = 1 >> processor eflags =C2=A0 =C2=A0 =C2=A0=3D interrupt enabled, resume, IOPL= =3D 0 >> current process =C2=A0 =C2=A0 =C2=A0 =3D 0 (swapper) >> [thread pid 0 tid 100000 ] >> Stopped at =C2=A0 =C2=A0 =C2=A0bzero+0xa: =C2=A0 =C2=A0 repe stosq =C2= =A0 =C2=A0 =C2=A0 %es:(%rdi) >> >> >> What do I do , has anyone else seen anything like this ? > > =C2=A0 =C2=A0What are the messages before that on the kernel console and = what > are your drivers loaded on a stable system? > Thanks, > -Garrett > Garrett The last 4 lines of the verbose boot up of the generic kernel are all from sio1 sio1: port may not be enabled sio1: irq maps: 0 0 0 0 sio1: prob failed tests(s): 4 sio1 at port 0x2f8-0x2ff irq 3 on isa0 Then the crash . No extra kernel modules are loaded Here is my pciconf hostb0@pci0:0:0:0: class=3D0x060000 card=3D0x32000e11 chip=3D0x3590808= 6 rev=3D0x0c hdr=3D0x00 vendor =3D 'Intel Corporation' device =3D 'E7520 Server Memory Controller Hub' class =3D bridge subclass =3D HOST-PCI pcib1@pci0:0:2:0: class=3D0x060400 card=3D0x00000000 chip=3D0x3595808= 6 rev=3D0x0c hdr=3D0x01 vendor =3D 'Intel Corporation' device =3D 'E752x Memory Controller Hub PCIe Port A0' class =3D bridge subclass =3D PCI-PCI pcib2@pci0:0:4:0: class=3D0x060400 card=3D0x00000000 chip=3D0x3597808= 6 rev=3D0x0c hdr=3D0x01 vendor =3D 'Intel Corporation' device =3D 'E752x Memory Controller Hub PCIe Port B0' class =3D bridge subclass =3D PCI-PCI pcib5@pci0:0:6:0: class=3D0x060400 card=3D0x00000000 chip=3D0x3599808= 6 rev=3D0x0c hdr=3D0x01 vendor =3D 'Intel Corporation' device =3D 'E752x Memory Controller Hub PCIe Port C0' class =3D bridge subclass =3D PCI-PCI pcib6@pci0:0:28:0: class=3D0x060400 card=3D0x00000000 chip=3D0x25ae808= 6 rev=3D0x02 hdr=3D0x01 vendor =3D 'Intel Corporation' device =3D 'Hub Interface to PCI-X Bridge (6300ESB)' class =3D bridge subclass =3D PCI-PCI uhci0@pci0:0:29:0: class=3D0x0c0300 card=3D0x32010e11 chip=3D0x25a9808= 6 rev=3D0x02 hdr=3D0x00 vendor =3D 'Intel Corporation' device =3D 'USB 1.1 UHCI Controller *1 (6300ESB)' class =3D serial bus subclass =3D USB uhci1@pci0:0:29:1: class=3D0x0c0300 card=3D0x32010e11 chip=3D0x25aa808= 6 rev=3D0x02 hdr=3D0x00 vendor =3D 'Intel Corporation' device =3D 'USB 1.1 UHCI Controller *2 (6300ESB)' class =3D serial bus subclass =3D USB none0@pci0:0:29:4: class=3D0x088000 card=3D0x32010e11 chip=3D0x25ab808= 6 rev=3D0x02 hdr=3D0x00 vendor =3D 'Intel Corporation' device =3D 'Watchdog Timer (6300ESB)' class =3D base peripheral ioapic0@pci0:0:29:5: class=3D0x080020 card=3D0x32010e11 chip=3D0x25ac808= 6 rev=3D0x02 hdr=3D0x00 vendor =3D 'Intel Corporation' device =3D '6300ESB I/O Advanced Programmable Interrupt Controller' class =3D base peripheral subclass =3D interrupt controller ehci0@pci0:0:29:7: class=3D0x0c0320 card=3D0x32010e11 chip=3D0x25ad808= 6 rev=3D0x02 hdr=3D0x00 vendor =3D 'Intel Corporation' device =3D 'USB 2.0 EHCI Controller (6300ESB)' class =3D serial bus subclass =3D USB pcib7@pci0:0:30:0: class=3D0x060400 card=3D0x00000000 chip=3D0x244e808= 6 rev=3D0x0a hdr=3D0x01 vendor =3D 'Intel Corporation' device =3D '82801 Family (ICH2/3/4/5/6/7/8/9,63xxESB) Hub Interface to PCI Bridge' class =3D bridge subclass =3D PCI-PCI isab0@pci0:0:31:0: class=3D0x060100 card=3D0x00000000 chip=3D0x25a1808= 6 rev=3D0x02 hdr=3D0x00 vendor =3D 'Intel Corporation' device =3D '6300ESB LPC Inteface Controller' class =3D bridge subclass =3D PCI-ISA atapci0@pci0:0:31:1: class=3D0x01018a card=3D0x32010e11 chip=3D0x25a2808= 6 rev=3D0x02 hdr=3D0x00 vendor =3D 'Intel Corporation' device =3D 'IDE Controller (6300ESB)' class =3D mass storage subclass =3D ATA pcib3@pci0:6:0:0: class=3D0x060400 card=3D0x00000000 chip=3D0x0329808= 6 rev=3D0x09 hdr=3D0x01 vendor =3D 'Intel Corporation' device =3D 'PCI Express-to-PCI Express Bridge A (6700PXH)' class =3D bridge subclass =3D PCI-PCI pcib4@pci0:6:0:2: class=3D0x060400 card=3D0x00000000 chip=3D0x032a808= 6 rev=3D0x09 hdr=3D0x01 vendor =3D 'Intel Corporation' device =3D 'PCI Express-to-PCI Express Bridge B (6700PXH)' class =3D bridge subclass =3D PCI-PCI ciss0@pci0:2:1:0: class=3D0x010400 card=3D0x40910e11 chip=3D0x00460e1= 1 rev=3D0x01 hdr=3D0x00 vendor =3D 'Compaq Computer Corp (Now owned by Hewlett-Packard)' device =3D 'Smart Array 64xx/6i Controller' class =3D mass storage subclass =3D RAID bge0@pci0:2:2:0: class=3D0x020000 card=3D0x00d00e11 chip=3D0x164814e= 4 rev=3D0x10 hdr=3D0x00 vendor =3D 'Broadcom Corporation' device =3D 'NetXtreme Dual Gigabit Adapter (BCM5704)' class =3D network subclass =3D ethernet bge1@pci0:2:2:1: class=3D0x020000 card=3D0x00d00e11 chip=3D0x164814e= 4 rev=3D0x10 hdr=3D0x00 vendor =3D 'Broadcom Corporation' device =3D 'NetXtreme Dual Gigabit Adapter (BCM5704)' class =3D network subclass =3D ethernet vgapci0@pci0:1:3:0: class=3D0x030000 card=3D0x001e0e11 chip=3D0x4752100= 2 rev=3D0x27 hdr=3D0x00 vendor =3D 'ATI Technologies Inc. / Advanced Micro Devices, Inc.' device =3D 'ATI On-Board VGA for HP Proliant 350 G3 (Rage XL PCI)' class =3D display subclass =3D VGA none1@pci0:1:4:0: class=3D0x088000 card=3D0xb2060e11 chip=3D0xb2030e1= 1 rev=3D0x01 hdr=3D0x00 vendor =3D 'Compaq Computer Corp (Now owned by Hewlett-Packard)' device =3D 'Integrated Lights Out Processor (iLo)' class =3D base peripheral none2@pci0:1:4:2: class=3D0x088000 card=3D0xb2060e11 chip=3D0xb2040e1= 1 rev=3D0x01 hdr=3D0x00 vendor =3D 'Compaq Computer Corp (Now owned by Hewlett-Packard)' device =3D 'Integrated Lights Out Processor (iLo)' class =3D base peripheral and here is my /var/run/dmesg.boot Copyright (c) 1992-2010 The FreeBSD Project. Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 The Regents of the University of California. All rights reserved. FreeBSD is a registered trademark of The FreeBSD Foundation. FreeBSD 7.3-RELEASE-p4 #1: Fri Jan 7 18:24:07 UTC 2011 root@about-bsd:/usr/obj/usr/src/sys/DEBUG amd64 Timecounter "i8254" frequency 1193182 Hz quality 0 CPU: Intel(R) Xeon(TM) CPU 3.60GHz (3600.15-MHz K8-class CPU) Origin =3D "GenuineIntel" Id =3D 0xf43 Stepping =3D 3 Features=3D0xbfebfbff Features2=3D0x659d AMD Features=3D0x20000800 TSC: P-state invariant Logical CPUs per core: 2 usable memory =3D 4214386688 (4019 MB) avail memory =3D 4051181568 (3863 MB) ACPI APIC Table: FreeBSD/SMP: Multiprocessor System Detected: 4 CPUs cpu0 (BSP): APIC ID: 0 cpu1 (AP/HT): APIC ID: 1 cpu2 (AP): APIC ID: 6 cpu3 (AP/HT): APIC ID: 7 ioapic1: Changing APIC ID to 9 ioapic0 irqs 0-23 on motherboard ioapic1 irqs 24-47 on motherboard ioapic2 irqs 48-71 on motherboard ioapic3 irqs 72-95 on motherboard kbd1 at kbdmux0 acpi0: on motherboard acpi0: [ITHREAD] acpi0: Power Button (fixed) Timecounter "ACPI-safe" frequency 3579545 Hz quality 850 acpi_timer0: <24-bit timer at 3.579545MHz> port 0x908-0x90b on acpi0 pcib0: on acpi0 pci0: on pcib0 pcib1: at device 2.0 on pci0 pci13: on pcib1 pcib2: at device 4.0 on pci0 pci6: on pcib2 pcib3: at device 0.0 on pci6 pci7: on pcib3 pcib4: at device 0.2 on pci6 pci10: on pcib4 pcib5: at device 6.0 on pci0 pci3: on pcib5 pcib6: at device 28.0 on pci0 pci2: on pcib6 ciss0: port 0x4000-0x40ff mem 0xfdff0000-0xfdff1fff,0xfdf80000-0xfdfbffff irq 24 at device 1.0 on pci2 ciss0: [ITHREAD] bge0: mem 0xfdf70000-0xfdf7ffff irq 25 at device 2.0 on pci2 miibus0: on bge0 brgphy0: PHY 1 on miibus0 brgphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT, 1000baseT-FDX, auto bge0: Ethernet address: 00:17:a4:a7:a3:fc bge0: [ITHREAD] bge1: mem 0xfdf60000-0xfdf6ffff irq 26 at device 2.1 on pci2 miibus1: on bge1 brgphy1: PHY 1 on miibus1 brgphy1: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT, 1000baseT-FDX, auto bge1: Ethernet address: 00:17:a4:a7:a3:fb bge1: [ITHREAD] uhci0: port 0x2000-0x201f irq 16 at device 29.0 on pci0 uhci0: [GIANT-LOCKED] ...skipping... device_attach: est2 attach returned 6 p4tcc2: on cpu2 cpu3: on acpi0 est3: on cpu3 est: CPU supports Enhanced Speedstep, but is not recognized. est: cpu_vendor GenuineIntel, msr 122900001229 device_attach: est3 attach returned 6 p4tcc3: on cpu3 orm0: at iomem 0xc0000-0xc7fff,0xc8000-0xcbfff,0xee000-0xeffff on isa0 ppc0: cannot reserve I/O port range sc0: at flags 0x100 on isa0 sc0: VGA <16 virtual consoles, flags=3D0x300> sio1: configured irq 3 not in bitmap of probed irqs 0 sio1: port may not be enabled sio1: configured irq 3 not in bitmap of probed irqs 0 sio1: port may not be enabled sio1 at port 0x2f8-0x2ff irq 3 on isa0 sio1: type 16550A sio1: [FILTER] vga0: at port 0x3c0-0x3df iomem 0xa0000-0xbffff on isa0 Timecounters tick every 1.000 msec acd0: CDROM at ata0-master PIO4 SMPd:a 0A Pa tC PcUi s#s01 bLuasu nc0h etda!rg et 0 lun 0 da0: Fixed Direct Access SCSI-4 device da0: 135.168MB/s transfers da0: Command Queueing EnabledS MdPa:0 :A P6 9C4P5U9 M#B 2( 1L4a2u2n5c3h2e8d0! 512 byte sectors: 255H 32S/T 17433C) SMP: AP CPU #3 Launched! Trying to mount root from ufs:/dev/da0s1a WARNING: /var was not properly dismounted --=20 mark saad | nonesuch@longcount.org From owner-freebsd-hackers@FreeBSD.ORG Fri Jan 7 22:26:09 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D7B79106566B for ; Fri, 7 Jan 2011 22:26:09 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id 677608FC12 for ; Fri, 7 Jan 2011 22:26:09 +0000 (UTC) Received: by wyf19 with SMTP id 19so18044005wyf.13 for ; Fri, 07 Jan 2011 14:26:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=uRpdI3ND37JgvGXqrB1G1+2HGZ85S0biAMdSW5dM6s8=; b=aLQrHAWfZHG0TuC8NvX56K0FPVE/eNt+iBrT7CA1h1h/e899k2dBZueoX/KoHFwYxr WrilI29FTIGLX0zMZcz3c3BW/AHicjc+VJBqvYm6vgmDo0tT4njBFix7B20xjYEYtsSg SPUxxcnMGRdyetMpjFXon0nAfcTZvzJJ13BNA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=oRZNU3J8TBIwahpla8/cwKMoO3WaWZPwgXUw8HX2CD1kVYst0rVIMG0AYjxls1kkHm k/uvWzWYC2ElGwQuotpZAf7NX+SiNpbOxcQtsDdlJKX9sh99vZ5WKw5CfenNCbjBZ7Z7 kOua5+q8ZMBuOOG3P1jExHEG5pIH4J0d4PTFw= MIME-Version: 1.0 Received: by 10.227.134.142 with SMTP id j14mr16459817wbt.53.1294439168471; Fri, 07 Jan 2011 14:26:08 -0800 (PST) Sender: yanegomi@gmail.com Received: by 10.216.254.226 with HTTP; Fri, 7 Jan 2011 14:26:08 -0800 (PST) In-Reply-To: References: Date: Fri, 7 Jan 2011 14:26:08 -0800 X-Google-Sender-Auth: O7OZmMFJFejs7sZifNkT9Xzkq8g Message-ID: From: Garrett Cooper To: Mark Saad Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-hackers@freebsd.org Subject: Re: With out ddb and kdb set 7.3-RELEASE amd64 does not boot. X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Jan 2011 22:26:10 -0000 On Fri, Jan 7, 2011 at 2:22 PM, Mark Saad wrote: > On Fri, Jan 7, 2011 at 4:56 PM, Garrett Cooper wrot= e: >> On Fri, Jan 7, 2011 at 1:20 PM, Mark Saad wrote= : >>> Hello hackers@, >>> =A0I have a good question that I cant find an answer for. I believe >>> found a kernel bug in 7.3-RELEASE that prevents me from booting 64-bit >>> kernels on HP's DL360 G4p . The kernel dies with "Fatal trap 12: page >>> fault while in kernel mode " . The hardware works fine in 7.2-RELEASE >>> amd64, 7.1-RELEASE amd64, and 6.4-RELEASE amd64 . >>> >>> In 7.3-RELEASE amd64 I can not boot from cd or pxe correctly using the >>> stock 7.3-RELEASE amd64 kernel however i386 works fine. To see if this >>> issue was some how fixed in 7.3-RELEASE-p4 amd64 I rebuilt a GENERIC >>> kernel using patches sources and tried to boot and I got the same >>> crash. >>> >>> =A0Next I rebuilt the kernel with KDB and DDB to see if I could get a >>> core-dump of the system. I also set loader.conf to >>> >>> kernel=3D"kernel.DEBUG" >>> kern.dumpdev=3D"/dev/da0s1b" >>> >>> Next I pxebooted =A0the box and the system does not crash on boot up, i= t >>> will easily load a nfs root and work fine. So I copied my debug >>> kernel, and loader.conf to the local disk and rebooted and it boots >>> fine from the local disk . >>> >>> Rebooting the server and running off the local disks and debug kernel, >>> I cant find any issues. >>> >>> Reboot the box into a GENERIC 7.3-RELEASE-p4 kernel and it crashes >>> >>> With this error >>> >>> Fatal trap 12: page fault while in kernel mode >>> cpuid =3D 0; apic id =3D 00 >>> fault virtual address =A0 =3D 0x0 >>> fault code =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =3D supervisor write data, p= age not present >>> instruction pointer =A0 =A0 =3D 0x8:0xffffffff800070fa >>> stack pointer =A0 =A0 =A0 =A0 =A0 =A0=3D 0x10:0xffffffff8153cbe0 >>> frame pointer =A0 =A0 =A0 =A0 =A0 =A0=3D 0x10:0xffffffff8153cc50 >>> code segment =A0 =A0 =A0 =A0 =A0=3D base 0x0, limit 0xfffff, type 0x1b >>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=3D DPL 0, p= res 1, long 1, def32 0, gran 1 >>> processor eflags =A0 =A0 =A0=3D interrupt enabled, resume, IOPL =3D 0 >>> current process =A0 =A0 =A0 =3D 0 (swapper) >>> [thread pid 0 tid 100000 ] >>> Stopped at =A0 =A0 =A0bzero+0xa: =A0 =A0 repe stosq =A0 =A0 =A0 %es:(%r= di) >>> >>> >>> What do I do , has anyone else seen anything like this ? >> >> =A0 =A0What are the messages before that on the kernel console and what >> are your drivers loaded on a stable system? >> Thanks, >> -Garrett >> > Garrett > =A0The last 4 lines of the verbose boot up of the generic kernel are > all from sio1 Is sio1 pointing to a generic UART, or is it something more special like the HP lights-out SOL interface? Simple test might be to disable the sio/uart driver in the kernel and see if things worked. Thanks, -Garrett From owner-freebsd-hackers@FreeBSD.ORG Fri Jan 7 22:58:54 2011 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1B180106566B for ; Fri, 7 Jan 2011 22:58:54 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id 9BF708FC0C for ; Fri, 7 Jan 2011 22:58:53 +0000 (UTC) Received: by wyf19 with SMTP id 19so18066397wyf.13 for ; Fri, 07 Jan 2011 14:58:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=fEln+nJBOEAtMvRVExUlcgDI+Ph+HRGtgJU40OpZOE8=; b=G1VDOJaBwID2IBVId9SLPdMIThDy1ulgb2QFWEooKTjj0lUVKX+sCeER48Ny6/QY6v FEN0yainpXy3tGSMVxAqhW62bvYD0gzx0i7C2pnG+MJ5vRHTCYI9IM0bwqP+6k6vrGda Rk7irm9ODHhjh/8AZ/ZS2abA0fqrYyEGLmTUg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=IHLELC+zZIJHmR+/lVwpttUH1soZElyxblooV2nE5SI8z0pRBIfiyEy8aG8w3u0xK+ jF7f8HTpn/bmhlGaInsZALM3UM1cctvqvhUjA0AH5751LHfDeyZ58N3aTVWWjIZjr5Bz EoQy1/MpzLIROyzRwedP+o1lHOqtjVbEq2DG0= MIME-Version: 1.0 Received: by 10.227.69.201 with SMTP id a9mr16521906wbj.24.1294441132417; Fri, 07 Jan 2011 14:58:52 -0800 (PST) Sender: yanegomi@gmail.com Received: by 10.216.254.226 with HTTP; Fri, 7 Jan 2011 14:58:52 -0800 (PST) In-Reply-To: References: Date: Fri, 7 Jan 2011 14:58:52 -0800 X-Google-Sender-Auth: QIhFY6h1s-9V8nx5fcOO9XTyPzs Message-ID: From: Garrett Cooper To: Mark Saad Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: hackers@freebsd.org Subject: Re: With out ddb and kdb set 7.3-RELEASE amd64 does not boot. X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Jan 2011 22:58:54 -0000 On Fri, Jan 7, 2011 at 2:36 PM, Mark Saad wrote: > On Fri, Jan 7, 2011 at 5:27 PM, Garrett Cooper wrot= e: >> On Fri, Jan 7, 2011 at 2:26 PM, Garrett Cooper wro= te: >>> On Fri, Jan 7, 2011 at 2:22 PM, Mark Saad wrot= e: >>>> On Fri, Jan 7, 2011 at 4:56 PM, Garrett Cooper w= rote: >>>>> On Fri, Jan 7, 2011 at 1:20 PM, Mark Saad wr= ote: >>>>>> Hello hackers@, >>>>>> =A0I have a good question that I cant find an answer for. I believe >>>>>> found a kernel bug in 7.3-RELEASE that prevents me from booting 64-b= it >>>>>> kernels on HP's DL360 G4p . The kernel dies with "Fatal trap 12: pag= e >>>>>> fault while in kernel mode " . The hardware works fine in 7.2-RELEAS= E >>>>>> amd64, 7.1-RELEASE amd64, and 6.4-RELEASE amd64 . >>>>>> >>>>>> In 7.3-RELEASE amd64 I can not boot from cd or pxe correctly using t= he >>>>>> stock 7.3-RELEASE amd64 kernel however i386 works fine. To see if th= is >>>>>> issue was some how fixed in 7.3-RELEASE-p4 amd64 I rebuilt a GENERIC >>>>>> kernel using patches sources and tried to boot and I got the same >>>>>> crash. >>>>>> >>>>>> =A0Next I rebuilt the kernel with KDB and DDB to see if I could get = a >>>>>> core-dump of the system. I also set loader.conf to >>>>>> >>>>>> kernel=3D"kernel.DEBUG" >>>>>> kern.dumpdev=3D"/dev/da0s1b" >>>>>> >>>>>> Next I pxebooted =A0the box and the system does not crash on boot up= , it >>>>>> will easily load a nfs root and work fine. So I copied my debug >>>>>> kernel, and loader.conf to the local disk and rebooted and it boots >>>>>> fine from the local disk . >>>>>> >>>>>> Rebooting the server and running off the local disks and debug kerne= l, >>>>>> I cant find any issues. >>>>>> >>>>>> Reboot the box into a GENERIC 7.3-RELEASE-p4 kernel and it crashes >>>>>> >>>>>> With this error >>>>>> >>>>>> Fatal trap 12: page fault while in kernel mode >>>>>> cpuid =3D 0; apic id =3D 00 >>>>>> fault virtual address =A0 =3D 0x0 >>>>>> fault code =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =3D supervisor write data= , page not present >>>>>> instruction pointer =A0 =A0 =3D 0x8:0xffffffff800070fa >>>>>> stack pointer =A0 =A0 =A0 =A0 =A0 =A0=3D 0x10:0xffffffff8153cbe0 >>>>>> frame pointer =A0 =A0 =A0 =A0 =A0 =A0=3D 0x10:0xffffffff8153cc50 >>>>>> code segment =A0 =A0 =A0 =A0 =A0=3D base 0x0, limit 0xfffff, type 0x= 1b >>>>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=3D DPL 0= , pres 1, long 1, def32 0, gran 1 >>>>>> processor eflags =A0 =A0 =A0=3D interrupt enabled, resume, IOPL =3D = 0 >>>>>> current process =A0 =A0 =A0 =3D 0 (swapper) >>>>>> [thread pid 0 tid 100000 ] >>>>>> Stopped at =A0 =A0 =A0bzero+0xa: =A0 =A0 repe stosq =A0 =A0 =A0 %es:= (%rdi) >>>>>> >>>>>> >>>>>> What do I do , has anyone else seen anything like this ? >>>>> >>>>> =A0 =A0What are the messages before that on the kernel console and wh= at >>>>> are your drivers loaded on a stable system? >>>>> Thanks, >>>>> -Garrett >>>>> >>>> Garrett >>>> =A0The last 4 lines of the verbose boot up of the generic kernel are >>>> all from sio1 >>> >>> =A0 =A0Is sio1 pointing to a generic UART, or is it something more >>> special like the HP lights-out SOL interface? >>> =A0 =A0Simple test might be to disable the sio/uart driver in the kerne= l >>> and see if things worked. >> >> Or easier yet, disable the port in the BIOS and comment out all of the >> sio/uart references in device.hints. >> > Garrett > =A0Interesting commenting out the sio lines in device.hints fixes it, > did device.hints > or the sio driver change some how from 7.2 to 7.3 ? Given that the messages changed, it's probably a driver bug (my guess is either isa or sio) that was introduced by accident where a device is failing to probe and isn't properly releasing resources and/or notifying that the driver couldn't attach at the kernel level. re-CCing the list, but you might want to ask imp@ for some input; I might have time to look at this further tonight, but I would check and see where `prob failed tests(s):' is being printed out, and analyze the code if possible for missing return codes, or put breakpoints in ddb there so you can trace the call stack and figure out more info, etc -- that will help point you at the culprit better. Thanks, -Garrett From owner-freebsd-hackers@FreeBSD.ORG Fri Jan 7 23:25:07 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0259C106566B for ; Fri, 7 Jan 2011 23:25:07 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mail.cksoft.de (mail.cksoft.de [IPv6:2001:4068:10::3]) by mx1.freebsd.org (Postfix) with ESMTP id B26318FC16 for ; Fri, 7 Jan 2011 23:25:06 +0000 (UTC) Received: from localhost (amavis.fra.cksoft.de [192.168.74.71]) by mail.cksoft.de (Postfix) with ESMTP id 0FB0241C67B; Sat, 8 Jan 2011 00:25:06 +0100 (CET) X-Virus-Scanned: amavisd-new at cksoft.de Received: from mail.cksoft.de ([192.168.74.103]) by localhost (amavis.fra.cksoft.de [192.168.74.71]) (amavisd-new, port 10024) with ESMTP id elfcDFJwLKyj; Sat, 8 Jan 2011 00:25:05 +0100 (CET) Received: by mail.cksoft.de (Postfix, from userid 66) id A857441C64A; Sat, 8 Jan 2011 00:25:05 +0100 (CET) Received: from maildrop.int.zabbadoz.net (maildrop.int.zabbadoz.net [10.111.66.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.int.zabbadoz.net (Postfix) with ESMTP id 260304448F3; Fri, 7 Jan 2011 23:21:47 +0000 (UTC) Date: Fri, 7 Jan 2011 23:21:46 +0000 (UTC) From: "Bjoern A. Zeeb" X-X-Sender: bz@maildrop.int.zabbadoz.net To: joris dedieu In-Reply-To: Message-ID: <20110107232016.S14966@maildrop.int.zabbadoz.net> References: X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-hackers Subject: Re: netinet6 little cleanup X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Jan 2011 23:25:07 -0000 On Fri, 7 Jan 2011, joris dedieu wrote: Hi, > As I was reading netinet6 code, I found some redundant SYSCTL_DECL. Why are the redundant currently? Scrolling though I am not seeing the "duplicate" removed. They are just distributed? > I don't know if it's really useful but here is a patch to clean it. > - remove SYSCTL_DECL(_net_inet6_ip6) and SYSCTL_DECL(_net_inet6) from c files > + add them to netinet6/in6_var.h header (like for netinet). Yeah, that's a different thing. /bz -- Bjoern A. Zeeb You have to have visions! Going to jail sucks -- All my daemons like it! http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/jails.html From owner-freebsd-hackers@FreeBSD.ORG Sat Jan 8 00:51:45 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7F1FF1065670 for ; Sat, 8 Jan 2011 00:51:45 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-ww0-f42.google.com (mail-ww0-f42.google.com [74.125.82.42]) by mx1.freebsd.org (Postfix) with ESMTP id 104AF8FC12 for ; Sat, 8 Jan 2011 00:51:44 +0000 (UTC) Received: by wwi17 with SMTP id 17so5826wwi.1 for ; Fri, 07 Jan 2011 16:51:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:date:x-google-sender-auth :message-id:subject:from:to:content-type; bh=/B9TpxcBy73igSTgzM2CrGe5/KoQg2arP8HLfkQw2Ag=; b=hEernrKseUNu+hOAKodwNfo6rDwRDBoyJKvO2+QnaV9SJvM3aMn5NDN2Nab4LZ2enQ v0LBIY7VsgcrsVVuoyvDu4FO58HaT/BJoaBkDV9mviSRnAy0QghTzD6kINiUlsPtPimj U8QFEWW8DEZRewPX/e0bnp4xUSVogOyLqL1To= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:content-type; b=LQys3pwfZG6GwXlyyszdjBYIvf6jSZk1RhklzemGHMbCzIJSh7oWPvbnblzMy5jP2F /n7qcOOweiY7o32PtYWWo0JscLOsGW/caz2rkQdLUaItiDdG76gSmXmzUeuMsDdA5+hb h3BoDKCI40Tq9m6hrKo3zPvejlSxsRfMa+LCQ= MIME-Version: 1.0 Received: by 10.216.141.75 with SMTP id f53mr1533793wej.16.1294447903790; Fri, 07 Jan 2011 16:51:43 -0800 (PST) Sender: yanegomi@gmail.com Received: by 10.216.254.226 with HTTP; Fri, 7 Jan 2011 16:51:43 -0800 (PST) Date: Fri, 7 Jan 2011 16:51:43 -0800 X-Google-Sender-Auth: W3w5v0Ifv9IKktfQ-Rjh1Hx4IsY Message-ID: From: Garrett Cooper To: freebsd-hackers@freebsd.org Content-Type: multipart/mixed; boundary=0016e6de03be7c56f804994b2322 Subject: [PATCH] document automatic user group removal via pw userdel X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Jan 2011 00:51:45 -0000 --0016e6de03be7c56f804994b2322 Content-Type: text/plain; charset=ISO-8859-1 Hi Hackers, The following is a really short patch commit request for updating the manpage documentation for pw(8) to note that if I do the following: pw user add foo pw user del foo It will remove the group foo, but if I do the following: pw user add foo pw user add bar -G foo pw user del foo It will retain the foo user group as the membership is non-zero. This behavior is intuitive, but undocumented in the manpage as it stands. Credits go to Karl Schumaker @ IronPort for the find. Thanks, -Garrett --0016e6de03be7c56f804994b2322 Content-Type: text/x-patch; charset=US-ASCII; name="pw-document-automatic-group-removal.patch" Content-Disposition: attachment; filename="pw-document-automatic-group-removal.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_ginstuq30 SW5kZXg6IHVzci5zYmluL3B3L3B3LjgKPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0gdXNyLnNiaW4vcHcvcHcuOAko cmV2aXNpb24gMjE2NDk1KQorKysgdXNyLnNiaW4vcHcvcHcuOAkod29ya2luZyBjb3B5KQpAQCAt NzEzLDYgKzcxMywxMCBAQAogYXJlIGFsc28gcmVtb3ZlZCBpZiB0aGUgdXNlcidzIHVpZCBpcyB1 bmlxdWUgYW5kIG5vdCBhbHNvIHVzZWQgYnkgYW5vdGhlciBhY2NvdW50IG9uIHRoZQogc3lzdGVt LgogLlBwCitJZiB0aGUgdXNlciBzcGVjaWZpZWQgaGFzIGEgdXNlciBncm91cCBhc3NvY2lhdGVk IHdpdGggaXQsIGFuZCB0aGUgZ3JvdXAKK21lbWJlcnNoaXAgd2hlbiByZW1vdmVkIGlzIGp1c3Qg dGhlIHVzZXIsIHRoZSB1c2VyIGdyb3VwIHdpbGwgYmUgYXV0b21hdGljYWxseQorcmVtb3ZlZCBm cm9tIHRoZSBncm91cCBmaWxlIGFzIHdlbGwuCisuUHAKIFRoZQogLkFyIHVzZXJzaG93CiBjb21t YW5kIGFsbG93cyB2aWV3aW5nIG9mIGFuIGFjY291bnQgaW4gb25lIG9mIHR3byBmb3JtYXRzLgo= --0016e6de03be7c56f804994b2322-- From owner-freebsd-hackers@FreeBSD.ORG Sat Jan 8 16:55:11 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C309610656E0 for ; Sat, 8 Jan 2011 16:55:11 +0000 (UTC) (envelope-from george@m5p.com) Received: from mailhost.m5p.com (unknown [IPv6:2001:418:3fd::3]) by mx1.freebsd.org (Postfix) with ESMTP id 71A618FC16 for ; Sat, 8 Jan 2011 16:55:11 +0000 (UTC) Received: from m5p.com (wonderland.m5p.com [IPv6:2001:418:3fd::19]) by mailhost.m5p.com (8.14.3/8.14.3) with ESMTP id p08Gt415011165 for ; Sat, 8 Jan 2011 11:55:09 -0500 (EST) (envelope-from george@m5p.com) Received: (from george@localhost) by m5p.com (8.14.4/8.13.7/Submit) id p08Gt39N001427; Sat, 8 Jan 2011 11:55:03 -0500 (EST) Date: Sat, 8 Jan 2011 11:55:03 -0500 (EST) Message-Id: <201101081655.p08Gt39N001427@m5p.com> From: george+freebsd@m5p.com To: freebsd-hackers@freebsd.org X-Spam-Score: -0.3 () BAYES_00,J_CHICKENPOX_28,J_CHICKENPOX_66 X-Scanned-By: MIMEDefang 2.67 on IPv6:2001:418:3fd::f7 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.0 (mailhost.m5p.com [IPv6:2001:418:3fd::f7]); Sat, 08 Jan 2011 11:55:10 -0500 (EST) Subject: NFS Performance X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Jan 2011 16:55:11 -0000 Among four machines on my network, I'm observing startling differences in NFS performance. All machines are AMD64, and rpc_statd, rpc_lockd, and amd are enabled on all four machines. wonderland: hw.model: AMD Athlon(tm) II Dual-Core M32 hw.physmem: 293510758 ethernet: 100Mb/s partition 1: FreeBSD 8.1-STABLE partition 2: FreeBSD 7.3-STABLE scollay: hw.model: AMD Sempron(tm) 140 Processor hw.physmem: 186312294 ethernet: 1000Mb/s FreeBSD 8.1-PRERELEASE sullivan: hw.model: AMD Athlon(tm) 64 X2 Dual Core Processor 4800+ hw.physmem: 4279980032 ethernet 1000Mb/s FreeBSD 7.2-RELEASE mattapan: hw.model: AMD Sempron(tm) Processor 2600+ hw.physmem: 456380416 ethernet: 1000Mb/s FreeBSD 7.1-RELEASE Observed bytes per second (dd if=filename of=/dev/null bs=65536): Source machine: mattapan scollay sullivan Destination machine: wonderland/7.3 870K 5.2M 1.8M wonderland/8.1 496K 690K 420K mattapan 38M 28M scollay 33M 33M sullivan 38M 5M There is one 10/100/1000Mb/s ethernet switch between the various pairs of machines. I'm startled by the numbers for wonderland, first because of how much the 100Mb/s interface slows things down, but even more because of how much difference there is on the identical hardware between FreeBSD 7 and FreeBSD 8. Even more annoying when running 8.1 on wonderland, NFS simply locks up at random for roughly a minute and a half under high load (such as when firefox does a gazillion locked references to my places.sqlite file), leading to entertaining log message clusters such as: Dec 29 08:17:41 wonderland kernel: nfs server home:/usr: not responding Dec 29 08:17:41 wonderland kernel: nfs server home:/usr: not responding Dec 29 08:17:41 wonderland kernel: nfs server home:/usr: is alive again Dec 29 08:17:41 wonderland kernel: nfs server home:/usr: is alive again Dec 29 08:17:47 wonderland kernel: nfs server home:/usr: not responding Dec 29 08:17:47 wonderland kernel: nfs server home:/usr: is alive again Dec 29 08:18:01 wonderland kernel: nfs server home:/usr: not responding Dec 29 08:18:01 wonderland kernel: nfs server home:/usr: is alive again Dec 29 08:18:02 wonderland kernel: nfs server home:/usr: not responding Dec 29 08:18:02 wonderland kernel: nfs server home:/usr: not responding Dec 29 08:18:02 wonderland kernel: nfs server home:/usr: is alive again Dec 29 08:18:02 wonderland kernel: nfs server home:/usr: is alive again Dec 29 08:18:08 wonderland kernel: nfs server home:/usr: not responding Dec 29 08:18:08 wonderland kernel: nfs server home:/usr: is alive again Dec 29 08:18:09 wonderland kernel: nfs server home:/usr: not responding Dec 29 08:18:09 wonderland kernel: nfs server home:/usr: not responding Dec 29 08:18:09 wonderland kernel: nfs server home:/usr: is alive again Dec 29 08:18:09 wonderland kernel: nfs server home:/usr: is alive again Dec 29 08:20:21 wonderland kernel: nfs server home:/usr: not responding Dec 29 08:20:21 wonderland kernel: nfs server home:/usr: not responding Dec 29 08:20:21 wonderland kernel: nfs server home:/usr: is alive again Dec 29 08:20:21 wonderland kernel: nfs server home:/usr: not responding Dec 29 08:20:21 wonderland kernel: nfs server home:/usr: not responding Dec 29 08:20:21 wonderland kernel: nfs server home:/usr: is alive again Dec 29 08:20:21 wonderland last message repeated 2 times Dec 29 08:20:22 wonderland kernel: nfs server home:/usr: not responding Dec 29 08:20:22 wonderland kernel: nfs server home:/usr: is alive again Dec 29 08:20:36 wonderland kernel: nfs server home:/usr: not responding Dec 29 08:20:36 wonderland kernel: nfs server home:/usr: is alive again Dec 29 08:21:05 wonderland kernel: nfs server home:/usr: not responding Dec 29 08:21:10 wonderland kernel: nfs server home:/usr: not responding Dec 29 08:22:20 wonderland kernel: nfs server home:/usr: not responding Dec 29 08:22:20 wonderland kernel: nfs server home:/usr: is alive again Dec 29 08:22:20 wonderland kernel: nfs server home:/usr: not responding Dec 29 08:22:20 wonderland kernel: nfs server home:/usr: not responding Dec 29 08:22:20 wonderland kernel: nfs server home:/usr: is alive again Dec 29 08:22:20 wonderland kernel: nfs server home:/usr: is alive again Dec 29 08:22:22 wonderland kernel: nfs server home:/usr: not responding Dec 29 08:22:22 wonderland kernel: nfs server home:/usr: is alive again Dec 29 08:22:24 wonderland kernel: nfs server home:/usr: not responding Dec 29 08:22:24 wonderland last message repeated 2 times Dec 29 08:22:24 wonderland kernel: nfs server home:/usr: is alive again Dec 29 08:22:24 wonderland last message repeated 2 times Dec 29 08:22:24 wonderland kernel: nfs server home:/usr: not responding Dec 29 08:22:24 wonderland kernel: nfs server home:/usr: is alive again Dec 29 08:22:27 wonderland kernel: nfs server home:/usr: not responding Dec 29 08:22:27 wonderland kernel: nfs server home:/usr: is alive again The time stamps on the "not responding" messages are lies; the lack of response in each case was roughly a minute and a half earlier. "home" equals mattapan in the earlier table. During the periods of NFS lack of response, mattapan is still completely functional, and a concurrent ssh session proceeds without difficulty. I can also make this happen (though not as easily) on NFS from sullivan to wonderland, but I haven't seen it yet from scollay to wonderland. This problem never occurs when wonderland is running 7.3. Any suggestions? -- George Mitchell From owner-freebsd-hackers@FreeBSD.ORG Sat Jan 8 17:12:42 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A53F710656D5 for ; Sat, 8 Jan 2011 17:12:42 +0000 (UTC) (envelope-from nonesuch@longcount.org) Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id B67068FC1A for ; Sat, 8 Jan 2011 17:12:41 +0000 (UTC) Received: by bwz12 with SMTP id 12so10816875bwz.13 for ; Sat, 08 Jan 2011 09:12:40 -0800 (PST) MIME-Version: 1.0 Received: by 10.204.140.208 with SMTP id j16mr1928282bku.151.1294506759568; Sat, 08 Jan 2011 09:12:39 -0800 (PST) Received: by 10.204.151.212 with HTTP; Sat, 8 Jan 2011 09:12:39 -0800 (PST) X-Originating-IP: [68.171.231.20] In-Reply-To: <201101081655.p08Gt39N001427@m5p.com> References: <201101081655.p08Gt39N001427@m5p.com> Date: Sat, 8 Jan 2011 12:12:39 -0500 Message-ID: From: Mark Saad To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset=UTF-8 Subject: Re: NFS Performance X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Jan 2011 17:12:42 -0000 George I remember reading there was some sort of nfs issues in 8.1-RELEASE, a regression of some sort it was noted early on in the release. Have you tried this with 8.2-RC1 also what are your nfs client mount options ? On 1/8/11, george+freebsd@m5p.com wrote: > Among four machines on my network, I'm observing startling differences > in NFS performance. All machines are AMD64, and rpc_statd, rpc_lockd, > and amd are enabled on all four machines. > > wonderland: > hw.model: AMD Athlon(tm) II Dual-Core M32 > hw.physmem: 293510758 > ethernet: 100Mb/s > partition 1: FreeBSD 8.1-STABLE > partition 2: FreeBSD 7.3-STABLE > > scollay: > hw.model: AMD Sempron(tm) 140 Processor > hw.physmem: 186312294 > ethernet: 1000Mb/s > FreeBSD 8.1-PRERELEASE > > sullivan: > hw.model: AMD Athlon(tm) 64 X2 Dual Core Processor 4800+ > hw.physmem: 4279980032 > ethernet 1000Mb/s > FreeBSD 7.2-RELEASE > > mattapan: > hw.model: AMD Sempron(tm) Processor 2600+ > hw.physmem: 456380416 > ethernet: 1000Mb/s > FreeBSD 7.1-RELEASE > > Observed bytes per second (dd if=filename of=/dev/null bs=65536): > Source machine: mattapan scollay sullivan > Destination machine: > wonderland/7.3 870K 5.2M 1.8M > wonderland/8.1 496K 690K 420K > mattapan 38M 28M > scollay 33M 33M > sullivan 38M 5M > > There is one 10/100/1000Mb/s ethernet switch between the various pairs > of machines. > > I'm startled by the numbers for wonderland, first because of how much the > 100Mb/s interface slows things down, but even more because of how much > difference there is on the identical hardware between FreeBSD 7 and > FreeBSD 8. > > Even more annoying when running 8.1 on wonderland, NFS simply locks up > at random for roughly a minute and a half under high load (such as when > firefox does a gazillion locked references to my places.sqlite file), > leading to entertaining log message clusters such as: > > Dec 29 08:17:41 wonderland kernel: nfs server home:/usr: not responding > Dec 29 08:17:41 wonderland kernel: nfs server home:/usr: not responding > Dec 29 08:17:41 wonderland kernel: nfs server home:/usr: is alive again > Dec 29 08:17:41 wonderland kernel: nfs server home:/usr: is alive again > Dec 29 08:17:47 wonderland kernel: nfs server home:/usr: not responding > Dec 29 08:17:47 wonderland kernel: nfs server home:/usr: is alive again > Dec 29 08:18:01 wonderland kernel: nfs server home:/usr: not responding > Dec 29 08:18:01 wonderland kernel: nfs server home:/usr: is alive again > Dec 29 08:18:02 wonderland kernel: nfs server home:/usr: not responding > Dec 29 08:18:02 wonderland kernel: nfs server home:/usr: not responding > Dec 29 08:18:02 wonderland kernel: nfs server home:/usr: is alive again > Dec 29 08:18:02 wonderland kernel: nfs server home:/usr: is alive again > Dec 29 08:18:08 wonderland kernel: nfs server home:/usr: not responding > Dec 29 08:18:08 wonderland kernel: nfs server home:/usr: is alive again > Dec 29 08:18:09 wonderland kernel: nfs server home:/usr: not responding > Dec 29 08:18:09 wonderland kernel: nfs server home:/usr: not responding > Dec 29 08:18:09 wonderland kernel: nfs server home:/usr: is alive again > Dec 29 08:18:09 wonderland kernel: nfs server home:/usr: is alive again > Dec 29 08:20:21 wonderland kernel: nfs server home:/usr: not responding > Dec 29 08:20:21 wonderland kernel: nfs server home:/usr: not responding > Dec 29 08:20:21 wonderland kernel: nfs server home:/usr: is alive again > Dec 29 08:20:21 wonderland kernel: nfs server home:/usr: not responding > Dec 29 08:20:21 wonderland kernel: nfs server home:/usr: not responding > Dec 29 08:20:21 wonderland kernel: nfs server home:/usr: is alive again > Dec 29 08:20:21 wonderland last message repeated 2 times > Dec 29 08:20:22 wonderland kernel: nfs server home:/usr: not responding > Dec 29 08:20:22 wonderland kernel: nfs server home:/usr: is alive again > Dec 29 08:20:36 wonderland kernel: nfs server home:/usr: not responding > Dec 29 08:20:36 wonderland kernel: nfs server home:/usr: is alive again > Dec 29 08:21:05 wonderland kernel: nfs server home:/usr: not responding > Dec 29 08:21:10 wonderland kernel: nfs server home:/usr: not responding > Dec 29 08:22:20 wonderland kernel: nfs server home:/usr: not responding > Dec 29 08:22:20 wonderland kernel: nfs server home:/usr: is alive again > Dec 29 08:22:20 wonderland kernel: nfs server home:/usr: not responding > Dec 29 08:22:20 wonderland kernel: nfs server home:/usr: not responding > Dec 29 08:22:20 wonderland kernel: nfs server home:/usr: is alive again > Dec 29 08:22:20 wonderland kernel: nfs server home:/usr: is alive again > Dec 29 08:22:22 wonderland kernel: nfs server home:/usr: not responding > Dec 29 08:22:22 wonderland kernel: nfs server home:/usr: is alive again > Dec 29 08:22:24 wonderland kernel: nfs server home:/usr: not responding > Dec 29 08:22:24 wonderland last message repeated 2 times > Dec 29 08:22:24 wonderland kernel: nfs server home:/usr: is alive again > Dec 29 08:22:24 wonderland last message repeated 2 times > Dec 29 08:22:24 wonderland kernel: nfs server home:/usr: not responding > Dec 29 08:22:24 wonderland kernel: nfs server home:/usr: is alive again > Dec 29 08:22:27 wonderland kernel: nfs server home:/usr: not responding > Dec 29 08:22:27 wonderland kernel: nfs server home:/usr: is alive again > > The time stamps on the "not responding" messages are lies; the lack of > response in each case was roughly a minute and a half earlier. "home" > equals mattapan in the earlier table. During the periods of NFS lack > of response, mattapan is still completely functional, and a concurrent > ssh session proceeds without difficulty. I can also make this happen > (though not as easily) on NFS from sullivan to wonderland, but I haven't > seen it yet from scollay to wonderland. This problem never occurs when > wonderland is running 7.3. > > Any suggestions? -- George Mitchell > > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" > -- Sent from my mobile device mark saad | nonesuch@longcount.org From owner-freebsd-hackers@FreeBSD.ORG Sat Jan 8 17:55:06 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0C47C1065674 for ; Sat, 8 Jan 2011 17:55:06 +0000 (UTC) (envelope-from george@m5p.com) Received: from mailhost.m5p.com (unknown [IPv6:2001:418:3fd::3]) by mx1.freebsd.org (Postfix) with ESMTP id B292C8FC23 for ; Sat, 8 Jan 2011 17:55:05 +0000 (UTC) Received: from m5p.com (wonderland.m5p.com [IPv6:2001:418:3fd::19]) by mailhost.m5p.com (8.14.3/8.14.3) with ESMTP id p08HsxMY011437 for ; Sat, 8 Jan 2011 12:55:04 -0500 (EST) (envelope-from george@m5p.com) Received: (from george@localhost) by m5p.com (8.14.4/8.13.7/Submit) id p08HsxWg001582; Sat, 8 Jan 2011 12:54:59 -0500 (EST) Date: Sat, 8 Jan 2011 12:54:59 -0500 (EST) Message-Id: <201101081754.p08HsxWg001582@m5p.com> From: george+freebsd@m5p.com To: freebsd-hackers@freebsd.org In-Reply-To: X-Spam-Score: -1.5 () BAYES_00 X-Scanned-By: MIMEDefang 2.67 on IPv6:2001:418:3fd::f7 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.0 (mailhost.m5p.com [IPv6:2001:418:3fd::f7]); Sat, 08 Jan 2011 12:55:05 -0500 (EST) Subject: Re: NFS Performance X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Jan 2011 17:55:06 -0000 > George > I remember reading there was some sort of nfs issues in 8.1-RELEASE, > a regression of some sort it was noted early on in the release. Have > you tried this with 8.2-RC1 also what are your nfs client mount > options ? > I'll update to 8.2-RC1 later today and see if anything changes, but I started seeing the problem as early as 8.0-RELEASE. -- George From owner-freebsd-hackers@FreeBSD.ORG Sat Jan 8 18:08:59 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 60CC510656E4 for ; Sat, 8 Jan 2011 18:08:59 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx22.fluidhosting.com [204.14.89.5]) by mx1.freebsd.org (Postfix) with ESMTP id E19328FC08 for ; Sat, 8 Jan 2011 18:08:58 +0000 (UTC) Received: (qmail 29459 invoked by uid 399); 8 Jan 2011 18:08:58 -0000 Received: from localhost (HELO doug-optiplex.ka9q.net) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 8 Jan 2011 18:08:58 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4D28A838.7080906@FreeBSD.org> Date: Sat, 08 Jan 2011 10:08:56 -0800 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.13) Gecko/20101210 Thunderbird/3.1.7 MIME-Version: 1.0 To: george+freebsd@m5p.com References: <201101081754.p08HsxWg001582@m5p.com> In-Reply-To: <201101081754.p08HsxWg001582@m5p.com> X-Enigmail-Version: 1.1.2 OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org Subject: Re: NFS Performance X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Jan 2011 18:08:59 -0000 FYI, -stable is probably the better list for this. On 01/08/2011 09:54, george+freebsd@m5p.com wrote: >> George >> I remember reading there was some sort of nfs issues in 8.1-RELEASE, >> a regression of some sort it was noted early on in the release. Have >> you tried this with 8.2-RC1 also what are your nfs client mount >> options ? >> > > I'll update to 8.2-RC1 later today and see if anything changes, but I > started seeing the problem as early as 8.0-RELEASE. -- George I think it's great that you're reporting the problems now, but your statement above makes me wonder if you reported them then? Doug -- Nothin' ever doesn't change, but nothin' changes much. -- OK Go Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/ From owner-freebsd-hackers@FreeBSD.ORG Sat Jan 8 18:19:54 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CF162106570D for ; Sat, 8 Jan 2011 18:19:54 +0000 (UTC) (envelope-from george@m5p.com) Received: from mailhost.m5p.com (unknown [IPv6:2001:418:3fd::3]) by mx1.freebsd.org (Postfix) with ESMTP id 87F578FC17 for ; Sat, 8 Jan 2011 18:19:54 +0000 (UTC) Received: from m5p.com (wonderland.m5p.com [IPv6:2001:418:3fd::19]) by mailhost.m5p.com (8.14.3/8.14.3) with ESMTP id p08IJmeJ011576 for ; Sat, 8 Jan 2011 13:19:53 -0500 (EST) (envelope-from george@m5p.com) Received: (from george@localhost) by m5p.com (8.14.4/8.13.7/Submit) id p08IJmhe001670; Sat, 8 Jan 2011 13:19:48 -0500 (EST) Date: Sat, 8 Jan 2011 13:19:48 -0500 (EST) Message-Id: <201101081819.p08IJmhe001670@m5p.com> From: george+freebsd@m5p.com To: freebsd-hackers@freebsd.org In-Reply-to: <4D28A838.7080906@FreeBSD.org> X-Spam-Score: -1.5 () BAYES_00 X-Scanned-By: MIMEDefang 2.67 on IPv6:2001:418:3fd::f7 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.0 (mailhost.m5p.com [IPv6:2001:418:3fd::f7]); Sat, 08 Jan 2011 13:19:54 -0500 (EST) Subject: Re: NFS Performance X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Jan 2011 18:19:54 -0000 > FYI, -stable is probably the better list for this. > > On 01/08/2011 09:54, george+freebsd@m5p.com wrote: > >> George > >> I remember reading there was some sort of nfs issues in 8.1-RELEASE, > >> a regression of some sort it was noted early on in the release. Have > >> you tried this with 8.2-RC1 also what are your nfs client mount > >> options ? > >> > > > > I'll update to 8.2-RC1 later today and see if anything changes, but I > > started seeing the problem as early as 8.0-RELEASE. -- George > > I think it's great that you're reporting the problems now, but your > statement above makes me wonder if you reported them then? > > > Doug No, I did not report the problems then. -- George From owner-freebsd-hackers@FreeBSD.ORG Sat Jan 8 23:40:02 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A85051065670 for ; Sat, 8 Jan 2011 23:40:02 +0000 (UTC) (envelope-from dillon@apollo.backplane.com) Received: from apollo.backplane.com (apollo.backplane.com [216.240.41.2]) by mx1.freebsd.org (Postfix) with ESMTP id 5DBBD8FC0A for ; Sat, 8 Jan 2011 23:40:02 +0000 (UTC) Received: from apollo.backplane.com (localhost [127.0.0.1]) by apollo.backplane.com (8.14.4/8.14.1) with ESMTP id p08Ne02D015402; Sat, 8 Jan 2011 15:40:00 -0800 (PST) Received: (from dillon@localhost) by apollo.backplane.com (8.14.4/8.13.4/Submit) id p08Ndx5X015401; Sat, 8 Jan 2011 15:39:59 -0800 (PST) Date: Sat, 8 Jan 2011 15:39:59 -0800 (PST) From: Matthew Dillon Message-Id: <201101082339.p08Ndx5X015401@apollo.backplane.com> To: Joerg Sonnenberger References: <201012182224.oBIMOYfl067212@apollo.backplane.com> <20101219070515.GB2433@britannica.bec.de> Cc: freebsd-hackers@freebsd.org Subject: Re: MONITOR/MWAIT question X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Jan 2011 23:40:02 -0000 :On Sat, Dec 18, 2010 at 02:24:34PM -0800, Matthew Dillon wrote: :> Does anyone know if an IRET cancels/triggers a MONITOR event? : :AMD's Architecture Programmer's Manual explicitly contains: : :Events that cause an exit from the monitor event pending state include: :... :- Any far control transfer that occurs between the MONITOR and the :MWAIT. : :Joerg Yah. The Intel documentation listed specific instructions and said something about a 'far call' but wasn't generic enough. My AMD manuals are too old, I'm getting a new set. The AMD manual using the 'any far control transfer' terminology implies that IRET is also covered. Another interesting question came up and that is whether a write on the same cpu that MONITOR was run on (without a far control transfer) can trigger a later MWAIT. i.e. MONITOR addr, INCL addr, MWAIT addr, on the same cpu (that the MWAIT would then effectively be a NOP). The MONITOR/MWAIT stuff apparently ties into the cpu's cache management architecture and a local write to a cache line which is already exclusive might not count, so I'm not sure if that case is covered. I can't find a definitive answer so at some point I'll actually code something up and test it. It isn't a case which current uses trigger but I don't like question marks. Right now it looks like MONITOR/MWAIT works quite nicely with a pseudo-FIFO reservation model for handling cpu contention. Basically you have a windex and a rindex. You reserve a 'spot' using XADD on the windex and then resolve the cpu<->cpu contention with MONITOR/CMP/MWAIT's on rindex. Only the owner of the rindex (when rindex matches the reserved index, which is exactly one cpu out of the N contending cpus) can increment rindex. That way only *ONE* cpu at a time is trying to get the spin lock against the current lock holder instead of all the cpus contending with each other to try to get the spin lock from the current lock holder. Exponential backoff seems to fail horribly once you get over 8 cpus or so, but the pseudo-FIFO methodology seems to work well up to the maximum I've been able to test on (48 cpus). -Matt Matthew Dillon